Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tight-Coupling Algorithm for OpenFAST 5.0 #2439

Draft
wants to merge 252 commits into
base: dev
Choose a base branch
from
Draft
Changes from 1 commit
Commits
Show all changes
252 commits
Select commit Hold shift + click to select a range
9e213ea
Modify FAST_Lin/FAST_SS_Solver for ED module variables
deslaughter Jan 25, 2024
ec0a483
Use module variables in BD, fix bugs in ModVar
deslaughter Feb 9, 2024
1b59356
Update BeamDyn_Types after rebase
deslaughter Feb 9, 2024
e4ab51c
Fix single precision build
deslaughter Jan 26, 2024
fd133c1
ModVar: fix rotation perturbation/diff order
deslaughter Jan 29, 2024
009f28a
BD: apply rotate states before copying to output matrix
deslaughter Jan 29, 2024
b549f9f
ED/BD: change flag to CalcWriteOutput in Jacobian/OP routines
deslaughter Jan 29, 2024
770ebb7
Added params and funds to access input/output meshes
deslaughter Feb 8, 2024
81dc1d3
Reworked many routines in ModVar.f90
deslaughter Feb 8, 2024
9136147
Modify AeroDyn for module variables
deslaughter Feb 9, 2024
2f59f57
Update ED and BD module variables
deslaughter Feb 9, 2024
aad062b
Add Module variables to ServoDyn
deslaughter Feb 9, 2024
be71539
Add Module variables to openfast-library, start replacing FAST_Lin
deslaughter Feb 9, 2024
c3b22e6
Add module for managing meshes at glue code level
deslaughter Feb 9, 2024
068363e
Add modules in FAST_Subs, replace FAST_Linearize_OP
deslaughter Feb 9, 2024
098296d
Regenerate _Types.f90 files after registry modifications
deslaughter Feb 9, 2024
9e32e1e
Use R8Ki in GetOP functions
deslaughter Feb 9, 2024
d570445
Disable FAST_Linear, FAST_CalcSteady, and FAST_RunSteadyStateDriver
deslaughter Feb 9, 2024
964e0f5
Changed function signature of Input/Output Mesh Names function
deslaughter Feb 14, 2024
aacc6c4
Add missing error return initialization
deslaughter Feb 14, 2024
46a9259
Expand mesh mapping data structure
deslaughter Feb 14, 2024
d5d9d24
Add HydroDyn and MAP to MV_AddModule in FAST_Subs
deslaughter Feb 14, 2024
a7cdf92
Initialize variable linearization index in ModLin
deslaughter Feb 14, 2024
761bbde
Change how extended linearization variables are handled in ElastoDyn
deslaughter Feb 14, 2024
86c7fca
Add Hydrodyn module variables
deslaughter Feb 14, 2024
f448bf5
Add MAP Module Variables
deslaughter Feb 14, 2024
2783349
ModVar: don't add variables with zero number
deslaughter Feb 14, 2024
78a0f55
Remove duplicate registry generation in MAP
deslaughter Feb 14, 2024
1d111c4
Add missing routines to FAST_Funcs
deslaughter Feb 14, 2024
1f96ede
Completely rework FAST_Mesh
deslaughter Feb 14, 2024
69cdcc9
Fixing types for single-precision compile
deslaughter Feb 14, 2024
613c5c0
Update simulink CMakeLists with new FAST modules
deslaughter Feb 14, 2024
69e4fb9
Added HD mappings in FAST_Mesh.f90
deslaughter Feb 15, 2024
a11ceb3
Fix bug in map.f90 jacobian routine
deslaughter Feb 15, 2024
51d77a8
Add guard on HD WAMITObj when creating vars
deslaughter Feb 15, 2024
fb9ab9c
Add iVar guards on ModVar pack/unpack routines
deslaughter Feb 15, 2024
b0614cb
Fix variable linearization names in ServoDyn.f90
deslaughter Feb 15, 2024
13e641b
Rename FAST_Mesh.f90 to FAST_Mapping.f90
deslaughter Feb 16, 2024
cf7fa65
Added mapping for non-mesh variables in FAST_Mapping
deslaughter Feb 16, 2024
9c82411
Updating AeroDyn Linearization
deslaughter Feb 20, 2024
b9853c5
Update test list and r-test pointer
deslaughter Feb 20, 2024
09c3cec
Merge remote-tracking branch 'andy/f/AD15_IfW_Linearization' into f/t…
deslaughter Feb 20, 2024
c8a94fe
5MW_Land_Linear_Aero mostly working
deslaughter Feb 22, 2024
a8bea4a
Add AD extended inputs as standard inputs
deslaughter Feb 22, 2024
1bd9b50
Merge remote-tracking branch 'andy/f/AD15_IfW_Linearization' into f/t…
deslaughter Feb 22, 2024
d7c3d59
Change OP type in InflowWind_GetOP to R8Ki
deslaughter Feb 22, 2024
a40ed60
Fix bug in AD WriteOutput Variable creation
deslaughter Feb 22, 2024
d9ed815
Add docs to FAST_LinearizeMappings, minor cleanup
deslaughter Feb 22, 2024
04ac77a
Update r-test pointer
deslaughter Feb 22, 2024
a2e9cb7
Fixed UA State variables and packing, use RotInflow_perturb in functions
deslaughter Feb 22, 2024
febda0d
FAST_Mapping: added comments, fixed load mesh linearization for non-s…
deslaughter Feb 22, 2024
f8fc2e7
Merge remote-tracking branch 'andy/f/AD15_IfW_Linearization' into f/t…
deslaughter Feb 22, 2024
6cdf30c
Create AD_SetOP routine, standardize OP pack/unpack routines
deslaughter Feb 23, 2024
4e62b3f
Restore AD Compute_dY which is used by JacobianPConstrState
deslaughter Feb 23, 2024
93e06be
Add module instance to AD_GetOP as the rotor index
deslaughter Feb 23, 2024
63f9d2b
FAST_Mapping: Added more mesh and variable mappings
deslaughter Feb 27, 2024
b269c58
Added Custom mapping type for direct transfers not used in linearization
deslaughter Feb 27, 2024
205b412
Use MV_Pack in SrvD GetOP, add variables indices
deslaughter Feb 27, 2024
9e688d8
Add MD to modules list in FAST_Subs
deslaughter Feb 27, 2024
70328c2
Change GetOP order in FAST_ModLin
deslaughter Feb 27, 2024
4482c5e
Modify MoorDyn to use module variables
deslaughter Feb 27, 2024
7a022ed
Standardize names of module pack/unpack routines
deslaughter Feb 27, 2024
d881246
Added SubDyn Linearization
deslaughter Feb 27, 2024
8c78841
Fix single precision compilation
deslaughter Feb 27, 2024
956eccb
Remove mapping to unused SrvD%u%PtfmMotionMesh
deslaughter Feb 27, 2024
af70cf2
Fix blade structural controller indexing
deslaughter Feb 27, 2024
1a1e4c6
Disable AeroMap
deslaughter Feb 27, 2024
bd9b914
Update r-test pointer
deslaughter Feb 29, 2024
85230ef
Merge remote-tracking branch 'andy/f/AD15_IfW_Linearization' into f/t…
deslaughter Feb 29, 2024
f6bdbd3
Fix bad merge of ElastoDyn_Registry.txt
deslaughter Feb 29, 2024
2487ea7
Specify linearization modules in FAST_Mods.f90
deslaughter Feb 29, 2024
f2c0f5a
Update r-test pointer
deslaughter Feb 29, 2024
6cd6258
Disable allocation of ModGlue linearization matrices unless lineariza…
deslaughter Feb 29, 2024
eb206a6
Fix rotate states in BD
deslaughter Mar 1, 2024
bca1758
Remove AeroMap from AD, BD, ED
deslaughter Mar 5, 2024
cb5b25e
InflowWind_IO: Add function to init SteadyFlowField from RefHt, HWind…
deslaughter Mar 5, 2024
ff89859
Rename FAST_ModLin to FAST_ModGlue
deslaughter Mar 5, 2024
f27e629
Move some types/funcs out of ModVar and into glue code
deslaughter Mar 5, 2024
0cd04a2
FAST_Funcs add subroutine for copying inputs
deslaughter Mar 5, 2024
446b0c1
Add header to FAST_Mapping
deslaughter Mar 5, 2024
933ff11
Change FAST_ModLin to FAST_ModGlue in FAST_Subs
deslaughter Mar 5, 2024
0a5433d
Add guard around WriteOutput in Servodyn in GetOP function
deslaughter Mar 5, 2024
3d477df
Remove indexing for linearization, handle it inline
deslaughter Mar 5, 2024
f96090a
Merge remote-tracking branch 'andy/f/AD15_IfW_Linearization' into f/t…
deslaughter Mar 5, 2024
df1bc2a
Change FAST_ModLin to FAST_ModGlue in Simulink CMakeLists.txt
deslaughter Mar 5, 2024
878ee64
Update r-test pointer
deslaughter Mar 5, 2024
98801a4
Update r-test pointer for reg_test changes
deslaughter Mar 6, 2024
e7dc2a7
Started re-adding AeroMap
deslaughter May 17, 2024
e299b6a
Merge remote-tracking branch 'upstream/dev' into f/tight-coupling
deslaughter May 17, 2024
31f68dd
Switch to dev r-test branch
deslaughter May 17, 2024
a5dd7b3
Add FAST_Idx.f90 to simulink/CMakeLists.txt
deslaughter May 17, 2024
da4e4d8
Disable 5MW_Land_AeroMap test temporarily
deslaughter May 17, 2024
8cf4a36
Switch to quaternions from WM params in ModVar
deslaughter May 21, 2024
bc3da89
Attempt to get linearization test cases to work again
deslaughter May 21, 2024
f906d9b
Add missing flag on SubDyn WriteOutput variable
deslaughter May 23, 2024
d20489e
Added SeaState to module system
deslaughter May 23, 2024
ecc8605
Revised quaternion handling in BeamDyn
deslaughter May 23, 2024
c232ec4
Fix bug where SeaState variables weren't being initialized
deslaughter May 23, 2024
48d7df1
Variable Perturb was wrong type in SeaState
deslaughter May 23, 2024
c32d196
Attempt to remove uninitialized variables from FAST_Mapping and FAST_…
deslaughter May 23, 2024
76a0bba
Fix extending WaveElev0 input/output name in SeaState
deslaughter May 24, 2024
ab1ad26
Fix indexing in dXdu in HydroDyn for new extended inputs
deslaughter May 24, 2024
b8f2c6b
Reduce memory usage in fast_linearization_file.py when reading matrices
deslaughter May 24, 2024
f9d9241
Add Glue_Registry.txt to store new glue code structures, change FAST …
deslaughter May 28, 2024
a0c46c7
Add ModGlue_CalcSteady
deslaughter May 31, 2024
c603aef
Add MV_ExtrapInterp function to ModVar
deslaughter Jun 3, 2024
1e4bc9a
Rename ModVar variables fields to better differentiate from Flags. Ad…
deslaughter Jun 3, 2024
1621b8a
Add proper angle interpolation on [0,2PI] to MV_ExtrapInterp
deslaughter Jun 3, 2024
25a7742
Add FEAM and Orca to Module System
deslaughter Jun 3, 2024
5c1d034
Update r-test pointer
deslaughter Jun 3, 2024
e347f85
Add OrcaFlex, ExtInfw, ExtLd to module system. Fix spelling in InitVa…
deslaughter Jun 3, 2024
b5fe903
Update r-test pointer
deslaughter Jun 3, 2024
0cb0072
Remove unused linearization routines in MAP, BeamDyn, SubDyn
deslaughter Jun 3, 2024
7ac2d84
Merge remote-tracking branch 'upstream/dev' into f/tight-coupling
deslaughter Jun 3, 2024
9917249
Update r-test pointer
deslaughter Jun 6, 2024
b543b77
Making progress on AeroMap, update indexing
deslaughter Jun 15, 2024
7182ff8
Change FAST_Idx.f90 to FAST_ModData.90 in simulink CMakeLists.txt
deslaughter Jun 15, 2024
c465160
AeroMap working for ElastoDyn
deslaughter Jun 18, 2024
ffa7098
Get AeroMap reset working, re-enable AeroMap test for ED
deslaughter Jun 18, 2024
d0d19f4
Minor cleanup in AeroMap
deslaughter Jun 20, 2024
98b0e9a
Add parsing of J matrix to FASTLinearizationFile
deslaughter Jun 20, 2024
f2996f7
Partially working revision of module vars
deslaughter Jul 8, 2024
49fec4e
Refactoring module variables again
deslaughter Jul 22, 2024
ceda2b5
Merge remote-tracking branch 'upstream/dev' into f/tight-coupling
deslaughter Jul 22, 2024
35c64b2
Fix merge issues
deslaughter Jul 22, 2024
8dc5ebb
Linearization changes
deslaughter Jul 24, 2024
a59fa0a
Majority of linearization regression tests working
deslaughter Jul 25, 2024
6c3eabc
Merge remote-tracking branch 'upstream/dev' into f/tight-coupling
deslaughter Jul 25, 2024
14cf9e6
Remove Glue_ModData from simulink CMakeLists.txt
deslaughter Jul 26, 2024
f0b3a77
Regenerate Types files
deslaughter Jul 26, 2024
653b976
fix typo in fast_linearization_file.py
deslaughter Jul 26, 2024
7ab1028
Change dxdt_jac to dxdt_lin
deslaughter Jul 26, 2024
5f0d9a0
Reenable AeroMap
deslaughter Jul 26, 2024
72017b5
Restore iSrcMaps and iDstMaps zero allocation
deslaughter Jul 27, 2024
2695d5f
Fix 5MW_OC4Semi_MD_Linear test case, generate field name functions
deslaughter Jul 29, 2024
fe88291
Tight coupling appears to be working for at least some regression tes…
deslaughter Aug 9, 2024
0111789
Don't clear load mesh if mapping isn't ready
deslaughter Aug 9, 2024
819d504
BeamDyn, ModMesh, NWTC_Num performance improvements
deslaughter Aug 16, 2024
b57c17e
Tight coupling appears to be working for the IEA15
deslaughter Aug 16, 2024
0f67063
Fix bug in BeamDyn performance commit
deslaughter Aug 19, 2024
d18c96d
Set SrvD hub wind speed from IfW hub speed
deslaughter Aug 19, 2024
f664cc5
Add commented option for performance profiling in OpenfastFortranOpti…
deslaughter Aug 19, 2024
dd7e4f4
Use small rotation angles in ModVar
deslaughter Aug 20, 2024
56d830b
Make SolverTC work with no states
deslaughter Aug 20, 2024
427af96
Add error in SrvD to exit if HSSBrMode is not 0. The brake doesn't cu…
deslaughter Aug 20, 2024
e36a35c
Change errorPlotting.py and pass_fail.py to ignore TC channels (ConvE…
deslaughter Aug 20, 2024
12b0d8d
Set mapping from SeaSt_y_WaveElev0 to HydroDyn_u_WaveElev0 to only be…
deslaughter Aug 20, 2024
e460460
Remove duplicate array allocation in AeroMap
deslaughter Aug 20, 2024
625ba1e
Change Vars used in Option 1 in SolverTC
deslaughter Aug 20, 2024
0b4894f
Fix beamdyn_utest incorrect size of m%qp%upp
deslaughter Aug 20, 2024
37b6f34
Fix more bugs in BeamDyn performance improvements
deslaughter Aug 22, 2024
4c93cf7
Update executePythonRegressionCase.py for TC outputs
deslaughter Aug 22, 2024
699bcb0
Reworked TC Solver initialization method
deslaughter Aug 22, 2024
07ae8bb
FAST_Func: Add SeaSt CalcOutput, fix MAP_UpdateStates
deslaughter Aug 22, 2024
04f488a
Specify name in Glue_CombineModules
deslaughter Aug 22, 2024
3e171d4
Rename some vars in Glue_Registry.txt
deslaughter Aug 22, 2024
ab1ce23
Merge remote-tracking branch 'upstream/dev' into f/tight-coupling
deslaughter Aug 22, 2024
b34e327
Fix simulink CMakeLists.txt
deslaughter Aug 22, 2024
0f5a5a9
Point to r-test-5 in submodule
deslaughter Aug 23, 2024
f9f31c2
Update r-test pointer
deslaughter Aug 23, 2024
9fc8246
Allow reg_tests to use .out or .outb files
deslaughter Aug 26, 2024
f8a952f
Fix step0 system initialization in FAST_SolverTC
deslaughter Aug 26, 2024
d1d3f61
Disable use of small rotation angles in ModVar
deslaughter Aug 26, 2024
33ca6dc
Align SolverTC with FAST_Subs
deslaughter Aug 26, 2024
cd6b4fc
Fix bug in Calculate_C_alpha (AirfoilInfo.f90)
deslaughter Aug 27, 2024
d4e7c7c
Rename functions in FAST_SolverTC
deslaughter Aug 27, 2024
f49fc9a
Allow .out and .outb files in regression test scripts
deslaughter Aug 27, 2024
4b703bc
Update r-test pointer
deslaughter Aug 27, 2024
c06f0bb
Remove GetOP from IfW and ExtPtfm
deslaughter Aug 27, 2024
724593f
Reduce linearization size by keeping only necessary variables
deslaughter Aug 27, 2024
5912006
Add name argument to Glue_CombineModules
deslaughter Aug 27, 2024
c624cb4
Update r-test pointer, disable 5MW_OC4Jckt_DLL_WTurb_WavesIrr_MGrowth
deslaughter Aug 27, 2024
1a128c4
Read solver parameters from input file
deslaughter Aug 27, 2024
fe73405
Update FAST_Types.f90
deslaughter Aug 28, 2024
b67fb62
Update r-test pointer
deslaughter Aug 28, 2024
2f7b2f8
Update r-test pointer
deslaughter Aug 28, 2024
467bb85
Update r-test pointer
deslaughter Aug 28, 2024
4040fba
Update r-test pointer
deslaughter Aug 28, 2024
435d084
Add checks in linearization for when dUdu and dUdy aren't allocated
deslaughter Aug 28, 2024
25a5dcd
Update r-test pointer
deslaughter Aug 29, 2024
4c139fd
Rework initialization again
deslaughter Aug 29, 2024
1cf4f63
Rework initialization, attempt 3
deslaughter Aug 29, 2024
4013962
Update r-test pointer
deslaughter Aug 29, 2024
45be70a
Skip Solver_Step0 convergence if no inputs
deslaughter Aug 29, 2024
ff50e97
Update r-test pointer
deslaughter Aug 29, 2024
ef0e277
Move NacelleDrag and BuoyantLoads calc into RotCalcOutput to be inclu…
deslaughter Aug 29, 2024
78c1282
Update r-test pointer
deslaughter Aug 29, 2024
75f46da
Add MHK_RM1_Floating_Linear regression test
deslaughter Aug 29, 2024
a644cad
Disable MHK_RM1_Floating_Linear, reset flag in ModGlue
deslaughter Aug 29, 2024
0c05514
Get AeroMap working again
deslaughter Aug 29, 2024
17818c2
Integrate ExtLoads
deslaughter Aug 31, 2024
8f512df
Fix blade structural control in FAST_Mapping
deslaughter Aug 31, 2024
639b0a5
Update r-test pointer
deslaughter Aug 31, 2024
410d516
Fix FAST_Mapping again
deslaughter Aug 31, 2024
36c73bc
Update remap flat reset function to use mesh pointers
deslaughter Sep 4, 2024
bc551ce
improve flag usage in elastodyn
deslaughter Sep 4, 2024
1bef93f
Improve method for select vars used in TC solve
deslaughter Sep 4, 2024
8669b9a
Update r-test pointer
deslaughter Sep 4, 2024
3023d8e
Update r-test pointer
deslaughter Sep 4, 2024
711df68
Change field strings in ModVar.f90
deslaughter Sep 7, 2024
ffc4cdb
Fix SD->HD mapping with Y2Mesh in FAST_Mapping
deslaughter Sep 7, 2024
373a523
Cleanup in FAST_Mapping
deslaughter Sep 7, 2024
2634482
Add solve debug output in FAST_SolverTC
deslaughter Sep 7, 2024
0b59134
Perf improvements to Conv_Radiation and SeaSt_WaveField
deslaughter Sep 9, 2024
7bff0dc
Mark several NWTC Lib functions as PURE
deslaughter Sep 10, 2024
cf89895
Minor performance improvements in SeaState (reorganize indexing to mi…
deslaughter Sep 10, 2024
208db9d
Small performance improvements in Morison.f90
deslaughter Sep 10, 2024
640acba
Minor performance improvements in SubDyn
deslaughter Sep 10, 2024
74f77e6
Use LAPACK_GEMV in SubDyn
deslaughter Sep 10, 2024
2ebd615
Fully initialize Mesh%ElemTable in MeshCreate
deslaughter Sep 11, 2024
89238f4
SubDyn: fix single precision compile
deslaughter Sep 11, 2024
41649b2
SeaSt_WaveField: remove unused WaveElev functions
deslaughter Sep 11, 2024
ea17262
Fix crashes with Intel compiler
deslaughter Sep 11, 2024
deaff44
Merge remote-tracking branch 'upstream/dev' into f/tight-coupling
deslaughter Sep 11, 2024
622b60b
Everything builds after merge
deslaughter Sep 11, 2024
e611250
FAST_Subs: Fix duplicate array allocation
deslaughter Sep 12, 2024
bc3ebe5
Add IceDyn and IceFloe to modules system
deslaughter Sep 12, 2024
5a17a69
Integrate SED and AeroDisk into new glue code
deslaughter Sep 12, 2024
10fecd5
Get SED working, missing mappings
deslaughter Sep 13, 2024
6156ee1
Copy .outb file when doing linear regression test
deslaughter Sep 13, 2024
345db2e
Update r-test pointer
deslaughter Sep 13, 2024
8205fce
SubDyn: fix single precision build
deslaughter Sep 13, 2024
7257fd4
FAST_SolverTC: Disable AD in Option 1
deslaughter Sep 13, 2024
99390be
Update r-test pointer
deslaughter Sep 13, 2024
f68f85f
FAST_SolverTC: disable Jacobian debug output
deslaughter Sep 13, 2024
6d50fd4
Add MHK floating test case
deslaughter Sep 13, 2024
4460bef
FAST_Subs: fix bug in InputAryLB calc
deslaughter Sep 13, 2024
796423c
Update r-test pointer
deslaughter Sep 13, 2024
7f85499
HydroDyn: fix output of WAMIT%Conv_Rdtn%RdtnKrnl
deslaughter Sep 13, 2024
b5394f4
FAST_SolverTC: Enable switching of AeroDyn between Opt1 and Opt2 if M…
deslaughter Sep 13, 2024
94c6bcf
AeroDyn: disable first tower node depth check in RotCalcBuoyantLoads …
deslaughter Sep 13, 2024
d977fb7
CTestList: Add highpass filter for MHK_RM1_Floating_Linear case
deslaughter Sep 13, 2024
c55c291
Print more failed errors for linearization regression tests
deslaughter Sep 13, 2024
348921d
CTestList: Disable MHK_RM1_Floating_Linear and update r-test pointer
deslaughter Sep 13, 2024
500f0d8
Merge remote-tracking branch 'upstream/dev' into f/tight-coupling
deslaughter Sep 13, 2024
1d5b0d1
ExtLoads: update to match dev behavior
deslaughter Sep 14, 2024
83bed31
Update r-test pointer
deslaughter Sep 14, 2024
58f5aad
FAST_Subs: fix bad merge
deslaughter Sep 14, 2024
e9d007d
openfast_io: update reader & writer for tight-coupling inputs
deslaughter Sep 14, 2024
c68d693
Update r-test pointer
deslaughter Sep 14, 2024
7c5633f
Allow NLinTimes=1 when using CalcSteady
deslaughter Sep 17, 2024
ae12bdc
Allow DBEMT_Mod=-1 (frozen wake) for linearization
deslaughter Sep 17, 2024
e1a28e1
FAST_ModGlue: better way to prevent CalcSteady from converging premat…
deslaughter Sep 17, 2024
2723c20
FAST_Mapping: remove ExtLd -> SrvD
deslaughter Sep 18, 2024
0845870
Use at least 2 azimuth positions for CalcSteady
deslaughter Sep 18, 2024
09cc223
Merge remote-tracking branch 'upstream/dev' into f/tight-coupling
deslaughter Sep 18, 2024
efc9d5a
FAST_Mapping: reimplement tower and blade damping for CalcSteady
deslaughter Sep 19, 2024
b3541f5
ExtLoads: fix bad merge from dev
deslaughter Sep 20, 2024
fdffbe4
Update r-test pointer
deslaughter Sep 20, 2024
3f0e899
Fix MV_ExtrapInterp and its use in FAST_ModGlue
deslaughter Sep 26, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
ModVar: don't add variables with zero number
  • Loading branch information
deslaughter committed Feb 14, 2024
commit 27833494b154fd880dec630deb3f7ad01adcae68
10 changes: 6 additions & 4 deletions modules/nwtc-library/src/ModVar.f90
Original file line number Diff line number Diff line change
Expand Up @@ -154,9 +154,6 @@ subroutine MV_InitVarsJac(Vars, Jac, Linearize, ErrStat, ErrMsg)
end do
Vars%Ny = sum(Vars%y%Num)

! Initialize full linearization variable indexing (all variables)
call MV_InitVarIdx(Vars, Vars%IdxLin, VF_None, ErrStat2, ErrMsg2); if (Failed()) return

! Allocate arrays
if (Vars%Nx > 0) then
call AllocAry(Jac%x, Vars%Nx, "Lin%x", ErrStat2, ErrMsg2); if (Failed()) return
Expand Down Expand Up @@ -770,8 +767,13 @@ subroutine MV_AddVar(VarAry, Name, Field, Num, Flags, iUsr, jUsr, DerivOrder, Pe
! Initialize var with default values
Var = ModVarType(Name=Name, Field=Field)

! If number of values is zero, return
if (present(Num)) then
if (Num == 0) return
Var%Num = Num
end if

! Set optional values
if (present(Num)) Var%Num = Num
if (present(Flags)) Var%Flags = Flags
if (present(iUsr)) Var%iUsr = [iUsr, iUsr + Var%Num - 1]
if (present(jUsr)) Var%jUsr = jUsr
Expand Down