From 7bbdaca7f452b23a52c3a609b03e82204653dc5e Mon Sep 17 00:00:00 2001 From: Mickael Accensi <49198861+mickaelaccensi@users.noreply.github.com> Date: Fri, 22 Sep 2023 20:28:10 +0200 Subject: [PATCH] correct calendar for track netcdf output (#1079) --- model/src/ww3_trnc.F90 | 42 +++++++++++++-------- regtests/ww3_tp2.2/input/track_i.ww3 | 10 ++--- regtests/ww3_tp2.2/input/ww3_multi.inp | 14 +++---- regtests/ww3_tp2.2/input/ww3_multi.nml | 11 +++--- regtests/ww3_tp2.2/input/ww3_ounf.inp | 2 +- regtests/ww3_tp2.2/input/ww3_ounf.nml | 2 +- regtests/ww3_tp2.2/input/ww3_ounp.inp | 2 +- regtests/ww3_tp2.2/input/ww3_ounp.nml | 2 +- regtests/ww3_tp2.2/input/ww3_outf.inp | 2 +- regtests/ww3_tp2.2/input/ww3_outp_spec.inp | 2 +- regtests/ww3_tp2.2/input/ww3_outp_tab51.inp | 2 +- regtests/ww3_tp2.2/input/ww3_outp_tab52.inp | 2 +- regtests/ww3_tp2.2/input/ww3_outp_tab53.inp | 2 +- regtests/ww3_tp2.2/input/ww3_shel.inp | 24 ++++++------ regtests/ww3_tp2.2/input/ww3_shel.nml | 16 ++++---- regtests/ww3_tp2.2/input/ww3_trnc.inp | 2 +- regtests/ww3_tp2.2/input/ww3_trnc.nml | 2 +- 17 files changed, 76 insertions(+), 63 deletions(-) diff --git a/model/src/ww3_trnc.F90 b/model/src/ww3_trnc.F90 index b26d0d642..c2049751c 100644 --- a/model/src/ww3_trnc.F90 +++ b/model/src/ww3_trnc.F90 @@ -47,6 +47,7 @@ PROGRAM W3TRNC ! ---------------------------------------------------------------- ! W3NMOD Subr. W3GDATMD Set number of model. ! W3NOUT Subr. W3ODATMD Set number of model for output. + ! W3IOGR Subr. W3IOGRMD Reading/writing model definition file. ! ---------------------------------------------------------------- ! ! 5. Called by : @@ -70,13 +71,14 @@ PROGRAM W3TRNC !/ ------------------------------------------------------------------- / USE CONSTANTS - USE W3GDATMD, ONLY : W3NMOD, W3SETG, FLAGLL, XFR + USE W3GDATMD, ONLY : W3NMOD, W3SETG, FLAGLL, XFR, GNAME USE W3ODATMD, ONLY : W3NOUT, W3SETO, FNMPRE USE W3SERVMD, ONLY : ITRACE, NEXTLN, EXTCDE #ifdef W3_S USE W3SERVMD, ONLY : STRACE #endif USE W3TIMEMD + USE W3IOGRMD, ONLY: W3IOGR ! USE W3ODATMD, ONLY: NDSO, NDSE ! @@ -91,7 +93,7 @@ PROGRAM W3TRNC TYPE(NML_TRACK_T) :: NML_TRACK TYPE(NML_FILE_T) :: NML_FILE ! - INTEGER :: NDSI, NDSINP, & + INTEGER :: NDSI, NDSINP, NDSM, & NDSOUT, NDSTRC, NTRACE, & NSPEC, IERR, MK, MTH, IT, & ILOC, ISPEC, S3, IOUT, & @@ -135,6 +137,7 @@ PROGRAM W3TRNC ! 1. IO set-up. ! NDSI = 10 + NDSM = 20 NDSINP = 11 NDSOUT = 51 ! @@ -148,11 +151,16 @@ PROGRAM W3TRNC ! WRITE (NDSO,900) ! + !--- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + ! 2. Read model definition file. + ! + CALL W3IOGR ( 'READ', NDSM ) + WRITE (NDSO,920) GNAME ! !--- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ! 2. Read requests from input file. + ! 3. Read requests from input file. ! ! @@ -163,13 +171,13 @@ PROGRAM W3TRNC ! Read namelist CALL W3NMLTRNC (NDSI, TRIM(FNMPRE)//'ww3_trnc.nml', NML_TRACK, NML_FILE, IERR) - ! 2.1 Time setup IDTIME, DTREQ, NOUT + ! 3.1 Time setup IDTIME, DTREQ, NOUT READ(NML_TRACK%TIMESTRIDE, *) DTREQ READ(NML_TRACK%TIMECOUNT, *) NOUT READ(NML_TRACK%TIMESTART, *) TOUT(1), TOUT(2) - ! 2.2 Output type + ! 3.2 Output type NCTYPE = NML_FILE%NETCDF FILEPREFIX = NML_FILE%PREFIX S3 = NML_TRACK%TIMESPLIT @@ -189,12 +197,12 @@ PROGRAM W3TRNC WRITE (NDSO,901) COMSTR - ! 2.1 Time setup IDTIME, DTREQ, NOUT + ! 3.1 Time setup IDTIME, DTREQ, NOUT CALL NEXTLN ( COMSTR , NDSI , NDSE ) READ (NDSI,*,END=806,ERR=807) TOUT, DTREQ, NOUT - ! 2.2 Output type + ! 3.2 Output type CALL NEXTLN ( COMSTR , NDSI , NDSE ) READ (NDSI,*,END=806,ERR=807) NCTYPE CALL NEXTLN ( COMSTR , NDSI , NDSE ) @@ -208,7 +216,7 @@ PROGRAM W3TRNC - ! 2.1 Time setup IDTIME, DTREQ, NOUT + ! 3.3 Time setup IDTIME, DTREQ, NOUT DTREQ = MAX ( 0. , DTREQ ) IF ( DTREQ.EQ.0. ) NOUT = 1 NOUT = MAX ( 1 , NOUT ) @@ -227,7 +235,7 @@ PROGRAM W3TRNC WRITE (NDSO,941) IDTIME, NOUT - ! 2.2 Output type + ! 3.4 Output type IF ( NCTYPE.LT.3 .OR. NCTYPE.GT.4 ) THEN WRITE (NDSE,1010) NCTYPE CALL EXTCDE ( 1 ) @@ -239,7 +247,7 @@ PROGRAM W3TRNC ! !--- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ! 3. Check consistency with input file and track_o.ww3 + ! 4. Check consistency with input file and track_o.ww3 ! OPEN (NDSINP,FILE=TRIM(FNMPRE)//'track_o.ww3',form='UNFORMATTED', convert=file_endian, & STATUS='OLD',ERR=800,IOSTAT=IERR) @@ -262,7 +270,7 @@ PROGRAM W3TRNC ! !--- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ! 4. Time management. + ! 5. Time management. ! IOUT = 0 NCID = 0 @@ -271,7 +279,7 @@ PROGRAM W3TRNC BACKSPACE (NDSINP) - ! 4.1 Loops on track_o.ww3 to read the time and data + ! 5.1 Loops on track_o.ww3 to read the time and data DO DTEST = DSEC21 ( TIME , TOUT ) @@ -310,17 +318,17 @@ PROGRAM W3TRNC END IF - ! 4.1.1 Increments the global time counter IOUT + ! 5.1.1 Increments the global time counter IOUT IOUT = IOUT + 1 CALL STME21 ( TOUT , IDTIME ) WRITE (NDSO,971) IDTIME - ! 4.1.2 Processes the variable value for the time step IOUT + ! 5.1.2 Processes the variable value for the time step IOUT CALL W3EXNC ( FILEPREFIX, NCTYPE, NCID, S3, STRSTOPDATE, MK, MTH ) - ! 4.1.3 Defines the stop date + ! 5.1.3 Defines the stop date CALL T2D(TOUT,STOPDATE,IERR) WRITE(STRSTOPDATE,'(I4.4,A,4(I2.2,A),I2.2)') STOPDATE(1),'-',STOPDATE(2), & '-',STOPDATE(3),' ',STOPDATE(5),':',STOPDATE(6),':',STOPDATE(7) @@ -331,7 +339,7 @@ PROGRAM W3TRNC 444 CONTINUE - ! 4.2 Closes the netCDF file + ! 5.2 Closes the netCDF file IF (NCID.NE.0) THEN IRET = NF90_REDEF(NCID) CALL CHECK_ERR(IRET) @@ -383,6 +391,8 @@ PROGRAM W3TRNC 902 FORMAT ( ' Spectral grid size : ',I3,' by ',I3// & ' Opening file : '/ & ' -----------------------------------------------') +920 FORMAT ( ' Grid name : ',A/) + ! 940 FORMAT (/' Output time data : '/ & ' --------------------------------------------------'/ & ' First time : ',A) diff --git a/regtests/ww3_tp2.2/input/track_i.ww3 b/regtests/ww3_tp2.2/input/track_i.ww3 index ae2154a44..e4e7fbf61 100644 --- a/regtests/ww3_tp2.2/input/track_i.ww3 +++ b/regtests/ww3_tp2.2/input/track_i.ww3 @@ -1,6 +1,6 @@ WAVEWATCH III TRACK LOCATIONS DATA -19680606 000000 0 0 S1A -19680606 040000 1 0 S1B -19680606 060000 1 0 S1C -19680606 080000 2 0 S1D -19680606 120000 0.5 0 S1E +20220606 000000 0 0 S1A +20220606 040000 1 0 S1B +20220606 060000 1 0 S1C +20220606 080000 2 0 S1D +20220606 120000 0.5 0 S1E diff --git a/regtests/ww3_tp2.2/input/ww3_multi.inp b/regtests/ww3_tp2.2/input/ww3_multi.inp index 4d5d699e6..62f187b20 100644 --- a/regtests/ww3_tp2.2/input/ww3_multi.inp +++ b/regtests/ww3_tp2.2/input/ww3_multi.inp @@ -4,25 +4,25 @@ $ ------------------------------ $ 'ww3' 'no' 'no' 'no' 'no' 'no' 'no' 'no' 'no' 'no' 1 1 0.00 1.00 F $ - 19680606 000000 19680618 000000 + 20220606 000000 20220618 000000 $ T T $ - 19680606 000000 86400 19680618 000000 + 20220606 000000 86400 20220618 000000 $ N HS T0M1 DIR SPR $ - 19680606 000000 21600 19680618 000000 + 20220606 000000 21600 20220618 000000 0.0 0.0 'LEFT' 90.0 0.0 'CENTER' 180.0 0.0 'RIGHT' 0.0 0.0 'STOPSTRING' - 19680606 000000 3600 19680618 000000 + 20220606 000000 3600 20220618 000000 T - 19680612 000000 0 19680612 000000 - 19680606 000000 3600 19680618 000000 - 19680612 000000 0 19680612 000000 + 20220612 000000 0 20220612 000000 + 20220606 000000 3600 20220618 000000 + 20220612 000000 0 20220612 000000 $ 'the_end' 0 $ diff --git a/regtests/ww3_tp2.2/input/ww3_multi.nml b/regtests/ww3_tp2.2/input/ww3_multi.nml index 95c0f379c..6736ed229 100644 --- a/regtests/ww3_tp2.2/input/ww3_multi.nml +++ b/regtests/ww3_tp2.2/input/ww3_multi.nml @@ -9,7 +9,8 @@ &DOMAIN_NML DOMAIN%FLGHG1 = T DOMAIN%FLGHG2 = T - DOMAIN%STOP = '19680618 000000' + DOMAIN%START = '20220606 000000' + DOMAIN%STOP = '20220618 000000' / ! -------------------------------------------------------------------- ! @@ -37,10 +38,10 @@ ! Define output dates via OUTPUT_DATE_NML namelist ! -------------------------------------------------------------------- ! &OUTPUT_DATE_NML - ALLDATE%FIELD = '19680606 000000' '86400' '19680618 000000' - ALLDATE%POINT = '19680606 000000' '21600' '19680618 000000' - ALLDATE%TRACK = '19680606 000000' '3600' '19680618 000000' - ALLDATE%BOUNDARY = '19680606 000000' '3600' '19680618 000000' + ALLDATE%FIELD = '20220606 000000' '86400' '20220618 000000' + ALLDATE%POINT = '20220606 000000' '21600' '20220618 000000' + ALLDATE%TRACK = '20220606 000000' '3600' '20220618 000000' + ALLDATE%BOUNDARY = '20220606 000000' '3600' '20220618 000000' / ! -------------------------------------------------------------------- ! diff --git a/regtests/ww3_tp2.2/input/ww3_ounf.inp b/regtests/ww3_tp2.2/input/ww3_ounf.inp index 1d901574c..120b78d3d 100644 --- a/regtests/ww3_tp2.2/input/ww3_ounf.inp +++ b/regtests/ww3_tp2.2/input/ww3_ounf.inp @@ -4,7 +4,7 @@ $--------------------------------------------------------------------- $ $ First output time (yyyymmdd hhmmss), increment of output (s), $ and number of output times. $ - 19680606 000000 10800. 100 + 20220606 000000 10800. 100 $ $ Fields requested --------------------------------------------------- $ $ diff --git a/regtests/ww3_tp2.2/input/ww3_ounf.nml b/regtests/ww3_tp2.2/input/ww3_ounf.nml index 44db63521..07dcdd2c2 100644 --- a/regtests/ww3_tp2.2/input/ww3_ounf.nml +++ b/regtests/ww3_tp2.2/input/ww3_ounf.nml @@ -6,7 +6,7 @@ ! Define the output fields to postprocess via FIELD_NML namelist ! -------------------------------------------------------------------- ! &FIELD_NML - FIELD%TIMESTART = '19680606 000000' + FIELD%TIMESTART = '20220606 000000' FIELD%TIMESTRIDE = '10800.' FIELD%TIMECOUNT = '100' FIELD%LIST = 'HS T01 DIR SPR' diff --git a/regtests/ww3_tp2.2/input/ww3_ounp.inp b/regtests/ww3_tp2.2/input/ww3_ounp.inp index 4816a3a7e..2c6a2f8d2 100644 --- a/regtests/ww3_tp2.2/input/ww3_ounp.inp +++ b/regtests/ww3_tp2.2/input/ww3_ounp.inp @@ -4,7 +4,7 @@ $--------------------------------------------------------------------- $ $ First output time (yyyymmdd hhmmss), increment of output (s), $ and number of output times. $ - 19680606 000000 21600. 1000 + 20220606 000000 21600. 1000 $ $ Points requested --------------------------------------------------- $ $ diff --git a/regtests/ww3_tp2.2/input/ww3_ounp.nml b/regtests/ww3_tp2.2/input/ww3_ounp.nml index 29fa1897d..e97fc6b22 100644 --- a/regtests/ww3_tp2.2/input/ww3_ounp.nml +++ b/regtests/ww3_tp2.2/input/ww3_ounp.nml @@ -6,7 +6,7 @@ ! Define the output fields to postprocess via POINT_NML namelist ! -------------------------------------------------------------------- ! &POINT_NML - POINT%TIMESTART = '19680606 000000' + POINT%TIMESTART = '20220606 000000' POINT%TIMESTRIDE = '21600.' POINT%TIMECOUNT = '1000' POINT%LIST = '1 2 3' diff --git a/regtests/ww3_tp2.2/input/ww3_outf.inp b/regtests/ww3_tp2.2/input/ww3_outf.inp index 4b062a870..d49b283c9 100644 --- a/regtests/ww3_tp2.2/input/ww3_outf.inp +++ b/regtests/ww3_tp2.2/input/ww3_outf.inp @@ -1,6 +1,6 @@ $ WAVEWATCH III Grid output post-processing $ ----------------------------------------- - 19680612 000000 518400. 2 + 20220612 000000 518400. 2 $ N HS T01 DIR SPR diff --git a/regtests/ww3_tp2.2/input/ww3_outp_spec.inp b/regtests/ww3_tp2.2/input/ww3_outp_spec.inp index d4c452b1f..cb7c2ba52 100644 --- a/regtests/ww3_tp2.2/input/ww3_outp_spec.inp +++ b/regtests/ww3_tp2.2/input/ww3_outp_spec.inp @@ -1,6 +1,6 @@ $ WAVEWATCH III Point output post-processing $ ------------------------------------------ - 19680606 000000 43200. 25 + 20220606 000000 43200. 25 $ 1 2 diff --git a/regtests/ww3_tp2.2/input/ww3_outp_tab51.inp b/regtests/ww3_tp2.2/input/ww3_outp_tab51.inp index d40f4a55d..9e4c288b6 100644 --- a/regtests/ww3_tp2.2/input/ww3_outp_tab51.inp +++ b/regtests/ww3_tp2.2/input/ww3_outp_tab51.inp @@ -1,6 +1,6 @@ $ WAVEWATCH III Point output post-processing $ ------------------------------------------ - 19680606 000000 43200. 25 + 20220606 000000 43200. 25 $ 1 -1 diff --git a/regtests/ww3_tp2.2/input/ww3_outp_tab52.inp b/regtests/ww3_tp2.2/input/ww3_outp_tab52.inp index 06431db5d..3ded7db46 100644 --- a/regtests/ww3_tp2.2/input/ww3_outp_tab52.inp +++ b/regtests/ww3_tp2.2/input/ww3_outp_tab52.inp @@ -1,6 +1,6 @@ $ WAVEWATCH III Point output post-processing $ ------------------------------------------ - 19680606 000000 43200. 25 + 20220606 000000 43200. 25 $ 2 -1 diff --git a/regtests/ww3_tp2.2/input/ww3_outp_tab53.inp b/regtests/ww3_tp2.2/input/ww3_outp_tab53.inp index 209a605b0..0e57f1322 100644 --- a/regtests/ww3_tp2.2/input/ww3_outp_tab53.inp +++ b/regtests/ww3_tp2.2/input/ww3_outp_tab53.inp @@ -1,6 +1,6 @@ $ WAVEWATCH III Point output post-processing $ ------------------------------------------ - 19680606 000000 43200. 25 + 20220606 000000 43200. 25 $ 3 -1 diff --git a/regtests/ww3_tp2.2/input/ww3_shel.inp b/regtests/ww3_tp2.2/input/ww3_shel.inp index aba7af3e4..37d914fad 100644 --- a/regtests/ww3_tp2.2/input/ww3_shel.inp +++ b/regtests/ww3_tp2.2/input/ww3_shel.inp @@ -10,31 +10,31 @@ $ ------------------------------ F F $ - 19680606 000000 - 19680606 120000 + 20220606 000000 + 20220606 120000 $ 1 $ - 19680606 000000 10800 19680608 000000 + 20220606 000000 10800 20220608 000000 $ N HS EF T01 DIR SPR $ - 19680606 000000 21600 19680608 000000 + 20220606 000000 21600 20220608 000000 0.0 0.0 'LEFT' 90.0 0.0 'CENTER' 180.0 0.0 'RIGHT' 0.0 0.0 'STOPSTRING' - 19680606 000000 14400 19680608 000000 + 20220606 000000 14400 20220608 000000 T - 19680606 000000 0 19680608 000000 - 19680606 000000 0 19680608 000000 - 19680606 000000 0 19680608 000000 + 20220606 000000 0 20220608 000000 + 20220606 000000 0 20220608 000000 + 20220606 000000 0 20220608 000000 $ - 'CUR' 19680606 030000 2.0 45. - 'WND' 19680606 000000 20.0 180. 2. - 'WND' 19680606 040000 15.0 130. 1. - 'WND' 19680606 080000 25.0 90. 3. + 'CUR' 20220606 030000 2.0 45. + 'WND' 20220606 000000 20.0 180. 2. + 'WND' 20220606 040000 15.0 130. 1. + 'WND' 20220606 080000 25.0 90. 3. 'STP' $ $ -------------------------------------------------------------------- $ diff --git a/regtests/ww3_tp2.2/input/ww3_shel.nml b/regtests/ww3_tp2.2/input/ww3_shel.nml index 578f05f93..32205bc57 100644 --- a/regtests/ww3_tp2.2/input/ww3_shel.nml +++ b/regtests/ww3_tp2.2/input/ww3_shel.nml @@ -7,7 +7,8 @@ ! Define top-level model parameters via DOMAIN_NML namelist ! -------------------------------------------------------------------- ! &DOMAIN_NML - DOMAIN%STOP = '19680606 120000' + DOMAIN%START = '20220606 000000' + DOMAIN%STOP = '20220606 120000' / ! -------------------------------------------------------------------- ! @@ -30,9 +31,9 @@ ! Define output dates via OUTPUT_DATE_NML namelist ! -------------------------------------------------------------------- ! &OUTPUT_DATE_NML - DATE%FIELD = '19680606 000000' '10800' '19680608 000000' - DATE%POINT = '19680606 000000' '21600' '19680608 000000' - DATE%TRACK = '19680606 000000' '14400' '19680608 000000' + DATE%FIELD = '20220606 000000' '10800' '20220608 000000' + DATE%POINT = '20220606 000000' '21600' '20220608 000000' + DATE%TRACK = '20220606 000000' '14400' '20220608 000000' / ! -------------------------------------------------------------------- ! @@ -45,23 +46,24 @@ &HOMOG_INPUT_NML HOMOG_INPUT(1)%NAME = 'CUR' - HOMOG_INPUT(1)%DATE = '19680606 030000' + HOMOG_INPUT(1)%DATE = '20220606 030000' HOMOG_INPUT(1)%VALUE1 = 2.0 HOMOG_INPUT(1)%VALUE2 = 45. HOMOG_INPUT(2)%NAME = 'WND' + HOMOG_INPUT(2)%DATE = '20220606 000000' HOMOG_INPUT(2)%VALUE1 = 20.0 HOMOG_INPUT(2)%VALUE2 = 180. HOMOG_INPUT(2)%VALUE3 = 2. HOMOG_INPUT(3)%NAME = 'WND' - HOMOG_INPUT(3)%DATE = '19680606 040000' + HOMOG_INPUT(3)%DATE = '20220606 040000' HOMOG_INPUT(3)%VALUE1 = 15.0 HOMOG_INPUT(3)%VALUE2 = 130. HOMOG_INPUT(3)%VALUE3 = 1. HOMOG_INPUT(4)%NAME = 'WND' - HOMOG_INPUT(4)%DATE = '19680606 080000' + HOMOG_INPUT(4)%DATE = '20220606 080000' HOMOG_INPUT(4)%VALUE1 = 25.0 HOMOG_INPUT(4)%VALUE2 = 90. HOMOG_INPUT(4)%VALUE3 = 3. diff --git a/regtests/ww3_tp2.2/input/ww3_trnc.inp b/regtests/ww3_tp2.2/input/ww3_trnc.inp index df60800b8..ddfd4f403 100755 --- a/regtests/ww3_tp2.2/input/ww3_trnc.inp +++ b/regtests/ww3_tp2.2/input/ww3_trnc.inp @@ -4,7 +4,7 @@ $--------------------------------------------------------------------- $ $ First output time (yyyymmdd hhmmss), increment of output (s), $ and number of output times. $ - 19680606 000000 3600. 100000 + 20220606 000000 3600. 100000 $ $ Output type -------------------------------------------------------- $ $ netCDF version [3,4] diff --git a/regtests/ww3_tp2.2/input/ww3_trnc.nml b/regtests/ww3_tp2.2/input/ww3_trnc.nml index e4ae8ceab..e6847f529 100644 --- a/regtests/ww3_tp2.2/input/ww3_trnc.nml +++ b/regtests/ww3_tp2.2/input/ww3_trnc.nml @@ -6,7 +6,7 @@ ! Define the output fields to postprocess via TRACK_NML namelist ! -------------------------------------------------------------------- ! &TRACK_NML - TRACK%TIMESTART = '19680606 000000' + TRACK%TIMESTART = '20220606 000000' TRACK%TIMESTRIDE = '3600.' /