Skip to content

Commit 24e2e50

Browse files
committed
IfW_uniform: remove file passing option
1 parent eab6ed1 commit 24e2e50

File tree

8 files changed

+4
-103
lines changed

8 files changed

+4
-103
lines changed

modules/inflowwind/src/InflowWind.f90

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -255,8 +255,6 @@ SUBROUTINE InflowWind_Init( InitInp, InputGuess, p, ContStates, DiscStates, Cons
255255
Uniform_InitInput%RefHt = InputFileData%Uniform_RefHt
256256
Uniform_InitInput%RefLength = InputFileData%Uniform_RefLength
257257
Uniform_InitInput%PropagationDir = InputFileData%PropagationDir
258-
Uniform_InitInput%UseInputFile = InitInp%WindType2UseInputFile
259-
Uniform_InitInput%PassedFileInfo = InitInp%WindType2Info
260258

261259
p%FlowField%FieldType = Uniform_FieldType
262260
call IfW_UniformWind_Init(Uniform_InitInput, SumFileUnit, p%FlowField%Uniform, InitOutData%WindFileInfo, TmpErrStat, TmpErrMsg); if (Failed()) return

modules/inflowwind/src/InflowWind.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,6 @@ typedef ^ ^ CHARACTER(1024) RootName
9191
typedef ^ ^ IntKi FilePassingMethod - 0 - "Method for file passing {0: None (read from file), 1: as FileInfoType to parse, 2: as InputFileType already parsed}" -
9292
typedef ^ ^ FileInfoType PassedFileInfo - - - "If we don't use the input file, pass everything through this [FilePassingMethod = 1]" -
9393
typedef ^ ^ InflowWind_InputFile PassedFileData - - - "If we don't use the input file, pass everything through this [FilePassingMethod = 2]" -
94-
typedef ^ ^ LOGICAL WindType2UseInputFile - .TRUE. - "Flag for toggling file based IO in wind type 2." -
95-
typedef ^ ^ FileInfoType WindType2Info - - - "Optional slot for wind type 2 data if file IO is not used." -
9694
typedef ^ ^ LOGICAL OutputAccel - .FALSE. - "Flag to output wind acceleration" -
9795
typedef ^ ^ Lidar_InitInputType lidar - - - "InitInput for lidar data" -
9896
typedef ^ ^ Grid4D_InitInputType FDext - - - "InitInput for 4D external wind data" -

modules/inflowwind/src/InflowWind_IO.f90

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -182,12 +182,8 @@ subroutine IfW_UniformWind_Init(InitInp, SumFileUnit, UF, FileDat, ErrStat, ErrM
182182
UF%RefHeight = InitInp%RefHt
183183
UF%RefLength = InitInp%RefLength
184184

185-
! Read wind data from file or init input data
186-
if (InitInp%UseInputFile) then
187-
call ProcessComFile(InitInp%WindFileName, WindFileInfo, TmpErrStat, TmpErrMsg)
188-
else
189-
call NWTC_Library_CopyFileInfoType(InitInp%PassedFileInfo, WindFileInfo, MESH_NEWCOPY, TmpErrStat, TmpErrMsg)
190-
end if
185+
! Read wind data from file
186+
call ProcessComFile(InitInp%WindFileName, WindFileInfo, TmpErrStat, TmpErrMsg)
191187
call SetErrStat(TmpErrStat, TmpErrMsg, ErrStat, ErrMsg, RoutineName)
192188
if (ErrStat >= AbortErrLev) return
193189

modules/inflowwind/src/InflowWind_IO.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ typedef ^ ^ ReKi RefHt
4040
typedef ^ ^ ReKi RefLength - - - "Reference length for linear horizontal and vertical sheer" -
4141
typedef ^ ^ ReKi PropagationDir - - - "Direction of wind propagation" radians
4242
typedef ^ ^ logical UseInputFile - .true. - "Flag for toggling file based IO in wind type 2." -
43-
typedef ^ ^ FileInfoType PassedFileInfo - - - "Optional slot for wind type 2 data if file IO is not used." -
4443

4544
#----------------------------------------------------------------------------------------------------------------------------------
4645
typedef ^ Grid3D_InitInputType IntKi ScaleMethod - 0 - "Turbulence scaling method [0=none, 1=direct scaling, 2= calculate scaling factor based on a desired standard deviation]" -

modules/inflowwind/src/InflowWind_IO_Types.f90

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,6 @@ MODULE InflowWind_IO_Types
7070
REAL(ReKi) :: RefLength = 0.0_ReKi !< Reference length for linear horizontal and vertical sheer [-]
7171
REAL(ReKi) :: PropagationDir = 0.0_ReKi !< Direction of wind propagation [radians]
7272
LOGICAL :: UseInputFile = .true. !< Flag for toggling file based IO in wind type 2. [-]
73-
TYPE(FileInfoType) :: PassedFileInfo !< Optional slot for wind type 2 data if file IO is not used. [-]
7473
END TYPE Uniform_InitInputType
7574
! =======================
7675
! ========= Grid3D_InitInputType =======
@@ -281,8 +280,6 @@ subroutine InflowWind_IO_CopyUniform_InitInputType(SrcUniform_InitInputTypeData,
281280
integer(IntKi), intent(in ) :: CtrlCode
282281
integer(IntKi), intent( out) :: ErrStat
283282
character(*), intent( out) :: ErrMsg
284-
integer(IntKi) :: ErrStat2
285-
character(ErrMsgLen) :: ErrMsg2
286283
character(*), parameter :: RoutineName = 'InflowWind_IO_CopyUniform_InitInputType'
287284
ErrStat = ErrID_None
288285
ErrMsg = ''
@@ -291,22 +288,15 @@ subroutine InflowWind_IO_CopyUniform_InitInputType(SrcUniform_InitInputTypeData,
291288
DstUniform_InitInputTypeData%RefLength = SrcUniform_InitInputTypeData%RefLength
292289
DstUniform_InitInputTypeData%PropagationDir = SrcUniform_InitInputTypeData%PropagationDir
293290
DstUniform_InitInputTypeData%UseInputFile = SrcUniform_InitInputTypeData%UseInputFile
294-
call NWTC_Library_CopyFileInfoType(SrcUniform_InitInputTypeData%PassedFileInfo, DstUniform_InitInputTypeData%PassedFileInfo, CtrlCode, ErrStat2, ErrMsg2)
295-
call SetErrStat(ErrStat2, ErrMsg2, ErrStat, ErrMsg, RoutineName)
296-
if (ErrStat >= AbortErrLev) return
297291
end subroutine
298292

299293
subroutine InflowWind_IO_DestroyUniform_InitInputType(Uniform_InitInputTypeData, ErrStat, ErrMsg)
300294
type(Uniform_InitInputType), intent(inout) :: Uniform_InitInputTypeData
301295
integer(IntKi), intent( out) :: ErrStat
302296
character(*), intent( out) :: ErrMsg
303-
integer(IntKi) :: ErrStat2
304-
character(ErrMsgLen) :: ErrMsg2
305297
character(*), parameter :: RoutineName = 'InflowWind_IO_DestroyUniform_InitInputType'
306298
ErrStat = ErrID_None
307299
ErrMsg = ''
308-
call NWTC_Library_DestroyFileInfoType(Uniform_InitInputTypeData%PassedFileInfo, ErrStat2, ErrMsg2)
309-
call SetErrStat(ErrStat2, ErrMsg2, ErrStat, ErrMsg, RoutineName)
310300
end subroutine
311301

312302
subroutine InflowWind_IO_PackUniform_InitInputType(RF, Indata)
@@ -319,7 +309,6 @@ subroutine InflowWind_IO_PackUniform_InitInputType(RF, Indata)
319309
call RegPack(RF, InData%RefLength)
320310
call RegPack(RF, InData%PropagationDir)
321311
call RegPack(RF, InData%UseInputFile)
322-
call NWTC_Library_PackFileInfoType(RF, InData%PassedFileInfo)
323312
if (RegCheckErr(RF, RoutineName)) return
324313
end subroutine
325314

@@ -333,7 +322,6 @@ subroutine InflowWind_IO_UnPackUniform_InitInputType(RF, OutData)
333322
call RegUnpack(RF, OutData%RefLength); if (RegCheckErr(RF, RoutineName)) return
334323
call RegUnpack(RF, OutData%PropagationDir); if (RegCheckErr(RF, RoutineName)) return
335324
call RegUnpack(RF, OutData%UseInputFile); if (RegCheckErr(RF, RoutineName)) return
336-
call NWTC_Library_UnpackFileInfoType(RF, OutData%PassedFileInfo) ! PassedFileInfo
337325
end subroutine
338326

339327
subroutine InflowWind_IO_CopyGrid3D_InitInputType(SrcGrid3D_InitInputTypeData, DstGrid3D_InitInputTypeData, CtrlCode, ErrStat, ErrMsg)

modules/inflowwind/src/InflowWind_Subs.f90

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -699,7 +699,7 @@ SUBROUTINE InflowWind_ValidateInput( InitInp, InputFileData, ErrStat, ErrMsg )
699699
CALL Steady_ValidateInput()
700700

701701
CASE ( Uniform_WindNumber )
702-
IF ( InitInp%WindType2UseInputFile ) CALL Uniform_ValidateInput()
702+
CALL Uniform_ValidateInput()
703703

704704
CASE ( TSFF_WindNumber )
705705
CALL TSFF_ValidateInput()

modules/inflowwind/src/InflowWind_Types.f90

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,6 @@ MODULE InflowWind_Types
110110
INTEGER(IntKi) :: FilePassingMethod = 0 !< Method for file passing {0: None (read from file), 1: as FileInfoType to parse, 2: as InputFileType already parsed} [-]
111111
TYPE(FileInfoType) :: PassedFileInfo !< If we don't use the input file, pass everything through this [FilePassingMethod = 1] [-]
112112
TYPE(InflowWind_InputFile) :: PassedFileData !< If we don't use the input file, pass everything through this [FilePassingMethod = 2] [-]
113-
LOGICAL :: WindType2UseInputFile = .TRUE. !< Flag for toggling file based IO in wind type 2. [-]
114-
TYPE(FileInfoType) :: WindType2Info !< Optional slot for wind type 2 data if file IO is not used. [-]
115113
LOGICAL :: OutputAccel = .FALSE. !< Flag to output wind acceleration [-]
116114
TYPE(Lidar_InitInputType) :: lidar !< InitInput for lidar data [-]
117115
TYPE(Grid4D_InitInputType) :: FDext !< InitInput for 4D external wind data [-]
@@ -511,10 +509,6 @@ subroutine InflowWind_CopyInitInput(SrcInitInputData, DstInitInputData, CtrlCode
511509
call InflowWind_CopyInputFile(SrcInitInputData%PassedFileData, DstInitInputData%PassedFileData, CtrlCode, ErrStat2, ErrMsg2)
512510
call SetErrStat(ErrStat2, ErrMsg2, ErrStat, ErrMsg, RoutineName)
513511
if (ErrStat >= AbortErrLev) return
514-
DstInitInputData%WindType2UseInputFile = SrcInitInputData%WindType2UseInputFile
515-
call NWTC_Library_CopyFileInfoType(SrcInitInputData%WindType2Info, DstInitInputData%WindType2Info, CtrlCode, ErrStat2, ErrMsg2)
516-
call SetErrStat(ErrStat2, ErrMsg2, ErrStat, ErrMsg, RoutineName)
517-
if (ErrStat >= AbortErrLev) return
518512
DstInitInputData%OutputAccel = SrcInitInputData%OutputAccel
519513
call Lidar_CopyInitInput(SrcInitInputData%lidar, DstInitInputData%lidar, CtrlCode, ErrStat2, ErrMsg2)
520514
call SetErrStat(ErrStat2, ErrMsg2, ErrStat, ErrMsg, RoutineName)
@@ -542,8 +536,6 @@ subroutine InflowWind_DestroyInitInput(InitInputData, ErrStat, ErrMsg)
542536
call SetErrStat(ErrStat2, ErrMsg2, ErrStat, ErrMsg, RoutineName)
543537
call InflowWind_DestroyInputFile(InitInputData%PassedFileData, ErrStat2, ErrMsg2)
544538
call SetErrStat(ErrStat2, ErrMsg2, ErrStat, ErrMsg, RoutineName)
545-
call NWTC_Library_DestroyFileInfoType(InitInputData%WindType2Info, ErrStat2, ErrMsg2)
546-
call SetErrStat(ErrStat2, ErrMsg2, ErrStat, ErrMsg, RoutineName)
547539
call Lidar_DestroyInitInput(InitInputData%lidar, ErrStat2, ErrMsg2)
548540
call SetErrStat(ErrStat2, ErrMsg2, ErrStat, ErrMsg, RoutineName)
549541
call InflowWind_IO_DestroyGrid4D_InitInputType(InitInputData%FDext, ErrStat2, ErrMsg2)
@@ -565,8 +557,6 @@ subroutine InflowWind_PackInitInput(RF, Indata)
565557
call RegPack(RF, InData%FilePassingMethod)
566558
call NWTC_Library_PackFileInfoType(RF, InData%PassedFileInfo)
567559
call InflowWind_PackInputFile(RF, InData%PassedFileData)
568-
call RegPack(RF, InData%WindType2UseInputFile)
569-
call NWTC_Library_PackFileInfoType(RF, InData%WindType2Info)
570560
call RegPack(RF, InData%OutputAccel)
571561
call Lidar_PackInitInput(RF, InData%lidar)
572562
call InflowWind_IO_PackGrid4D_InitInputType(RF, InData%FDext)
@@ -593,8 +583,6 @@ subroutine InflowWind_UnPackInitInput(RF, OutData)
593583
call RegUnpack(RF, OutData%FilePassingMethod); if (RegCheckErr(RF, RoutineName)) return
594584
call NWTC_Library_UnpackFileInfoType(RF, OutData%PassedFileInfo) ! PassedFileInfo
595585
call InflowWind_UnpackInputFile(RF, OutData%PassedFileData) ! PassedFileData
596-
call RegUnpack(RF, OutData%WindType2UseInputFile); if (RegCheckErr(RF, RoutineName)) return
597-
call NWTC_Library_UnpackFileInfoType(RF, OutData%WindType2Info) ! WindType2Info
598586
call RegUnpack(RF, OutData%OutputAccel); if (RegCheckErr(RF, RoutineName)) return
599587
call Lidar_UnpackInitInput(RF, OutData%lidar) ! lidar
600588
call InflowWind_IO_UnpackGrid4D_InitInputType(RF, OutData%FDext) ! FDext

modules/inflowwind/tests/test_uniform_wind.F90

Lines changed: 1 addition & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@ module test_uniform_wind
1616
subroutine test_uniform_wind_suite(testsuite)
1717
type(unittest_type), allocatable, intent(out) :: testsuite(:)
1818
testsuite = [ &
19-
new_unittest("test_uniform_wind_input", test_uniform_wind_input), &
20-
new_unittest("test_uniform_wind_direct_data", test_uniform_wind_direct_data) &
19+
new_unittest("test_uniform_wind_input", test_uniform_wind_input) &
2120
]
2221
end subroutine
2322

@@ -44,70 +43,5 @@ subroutine test_uniform_wind_input(error)
4443

4544
end subroutine
4645

47-
subroutine test_uniform_wind_direct_data(error)
48-
type(error_type), allocatable, intent(out) :: error
49-
50-
! Types for setting up module
51-
type(InflowWind_InitInputType) :: InitInp !< Input data for initialization
52-
type(InflowWind_InputType) :: InputGuess !< An initial guess for the input; the input mesh must be defined
53-
type(InflowWind_ParameterType) :: p !< Parameters
54-
type(InflowWind_ContinuousStateType) :: ContStates !< Initial continuous states
55-
type(InflowWind_DiscreteStateType) :: DiscStates !< Initial discrete states
56-
type(InflowWind_ConstraintStateType) :: ConstrStateGuess !< Initial guess of the constraint states
57-
type(InflowWind_OtherStateType) :: OtherStates !< Initial other/optimization states
58-
type(InflowWind_OutputType) :: y !< Initial output (outputs are not calculated; only the output mesh is initialized)
59-
type(InflowWind_MiscVarType) :: m !< Misc variables for optimization (not copied in glue code)
60-
real(DbKi) :: TimeInterval !< Coupling time interval in seconds: InflowWind does not change this.
61-
type(InflowWind_InitOutputType) :: InitOutData
62-
63-
! Variables for testing
64-
integer :: ErrStat
65-
character(ErrMsgLen) :: ErrMsg
66-
type(FileInfoType) :: InFileInfo
67-
type(FileInfoType) :: WindType2Info
68-
character(1024), dimension(6) :: data = [ &
69-
'! Wind file for sheared 18 m/s wind with 30 degree direction. ', &
70-
'! Time Wind Wind Vert. Horiz. Vert. LinV Gust ', &
71-
'! Speed Dir Speed Shear Shear Shear Speed ', &
72-
' 0.0 12.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 ', &
73-
' 0.1 12.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 ', &
74-
' 999.9 12.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 ' &
75-
]
76-
77-
! Error handling
78-
integer(IntKi) :: TmpErrStat
79-
character(ErrMsgLen) :: TmpErrMsg !< temporary error message
80-
81-
InFileInfo = getInputFileDataWindType2()
82-
call InitFileInfo(data, WindType2Info, ErrStat, ErrMsg)
83-
84-
! For diagnostic purposes, the following can be used to display the contents
85-
! of the InFileInfo data structure.
86-
! call Print_FileInfo_Struct( CU, InFileInfo ) ! CU is the screen -- different number on different systems.
87-
88-
! Variable definitions
89-
InitInp%InputFileName = ""
90-
InitInp%NumWindPoints = 5
91-
InitInp%FilePassingMethod = 1_IntKi
92-
InitInp%RootName = ""
93-
InitInp%PassedFileInfo = InFileInfo
94-
InitInp%WindType2UseInputFile = .false.
95-
InitInp%WindType2Info = WindType2Info
96-
97-
call InflowWind_Init(InitInp, InputGuess, p, ContStates, DiscStates, &
98-
ConstrStateGuess, OtherStates, y, m, TimeInterval, &
99-
InitOutData, TmpErrStat, TmpErrMsg)
100-
101-
! Results
102-
call check(error, TmpErrStat, ErrID_None, message='Error message: '//trim(TmpErrMsg)//NewLine//'ErrStat: '); if (allocated(error)) return
103-
call check(error, p%FlowField%Uniform%Time(1), 0.0_ReKi); if (allocated(error)) return
104-
call check(error, p%FlowField%Uniform%Time(2), 0.1_ReKi); if (allocated(error)) return
105-
call check(error, p%FlowField%Uniform%Time(3), 999.9_ReKi); if (allocated(error)) return
106-
107-
call check(error, p%FlowField%Uniform%VelH(1), 12.0_ReKi); if (allocated(error)) return
108-
call check(error, p%FlowField%Uniform%VelH(2), 12.0_ReKi); if (allocated(error)) return
109-
call check(error, p%FlowField%Uniform%VelH(3), 12.0_ReKi); if (allocated(error)) return
110-
111-
end subroutine
11246

11347
end module

0 commit comments

Comments
 (0)