Skip to content
Merged
Changes from all commits
Commits
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
17 changes: 8 additions & 9 deletions modules/seastate/src/SeaState_Output.f90
Original file line number Diff line number Diff line change
Expand Up @@ -428,9 +428,9 @@ subroutine SeaStOut_WriteWaveElev0( Rootname, NStepWave, NGrid, WaveElev1, WaveE
CHARACTER(*), INTENT( IN ) :: Rootname ! filename including full path, minus any file extension.
INTEGER, INTENT( IN ) :: NStepWave ! Number of time steps for the wave kinematics arrays
INTEGER, INTENT( IN ) :: NGrid(3) ! Number of grid points for the wave kinematics arrays
REAL(SiKi), pointer, INTENT( IN ) :: WaveElev1 (:,:,: ) ! Instantaneous wave elevations at requested locations - 1st order
REAL(SiKi), pointer, INTENT( IN ) :: WaveElev2 (:,:,: ) ! Instantaneous wave elevations at requested locations - 2nd order
REAL(SiKi), pointer, INTENT( IN ) :: WaveTime (: ) ! The time values for the wave kinematics (time)
REAL(SiKi), allocatable, INTENT( IN ) :: WaveElev1 (:,:,: ) ! Instantaneous wave elevations at requested locations - 1st order
REAL(SiKi), allocatable, INTENT( IN ) :: WaveElev2 (:,:,: ) ! Instantaneous wave elevations at requested locations - 2nd order
REAL(SiKi), allocatable, INTENT( IN ) :: WaveTime (: ) ! The time values for the wave kinematics (time)
INTEGER, INTENT( OUT ) :: ErrStat ! returns a non-zero value when an error occurs
CHARACTER(*), INTENT( OUT ) :: ErrMsg ! Error message if ErrStat /= ErrID_None

Expand Down Expand Up @@ -459,12 +459,11 @@ subroutine SeaStOut_WriteWaveElev0( Rootname, NStepWave, NGrid, WaveElev1, WaveE
! Write the increments from [0, NStepWave] even though for OpenFAST data, NStepWave = 0, but for arbitrary user data this may not be true.
! As a result for WaveMod=5,6 we shouldn't assume periodic waves over the period WaveTMax
DO m= 0,NStepWave

if ( associated(WaveElev2) ) then
WRITE(UnWv,Frmt) WaveTime(m), WaveElev1(m,i,j) + WaveElev2(m,i,j)
else
WRITE(UnWv,Frmt) WaveTime(m), WaveElev1(m,i,j)
end if
if ( allocated(WaveElev2) ) then
WRITE(UnWv,Frmt) WaveTime(m), WaveElev1(m,i,j) + WaveElev2(m,i,j)
else
WRITE(UnWv,Frmt) WaveTime(m), WaveElev1(m,i,j)
end if
END DO

CLOSE( UnWv, IOSTAT=ErrStat )
Expand Down