Skip to content

Commit 4dfbc7a

Browse files
authored
perf: faster tension-only line steps; refactor the junction tangent after an unfactored exit (#19)
Tension-only (EI = 0) line steps drop work that repeated itself every Newton evaluation, about 10 % of a step: element kernels re-validating section data the line model validates when it is set, repeated scalar checks and message blanking in the Froude-Krylov and added-mass kernels, zero velocity Jacobians added into the band, a consistent-mass band re-assembled although its inputs had not changed, and rescans of a band and factor just checked finite. The kernels take an optional inputs_validated that the line model passes after its own check; public callers keep the full validation and every input error is reported as before. The mass band is reused while its inputs are unchanged, compared exactly, and every other writer clears the reuse. With the release build chain_range_tdp runs 16 % faster, als_volturnus_line_break_time and spar_pinned_rods 13 %, and rod_moored_spar 12 %. With gfortran every output of the 52 example decks is byte-identical; with the release build three output files differ by at most 8.6e-7 of their column maximum. The monolithic body and point coupling back-solved a line step's end tangent with its last factorization, but a fresh tangent evaluation overwrote the band before it was factored while the factored flags stayed set: a step that ended right there (accepted within the near-tolerance allowance, or converged on the fresh tangent) used an unfactored matrix. The flags are now cleared at the evaluation; in a unit test reaching that exit the end tangent was off by 2.3e5 (relative) and now agrees with an ordinary exit to 1.8e-11. No example deck takes this path. Tests: the trusted kernels bit for bit against the validating ones, the reused mass band against a fresh assembly with the expected hits and misses, and the junction tangent after an allowance exit. Signed-off-by: Jae Hoon Seo <jaehoon.seo@inha.ac.kr>
1 parent f2caf1f commit 4dfbc7a

9 files changed

Lines changed: 694 additions & 94 deletions

‎CHANGELOG.md‎

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,17 @@ All notable changes to CableDyn are recorded in this file. The format follows
139139
at 0.109 1/m instead of 0.075 1/m, and the anchor tension stays at its static 1.23 kN, where
140140
the coarse mesh showed stick-slip peaks up to 4.1 kN. The validation record and the tutorials
141141
are updated.
142+
- Faster tension-only (`EI = 0`) line steps. In every Newton evaluation the element kernels of
143+
the line loads (axial damping, Morison drag, Froude-Krylov, buoyancy recovery, added mass) no
144+
longer re-check, element by element, data the line model validates when it is set; the
145+
Froude-Krylov and added-mass kernels check their section data once instead of three times;
146+
the velocity Jacobians of the Froude-Krylov and buoyancy loads, which are zero, are no longer
147+
added into the band; a step reuses the consistent-mass band of the previous one while the
148+
lengths and masses are unchanged; and the Newton solve no longer rescans a matrix already
149+
checked finite. With the release build, `examples/als_volturnus_line_break_time.dat` runs
150+
13 % faster and `examples/spar_pinned_rods.dat` 13 %. Every input error is reported as
151+
before. With gfortran the results are bit-identical. With the Intel compiler of the release
152+
they can differ in the last printed digit, and by more where a deck amplifies round-off.
142153

143154
### Fixed
144155

@@ -258,6 +269,17 @@ All notable changes to CableDyn are recorded in this file. The format follows
258269
on the rounded surface. When the anchor walk of a finite-EI line over a non-planar bathymetry
259270
reaches a state that is rejected, the failure no longer states that the line is too long for
260271
its span to hang as a catenary, which is proven over a planar seabed only.
272+
- Junction end tangent of a tension-only line step that ends right after a fresh tangent
273+
evaluation. In the monolithic body and point coupling, a line step accepted within the
274+
near-tolerance allowance at its Newton iteration limit (or converged on a freshly evaluated
275+
tangent) still marked its last factorization as current, although the new tangent had
276+
overwritten it. The condensed end tangent, and the warm start of a re-solve of the same step,
277+
were then back-solved with the unfactored matrix: in a unit test the end tangent was wrong by
278+
five orders of magnitude, which can slow or misdirect the outer junction iteration. The step
279+
now clears the factorization flags whenever it overwrites the band without factoring it, so
280+
the end query factors the current tangent (one more tangent assembly and factorization for
281+
such a step of a junction solve). The outputs of the example decks and of the other tests
282+
are unchanged.
261283

262284
## [0.1.1] - 2026-10-09
263285

‎src/CableDyn_Damping.f90‎

Lines changed: 29 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -252,16 +252,27 @@ SUBROUTINE CD_Cable_Axial_Damping_Load(q, v, elem_conn, l0, ba, force, jac_q, ja
252252
END DO
253253
END SUBROUTINE CD_Cable_Axial_Damping_Load
254254

255-
SUBROUTINE CD_Axial_Damping_Element_Force(qa, qb, va, vb, l0, ba, force, ErrStat, ErrMsg, l0_dot)
255+
SUBROUTINE CD_Axial_Damping_Element_Force(qa, qb, va, vb, l0, ba, force, ErrStat, ErrMsg, l0_dot, &
256+
inputs_validated)
256257
!! Two-node axial damping force kernel for model hot paths.
258+
!! `inputs_validated` is an internal hot-path contract (as in CD_Component_Wave_Kinematics),
259+
!! shared with CD_Axial_Damping_Element_Load: a caller that already guarantees a finite
260+
!! state, a finite positive l0 and a finite resolved ba >= 0 skips the per-element input
261+
!! scan. The default remains full validation for public/direct calls.
257262
REAL(wp), INTENT(IN) :: qa(3), qb(3), va(3), vb(3), l0, ba
258263
REAL(wp), INTENT(OUT) :: force(6)
259264
REAL(wp), INTENT(IN), OPTIONAL :: l0_dot !! unstretched-length rate (see the cable-path routines)
260265
INTEGER, INTENT(OUT) :: ErrStat
261266
CHARACTER(*), INTENT(OUT) :: ErrMsg
267+
LOGICAL, INTENT(IN), OPTIONAL :: inputs_validated
262268
REAL(wp) :: chord(3), tang(3), rel(3), length, ldot, td_vec(3)
263269

264-
CALL validate_element_inputs(qa, qb, va, vb, l0, ba, ErrStat, ErrMsg)
270+
IF (trusted(inputs_validated)) THEN
271+
ErrStat = CD_DAMP_OK
272+
ErrMsg = ''
273+
ELSE
274+
CALL validate_element_inputs(qa, qb, va, vb, l0, ba, ErrStat, ErrMsg)
275+
END IF
265276
force = CD_ZERO
266277
IF (ErrStat /= CD_DAMP_OK) RETURN
267278
IF (PRESENT(l0_dot)) THEN
@@ -285,18 +296,25 @@ SUBROUTINE CD_Axial_Damping_Element_Force(qa, qb, va, vb, l0, ba, force, ErrStat
285296
force(4:6) = -td_vec
286297
END SUBROUTINE CD_Axial_Damping_Element_Force
287298

288-
SUBROUTINE CD_Axial_Damping_Element_Load(qa, qb, va, vb, l0, ba, force, jac_q, jac_v, ErrStat, ErrMsg, l0_dot)
299+
SUBROUTINE CD_Axial_Damping_Element_Load(qa, qb, va, vb, l0, ba, force, jac_q, jac_v, ErrStat, ErrMsg, l0_dot, &
300+
inputs_validated)
289301
!! Two-node axial damping force and residual-Jacobian kernel.
290302
REAL(wp), INTENT(IN) :: qa(3), qb(3), va(3), vb(3), l0, ba
291303
REAL(wp), INTENT(OUT) :: force(6), jac_q(6, 6), jac_v(6, 6)
292304
REAL(wp), INTENT(IN), OPTIONAL :: l0_dot !! unstretched-length rate: the damped rate is ldot - (length/l0)*l0_dot
293305
INTEGER, INTENT(OUT) :: ErrStat
294306
CHARACTER(*), INTENT(OUT) :: ErrMsg
307+
LOGICAL, INTENT(IN), OPTIONAL :: inputs_validated !! see CD_Axial_Damping_Element_Force
295308
INTEGER :: i
296309
REAL(wp) :: chord(3), tang(3), rel(3), length, ldot, k, td_vec(3)
297310
REAL(wp) :: eye(3, 3), ktt(3, 3), m1(3, 3), m2(3, 3), dmat(3, 3)
298311

299-
CALL validate_element_inputs(qa, qb, va, vb, l0, ba, ErrStat, ErrMsg)
312+
IF (trusted(inputs_validated)) THEN
313+
ErrStat = CD_DAMP_OK
314+
ErrMsg = ''
315+
ELSE
316+
CALL validate_element_inputs(qa, qb, va, vb, l0, ba, ErrStat, ErrMsg)
317+
END IF
300318
force = CD_ZERO
301319
jac_q = CD_ZERO
302320
jac_v = CD_ZERO
@@ -360,6 +378,13 @@ PURE FUNCTION outer(a, b) RESULT(m)
360378
END DO
361379
END FUNCTION outer
362380

381+
PURE LOGICAL FUNCTION trusted(inputs_validated) RESULT(trust)
382+
!! The value of an optional inputs_validated flag (.FALSE. when absent).
383+
LOGICAL, INTENT(IN), OPTIONAL :: inputs_validated
384+
trust = .FALSE.
385+
IF (PRESENT(inputs_validated)) trust = inputs_validated
386+
END FUNCTION trusted
387+
363388
SUBROUTINE add_block(mat, node_i, node_j, blk)
364389
!! Accumulate a 3x3 block into the (node_i, node_j) DOF positions of a global matrix.
365390
REAL(wp), INTENT(INOUT) :: mat(:, :)

‎src/CableDyn_Dynamic.f90‎

Lines changed: 109 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,15 @@ MODULE CableDyn_Dynamic
145145
REAL(wp), ALLOCATABLE :: nodes_eval(:, :)
146146
INTEGER :: topo_n_nodes = 0, bw_kl = 0, bw_ku = 0
147147
LOGICAL :: topo_valid = .FALSE., bw_valid = .FALSE.
148+
! M_band holds the element consistent mass band assembled for the remembered connectivity
149+
! and free list (bw_free) from the lengths mb_l0 and masses per length mb_rho; a step whose
150+
! inputs match reuses it instead of assembling the same band again. Every other writer of
151+
! M_band clears mb_valid.
152+
LOGICAL :: mb_valid = .FALSE.
153+
REAL(wp), ALLOCATABLE :: mb_l0(:), mb_rho(:)
154+
! TEST-ONLY diagnostic: the number of steps that reused the remembered mass band (saturating).
155+
! Only the unit tests read it (to assert that the cache hit); no result depends on it.
156+
INTEGER :: mb_hits = 0
148157
INTEGER :: ad_kl = 0
149158
INTEGER, ALLOCATABLE :: ad_finv(:), ad_ipiv(:), ad_fixed(:)
150159
REAL(wp), ALLOCATABLE :: ad_full(:, :), ad_add(:, :), ad_ab(:, :), ad_x(:, :), ad_result(:, :)
@@ -164,7 +173,8 @@ MODULE CableDyn_Dynamic
164173
LOGICAL :: end_valid = .FALSE.
165174
! the factored effective band in eff_band/ipiv belongs to the current step (a junction solve
166175
! of this step factored it): a warm re-solve of the same step starts with a chord iteration
167-
! on it instead of assembling and factoring a new tangent
176+
! on it instead of assembling and factoring a new tangent. Cleared whenever eff_band is
177+
! overwritten by a tangent that is not factored.
168178
LOGICAL :: step_factor = .FALSE.
169179
! force scale of the junction solves (largest element tension of the last one): the
170180
! residual gate of a warm-started junction solve is relative to it, not to its own
@@ -311,6 +321,10 @@ SUBROUTINE CD_Clear_GenAlpha_Workspace(work)
311321
work%bw_ku = 0
312322
work%topo_valid = .FALSE.
313323
work%bw_valid = .FALSE.
324+
work%mb_valid = .FALSE.
325+
work%mb_hits = 0
326+
IF (ALLOCATED(work%mb_l0)) DEALLOCATE (work%mb_l0)
327+
IF (ALLOCATED(work%mb_rho)) DEALLOCATE (work%mb_rho)
314328
IF (ALLOCATED(work%ad_finv)) DEALLOCATE (work%ad_finv)
315329
IF (ALLOCATED(work%ad_ipiv)) DEALLOCATE (work%ad_ipiv)
316330
IF (ALLOCATED(work%ad_fixed)) DEALLOCATE (work%ad_fixed)
@@ -536,6 +550,8 @@ SUBROUTINE CD_Cable_Initial_Acceleration(q, v, elem_conn, l0, ea, rho_a, tension
536550
RETURN
537551
END IF
538552
END IF
553+
! the band is factored in place below: not the step's reusable mass band
554+
work%mb_valid = .FALSE.
539555
IF (use_element_mass_band) THEN
540556
CALL assemble_mass_band_free(elem_conn, l0, rho_a, work%dof_marker(1:n_dof), kl, ku, M_band, es, em)
541557
ELSE
@@ -615,7 +631,7 @@ SUBROUTINE CD_Cable_Gen_Alpha_Step(q, v, a, elem_conn, l0, ea, rho_a, tension_on
615631
REAL(wp), POINTER :: a_eval(:), a_alpha(:), q_alpha(:), v_eval(:), v_alpha(:), fint_eval(:)
616632
! q_alpha viewed as (3, n_nodes) nodal coordinates, without a copy
617633
REAL(wp), POINTER :: q_alpha_nodes(:, :)
618-
LOGICAL :: topo_ok, bw_hit
634+
LOGICAL :: topo_ok, bw_hit, mb_hit
619635
INTEGER :: il, jl
620636
REAL(wp), POINTER :: Kt_eval(:, :), tension_eval(:), load_eval(:), jac_q_eval(:, :), jac_v_eval(:, :)
621637
REAL(wp), POINTER :: M_eff_eval(:, :), M_add_eval(:, :), dMa_a_dq_eval(:, :)
@@ -745,6 +761,7 @@ SUBROUTINE CD_Cable_Gen_Alpha_Step(q, v, a, elem_conn, l0, ea, rho_a, tension_on
745761
direct_banded = .NOT. has_load_proc .AND. .NOT. has_added_mass_proc
746762
use_element_mass_band = direct_banded .AND. .NOT. PRESENT(structural_mass)
747763
CALL validate_topology_once(work, elem_conn, n_dof/3, topo_ok)
764+
bw_hit = .FALSE.
748765
IF (direct_banded) THEN
749766
bw_hit = topo_ok .AND. work%bw_valid
750767
IF (bw_hit) bw_hit = SIZE(work%bw_free) == n_free
@@ -753,6 +770,7 @@ SUBROUTINE CD_Cable_Gen_Alpha_Step(q, v, a, elem_conn, l0, ea, rho_a, tension_on
753770
kl = work%bw_kl
754771
ku = work%bw_ku
755772
ELSE
773+
work%mb_valid = .FALSE.
756774
CALL CD_Cable_Free_Bandwidth(elem_conn, n_dof/3, free, kl, ku, es, em, topology_validated=topo_ok)
757775
IF (es /= 0) THEN
758776
CALL fail(ErrStat, ErrMsg, 'bandwidth analysis failed: '//TRIM(em))
@@ -907,9 +925,22 @@ SUBROUTINE CD_Cable_Gen_Alpha_Step(q, v, a, elem_conn, l0, ea, rho_a, tension_on
907925
RETURN
908926
END IF
909927
END IF
928+
es = 0
910929
IF (use_element_mass_band) THEN
911-
CALL assemble_mass_band_free(elem_conn, l0, rho_a, work%dof_marker(1:n_dof), kl, ku, M_band, es, em)
930+
! The element mass band depends only on the connectivity, the free list, l0 and
931+
! rho_a: a step with the inputs of the remembered band (bw_hit: same connectivity and
932+
! free list) reuses it, which is the band the assembly would build again.
933+
mb_hit = .FALSE.
934+
IF (bw_hit) mb_hit = mass_band_matches(work, l0, rho_a)
935+
IF (.NOT. mb_hit) THEN
936+
work%mb_valid = .FALSE.
937+
CALL assemble_mass_band_free(elem_conn, l0, rho_a, work%dof_marker(1:n_dof), kl, ku, M_band, es, em)
938+
IF (es == 0 .AND. work%bw_valid) CALL remember_mass_band(work, l0, rho_a)
939+
ELSE IF (work%mb_hits < HUGE(work%mb_hits)) THEN
940+
work%mb_hits = work%mb_hits + 1
941+
END IF
912942
ELSE
943+
work%mb_valid = .FALSE.
913944
CALL pack_dense_free_band(M, free, kl, ku, CD_ONE, M_band, es, em)
914945
END IF
915946
IF (es /= 0) THEN
@@ -955,6 +986,13 @@ SUBROUTINE CD_Cable_Gen_Alpha_Step(q, v, a, elem_conn, l0, ea, rho_a, tension_on
955986
IF (tangent_fresh) THEN
956987
IF (direct_banded) THEN
957988
CALL eval_dynamic(qk, R, es, em, effbandout=eff_band)
989+
! factored_now and work%step_factor state that eff_band/ipiv hold the LU of the last
990+
! factorization. eff_band now holds the unfactored tangent at qk, and they are set
991+
! again only once it is factored below: an exit before that (convergence, or the
992+
! near-tolerance allowance at the iteration limit) leaves the junction end query and
993+
! a warm re-solve to factor it instead of back-solving with an unfactored band.
994+
factored_now = .FALSE.
995+
work%step_factor = .FALSE.
958996
ELSE
959997
CALL eval_dynamic(qk, R, es, em, effout=eff)
960998
END IF
@@ -1017,7 +1055,10 @@ SUBROUTINE CD_Cable_Gen_Alpha_Step(q, v, a, elem_conn, l0, ea, rho_a, tension_on
10171055
eff_band_unfactored(il, jl) = eff_band(il, jl)
10181056
END DO
10191057
END DO
1020-
CALL CD_Factor_Banded(eff_band, kl, ku, ipiv, es, em)
1058+
! eval_dynamic has just checked this band finite when a banded load or added-mass
1059+
! callback contributes to it; the factorization then skips repeating that scan.
1060+
CALL CD_Factor_Banded(eff_band, kl, ku, ipiv, es, em, &
1061+
matrix_validated=has_load_band_proc .OR. has_added_mass_band_proc)
10211062
factored_now = es == 0
10221063
work%step_factor = factored_now .AND. work%end_request
10231064
IF (es /= 0) THEN
@@ -1031,7 +1072,9 @@ SUBROUTINE CD_Cable_Gen_Alpha_Step(q, v, a, elem_conn, l0, ea, rho_a, tension_on
10311072
op_norm = MAX(CD_ONE, dense_row_abs_sum_max(eff, free))
10321073
END IF
10331074
IF (direct_banded) THEN
1034-
CALL CD_Solve_Factored_Banded(eff_band, kl, ku, ipiv, dq, es, em)
1075+
! A tangent factored in this iteration is the finite LU CD_Factor_Banded returned; a
1076+
! reused one keeps the full check.
1077+
CALL CD_Solve_Factored_Banded(eff_band, kl, ku, ipiv, dq, es, em, factor_validated=tangent_fresh)
10351078
ELSE
10361079
eff_free = eff(free, free)
10371080
CALL CD_Solve_Dense_As_Banded(eff_free, dq, es, em)
@@ -1758,6 +1801,12 @@ SUBROUTINE ensure_step_workspace(work, n_dof, n_elem, n_free, ldab, need_band, n
17581801
CALL ensure_real_vector(work%load_eval, n_dof, ErrStat, ErrMsg)
17591802
IF (ErrStat /= CD_DYN_OK) RETURN
17601803
IF (need_band) THEN
1804+
! a reallocated mass band no longer holds the remembered one
1805+
IF (ALLOCATED(work%M_band)) THEN
1806+
IF (SIZE(work%M_band, 1) < ldab .OR. SIZE(work%M_band, 2) < n_free) work%mb_valid = .FALSE.
1807+
ELSE
1808+
work%mb_valid = .FALSE.
1809+
END IF
17611810
CALL ensure_real_matrix(work%M_band, ldab, n_free, ErrStat, ErrMsg)
17621811
IF (ErrStat /= CD_DYN_OK) RETURN
17631812
CALL ensure_real_vector(work%M_add_a_eval, n_dof, ErrStat, ErrMsg)
@@ -1863,6 +1912,56 @@ SUBROUTINE remember_bandwidth(work, free, kl, ku, topology_validated)
18631912
work%bw_valid = .TRUE.
18641913
END SUBROUTINE remember_bandwidth
18651914

1915+
LOGICAL FUNCTION mass_band_matches(work, l0, rho_a) RESULT(match)
1916+
!! work%M_band holds the element mass band of these l0 and rho_a (for the remembered
1917+
!! connectivity and free list). Equality is tested as <= and >= so that a NaN never matches.
1918+
TYPE(CD_CableGenAlphaWorkspace), INTENT(IN) :: work
1919+
REAL(wp), INTENT(IN) :: l0(:), rho_a(:)
1920+
INTEGER :: e
1921+
1922+
match = work%mb_valid
1923+
IF (match) match = SIZE(work%mb_l0) == SIZE(l0) .AND. SIZE(work%mb_rho) == SIZE(rho_a)
1924+
IF (.NOT. match) RETURN
1925+
DO e = 1, SIZE(l0)
1926+
IF (.NOT. (work%mb_l0(e) <= l0(e) .AND. work%mb_l0(e) >= l0(e))) THEN
1927+
match = .FALSE.
1928+
RETURN
1929+
END IF
1930+
END DO
1931+
DO e = 1, SIZE(rho_a)
1932+
IF (.NOT. (work%mb_rho(e) <= rho_a(e) .AND. work%mb_rho(e) >= rho_a(e))) THEN
1933+
match = .FALSE.
1934+
RETURN
1935+
END IF
1936+
END DO
1937+
END FUNCTION mass_band_matches
1938+
1939+
SUBROUTINE remember_mass_band(work, l0, rho_a)
1940+
!! Record the inputs of the element mass band just assembled into work%M_band.
1941+
TYPE(CD_CableGenAlphaWorkspace), INTENT(INOUT) :: work
1942+
REAL(wp), INTENT(IN) :: l0(:), rho_a(:)
1943+
INTEGER :: istat
1944+
1945+
work%mb_valid = .FALSE.
1946+
IF (ALLOCATED(work%mb_l0)) THEN
1947+
IF (SIZE(work%mb_l0) /= SIZE(l0)) DEALLOCATE (work%mb_l0)
1948+
END IF
1949+
IF (ALLOCATED(work%mb_rho)) THEN
1950+
IF (SIZE(work%mb_rho) /= SIZE(rho_a)) DEALLOCATE (work%mb_rho)
1951+
END IF
1952+
IF (.NOT. ALLOCATED(work%mb_l0)) THEN
1953+
ALLOCATE (work%mb_l0(SIZE(l0)), STAT=istat)
1954+
IF (istat /= 0) RETURN
1955+
END IF
1956+
IF (.NOT. ALLOCATED(work%mb_rho)) THEN
1957+
ALLOCATE (work%mb_rho(SIZE(rho_a)), STAT=istat)
1958+
IF (istat /= 0) RETURN
1959+
END IF
1960+
work%mb_l0 = l0
1961+
work%mb_rho = rho_a
1962+
work%mb_valid = .TRUE.
1963+
END SUBROUTINE remember_mass_band
1964+
18661965
SUBROUTINE partition_free_dofs_workspace(fixed_dofs, n_dof, free, n_free, fixed, marker, ErrStat, ErrMsg)
18671966
INTEGER, INTENT(IN) :: fixed_dofs(:), n_dof
18681967
INTEGER, INTENT(INOUT) :: free(:), fixed(:)
@@ -1907,14 +2006,15 @@ SUBROUTINE partition_free_dofs_workspace(fixed_dofs, n_dof, free, n_free, fixed,
19072006
END SUBROUTINE partition_free_dofs_workspace
19082007

19092008
SUBROUTINE ensure_int_vector(x, n, ErrStat, ErrMsg)
2009+
!! The ensure_* helpers run for every workspace array on every step: they write ErrMsg only
2010+
!! on failure, and their callers (ensure_dof_workspace, ensure_step_workspace) clear it.
19102011
INTEGER, ALLOCATABLE, INTENT(INOUT) :: x(:)
19112012
INTEGER, INTENT(IN) :: n
19122013
INTEGER, INTENT(OUT) :: ErrStat
1913-
CHARACTER(*), INTENT(OUT) :: ErrMsg
2014+
CHARACTER(*), INTENT(INOUT) :: ErrMsg
19142015
INTEGER :: istat
19152016

19162017
ErrStat = CD_DYN_OK
1917-
ErrMsg = ''
19182018
IF (n < 0) THEN
19192019
CALL fail(ErrStat, ErrMsg, 'internal workspace size must be non-negative')
19202020
RETURN
@@ -1931,11 +2031,10 @@ SUBROUTINE ensure_real_vector(x, n, ErrStat, ErrMsg)
19312031
REAL(wp), ALLOCATABLE, INTENT(INOUT) :: x(:)
19322032
INTEGER, INTENT(IN) :: n
19332033
INTEGER, INTENT(OUT) :: ErrStat
1934-
CHARACTER(*), INTENT(OUT) :: ErrMsg
2034+
CHARACTER(*), INTENT(INOUT) :: ErrMsg
19352035
INTEGER :: istat
19362036

19372037
ErrStat = CD_DYN_OK
1938-
ErrMsg = ''
19392038
IF (n < 0) THEN
19402039
CALL fail(ErrStat, ErrMsg, 'internal workspace size must be non-negative')
19412040
RETURN
@@ -1952,11 +2051,10 @@ SUBROUTINE ensure_real_matrix(x, n1, n2, ErrStat, ErrMsg)
19522051
REAL(wp), ALLOCATABLE, INTENT(INOUT) :: x(:, :)
19532052
INTEGER, INTENT(IN) :: n1, n2
19542053
INTEGER, INTENT(OUT) :: ErrStat
1955-
CHARACTER(*), INTENT(OUT) :: ErrMsg
2054+
CHARACTER(*), INTENT(INOUT) :: ErrMsg
19562055
INTEGER :: istat
19572056

19582057
ErrStat = CD_DYN_OK
1959-
ErrMsg = ''
19602058
IF (n1 < 0 .OR. n2 < 0) THEN
19612059
CALL fail(ErrStat, ErrMsg, 'internal workspace shape must be non-negative')
19622060
RETURN

0 commit comments

Comments
 (0)