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

[ww3_ounp] TIMESPLIT=0 support #569

Merged
merged 4 commits into from
Jan 11, 2022
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion model/inp/ww3_ounp.inp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ $ mandatory end of list
$
$--------------------------------------------------------------------- $
$ file prefix
$ number of characters in date [4(yearly),6(monthly),8(daily),10(hourly)]
$ number of characters in date [0(nodate),4(yearly),6(monthly),8(daily),10(hourly)]
$ netCDF version [3,4]
$ points in same file [T] or not [F]
$ and max number of points to be processed in one pass
Expand Down
2 changes: 1 addition & 1 deletion model/nml/ww3_ounp.nml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
! POINT%TIMESTART = '19000101 000000' ! Stop date for the output field
! POINT%TIMESTRIDE = '0' ! Time stride for the output field
! POINT%TIMECOUNT = '1000000000' ! Number of time steps
! POINT%TIMESPLIT = 6 ! [4(yearly),6(monthly),8(daily),10(hourly)]
! POINT%TIMESPLIT = 6 ! [0(nodate),4(yearly),6(monthly),8(daily),10(hourly)]
! POINT%LIST = 'all' ! List of points index ['all'|'1 2 3']
! POINT%SAMEFILE = T ! All the points in the same file
! POINT%BUFFER = 150 ! Number of points to process per pass
Expand Down
30 changes: 19 additions & 11 deletions model/src/ww3_ounp.F90
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ PROGRAM W3OUNP
!/ 18-Jun-2020 : Support for 360-day calendar. ( version 7.08 )
!/ 19-Jul-2021 : Momentum and air density support ( version 7.14 )
!/ 06-Sep-2021 : scale factor on spectra output ( version 7.12 )
!/ 05-Jan-2022 : Added TIMESPLIT=0 (nodate) support ( version 7.14 )
!/
!/ Copyright 2009 National Weather Service (NWS),
!/ National Oceanic and Atmospheric Administration. All rights
Expand Down Expand Up @@ -249,6 +250,7 @@ PROGRAM W3OUNP
CHARACTER(LEN=8) :: EXT
CHARACTER(LEN=128) :: NCNAME
CHARACTER(LEN=25) :: IDSRCE(7)
CHARACTER :: SEP
!
CHARACTER(LEN=100),ALLOCATABLE :: POINTLIST(:)
CHARACTER(LEN=128),ALLOCATABLE :: NCFILE(:)
Expand Down Expand Up @@ -600,16 +602,18 @@ PROGRAM W3OUNP
! 4.3 Output type
!
! S3 defines the number of characters in the date for the filename
! S3=4-> YYYY, S3=6 -> YYYYMM, S3=10 -> YYYYMMDDHH
! S3=0 -> empty, S3=4 -> YYYY, S3=6 -> YYYYMM, S3=10 -> YYYYMMDDHH
!
! Setups min and max date format
IF (S3.LT.4) S3=4
IF (S3.GT.0 .AND. S3.LT.4) S3=4
IF (S3.GT.10) S3=10
!
! Defines the format of FILETIME as ISO8601 convention
S5=S3-8
! if S3=>YYYYMMDDHH then filetime='YYYYMMDDTHHMMSSZ'
IF (S3.EQ.10) THEN
IF (S3.EQ.0) THEN
FILETIME = ''
ELSE IF (S3.EQ.10) THEN
WRITE(FORMAT1,'(A,I1,A,I1,A)') '(I8.8,A1,I',S5,'.',S5,',A1)'
WRITE (FILETIME,FORMAT1) TIME(1), 'T', &
FLOOR(REAL(TIME(2))/NINT(10.**(6-S5))), 'Z'
Expand Down Expand Up @@ -661,14 +665,16 @@ PROGRAM W3OUNP


! 5.2 Creates filename listing
SEP = '_'
IF(S3 .EQ. 0) SEP = '' ! No "_" separator if no datetime string.
WRITE(EXT,'(A)') ''
IF ((ITYPE .EQ. 1) .AND. (OTYPE.EQ.2)) WRITE(EXT,'(A)') '_tab.nc'
IF ((ITYPE .EQ. 1) .AND. (OTYPE.EQ.3)) WRITE(EXT,'(A)') '_spec.nc'
IF ((ITYPE .EQ. 1) .AND. (OTYPE.EQ.4)) WRITE(EXT,'(A)') '_tab.nc'
IF (ITYPE .EQ. 2) WRITE(EXT,'(A)') '_tab.nc'
IF ((ITYPE .EQ. 3) .AND. (OTYPE.EQ.2)) WRITE(EXT,'(A)') '_tab.nc'
IF ((ITYPE .EQ. 3) .AND. (OTYPE.EQ.3)) WRITE(EXT,'(A)') '_tab.nc'
IF ((ITYPE .EQ. 3) .AND. (OTYPE.EQ.4)) WRITE(EXT,'(A)') '_src.nc'
IF ((ITYPE .EQ. 1) .AND. (OTYPE.EQ.2)) WRITE(EXT,'(A,A)') TRIM(SEP), 'tab.nc'
IF ((ITYPE .EQ. 1) .AND. (OTYPE.EQ.3)) WRITE(EXT,'(A,A)') TRIM(SEP), 'spec.nc'
IF ((ITYPE .EQ. 1) .AND. (OTYPE.EQ.4)) WRITE(EXT,'(A,A)') TRIM(SEP), 'tab.nc'
IF (ITYPE .EQ. 2) WRITE(EXT,'(A,A)') TRIM(SEP), 'tab.nc'
IF ((ITYPE .EQ. 3) .AND. (OTYPE.EQ.2)) WRITE(EXT,'(A,A)') TRIM(SEP), 'tab.nc'
IF ((ITYPE .EQ. 3) .AND. (OTYPE.EQ.3)) WRITE(EXT,'(A,A)') TRIM(SEP), 'tab.nc'
IF ((ITYPE .EQ. 3) .AND. (OTYPE.EQ.4)) WRITE(EXT,'(A,A)') TRIM(SEP), 'src.nc'
! checks if extension exists
IF (LEN_TRIM(EXT).EQ.0) THEN
WRITE (NDSE,1006)
Expand Down Expand Up @@ -720,7 +726,9 @@ PROGRAM W3OUNP

! 5.6.1 Redefines the filetime when it's a new date defined by the date division S3
! if S3=>YYYYMMDDHH then filetime='YYYYMMDDTHHMMSSZ'
IF (S3.EQ.10) THEN
IF (S3.EQ.0) THEN
FILETIME = ''
ELSE IF (S3.EQ.10) THEN
WRITE(FORMAT1,'(A,I1,A,I1,A)') '(I8.8,A1,I',S5,'.',S5,',A1)'
WRITE (FILETIME,FORMAT1) TIME(1), 'T', &
NINT(REAL(TIME(2))/NINT(10.**(6-S5))), 'Z'
Expand Down