Skip to content

Commit

Permalink
Fb coupling fields (NOAA-EMC#285)
Browse files Browse the repository at this point in the history
This PR adds new fields that can be sent (mean wave number, mean wave period, total ocean wind stress) and received (air density, wind stress) to/from other models via OASIS coupling, which will also be available in the model output. The fields that can be received via coupling can also be read from an external file, and using a homogeneous ice fraction is now activated when using '.inp' input files, as it was already possible to do it using '.nml' input files. In order to add this functionality it was necessary to modify the format of the ww3_shel.inp and ww3_multi.inp files, so that new flags controlling if these fields are used can be read. Furthermore, the format of the ww3_outf.inp file must be modified to accommodate the new output fields available.

If no air density is read from file or via coupling, the default constant value is used. The infrastructure to read and use the wind stress is already in place, but the actual use of wind stress to drive the model is not implemented yet and it will be the aim of issue NOAA-EMC#337

* Fb oasis t+0 (#13)

In the original code a coupling lag had to be used, coupling took place at the last time step but not at the first, and the coupling fields had to be written in an oasis restart file. With this ticket, the program can run in a different way by not using a coupling lag, coupling taking place at the first time step but not the last, and the coupling fields are written in the wave restart file - no extra oasis restart file needed.

* Fb uprstr inp (#15)

Enhancement to improve the way in which input data is read in and logged by the ww3_uprstr program:
  * read in variables specific to the update process selected
  * output the values provided in the ww3_uprstr.out log file
  * update the .inp template file and regtests to improve clarity and work with the changes
  * add capability to read inputs from a namelist (ww3_uprstr.nml) file

* First set of changes, still testing

* Some fixes

* Further changes mainly fixing vector boundaries

* Main changes

* Most changes already present, only need to write in output and restart

* Further changes - activate coupling

* Bug fixes to make the code compile

* Further changes to run regtests

* Minor fixes for output, manual, and switches

* Small fix to comments in model input

* Remove some lines that had to be removed but were overlooked

* Substitute ATTX and ATXX switches by WNTX and WNXX; add comments
regarding last modification date

* Change in file missed in latest commit

* Minor changes fixing version change

* Small fixes after reviewer's comments and to fix regtest

* Changes to pass regtests

* Addition of a new regtest and small fixes to ww3_prnc

* Time-interpolate air density when read from file

* Ensure that units are consistent

* Restore long name in metadata for new fieds, and update code version for
input files needed in regtest

* Update last modification date; corrections for new output field: WNMEAN
has now index (2,19) instead of (2,18)

* Fixes from Jessica Meixner; update date of last change in restart file

* Small fix to the format of the example input file ww3_multi.inp

* Some fixes after merging with latest version of develop

* Correct one version number

* Fix the header of the table printed in log.ww3, should not cause changes
in the output

* Minor fix in the ww3_shel.inp file of one of the regtests

* Update ww3_shel.inp

* Some fixes and improvements that were proposed during the review process

* Added comment to the new regtests implemented in ww3_tp2.15

Co-authored-by: Andy Saulter <48921142+ukmo-ansaulter@users.noreply.github.com>
Co-authored-by: ukmo-chris.bunney <christopher.bunney@metoffice.gov.uk>
Co-authored-by: Ali.Abdolali <37336972+aliabdolali@users.noreply.github.com>
Co-authored-by: aliabdolali <ali.abdolali@noaa.gov>
Co-authored-by: Chris Bunney <48915820+ukmo-ccbunney@users.noreply.github.com>
  • Loading branch information
6 people authored May 18, 2021
1 parent 9708edc commit 482c500
Show file tree
Hide file tree
Showing 224 changed files with 4,818 additions and 1,000 deletions.
4 changes: 2 additions & 2 deletions manual/impl/switch.tex
Original file line number Diff line number Diff line change
Expand Up @@ -186,15 +186,15 @@ \subsubsection{~Mandatory switches} \label{sub:man_switch}
\end{slist}

\noindent
Selection of method of wind interpolation (time):
Selection of method of wind/momentum interpolation (time):
\begin{slist}
\sit{wnt0}{No interpolation.}
\sit{wnt1}{Linear interpolation.}
\sit{wnt2}{Approximately quadratic interpolation.}
\end{slist}

\noindent
Selection of method of wind interpolation (space):
Selection of method of wind/momentum interpolation (space):
\begin{slist}
\sit{wnx0}{Vector interpolation.}
\sit{wnx1}{Approximately linear speed interpolation.}
Expand Down
3 changes: 2 additions & 1 deletion model/bin/ww3_from_ftp.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ tar -xvzf ww3_from_ftp.${ww3ver}.tar.gz
#Move regtest info from data_regtests to regtests:
echo -e "Moving data from data_regtests to regtests"
cp -r data_regtests/ww3_tp2.18/input/*.nc regtests/ww3_tp2.18/input/
cp -r data_regtests/ww3_tp2.15/input/*.nc regtests/ww3_tp2.15/input/
cp -r data_regtests/ww3_tp2.15/input/wind.nc regtests/ww3_tp2.15/input/
cp -r data_regtests/ww3_tp2.15/input/*.nc regtests/ww3_tp2.15/input_rho/
cp -r data_regtests/ww3_tp2.13/*.png regtests/ww3_tp2.13/
cp -r data_regtests/ww3_tic1.4/input/*.nc regtests/ww3_tic1.4/input/
cp -r data_regtests/ww3_tp2.8/input/*.nc regtests/ww3_tp2.8/input/
Expand Down
30 changes: 24 additions & 6 deletions model/ftn/gx_outf.ftn
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
!/ | A. Chawla |
!/ | J.H.G.M. Alves |
!/ | FORTRAN 90 |
!/ | Last update : 27-Aug-2015 |
!/ | Last update : 22-Mar-2021 |
!/ +-----------------------------------+
!/
!/ 30-Jun-1999 : Final FORTRAN 77 ( version 1.18 )
Expand Down Expand Up @@ -37,6 +37,7 @@
!/ 25-Feb-2013 : Adding double-index output fields ( version 4.11 )
!/ 27-Aug-2015 : ICEH and ICEF added as output ( version 5.10 )
!/ 25-Aug-2018 : Add WBT parameter ( version 6.06 )
!/ 22-Mar-2021 : RHOA and TAUA added as output ( version 7.xx )
!/
!/
!/ Copyright 2009 National Weather Service (NWS),
Expand Down Expand Up @@ -124,12 +125,13 @@
USE W3TIMEMD, ONLY: STME21, TICK21, DSEC21
!/
USE W3GDATMD
USE W3WDATMD, ONLY: TIME, WLV, ICE, ICEH, ICEF, BERG, UST, USTDIR
USE W3WDATMD, ONLY: TIME, WLV, ICE, ICEH, ICEF, BERG, &
UST, USTDIR, RHOAIR
USE W3ADATMD, ONLY: CFLXYMAX, CFLTHMAX, AS, CX, CY, UA, UD, WN, &
DW, HS, WLM, T01, T0M1, T02, THM, THS, FP0, &
THP0, FP1, THP1, ABA, ABD, UBA, UBD, FCUT, &
SXX, SYY, SXY, PHS, PTP, PLP, PDIR, PSI, PWS,&
PTM1, PT1, PT2, PEP, &
PTM1, PT1, PT2, PEP, TAUA, TAUADIR, &
PTHP0, PQP, PSW, PPE, PGW, QP, &
PWST, PNR, USERO, TAUOX, TAUOY, TAUWIX, &
TAUWIY, PHIAW, PHIOC, TUSX, TUSY, PRMS, TPMS,&
Expand Down Expand Up @@ -734,7 +736,7 @@
!/ | WAVEWATCH III NOAA/NCEP |
!/ | H. L. Tolman |
!/ | FORTRAN 90 |
!/ | Last update : 28-Mar-2007 |
!/ | Last update : 22-Mar-2021 |
!/ +-----------------------------------+
!/
!/ 30-Jun-1999 : Final FORTRAN 77 ( version 1.18 )
Expand All @@ -748,6 +750,7 @@
!/ 18-Jan-2007 : Update MSOUT/MBOUT treatment. ( version 3.10 )
!/ 28-Mar-2007 : Adding partitioned output. ( version 3.11 )
!/ Adding user slots for outputs.
!/ 22-Mar-2021 : Add output fields RHOA and TAUA ( version 7.xx )
!/
! 1. Purpose :
!
Expand Down Expand Up @@ -971,15 +974,30 @@
FLONE = .TRUE.
CALL W3S2XY ( NSEA, NSEA, NX, NY, ICE , MAPSF, X1 )
!
! Atmospheric momentum
!
ELSE IF ( J.EQ.1 .AND. K.EQ.8 ) THEN
FLTWO = .TRUE.
CALL W3S2XY ( NSEA, NSEA, NX, NY, TAUA(1:NSEA) &
, MAPSF, XX )
CALL W3S2XY ( NSEA, NSEA, NX, NY, TAUADIR(1:NSEA) &
, MAPSF, XY )
!
! Air density
!
ELSE IF ( J.EQ.1 .AND. K.EQ.9 ) THEN
FLONE = .TRUE.
CALL W3S2XY ( NSEA, NSEA, NX, NY, RHOAIR, MAPSF, X1 )
!
! Ice thickness
!
!/IS2 ELSE IF ( J.EQ.1 .AND. K.EQ.9 ) THEN
!/IS2 ELSE IF ( J.EQ.1 .AND. K.EQ.11 ) THEN
!/IS2 FLONE = .TRUE.
!/IS2 CALL W3S2XY (NSEA, NSEA, NX, NY, ICEH , MAPSF, X1 )
!
! Average sea ice floe diameter
!
!/IS2 ELSE IF ( J.EQ.1 .AND. K.EQ.10) THEN
!/IS2 ELSE IF ( J.EQ.1 .AND. K.EQ.12) THEN
!/IS2 FLONE = .TRUE.
!/IS2 CALL W3S2XY (NSEA, NSEA, NX, NY, ICEF , MAPSF, X1 )
!
Expand Down
35 changes: 32 additions & 3 deletions model/ftn/pdlib_field_vec.ftn
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@ MODULE PDLIB_FIELD_VEC
!/ | Mathieu Dutour-Sikiric (IRB) |
!/ | |
!/ | FORTRAN 90 |
!/ | Last update : 01-Jan-2010 |
!/ | Last update : 22-Mar-2021 |
!/ +-----------------------------------+
!/
!/ 01-Jan-2010 : Origination. ( version 6.04 )
!/ 22-Mar-2021 : Add WNMEAN, TAUOC output ( version 7.xx )
!/
!/ Copyright 2010 National Weather Service (NWS),
!/ National Oceanic and Atmospheric Administration. All rights
Expand Down Expand Up @@ -163,6 +164,9 @@ MODULE PDLIB_FIELD_VEC
IF ( FLGRDALL( 2, 17) ) THEN
IH = IH + 1
END IF
IF ( FLGRDALL( 2, 19) ) THEN
IH = IH + 1
END IF
IF ( FLGRDALL( 3, 1) ) THEN
DO IK=E3DF(2,1),E3DF(3,1)
IH = IH + 1
Expand Down Expand Up @@ -317,6 +321,10 @@ MODULE PDLIB_FIELD_VEC
IF ( FLGRDALL( 6, 11) ) THEN
IH = IH + 1
END IF
IF ( FLGRDALL( 6, 13) ) THEN
IH = IH + 1
IH = IH + 1
END IF
IF ( FLGRDALL( 7, 1) ) THEN
IH = IH + 1
IH = IH + 1
Expand Down Expand Up @@ -837,10 +845,11 @@ MODULE PDLIB_FIELD_VEC
!/ | Mathieu Dutour-Sikiric (IRB) |
!/ | |
!/ | FORTRAN 90 |
!/ | Last update : 01-Mai-2018 |
!/ | Last update : 22-Mar-2021 |
!/ +-----------------------------------+
!/
!/ 01-Mai-2018 : Origination. ( version 6.04 )
!/ 22-Mar-2021 : Add WNMEAN, TAUOC output ( version 7.xx )
!/
! 1. Purpose : Do communication for PDLIB output
! 2. Method :
Expand All @@ -863,7 +872,7 @@ MODULE PDLIB_FIELD_VEC
DTDYN, FCUT, SPPNT, ABA, ABD, UBA, UBD,&
SXX, SYY, SXY, USERO, PHS, PTP, PLP, &
PDIR, PSI, PWS, PWST, PNR, PHIAW, &
PHIOC, &
PHIOC, TAUOCX, TAUOCY, WNMEAN, &
TUSX, TUSY, TAUWIX, TAUWIY, TAUOX, &
TAUOY, USSX, USSY, MSSX, MSSY, &
MSCX, MSCY, PRMS, TPMS, CHARN, &
Expand Down Expand Up @@ -1013,6 +1022,10 @@ MODULE PDLIB_FIELD_VEC
IH = IH + 1
Arrexch(IH,JSEA)=WBT(JSEA)
END IF
IF ( FLGRDALL( 2, 19) ) THEN
IH = IH + 1
Arrexch(IH,JSEA)=WNMEAN(JSEA)
END IF
IF ( FLGRDALL( 3, 1) ) THEN
DO IK=E3DF(2,1),E3DF(3,1)
IH = IH + 1
Expand Down Expand Up @@ -1251,6 +1264,12 @@ MODULE PDLIB_FIELD_VEC
IH = IH + 1
Arrexch(IH,JSEA)=PHICE(JSEA)
END IF
IF ( FLGRDALL( 6, 13) ) THEN
IH = IH + 1
Arrexch(IH,JSEA)=TAUOCX(JSEA)
IH = IH + 1
Arrexch(IH,JSEA)=TAUOCY(JSEA)
END IF
IF ( FLGRDALL( 7, 1) ) THEN
IH = IH + 1
Arrexch(IH,JSEA)=ABA(JSEA)
Expand Down Expand Up @@ -1474,6 +1493,10 @@ MODULE PDLIB_FIELD_VEC
IH = IH + 1
WBT(1:NSEA) = ARRtotal(IH,:)
END IF
IF ( FLGRDALL( 2, 19) ) THEN
IH = IH + 1
WNMEAN(1:NSEA) = ARRtotal(IH,:)
END IF
IF ( FLGRDALL( 3, 1) ) THEN
DO IK=E3DF(2,1),E3DF(3,1)
IH = IH + 1
Expand Down Expand Up @@ -1712,6 +1735,12 @@ MODULE PDLIB_FIELD_VEC
IH = IH + 1
PHICE(1:NSEA) = ARRtotal(IH,:)
END IF
IF ( FLGRDALL( 6, 13) ) THEN
IH = IH + 1
TAUOCX(1:NSEA) = ARRtotal(IH,:)
IH = IH + 1
TAUOCY(1:NSEA) = ARRtotal(IH,:)
END IF
IF ( FLGRDALL( 7, 1) ) THEN
IH = IH + 1
ABA(1:NSEA) = ARRtotal(IH,:)
Expand Down
Loading

0 comments on commit 482c500

Please sign in to comment.