Skip to content

Commit

Permalink
Fb wind stress (#483)
Browse files Browse the repository at this point in the history
Enable direct use of atmospheric model wind stress by source terms ST4 and ST6
  • Loading branch information
ukmo-nievesvaliente authored Oct 6, 2021
1 parent 1518403 commit 24ab9e6
Show file tree
Hide file tree
Showing 32 changed files with 925 additions and 572 deletions.
1 change: 1 addition & 0 deletions manual/impl/switch.tex
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ \subsubsection{~Mandatory switches} \label{sub:man_switch}
\sit{flx2} {Friction velocity from Tolman and Chalikov input.}
\sit{flx3} {Idem, with cap of Eq.~(\ref{eq:Cd_cap_1}) or (\ref{eq:Cd_cap_2}).}
\sit{flx4} {Friction velocity according to Eq.~(\ref{eq:ST607}).}
\sit{flx5} {Friction velocity from atmospheric stress (stresses should be an input).}
\end{slist}

\noindent
Expand Down
27 changes: 15 additions & 12 deletions model/bin/build_utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ check_switches()
#sort:stress:
stress ) TY='one'
ID='stress computation'
OK='FLX0 FLX1 FLX2 FLX3 FLX4' ;;
OK='FLX0 FLX1 FLX2 FLX3 FLX4 FLX5' ;;
#sort:dstress:
dstress) TY='upto1'
ID='Diagnostic stress comp'
Expand Down Expand Up @@ -444,6 +444,7 @@ check_switches()
FLX2) str_st1='OK' ; str_st2='OK' ; str_st3='no' ; str_st6='OK' ;;
FLX3) str_st1='OK' ; str_st2='OK' ; str_st3='no' ; str_st6='OK' ;;
FLX4) str_st1='OK' ; str_st2='no' ; str_st3='no' ; str_st6='OK' ;;
FLX5) str_st1='no' ; str_st2='no' ; str_st3='yes' ; str_st6='OK' ;;
esac

if [ -n "$thread2" ] && [ "$thread1" != 'OMPG' ]
Expand Down Expand Up @@ -518,7 +519,7 @@ check_switches()
then
echo ' '
echo " *** !/ST6 cannot be used in combination with !/$stress"
echo " Choose from FLX1, FLX2, FLX3, or FLX4."
echo " Choose from FLX1, FLX2, FLX3, or FLX4 or FLX5."
echo ' ' ; exit 14
fi

Expand Down Expand Up @@ -592,6 +593,8 @@ switch_files()
flxx=$NULL ;;
FLX4) flx='w3flx4md'
flxx=$NULL ;;
FLX5) flx='w3flx5md'
flxx=$NULL ;;
esac

case $dstress in
Expand Down Expand Up @@ -767,7 +770,7 @@ create_file_list()
core=
data='w3wdatmd w3gdatmd w3adatmd w3idatmd w3odatmd wmmdatmd'
prop=
sourcet="w3parall w3triamd w3gridmd $stx $nlx $btx $is $uostmd"
sourcet="w3parall w3triamd w3gridmd $stx $flx $nlx $btx $is $uostmd"
IO='w3iogrmd'
aux="constants w3servmd w3arrymd w3dispmd w3gsrumd w3timemd w3nmlgridmd $pdlibyow $memcode"
if [ "$scrip" = 'SCRIP' ]
Expand All @@ -784,7 +787,7 @@ create_file_list()
core=
data="$memcode w3gdatmd w3wdatmd w3adatmd w3idatmd w3odatmd"
prop=
sourcet="$pdlibcode $pdlibyow $db $tr $trx $bt $setupcode $stx $nlx $btx $is wmmdatmd w3parall $uostmd"
sourcet="$pdlibcode $pdlibyow $db $tr $trx $bt $setupcode $stx $flx $nlx $btx $is wmmdatmd w3parall $uostmd"
IO='w3iogrmd w3iorsmd'
aux="constants w3triamd w3servmd w3arrymd w3dispmd w3gsrumd w3timemd" ;;
ww3_bound)
Expand All @@ -805,14 +808,14 @@ create_file_list()
core='w3fldsmd'
data="$memcode w3gdatmd w3adatmd w3idatmd w3odatmd w3wdatmd wmmdatmd"
prop=
sourcet="$pdlibcode $pdlibyow $db $bt $setupcode w3triamd $stx $nlx $btx $is $uostmd"
sourcet="$pdlibcode $pdlibyow $db $bt $setupcode w3triamd $stx $flx $nlx $btx $is $uostmd"
IO="w3iogrmd $oasismd $agcmmd $ogcmmd $igcmmd"
aux="constants w3servmd w3timemd $tidecode w3arrymd w3dispmd w3gsrumd w3parall" ;;
ww3_prnc)
core='w3fldsmd'
data="$memcode w3gdatmd w3adatmd w3idatmd w3odatmd w3wdatmd wmmdatmd"
prop=
sourcet="$pdlibcode $pdlibyow $db $bt $setupcode w3triamd $stx $nlx $btx $is w3parall $uostmd"
sourcet="$pdlibcode $pdlibyow $db $bt $setupcode w3triamd $stx $flx $nlx $btx $is w3parall $uostmd"
IO="w3iogrmd $oasismd $agcmmd $ogcmmd $igcmmd"
aux="constants w3servmd w3timemd w3arrymd w3dispmd w3gsrumd w3tidemd w3nmlprncmd" ;;
ww3_prtide)
Expand Down Expand Up @@ -882,15 +885,15 @@ create_file_list()
core=
data="w3parall wmmdatmd $memcode w3gdatmd w3wdatmd w3adatmd w3idatmd w3odatmd"
prop=
sourcet="$pdlibcode $pdlibyow $db $bt $setupcode $tr $trx $stx $nlx $btx $is $uostmd"
sourcet="$pdlibcode $pdlibyow $db $bt $setupcode $tr $trx $stx $flx $nlx $btx $is $uostmd"
IO='w3iogrmd w3iogomd'
aux="constants w3servmd w3timemd w3arrymd w3dispmd w3gsrumd"
aux="$aux" ;;
ww3_ounf)
core='w3initmd'
data="wmmdatmd $memcode w3gdatmd w3wdatmd w3adatmd w3idatmd w3odatmd"
prop=
sourcet="$pdlibcode $pdlibyow $db $bt $setupcode w3parall w3triamd $stx $nlx $btx $is $uostmd"
sourcet="$pdlibcode $pdlibyow $db $bt $setupcode w3parall w3triamd $stx $flx $nlx $btx $is $uostmd"
IO='w3iogrmd w3iogomd w3iorsmd w3iopomd'
aux="constants w3servmd w3timemd w3arrymd w3dispmd w3gsrumd"
aux="$aux w3nmlounfmd $smco w3ounfmetamd w3metamd" ;;
Expand Down Expand Up @@ -927,15 +930,15 @@ create_file_list()
core=
data="w3parall wmmdatmd w3triamd $memcode w3gdatmd w3wdatmd w3adatmd w3idatmd w3odatmd"
prop=
sourcet="$pdlibcode $pdlibyow $db $bt $setupcode $stx $nlx $btx $is $uostmd"
sourcet="$pdlibcode $pdlibyow $db $bt $setupcode $stx $flx $nlx $btx $is $uostmd"
IO='w3iogrmd w3iogomd'
aux="constants w3servmd w3timemd w3arrymd w3dispmd w3gsrumd"
aux="$aux" ;;
ww3_gspl)
core='w3fldsmd'
data="$memcode w3gdatmd w3wdatmd w3adatmd w3idatmd w3odatmd"
prop=
sourcet="$pdlibcode $pdlibyow $db $bt $setupcode wmmdatmd w3parall w3triamd $stx $nlx $btx $is $uostmd"
sourcet="$pdlibcode $pdlibyow $db $bt $setupcode wmmdatmd w3parall w3triamd $stx $flx $nlx $btx $is $uostmd"
IO="w3iogrmd $oasismd $agcmmd $ogcmmd $igcmmd"
aux="constants w3servmd w3timemd w3arrymd w3dispmd w3gsrumd $tidecode" ;;
ww3_gint)
Expand All @@ -950,7 +953,7 @@ create_file_list()
core=
data="$memcode w3gdatmd w3wdatmd w3adatmd w3idatmd w3odatmd"
prop=
sourcet="$pdlibcode $pdlibyow $db $bt $setupcode wmmdatmd w3parall w3triamd $stx $nlx $btx $tr $bs $is $uostmd"
sourcet="$pdlibcode $pdlibyow $db $bt $setupcode wmmdatmd w3parall w3triamd $stx $flx $nlx $btx $tr $bs $is $uostmd"
IO='w3iogrmd w3iogomd'
aux="constants w3servmd w3timemd w3arrymd w3dispmd w3gsrumd"
aux="$aux" ;;
Expand All @@ -965,7 +968,7 @@ create_file_list()
core='w3strkmd'
data="$memcode w3gdatmd w3adatmd w3idatmd w3odatmd w3wdatmd"
prop=
sourcet="$pdlibcode $pdlibyow $db $bt $setupcode wmmdatmd w3dispmd w3triamd $ln $stx $nlx $btx $tr $bs $is $uostmd"
sourcet="$pdlibcode $pdlibyow $db $bt $setupcode wmmdatmd w3dispmd w3triamd $ln $stx $flx $nlx $btx $tr $bs $is $uostmd"
IO=
aux="constants w3servmd w3timemd w3arrymd w3gsrumd w3parall" ;;
libww3|libww3.so)
Expand Down
17 changes: 9 additions & 8 deletions model/bin/make_makefile.sh
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@


progs="ww3_grid ww3_strt ww3_prep ww3_prnc ww3_shel ww3_multi ww3_sbs1
ww3_outf ww3_outp ww3_trck ww3_trnc ww3_grib gx_outf gx_outp ww3_ounf
ww3_outf ww3_outp ww3_trck ww3_trnc ww3_grib gx_outf gx_outp ww3_ounf
ww3_ounp ww3_gspl ww3_gint ww3_bound ww3_bounc ww3_systrk $tideprog"
progs="$progs ww3_multi_esmf ww3_uprstr"
progs="$progs libww3"
Expand Down Expand Up @@ -220,7 +220,7 @@
done
echo " @cd \$(aPo); ld -o $lib -shared $objs" >> makefile
echo ' ' >> makefile

else
echo ' @$(aPb)/link '"$filesl" >> makefile
echo ' ' >> makefile
Expand Down Expand Up @@ -250,7 +250,7 @@

suffixes="ftn f F f90 F90 c"
fexti=none
ispdlibi=no
ispdlibi=no
for s in $suffixes
do
if [ -f $main_dir/ftn/$file.$s ]
Expand Down Expand Up @@ -285,9 +285,9 @@
string3="$NULL"

if [ "$ispdlibi" = 'yes' ]
then
then
string1='$(aPo)/'$file'.o : PDLIB/'$file.$fexti' '
fi
fi

$main_dir/bin/ad3 $file 0 1 > ad3.out 2>&1

Expand Down Expand Up @@ -351,6 +351,7 @@
'W3FLX2MD' ) modtest=w3flx2md.o ;;
'W3FLX3MD' ) modtest=w3flx3md.o ;;
'W3FLX4MD' ) modtest=w3flx4md.o ;;
'W3FLX5MD' ) modtest=w3flx5md.o ;;
'W3SLN1MD' ) modtest=w3sln1md.o ;;
'W3SRC0MD' ) modtest=w3src0md.o ;;
'W3SRC1MD' ) modtest=w3src1md.o ;;
Expand Down Expand Up @@ -435,7 +436,7 @@
'W3OUNFMETAMD' ) modtest=w3ounfmetamd.o ;;
'W3METAMD' ) modtest=w3metamd.o ;;
'W3GRIDMD' ) modtest=w3gridmd.o ;;
* ) modfound=no ;;
* ) modfound=no ;;
esac

if [ "$modfound" == "yes" ]
Expand Down Expand Up @@ -494,9 +495,9 @@
fi

if [ "$scripnc" = 'SCRIPNC' ]
then
then
scrip_mk=$scrip_dir/SCRIP_NC.mk
else
else
scrip_mk=$scrip_dir/SCRIP.mk
fi
if [ ! -e $scrip_mk ]
Expand Down
25 changes: 19 additions & 6 deletions model/ftn/gx_outp.ftn
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
!/ 26-Dec-2012 : Modified obsolete declarations. ( version 4.11 )
!/ 27-Aug-2015 : Sice add as additional output ( version 5.10 )
!/ (in source terms)
!/ 19-Jul-2021 : Momentum and air density support ( version 7.xx )
!/
!/ Copyright 2009-2012 National Weather Service (NWS),
!/ National Oceanic and Atmospheric Administration. All rights
Expand Down Expand Up @@ -150,6 +151,7 @@
USE W3ODATMD, ONLY: NDSE, NDST, NDSO, NOPTS, PTLOC, PTNME, &
DPO, WAO, WDO, ASO, CAO, CDO, SPCO, FNMPRE, &
GRDID, ICEO, ICEHO, ICEFO
!/FLX5 USE W3ODATMD, ONLY: TAUAO, TAUDO, DAIRO
!
IMPLICIT NONE
!/
Expand Down Expand Up @@ -621,6 +623,7 @@
!/FLX2 USE W3FLX2MD
!/FLX3 USE W3FLX3MD
!/FLX4 USE W3FLX4MD
!/FLX5 USE W3FLX5MD
!/LN1 USE W3SLN1MD
!/ST1 USE W3SRC1MD
!/ST2 USE W3SRC2MD
Expand Down Expand Up @@ -665,6 +668,7 @@
FACTOR, CD, USTAR, FHIGH, ZWND, ICE, &
USTD, Z0, CHARN, EMEAN, FMEAN, WNMEAN,&
ICETHICK, ICECON, ICEF
!/FLX5 REAL ::TAUA, TAUADIR, RHOAIR
!/IS2 REAL :: ICEDMAX
!/ST1 REAL :: AMAX, FH1, FH2
!/ST2 REAL :: AMAX, ALPHA(NK), FPI
Expand Down Expand Up @@ -741,6 +745,9 @@
UDIR = MOD ( 270. - WDO(J)*RADE , 360. )
UDIRR = WDO(J)
UABS = MAX ( 0.001 , WAO(J) )
!/FLX5 TAUA = MAX ( 0.001 , TAUAO(J))
!/FLX5 TAUADIR = MOD ( 270. - TAUDO(J)*RADE , 360. )
!/FLX5 RHOAIR = MAX ( 0. , DAIRO(J))
CDIR = MOD ( 270. - CDO(J)*RADE , 360. )
!/IS2 ICEDMAX = MAX ( 0., ICEFO(J))
!/IC2 ICEF = 0.
Expand Down Expand Up @@ -917,9 +924,11 @@
!/ST3 CALL W3SPR3 (A, CG, WN, EMEAN, FMEAN, FMEANS, &
!/ST3 WNMEAN, AMAX, UABS, UDIRR, USTAR, USTD, &
!/ST3 TAUWX, TAUWY, CD, Z0, CHARN, LLWS, FMEANWS)
!/ST4 CALL W3SPR4 (A, CG, WN, EMEAN, FMEAN, FMEAN1, &
!/ST4 WNMEAN, AMAX, UABS, UDIRR, USTAR, USTD, &
!/ST4 TAUWX, TAUWY, CD, Z0, CHARN, LLWS, FMEANWS, DLWMEAN)
!/ST4 CALL W3SPR4 (A, CG, WN, EMEAN, FMEAN, FMEAN1, &
!/ST4 WNMEAN, AMAX, UABS, UDIRR, &
!/ST4!/FLX5 TAUA, TAUADIR, RHOAIR, &
!/ST4 USTAR, USTD, TAUWX, TAUWY, CD, Z0, &
!/ST4 CHARN, LLWS, FMEANWS, DLWMEAN )
!/ST6 CALL W3SPR6 (A, CG, WN, EMEAN, FMEAN, WNMEAN, AMAX, FP)
!
!/FLX1 CALL W3FLX1 ( ZWND, UABS, UDIRR, &
Expand All @@ -929,6 +938,8 @@
!/FLX3 CALL W3FLX3 ( ZWND, DEPTH, FP, UABS, UDIRR, &
!/FLX3 USTAR, USTD, Z0, CD )
!/FLX4 CALL W3FLX4 ( ZWND, UABS, UDIRR, USTAR, USTD, Z0, CD )
!/FLX5 CALL W3FLX5 ( ZWND, UABS, UDIRR, TAUA, TAUADIR, &
!/FLX5 RHOAIR, USTAR, USTD, Z0, CD )
!
DO ITT=1, 3
!/ST2 CALL W3SIN2 (A, CG, WN2, UABS, UDIRR, CD, Z0, &
Expand All @@ -945,9 +956,11 @@
!/ST4 CALL W3SIN4 (A, CG, WN2, UABS, USTAR, DAIR/DWAT, &
!/ST4 ASO(J), UDIRR, Z0, CD, TAUWX, TAUWY, &
!/ST4 TAUWNX, TAUWNY, XWI, DIA, LLWS, IX, IY, LAMBDA )
!/ST4 CALL W3SPR4 (A, CG, WN, EMEAN, FMEAN, FMEAN1, &
!/ST4 WNMEAN, AMAX, UABS, UDIRR, USTAR, USTD, &
!/ST4 TAUWX, TAUWY, CD, Z0, CHARN, LLWS, FMEANWS, DLWMEAN)
!/ST4 CALL W3SPR4 (A, CG, WN, EMEAN, FMEAN, FMEAN1, &
!/ST4 WNMEAN, AMAX, UABS, UDIRR, &
!/ST4!/FLX5 TAUA, TAUADIR, RHOAIR, &
!/ST4 USTAR, USTD, TAUWX, TAUWY, CD, Z0, &
!/ST4 CHARN, LLWS, FMEANWS, DLWMEAN )
!/FLX2 CALL W3FLX2 ( ZWND, DEPTH, FP, UABS, UDIRR, &
!/FLX2 USTAR, USTD, Z0, CD )
!/FLX3 CALL W3FLX3 ( ZWND, DEPTH, FP, UABS, UDIRR, &
Expand Down
Loading

0 comments on commit 24ab9e6

Please sign in to comment.