From d483d23171cad3dc1f3a3aef08350f0ca2462bff Mon Sep 17 00:00:00 2001 From: Bonnie Jonkman Date: Mon, 19 Apr 2021 09:44:24 -0600 Subject: [PATCH 1/9] bug fixes: error handling + restart sizes + AD multi-rotor cpp restart --- modules/openfast-library/src/FAST_Library.f90 | 4 ++-- modules/openfast-library/src/FAST_Subs.f90 | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/modules/openfast-library/src/FAST_Library.f90 b/modules/openfast-library/src/FAST_Library.f90 index 3f1606b227..7867d49820 100644 --- a/modules/openfast-library/src/FAST_Library.f90 +++ b/modules/openfast-library/src/FAST_Library.f90 @@ -439,7 +439,7 @@ subroutine FAST_Restart(iTurb, CheckpointRootName_c, AbortErrLev_c, NumOuts_c, d ! transfer Fortran variables to C: n_t_global_c = n_t_global AbortErrLev_c = AbortErrLev - NumOuts_c = min(MAXOUTPUTS, 1 + SUM( Turbine(iTurb)%y_FAST%numOuts )) ! includes time + NumOuts_c = min(MAXOUTPUTS, SUM( Turbine(iTurb)%y_FAST%numOuts )) ! includes time dt_c = Turbine(iTurb)%p_FAST%dt ErrStat_c = ErrStat @@ -655,7 +655,7 @@ subroutine FAST_OpFM_Restart(iTurb, CheckpointRootName_c, AbortErrLev_c, dt_c, n ! transfer Fortran variables to C: n_t_global_c = n_t_global AbortErrLev_c = AbortErrLev - NumOuts_c = min(MAXOUTPUTS, 1 + SUM( Turbine(iTurb)%y_FAST%numOuts )) ! includes time + NumOuts_c = min(MAXOUTPUTS, SUM( Turbine(iTurb)%y_FAST%numOuts )) ! includes time if (allocated(Turbine(iTurb)%ad%p%rotors)) then ! this might not be allocated if we had an error earlier numBlades_c = Turbine(iTurb)%ad%p%rotors(1)%numblades numElementsPerBlade_c = Turbine(iTurb)%ad%p%rotors(1)%numblnds ! I'm not sure if FASTv8 can handle different number of blade nodes for each blade. diff --git a/modules/openfast-library/src/FAST_Subs.f90 b/modules/openfast-library/src/FAST_Subs.f90 index 784842dad3..41ea4c5eff 100644 --- a/modules/openfast-library/src/FAST_Subs.f90 +++ b/modules/openfast-library/src/FAST_Subs.f90 @@ -449,9 +449,9 @@ SUBROUTINE FAST_InitializeAll( t_initial, p_FAST, y_FAST, m_FAST, ED, BD, SrvD, END IF ELSEIF ( p_FAST%CompAero == Module_AD ) THEN - - allocate(Init%InData_AD%rotors(1), stat=errStat) - if (errStat/=0) then + + allocate(Init%InData_AD%rotors(1), stat=ErrStat2) + if (ErrStat2 /= 0 ) then call SetErrStat( ErrID_Fatal, 'Allocating rotors', errStat, errMsg, RoutineName ) call Cleanup() return From 2e255df795ebe77be27f0957d2509f5c438209bc Mon Sep 17 00:00:00 2001 From: Bonnie Jonkman Date: Mon, 26 Apr 2021 14:03:06 -0600 Subject: [PATCH 2/9] AD Bug Fix: close AD echo file Related to comment at the end of #695 AD was overwriting the echo file unit number when opening the blade properties files, which caused the echo file not to be closed when exiting the routine. --- modules/aerodyn/src/AeroDyn_IO.f90 | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/modules/aerodyn/src/AeroDyn_IO.f90 b/modules/aerodyn/src/AeroDyn_IO.f90 index c4f8258e7e..1fb3fbbb4b 100644 --- a/modules/aerodyn/src/AeroDyn_IO.f90 +++ b/modules/aerodyn/src/AeroDyn_IO.f90 @@ -1942,7 +1942,7 @@ SUBROUTINE ReadInputFiles( InputFileName, InputFileData, Default_DT, OutFileRoot CHARACTER(*), INTENT(IN) :: OutFileRoot ! The rootname of all the output files written by this routine. TYPE(AD_InputFile), INTENT(INOUT) :: InputFileData ! Data stored in the module's input file - INTEGER(IntKi), INTENT(OUT) :: UnEcho ! Unit number for the echo file + INTEGER(IntKi), INTENT(INOUT) :: UnEcho ! Unit number for the echo file INTEGER(IntKi), INTENT(IN) :: NumBlades(:) ! Number of blades per rotor INTEGER(IntKi), INTENT(OUT) :: ErrStat ! The error status code @@ -1964,7 +1964,6 @@ SUBROUTINE ReadInputFiles( InputFileName, InputFileData, Default_DT, OutFileRoot ErrStat = ErrID_None ErrMsg = '' - UnEcho = -1 InputFileData%DTAero = Default_DT ! the glue code's suggested DT for the module (may be overwritten in ReadPrimaryFile()) @@ -2351,18 +2350,17 @@ SUBROUTINE ParsePrimaryFileInfo( PriPath, InputFile, RootName, NumBlades, interv logical function Failed() CALL SetErrStat( ErrStat2, ErrMsg2, ErrStat, ErrMsg, 'ParsePrimaryFileInfo' ) Failed = ErrStat >= AbortErrLev - if (Failed) then - if (UnEc > -1_IntKi) CLOSE( UnEc ) - endif + !if (Failed) then + !endif end function Failed logical function FailedNodal() ErrMsg_NoAllBldNdOuts='AD15 Nodal Outputs: Nodal output section of AeroDyn input file not found or improperly formatted. Skipping nodal outputs.' - if (ErrStat2 >= AbortErrLev ) then + FailedNodal = ErrStat2 >= AbortErrLev + if ( FailedNodal ) then InputFileData%BldNd_BladesOut = 0 InputFileData%BldNd_NumOuts = 0 call wrscr( trim(ErrMsg_NoAllBldNdOuts) ) endif - FailedNodal = ErrStat2 >= AbortErrLev end function FailedNodal !------------------------------------------------------------------------------------------------- END SUBROUTINE ParsePrimaryFileInfo From 031f90f3cfccf6107e04a08b2e6300b09518bee7 Mon Sep 17 00:00:00 2001 From: Bonnie Jonkman Date: Thu, 20 May 2021 14:30:12 -0600 Subject: [PATCH 3/9] AD: fix typo in summary file Drag term for axial induction was written twice instead of once for axial and once for tangential. --- modules/aerodyn/src/AeroDyn_IO.f90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/aerodyn/src/AeroDyn_IO.f90 b/modules/aerodyn/src/AeroDyn_IO.f90 index 1fb3fbbb4b..f387a6eb3a 100644 --- a/modules/aerodyn/src/AeroDyn_IO.f90 +++ b/modules/aerodyn/src/AeroDyn_IO.f90 @@ -2656,7 +2656,7 @@ SUBROUTINE AD_PrintSum( InputFileData, p, p_AD, u, y, ErrStat, ErrMsg ) else Msg = 'No' end if - WRITE (UnSu,Ec_LgFrmt) InputFileData%AIDrag, 'AIDrag', "Include the drag term in the tangential-induction calculation? "//TRIM(Msg) + WRITE (UnSu,Ec_LgFrmt) InputFileData%TIDrag, 'TIDrag', "Include the drag term in the tangential-induction calculation? "//TRIM(Msg) ! IndToler WRITE (UnSu,Ec_ReFrmt) InputFileData%IndToler, 'IndToler', "Convergence tolerance for BEM induction factors (radians)" From 39cae5678af980aae52de0422ad9de7fa5c652a8 Mon Sep 17 00:00:00 2001 From: Bonnie Jonkman Date: Fri, 28 May 2021 08:17:46 -0600 Subject: [PATCH 4/9] FVW: initialize variables --- modules/aerodyn/src/FVW.f90 | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/modules/aerodyn/src/FVW.f90 b/modules/aerodyn/src/FVW.f90 index 21a10443ed..72910e70fb 100644 --- a/modules/aerodyn/src/FVW.f90 +++ b/modules/aerodyn/src/FVW.f90 @@ -1340,6 +1340,10 @@ subroutine WriteVTKOutputs(t, force, u, p, x, z, y, m, ErrStat, ErrMsg) character(*), parameter :: RoutineName = 'FVW_CalcOutput' integer(IntKi) :: iW, iGrid integer(IntKi) :: nSeg, nSegP + + ErrStat = ErrID_None + ErrMsg = "" + if (p%WrVTK>0) then if (m%FirstCall .or. force) then call MKDIR(p%VTK_OutFileRoot) From a98e3cb6cfb49b1a83b329751f04a283ebdd9198 Mon Sep 17 00:00:00 2001 From: Bonnie Jonkman Date: Mon, 14 Jun 2021 09:31:34 -0600 Subject: [PATCH 5/9] Extend the fix for array bounds in #769 to tower points --- modules/inflowwind/src/IfW_FFWind_Base.f90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/inflowwind/src/IfW_FFWind_Base.f90 b/modules/inflowwind/src/IfW_FFWind_Base.f90 index e5833a10d4..86150fd270 100644 --- a/modules/inflowwind/src/IfW_FFWind_Base.f90 +++ b/modules/inflowwind/src/IfW_FFWind_Base.f90 @@ -393,7 +393,7 @@ FUNCTION FFWind_Interp(Time, Position, p, ErrStat, ErrMsg) IF (p%InterpTower) THEN - CALL GetInterpValues() + CALL GetInterpValues(); if (ErrStat >= AbortErrLev) return !------------------------------------------------------------------------------------------------- ! Interpolate on the bottom of the grid to the ground From 752c4f2586c7d041fc64540820e3ff5ca8a07d03 Mon Sep 17 00:00:00 2001 From: Bonnie Jonkman Date: Tue, 22 Jun 2021 08:59:24 -0600 Subject: [PATCH 6/9] Fix some spacing; remove nonsense characters and reset var in VS build --- modules/aerodyn/src/AeroDyn.f90 | 2 +- vs-build/FASTlib/FASTlib.vfproj | 2 +- vs-build/RunRegistry.bat | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/modules/aerodyn/src/AeroDyn.f90 b/modules/aerodyn/src/AeroDyn.f90 index 4ace61b3c1..00039e85e4 100644 --- a/modules/aerodyn/src/AeroDyn.f90 +++ b/modules/aerodyn/src/AeroDyn.f90 @@ -5246,7 +5246,7 @@ SUBROUTINE Init_Jacobian_u( InputFileData, p, u, InitOut, ErrStat, ErrMsg) do k=1,p%NumBlades do i=1,p%NumBlNds - InitOut%LinNames_u(index) = 'User property on blade '//trim(num2lstr(k))//', node '//trim(num2lstr(i))//', -' + InitOut%LinNames_u(index) = 'User property on blade '//trim(num2lstr(k))//', node '//trim(num2lstr(i))//', -' index = index + 1 end do end do diff --git a/vs-build/FASTlib/FASTlib.vfproj b/vs-build/FASTlib/FASTlib.vfproj index c78ea5f9df..880205f5bf 100644 --- a/vs-build/FASTlib/FASTlib.vfproj +++ b/vs-build/FASTlib/FASTlib.vfproj @@ -36,7 +36,7 @@ - + diff --git a/vs-build/RunRegistry.bat b/vs-build/RunRegistry.bat index 3480ba5260..64b801b7d8 100644 --- a/vs-build/RunRegistry.bat +++ b/vs-build/RunRegistry.bat @@ -292,6 +292,7 @@ SET ModuleName= SET CURR_LOC= SET Root_Loc= +SET Output_Loc= SET Subs_Loc= SET FAST_Loc= From 5fb7a40d052d77906142c5139740152612fbde56 Mon Sep 17 00:00:00 2001 From: Bonnie Jonkman Date: Mon, 28 Jun 2021 09:53:47 -0600 Subject: [PATCH 7/9] Update VS build projects for smoother builds of OpenFAST releases This should remove the "-dirty" from Simulink builds on bjonkman fork (for now) --- vs-build/FAST/FAST.vfproj | 16 ++++++++-------- .../OpenFAST-Simulink/OpenFAST-Simulink.vfproj | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/vs-build/FAST/FAST.vfproj b/vs-build/FAST/FAST.vfproj index b9c9ca2a94..53f74b95ad 100644 --- a/vs-build/FAST/FAST.vfproj +++ b/vs-build/FAST/FAST.vfproj @@ -11,7 +11,7 @@ - + @@ -21,7 +21,7 @@ - + @@ -31,7 +31,7 @@ - + @@ -41,7 +41,7 @@ - + @@ -51,7 +51,7 @@ - + @@ -61,7 +61,7 @@ - + @@ -71,7 +71,7 @@ - + @@ -81,7 +81,7 @@ - + diff --git a/vs-build/OpenFAST-Simulink/OpenFAST-Simulink.vfproj b/vs-build/OpenFAST-Simulink/OpenFAST-Simulink.vfproj index de68e189f3..1b7110e1d7 100644 --- a/vs-build/OpenFAST-Simulink/OpenFAST-Simulink.vfproj +++ b/vs-build/OpenFAST-Simulink/OpenFAST-Simulink.vfproj @@ -36,7 +36,7 @@ - + From 399a314ae487cbafcc7f3519d3a5ac2892da8db3 Mon Sep 17 00:00:00 2001 From: Bonnie Jonkman Date: Fri, 23 Jul 2021 11:32:45 -0600 Subject: [PATCH 8/9] Add Simulink cache files to gitignore --- .gitignore | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.gitignore b/.gitignore index 3827d6e222..1634702f8b 100644 --- a/.gitignore +++ b/.gitignore @@ -49,3 +49,8 @@ vs-build/ *.aux *.nlo *.log + +#Simulink cache files +varcache +*.slxc + From 6669716536da20eefd225c28d62b07369d1c6cbb Mon Sep 17 00:00:00 2001 From: Bonnie Jonkman Date: Fri, 23 Jul 2021 11:36:55 -0600 Subject: [PATCH 9/9] Remove extra calls to CreateGitVersion in FAST.Farm VS project This should be called ONLY in projects that use VersionInfo.f90 because it isn't used elsewhere. --- vs-build/FAST-farm/FAST-Farm.vfproj | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/vs-build/FAST-farm/FAST-Farm.vfproj b/vs-build/FAST-farm/FAST-Farm.vfproj index f3baaa575d..adcd8f661d 100644 --- a/vs-build/FAST-farm/FAST-Farm.vfproj +++ b/vs-build/FAST-farm/FAST-Farm.vfproj @@ -11,7 +11,7 @@ - + @@ -21,7 +21,7 @@ - + @@ -31,7 +31,7 @@ - + @@ -41,7 +41,7 @@ - + @@ -51,7 +51,7 @@ - + @@ -61,7 +61,7 @@ - +