Skip to content

Commit

Permalink
UKMO staging [develop] NOAA-EMC#237 (NOAA-EMC#241)
Browse files Browse the repository at this point in the history
* Added boundary checks to the SMC grid input files for ww3_grid,
to ensure they comply with the limits of the nameslist.

* Fb 360 calendar (#8)

Changes to add support to 360-day and 365-day (no leap year) calendar - see ticket NOAA-EMC#209
  * Additional CALTYPE namelist parameter in MISC section
  * New ww3_tc1 regtest.

* RTD support for ww3_boun[dc] (#10)

* Updated ww3_bound and ww3_bounc to handle model grids formulated on a rotated pole.
* Manual and nml/inp files to updated clarify that ww3_bound/ww3_bounc only accept input spectra formulated on a standard pole grid.

* Fb coupling time (#9)

Updates to allow a coupling time step that is different from the model time step. 
* Includes new regtest (in ww3_tp2.14) for non-default oasis time step.
* ww3_tp2.14 regtest added to matrix.base.

* bug fix for ukmet development

Co-authored-by: lewis.sampson <lsampson@vld240.cmpd1.metoffice.gov.uk>
Co-authored-by: Juan Manuel Castillo Sanchez <48921434+ukmo-juan-castillo@users.noreply.github.com>
Co-authored-by: Chris Bunney <48915820+ukmo-ccbunney@users.noreply.github.com>
  • Loading branch information
4 people authored Aug 10, 2020
1 parent b3eec25 commit 60f0fdf
Show file tree
Hide file tree
Showing 56 changed files with 2,568 additions and 165 deletions.
7 changes: 6 additions & 1 deletion manual/num/rotagrid.tex
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,12 @@ \subsubsection{~Rotated grids} \label{sub:num_space_rotagrid}
has been used. Gridded netCDF files generated by {\bf ww3\_ounf} also include
\emph{standard\_latitude} and \emph{standard\_longitude} two-dimensional arrays
that describe location of the rotated model cell centres in the standard lat-lon
reference frame.
reference frame.

If the user wishes to generate boundary conditions for a rotated pole grid using
the {\bf ww3\_bound} or {\bf ww3\_bounc} boundary processing programs, then it
should be noted that the input spectra for these programs are always expected
to be formulated on a \emph{standard pole}.

Six subroutines are provided in module {\bf w3servmd.ftn} for rotated grid
conversion:
Expand Down
3 changes: 3 additions & 0 deletions manual/run/ww3_bounc.tex
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,7 @@ \subsubsection{The NetCDF boundary conditions program} \label{sub:ww3bounc}
\proddeff{Output}{standard out}{Formatted output of program.}{6}
\proddefa{nest.ww3}{Boundary conditions file.}{33}

\vspace{\baselineskip} \noindent
Note: When using this program to produce boundary inputs for a model formulated on rotated pole grid, the input spectra are always assumed to be formulated on a standard pole.

\pb
3 changes: 3 additions & 0 deletions manual/run/ww3_bound.tex
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,7 @@ \subsubsection{The boundary conditions program} \label{sub:ww3bound}
\proddeff{Output}{standard out}{Formatted output of program.}{6}
\proddefa{nest.ww3}{Boundary conditions file.}{33}

\vspace{\baselineskip} \noindent
Note: When using this program to produce boundary inputs for a model formulated on rotated pole grid, the input spectra are always assumed to be formulated on a standard pole.

\pb
4 changes: 4 additions & 0 deletions model/bin/ww3_from_ftp.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,16 @@ cp -r data_regtests/ww3_tp2.12/input/* regtests/ww3_tp2.12/input/
cp -r data_regtests/ww3_tp2.12/input_be/* regtests/ww3_tp2.12/input_be/
cp -r data_regtests/ww3_tp2.12/input_le/* regtests/ww3_tp2.12/input_le/
cp -r data_regtests/ww3_tp2.14/input/r-ww3.nc.OAS*CM regtests/ww3_tp2.14/input/
cp -r data_regtests/ww3_tp2.14/input/r-ww3.nc.OASACM regtests/ww3_tp2.14/input/OASACM2
cp -r data_regtests/ww3_tp2.14/input/r-ww3.nc.OASACM regtests/ww3_tp2.14/input/r-ww3.nc.OASACM2
if [ ! -d regtests/ww3_tp2.14/input/oasis3-mct/doc ]
then
mkdir regtests/ww3_tp2.14/input/oasis3-mct/doc
fi
cp -r data_regtests/ww3_tp2.14/input/oasis3-mct/doc/* regtests/ww3_tp2.14/input/oasis3-mct/doc/
cp -r data_regtests/ww3_tp2.14/input/toy/*.nc.OAS*CM regtests/ww3_tp2.14/input/toy/
cp -r data_regtests/ww3_tp2.14/input/toy/r-toy.nc.OASACM regtests/ww3_tp2.14/input/toy/r-toy.nc.OASACM2
cp -r data_regtests/ww3_tp2.14/input/toy/toy_coupled_field.nc.OASACM regtests/ww3_tp2.14/input/toy/toy_coupled_field.nc.OASACM2
cp -r data_regtests/ww3_tp2.14/input/toy/*.nc regtests/ww3_tp2.14/input/toy/
cp -r data_regtests/ww3_tp2.17/input/* regtests/ww3_tp2.17/input/

Expand Down
2 changes: 1 addition & 1 deletion model/ftn/w3gdatmd.ftn
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@
! FLDRY Log. Public Flag for 'dry' run (IO and data
! processing only).
! FLCx Log. Public Flags for prop. is different spaces.
! FLSOU Log. Public Flag for source term calcualtion.
! FLSOU Log. Public Flag for source term calculation.
! FUNO3 Log. Public Flag for 3rd order UNO3 scheme on SMC grid.
! FVERG Log. Public Flag for 1-2-1 averaging smoothing on SMC grid.
! FSWND Log. Public Flag for sea-point only wind input on SMC grid.
Expand Down
9 changes: 5 additions & 4 deletions model/ftn/w3iogrmd.ftn
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
!/
!/ Private parameter statements (ID strings)
!/
CHARACTER(LEN=10), PARAMETER, PRIVATE :: VERGRD = '2020-04-15'
CHARACTER(LEN=10), PARAMETER, PRIVATE :: VERGRD = '2020-06-18'
CHARACTER(LEN=35), PARAMETER, PRIVATE :: &
IDSTR = 'WAVEWATCH III MODEL DEFINITION FILE'
!/
Expand Down Expand Up @@ -146,6 +146,7 @@
!/ 18-Aug-2018 : S_{ice} IC5 (Q. Liu) ( version 6.06 )
!/ 26-Aug-2018 : UOST (Mentaschi et al. 2015, 2018) ( version 6.06 )
!/ 15-Apr-2020 : Adds optional opt-out for CFL on BC ( version 7.08 )
!/ 18-Jun-2020 : Adds 360-day calendar option ( version 7.08 )
!/
!/ Copyright 2009-2013 National Weather Service (NWS),
!/ National Oceanic and Atmospheric Administration. All rights
Expand Down Expand Up @@ -234,7 +235,7 @@
!/NLX USE W3SNLXMD, ONLY: INSNLX
!/NLS USE W3SNLSMD, ONLY: INSNLS
!/IS2 USE W3SIS2MD, ONLY: INSIS2
USE W3TIMEMD, ONLY: NOLEAP
USE W3TIMEMD, ONLY: CALTYPE
USE W3SERVMD, ONLY: EXTCDE
!/S USE W3SERVMD, ONLY: STRACE
USE W3DISPMD
Expand Down Expand Up @@ -640,7 +641,7 @@
FICE0, FICEN, FICEL, PFMOVE, FLDRY, FLCX, FLCY, FLCTH, &
FLCK, FLSOU, FLBPI, FLBPO, CLATS, CLATIS, CTHG0S, &
STEXU, STEYU, STEDU, IICEHMIN, IICEHINIT, IICEDISP, &
ICESCALES(1:4), NOLEAP, CMPRTRCK, IICEHFAC, IICEHDISP, &
ICESCALES(1:4), CALTYPE, CMPRTRCK, IICEHFAC, IICEHDISP,&
IICEDDISP, IICEFDISP, BTBETA

WRITE(NDSM)GRIDSHIFT
Expand Down Expand Up @@ -780,7 +781,7 @@
FICE0, FICEN, FICEL, PFMOVE, FLDRY, FLCX, FLCY, &
FLCTH, FLCK, FLSOU, FLBPI, FLBPO, CLATS, CLATIS, &
CTHG0S, STEXU, STEYU, STEDU, IICEHMIN, IICEHINIT, &
IICEDISP, ICESCALES(1:4), NOLEAP, CMPRTRCK, IICEHFAC, &
IICEDISP, ICESCALES(1:4), CALTYPE, CMPRTRCK, IICEHFAC, &
IICEDDISP, IICEHDISP, IICEFDISP, BTBETA
!/DEBUGIOGR WRITE(740+IAPROC,*) 'W3IOGR, step 7.14'
!/DEBUGIOGR FLUSH(740+IAPROC)
Expand Down
97 changes: 70 additions & 27 deletions model/ftn/w3timemd.ftn
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
!
INTEGER, PRIVATE :: PRFTB(8)
LOGICAL, PRIVATE :: FLPROF = .FALSE.
LOGICAL, PUBLIC :: NOLEAP
CHARACTER, PUBLIC :: CALTYPE*8
!
CONTAINS
!/ ------------------------------------------------------------------- /
Expand Down Expand Up @@ -192,13 +192,14 @@
!/ | WAVEWATCH III NOAA/NCEP |
!/ | H. L. Tolman |
!/ | FORTRAN 90 |
!/ | Last update : 29-Nov-1999 |
!/ | Last update : 18-Jun-2020 |
!/ +-----------------------------------+
!/ Based on INCYMD of the GLA GCM.
!/
!/ 18-Oct-1998 : Final FORTRAN 77 ( version 1.18 )
!/ 29-Nov-1999 : Upgrade to FORTRAN 90 ( version 2.00 )
!/ 10-Jan-2017 : Add NOLEAP option, 365 day calendar ( version 6.00 )
!/ 18-Jun-2020 : Add 360-day calendar option ( version 7.08 )
!/
! 1. Purpose :
!
Expand Down Expand Up @@ -247,26 +248,34 @@
!/
INTEGER :: NY, NM, ND
INTEGER, SAVE :: NDPM(12)
DATA NDPM / 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 /
!/S INTEGER, SAVE :: IENT = 0
LOGICAL :: LEAP
!/
!/ ------------------------------------------------------------------- /
!/
!/S CALL STRACE (IENT, 'IYMD21')
!
! Declare the number of days in month depending on calendar
!
IF (TRIM(CALTYPE) .EQ. '360_day' ) THEN
NDPM=(/ 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30 /)
ELSE
NDPM=(/ 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 /)
END IF
!
! "Unpack" and increment date :
!
NY = NYMD / 10000
NM = MOD(NYMD,10000) / 100
NM = MIN ( 12 , MAX(1,NM) )
ND = MOD(NYMD,100) + M
LEAP = MOD(NY,400).EQ.0 .OR. &
( MOD(NY,4).EQ.0 .AND. MOD(NY,100).NE.0 )
! Add override for simulations with no leap years
IF (NOLEAP) then
IF (TRIM(CALTYPE) .EQ. 'standard' ) THEN
LEAP = MOD(NY,400).EQ.0 .OR. &
( MOD(NY,4).EQ.0 .AND. MOD(NY,100).NE.0 )
ELSE
LEAP = .false.
ENDIF
END IF
!
! M = -1, change month if necessary :
!
Expand Down Expand Up @@ -314,12 +323,13 @@
!/ | WAVEWATCH III NOAA/NCEP |
!/ | H. L. Tolman |
!/ | FORTRAN 90 |
!/ | Last update : 05-Jan-2001 |
!/ | Last update : 18-Jun-2020 |
!/ +-----------------------------------+
!/
!/ 23-Mar-1993 : Final FORTRAN 77 ( version 1.18 )
!/ 29-Nov-1999 : Upgrade to FORTRAN 90 ( version 2.00 )
!/ 05-Jan-2001 : Y2K leap year error correction. ( version 2.05 )
!/ 18-Jun-2020 : Add 360-day calendar support ( version 7.08 )
!/
!/
! 1. Purpose :
Expand Down Expand Up @@ -401,9 +411,17 @@
IF (NY1.EQ.NY2) GOTO 200
IF (NST.GT.0) THEN
NY2 = NY2 - 1
ND = ND + MYMD21 ( NY2*10000 + 1231 )
IF (TRIM(CALTYPE) .EQ. '360_day' ) THEN
ND = ND + MYMD21 ( NY2*10000 + 1230 )
ELSE
ND = ND + MYMD21 ( NY2*10000 + 1231 )
END IF
ELSE
ND = ND - MYMD21 ( NY2*10000 + 1231 )
IF (TRIM(CALTYPE) .EQ. '360_day' ) THEN
ND = ND - MYMD21 ( NY2*10000 + 1230 )
ELSE
ND = ND - MYMD21 ( NY2*10000 + 1231 )
END IF
NY2 = NY2 + 1
ENDIF
GOTO 100
Expand All @@ -428,13 +446,14 @@
!/ | WAVEWATCH III NOAA/NCEP |
!/ | H. L. Tolman |
!/ | FORTRAN 90 |
!/ | Last update : 29-Nov-1999 |
!/ | Last update : 18-Jun-2020 |
!/ +-----------------------------------+
!/ Based on MODYMD of the GLA GCM.
!/
!/ 19-Oct-1998 : Final FORTRAN 77 ( version 1.18 )
!/ 29-Nov-1999 : Upgrade to FORTRAN 90 ( version 2.00 )
!/ 10-Jan-2017 : Add NOLEAP option, 365 day calendar ( version 6.01 )
!/ 18-Jun-2020 : Add 360-day calendar support ( version 7.08 )
!/
! 1. Purpose :
!
Expand Down Expand Up @@ -482,23 +501,31 @@
!/
INTEGER :: NY, NM, ND
INTEGER, SAVE :: NDPM(12)
DATA NDPM / 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 /
!/S INTEGER, SAVE :: IENT = 0
LOGICAL :: LEAP
!/
!/ ------------------------------------------------------------------- /
!/
!/S CALL STRACE (IENT, 'MYMD21')
!
! Declare the number of days in month depending on calendar
!
IF (TRIM(CALTYPE) .EQ. '360_day' ) THEN
NDPM=(/ 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30 /)
ELSE
NDPM=(/ 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 /)
END IF
!
! "Unpack" and increment date :
!
NY = NYMD / 10000
NM = MOD(NYMD,10000) / 100
ND = MOD(NYMD,100)
LEAP = MOD(NY,400).EQ.0 .OR. &
( MOD(NY,4).EQ.0 .AND. MOD(NY,100).NE.0 )
!Allow override for NoLeap simulations
IF (NOLEAP) THEN
IF (TRIM(CALTYPE) .EQ. 'standard' ) THEN
LEAP = MOD(NY,400).EQ.0 .OR. &
( MOD(NY,4).EQ.0 .AND. MOD(NY,100).NE.0 )
ELSE
LEAP=.false.
ENDIF
!
Expand Down Expand Up @@ -1431,10 +1458,11 @@
!/ | WAVEWATCH III NOAA/NCEP |
!/ | M. Accensi |
!/ | FORTRAN 90 |
!/ | Last update : 15-May-2018 |
!/ | Last update : 18-Jun-2020 |
!/ +-----------------------------------+
!/
!/ 15-May-2018 : Origination ( version 6.05 )
!/ 18-Jun-2020 : Addition of 360-day calendar ( version 7.08 )
!/
! 1. Purpose :
!
Expand Down Expand Up @@ -1484,19 +1512,34 @@
!
! Convert dates and times :
!
A1 = (14-T1(2))/12
B1 = T1(1) + 4800 - A1
C1 = T1(2) + 12*A1 - 3
D1 = T1(3) + (153*C1 + 2)/5 + 365*B1 + B1/4 -B1/100 + B1/400
E1 = 3600.0*T1(5) + 60.0*(T1(6)-T1(4)) + T1(7) + T1(8)/1000.0
IF (TRIM(CALTYPE) .EQ. '360_day' ) THEN
A1 = (T2(1)-T1(1))*360 + (T2(2)-T1(2))*30 + (T2(3)-T1(3))

E1 = 3600.0*T1(5) + 60.0*(T1(6)-T1(4)) + T1(7) + T1(8)/1000.0
E2 = 3600.0*T2(5) + 60.0*(T2(6)-T2(4)) + T2(7) + T2(8)/1000.0
!
A2 = (14-T2(2))/12
B2 = T2(1) + 4800 - A2
C2 = T2(2) + 12*A2 - 3
D2 = T2(3) + (153*C2 + 2)/5 + 365*B2 + B2/4 -B2/100 + B2/400
E2 = 3600.0*T2(5) + 60.0*(T2(6)-T2(4)) + T2(7) + T2(8)/1000.0
TSUB = DBLE(A1) + (E2-E1)/86400.0d0
ELSE
A1 = (14-T1(2))/12
B1 = T1(1) + 4800 - A1
C1 = T1(2) + 12*A1 - 3
D1 = T1(3) + (153*C1 + 2)/5 + 365*B1
IF (TRIM(CALTYPE) .EQ. 'standard' ) THEN
D1 = D1 + B1/4 -B1/100 + B1/400
ENDIF
E1 = 3600.0*T1(5) + 60.0*(T1(6)-T1(4)) + T1(7) + T1(8)/1000.0
!
A2 = (14-T2(2))/12
B2 = T2(1) + 4800 - A2
C2 = T2(2) + 12*A2 - 3
D2 = T2(3) + (153*C2 + 2)/5 + 365*B2
IF (TRIM(CALTYPE) .EQ. 'standard' ) THEN
D2 = D2 + B2/4 -B2/100 + B2/400
ENDIF
E2 = 3600.0*T2(5) + 60.0*(T2(6)-T2(4)) + T2(7) + T2(8)/1000.0
!
TSUB = DBLE(D2-D1) + (E2-E1)/86400.0d0
TSUB = DBLE(D2-D1) + (E2-E1)/86400.0d0
ENDIF
!
RETURN
!/
Expand Down
Loading

0 comments on commit 60f0fdf

Please sign in to comment.