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

Refactor gridded wave post #3014

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
140 commits
Select commit Hold shift + click to select a range
26e06a3
modified gefs_tasks.py
AntonMFernando-NOAA Oct 17, 2024
99dea4a
Merge branch 'NOAA-EMC:develop' into feature/wave_post_grid
AntonMFernando-NOAA Oct 17, 2024
97b5932
modified gefs_tasks.py
AntonMFernando-NOAA Oct 17, 2024
64552f8
modifed gefs_tasks.py
AntonMFernando-NOAA Oct 18, 2024
ed3768c
modifed gefs_tasks.py
AntonMFernando-NOAA Oct 18, 2024
9373b88
modified gefs_tasks.py
AntonMFernando-NOAA Oct 18, 2024
916c1fa
modified gefs_tasks.py
AntonMFernando-NOAA Oct 18, 2024
f018d2e
modified gefs_tasks.py
AntonMFernando-NOAA Oct 18, 2024
aede2e9
modify gefs_tasks.py
AntonMFernando-NOAA Oct 18, 2024
f59a6c9
modified exgfs_wave_post_gridded_sbs.sh
AntonMFernando-NOAA Oct 18, 2024
f07b0ec
modified gefs_tasks.py
AntonMFernando-NOAA Oct 18, 2024
6261b4f
modified gefs.py
AntonMFernando-NOAA Oct 18, 2024
b2b3078
modified gefs_tasks.py
AntonMFernando-NOAA Oct 18, 2024
ea023be
modified gefs_tasks.py
AntonMFernando-NOAA Oct 18, 2024
3c69e48
modified gefs_tasks.py
AntonMFernando-NOAA Oct 18, 2024
16205f1
modified gefs_task.py
AntonMFernando-NOAA Oct 18, 2024
0c7cb50
modified global-workflow\scripts\exgfs_wave_post_gridded_sbs.sh
AntonMFernando-NOAA Oct 18, 2024
458b130
modified global-workflow\scripts\exgfs_wave_post_gridded_sbs.sh
AntonMFernando-NOAA Oct 18, 2024
027e79f
modifed gefs_tasks.py
AntonMFernando-NOAA Oct 18, 2024
f75bbf3
modified global-workflow\scripts\exgfs_wave_post_gridded_sbs.sh
AntonMFernando-NOAA Oct 18, 2024
b408e75
corrected a typo
AntonMFernando-NOAA Oct 19, 2024
d96631e
mdified global-workflow\scripts\exgfs_wave_post_gridded_sbs.sh
AntonMFernando-NOAA Oct 19, 2024
08c4f12
modified gefs_tasks.py
AntonMFernando-NOAA Oct 19, 2024
bc74e49
modified gefs_tasks.py
AntonMFernando-NOAA Oct 19, 2024
99869ed
updated wavepostsbs.sh
AntonMFernando-NOAA Oct 19, 2024
8b9d5d1
Merge branch 'develop' into feature/wave_post_grid
AntonMFernando-NOAA Oct 21, 2024
2646773
Merge branch 'feature/wave_post_grid' of https://github.com/AntonMFer…
AntonMFernando-NOAA Oct 22, 2024
f31c4c1
add changes
AntonMFernando-NOAA Oct 22, 2024
4f58676
Merge branch 'NOAA-EMC:develop' into feature/wave_post_grid
AntonMFernando-NOAA Oct 23, 2024
bed6e67
Merge branch 'NOAA-EMC:develop' into feature/wave_post_grid
AntonMFernando-NOAA Oct 24, 2024
e742c7d
Merge branch 'NOAA-EMC:develop' into feature/wave_post_grid
AntonMFernando-NOAA Oct 24, 2024
bd34f6c
Merge branch 'NOAA-EMC:develop' into feature/wave_post_grid
AntonMFernando-NOAA Oct 25, 2024
a0f6cfd
shifted FORECAST_HOUR to scripts/
AntonMFernando-NOAA Oct 26, 2024
901a299
modified jobs\rocoto\wavepostsbs.sh
AntonMFernando-NOAA Oct 26, 2024
4fc487b
modifed jobs\rocoto\wavepostsbs.sh
AntonMFernando-NOAA Oct 26, 2024
f9ed53e
modified jobs\rocoto\wavepostsbs.sh
AntonMFernando-NOAA Oct 26, 2024
55171ec
Merge branch 'develop' into feature/wave_post_grid
AntonMFernando-NOAA Oct 28, 2024
12619c9
Merge branch 'develop' into feature/wave_post_grid
AntonMFernando-NOAA Oct 29, 2024
b78ea08
modify scripts\exgfs_wave_post_gridded_sbs.sh
AntonMFernando-NOAA Oct 29, 2024
232d438
modified scripts\exgfs_wave_post_gridded_sbs.sh
AntonMFernando-NOAA Oct 29, 2024
f7c4ba4
Merge branch 'NOAA-EMC:develop' into feature/wave_post_grid
AntonMFernando-NOAA Oct 30, 2024
2e4d298
Merge branch 'develop' into feature/wave_post_grid
AntonMFernando-NOAA Oct 30, 2024
1028319
modified scripts\exgfs_wave_post_gridded_sbs.sh
AntonMFernando-NOAA Oct 30, 2024
4fe0e52
Merge branch 'feature/wave_post_grid' of https://github.com/AntonMFer…
AntonMFernando-NOAA Oct 30, 2024
95d2532
modified scripts\exgfs_wave_post_gridded_sbs.sh
AntonMFernando-NOAA Oct 31, 2024
bda6124
Merge branch 'NOAA-EMC:develop' into feature/wave_post_grid
AntonMFernando-NOAA Oct 31, 2024
8cbffe5
modified gfs_tasks.py
AntonMFernando-NOAA Oct 31, 2024
50550e4
Merge branch 'feature/wave_post_grid' of https://github.com/AntonMFer…
AntonMFernando-NOAA Oct 31, 2024
bcd3386
Merge branch 'NOAA-EMC:develop' into feature/wave_post_grid
AntonMFernando-NOAA Oct 31, 2024
bad7250
modified gfs_tasks.py
AntonMFernando-NOAA Oct 31, 2024
8a0833b
Merge branch 'feature/wave_post_grid' of https://github.com/AntonMFer…
AntonMFernando-NOAA Oct 31, 2024
4db4b82
modified workflow\rocoto\gfs_tasks.py
AntonMFernando-NOAA Oct 31, 2024
96934ca
modified gfs_tasks.py
AntonMFernando-NOAA Oct 31, 2024
cb6881d
modified workflow\rocoto\gfs_tasks.py
AntonMFernando-NOAA Oct 31, 2024
d378f80
modified scripts\exgfs_wave_post_gridded_sbs.sh
AntonMFernando-NOAA Oct 31, 2024
636e44c
Merge branch 'NOAA-EMC:develop' into feature/wave_post_grid
AntonMFernando-NOAA Nov 1, 2024
dc6049e
Merge branch 'NOAA-EMC:develop' into feature/wave_post_grid
AntonMFernando-NOAA Nov 1, 2024
d279aa2
modifed workflow\rocoto\gfs_tasks.py
AntonMFernando-NOAA Nov 1, 2024
a9fb44d
Merge branch 'feature/wave_post_grid' of https://github.com/AntonMFer…
AntonMFernando-NOAA Nov 1, 2024
a179f2b
modified workflow\rocoto\gfs_tasks.py
AntonMFernando-NOAA Nov 1, 2024
88c4cce
Merge branch 'develop' into feature/wave_post_grid
AntonMFernando-NOAA Nov 1, 2024
2446ff3
Merge branch 'NOAA-EMC:develop' into feature/wave_post_grid
AntonMFernando-NOAA Nov 4, 2024
d8a38e6
modified task.py
AntonMFernando-NOAA Nov 8, 2024
9fce025
Merge branch 'feature/wave_post_grid' of https://github.com/AntonMFer…
AntonMFernando-NOAA Nov 8, 2024
fbd9d1d
modified scripts\exgfs_wave_post_gridded_sbs.sh
AntonMFernando-NOAA Nov 8, 2024
c964cd9
modified scripts\exgfs_wave_post_gridded_sbs.sh
AntonMFernando-NOAA Nov 8, 2024
6e35150
modified workflow\rocoto\gefs_tasks.py
AntonMFernando-NOAA Nov 8, 2024
a200dc4
modified scripts\exgfs_wave_post_gridded_sbs.sh
AntonMFernando-NOAA Nov 8, 2024
a539824
Merge branch 'develop' into feature/wave_post_grid
AntonMFernando-NOAA Nov 9, 2024
1c76d46
Merge branch 'NOAA-EMC:develop' into feature/wave_post_grid
AntonMFernando-NOAA Nov 12, 2024
ba95d05
modified gfs_tasks.py
AntonMFernando-NOAA Nov 13, 2024
a021e49
modified workflow\rocoto\gfs_tasks.py
AntonMFernando-NOAA Nov 13, 2024
5475b3d
Merge branch 'NOAA-EMC:develop' into feature/wave_post_grid
AntonMFernando-NOAA Nov 13, 2024
e496104
Merge branch 'feature/wave_post_grid' of https://github.com/AntonMFer…
AntonMFernando-NOAA Nov 13, 2024
f7f2e12
modified tasks.pys
AntonMFernando-NOAA Nov 13, 2024
2b6ace8
Merge branch 'NOAA-EMC:develop' into feature/wave_post_grid
AntonMFernando-NOAA Nov 13, 2024
1bff784
Merge branch 'NOAA-EMC:develop' into feature/wave_post_grid
AntonMFernando-NOAA Nov 14, 2024
3dd2264
Merge branch 'develop' into feature/wave_post_grid
AntonMFernando-NOAA Nov 15, 2024
0e1450e
Merge branch 'develop' into feature/wave_post_grid
AntonMFernando-NOAA Nov 15, 2024
4004070
modified tasks.py's
AntonMFernando-NOAA Nov 16, 2024
6b9ead0
Merge branch 'feature/wave_post_grid' of https://github.com/AntonMFer…
AntonMFernando-NOAA Nov 16, 2024
0a6d6eb
modified gefs_tasks.py
AntonMFernando-NOAA Nov 17, 2024
4a762d4
modified tasks.py
AntonMFernando-NOAA Nov 17, 2024
b438538
modified tasks.py
AntonMFernando-NOAA Nov 17, 2024
c259f11
modified tasks.py
AntonMFernando-NOAA Nov 18, 2024
2cae70f
modified tasks.py
AntonMFernando-NOAA Nov 18, 2024
cdb484d
modified tasks.py
AntonMFernando-NOAA Nov 18, 2024
0985bdc
modified tasks.py
AntonMFernando-NOAA Nov 18, 2024
5ff370f
modified tasks.py
AntonMFernando-NOAA Nov 18, 2024
9cb01ac
modified tasks.py
AntonMFernando-NOAA Nov 18, 2024
c5c86ba
modified tasks.py
AntonMFernando-NOAA Nov 18, 2024
44f7c83
modified tasks.py
AntonMFernando-NOAA Nov 18, 2024
b417419
modifed tasks.py
AntonMFernando-NOAA Nov 18, 2024
413da23
modified tasks.py
AntonMFernando-NOAA Nov 18, 2024
b8506c0
modified tasks.py
AntonMFernando-NOAA Nov 18, 2024
da1aae2
modified tasks.py
AntonMFernando-NOAA Nov 18, 2024
aa8ff13
typo
AntonMFernando-NOAA Nov 18, 2024
a75b23a
modified gefs_tasks.py
AntonMFernando-NOAA Nov 18, 2024
bcc6d28
modified scripts\exgfs_wave_post_gridded_sbs.sh
AntonMFernando-NOAA Nov 19, 2024
eae8c31
modified scripts\exgfs_wave_post_gridded_sbs.sh
AntonMFernando-NOAA Nov 19, 2024
d5275b1
modified scripts\exgfs_wave_post_gridded_sbs.sh
AntonMFernando-NOAA Nov 19, 2024
47e3244
modified scripts\exgfs_wave_post_gridded_sbs.sh
AntonMFernando-NOAA Nov 19, 2024
3300452
modified tasks.py and config.base
AntonMFernando-NOAA Nov 19, 2024
761530c
Update workflow/rocoto/gefs_tasks.py
AntonMFernando-NOAA Nov 19, 2024
7678e7c
updated tasks.py
AntonMFernando-NOAA Nov 19, 2024
7ffa203
Merge branch 'develop' into feature/wave_post_grid
AntonMFernando-NOAA Nov 19, 2024
964d52f
modified gefs_tasks.py
AntonMFernando-NOAA Nov 19, 2024
aac2bb6
modified tasks.py
AntonMFernando-NOAA Nov 19, 2024
1d48261
modified tasks.py
AntonMFernando-NOAA Nov 19, 2024
628eac7
modified tasks.py
AntonMFernando-NOAA Nov 19, 2024
5cb4cc6
updaed config.base
AntonMFernando-NOAA Nov 19, 2024
9950b14
Merge branch 'develop' into feature/wave_post_grid
AntonMFernando-NOAA Nov 19, 2024
8ddc19d
modified scripts\exgfs_wave_post_gridded_sbs.sh
AntonMFernando-NOAA Nov 20, 2024
571236f
Merge branch 'feature/wave_post_grid' of https://github.com/AntonMFer…
AntonMFernando-NOAA Nov 20, 2024
8f2dcd3
modified config.base
AntonMFernando-NOAA Nov 20, 2024
fdeefb7
modified tasks.py
AntonMFernando-NOAA Nov 20, 2024
fb9f754
modified gefs_tasks.py
AntonMFernando-NOAA Nov 20, 2024
316b06d
modified workflow\rocoto\gefs_tasks.py
AntonMFernando-NOAA Nov 20, 2024
7347495
cleared typos
AntonMFernando-NOAA Nov 20, 2024
312fb21
modified scripts\exgfs_wave_post_gridded_sbs.sh
AntonMFernando-NOAA Nov 20, 2024
2cfd303
modified scripts\exgfs_wave_post_gridded_sbs.sh
AntonMFernando-NOAA Nov 20, 2024
1030007
modified scripts\exgfs_wave_post_gridded_sbs.sh
AntonMFernando-NOAA Nov 20, 2024
df5fbd0
updated scripts\exgfs_wave_post_gridded_sbs.sh
AntonMFernando-NOAA Nov 21, 2024
48e810e
Merge branch 'develop' into feature/wave_post_grid
AntonMFernando-NOAA Nov 22, 2024
56f1111
modified config.base for gefs and gfs
AntonMFernando-NOAA Nov 22, 2024
cc4f97a
modified parm\config\gfs\config.base
AntonMFernando-NOAA Nov 22, 2024
41c423d
modified config.base
AntonMFernando-NOAA Nov 22, 2024
0b8c09b
modified parm\config\gefs\config.base
AntonMFernando-NOAA Nov 22, 2024
39da04d
modified parm\config\gefs\config.base
AntonMFernando-NOAA Nov 22, 2024
64a2c91
Merge branch 'develop' into feature/wave_post_grid
AntonMFernando-NOAA Nov 23, 2024
7bf1a83
modified parm\config\gfs\config.base
AntonMFernando-NOAA Nov 23, 2024
c8cdde1
Merge branch 'feature/wave_post_grid' of https://github.com/AntonMFer…
AntonMFernando-NOAA Nov 23, 2024
bfbc940
modified config.base for gfs
AntonMFernando-NOAA Nov 23, 2024
5a899c8
modified config.base for gfs
AntonMFernando-NOAA Nov 23, 2024
d774de8
Merge branch 'develop' into feature/wave_post_grid
AntonMFernando-NOAA Nov 25, 2024
f1a7995
modified config.base for gefs and gfs
AntonMFernando-NOAA Nov 26, 2024
4b0523b
modified parm\config\gfs\config.base
AntonMFernando-NOAA Nov 26, 2024
f4d8b23
modified gefs_tasks.py and gfs_tasks.py
AntonMFernando-NOAA Nov 26, 2024
232027f
Merge branch 'develop' into feature/wave_post_grid
AntonMFernando-NOAA Nov 26, 2024
4c05ca7
Merge branch 'develop' into feature/wave_post_grid
AntonMFernando-NOAA Nov 26, 2024
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
4 changes: 4 additions & 0 deletions parm/config/gefs/config.base
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,10 @@ export FHOUT_WAV=3
export FHMAX_HF_WAV=120
export FHOUT_HF_WAV=1
export FHMAX_WAV=${FHMAX_GFS}
export FHMAX_WAV_GFS=${FHMAX_GFS}
export FHMAX_HF_GFS=$(( FHMAX_HF_GFS > FHMAX_GFS ? FHMAX_GFS : FHMAX_HF_GFS ))
export FHMAX_WAV_GFS=$(( FHMAX_WAV_GFS > FHMAX_GFS ? FHMAX_GFS : FHMAX_WAV_GFS ))
export FHMAX_HF_WAV=$(( FHMAX_HF_WAV > FHMAX_WAV_GFS ? FHMAX_WAV_GFS : FHMAX_HF_WAV ))
export ILPOST=1 # gempak output frequency up to F120

export FHMIN_ENKF=${FHMIN_GFS}
Expand Down
4 changes: 4 additions & 0 deletions parm/config/gfs/config.base
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,10 @@ export FHMAX_HF_WAV=120
export FHOUT_HF_WAV=1
export FHMAX_WAV=${FHMAX:-9}
export FHMAX_WAV_GFS=${FHMAX_GFS}
export FHMAX_HF_GFS=$(( FHMAX_HF_GFS > FHMAX_GFS ? FHMAX_GFS : FHMAX_HF_GFS ))
export FHMAX_WAV=$(( FHMAX_WAV > FHMAX ? FHMAX : FHMAX_WAV ))
export FHMAX_WAV_GFS=$(( FHMAX_WAV_GFS > FHMAX_GFS ? FHMAX_GFS : FHMAX_WAV_GFS ))
export FHMAX_HF_WAV=$(( FHMAX_HF_WAV > FHMAX_WAV_GFS ? FHMAX_WAV_GFS : FHMAX_HF_WAV ))

# TODO: Change gempak to use standard out variables (#2348)
export ILPOST=${FHOUT_HF_GFS} # gempak output frequency up to F120
Expand Down
332 changes: 151 additions & 181 deletions scripts/exgfs_wave_post_gridded_sbs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -217,219 +217,189 @@ source "${USHgfs}/preamble.sh"
set +x
echo ' Making command file for sbs grib2 and GRID Interpolation '
set_trace

# 1.a.2 Loop over forecast time to generate post files
# When executed side-by-side, serial mode (cfp when run after the fcst step)
# Contingency for RERUN=YES
if [ "${RERUN-NO}" = "YES" ]; then
fhr=$((FHRUN + FHMIN_WAV))
if [ $FHMAX_HF_WAV -gt 0 ] && [ $FHOUT_HF_WAV -gt 0 ] && [ $fhr -lt $FHMAX_HF_WAV ]; then
FHINCG=$FHOUT_HF_WAV
else
FHINCG=$FHOUT_WAV
fi
fhr=$((fhr + FHINCG))
else
fhr=$FHMIN_WAV
fi
fhr=$(( 10#${FHR3} ))
fhrg=$fhr
sleep_interval=10
iwaitmax=120 # Maximum loop cycles for waiting until wave component output file is ready (fails after max)
while [ $fhr -le $FHMAX_WAV ]; do
ymdh=$($NDATE $fhr ${PDY}${cyc})
YMD=$(echo $ymdh | cut -c1-8)
HMS="$(echo $ymdh | cut -c9-10)0000"
YMDHMS=${YMD}${HMS}
FH3=$(printf %03i $fhr)

ymdh=$($NDATE $fhr ${PDY}${cyc})
YMD=$(echo $ymdh | cut -c1-8)
HMS="$(echo $ymdh | cut -c9-10)0000"
YMDHMS=${YMD}${HMS}
FH3=$(printf %03i $fhr)

fcmdnow=cmdfile.${FH3}
fcmdigrd=icmdfile.${FH3}
mkdir output_$YMDHMS
cd output_$YMDHMS
rm -f ${fcmdnow} ${fcmdigrd}
touch ${fcmdnow} ${fcmdigrd}
fcmdnow=cmdfile.${FH3}
fcmdigrd=icmdfile.${FH3}
mkdir output_$YMDHMS
cd output_$YMDHMS
rm -f ${fcmdnow} ${fcmdigrd}
touch ${fcmdnow} ${fcmdigrd}


# Create instances of directories for gridded output
export GRIBDATA=${DATA}/output_$YMDHMS
export GRDIDATA=${DATA}/output_$YMDHMS
export GRIBDATA=${DATA}/output_$YMDHMS
export GRDIDATA=${DATA}/output_$YMDHMS

# Gridded data (main part, need to be run side-by-side with forecast

if [ $fhr = $fhrg ]
then
for wavGRD in ${waveGRD}; do
gfile="${COMIN_WAVE_HISTORY}/${WAV_MOD_TAG}.out_grd.${wavGRD}.${YMD}.${HMS}"
if ! wait_for_file "${gfile}" "${sleep_interval}" "${iwaitmax}"; then
echo " FATAL ERROR : NO RAW FIELD OUTPUT FILE out_grd.${grdID}"
echo "${WAV_MOD_TAG} post ${grdID} ${PDY} ${cycle} : field output missing."

if [ $fhr = $fhrg ]
then
for wavGRD in ${waveGRD}; do
Fixed Show fixed Hide fixed
gfile="${COMIN_WAVE_HISTORY}/${WAV_MOD_TAG}.out_grd.${wavGRD}.${YMD}.${HMS}"
if [[ ! -s "${gfile}" ]]; then
echo " FATAL ERROR : NO RAW FIELD OUTPUT FILE ${gfile}"
err=3; export err; "${errchk}"
exit "${err}"
fi
${NLN} "${gfile}" "./out_grd.${wavGRD}"
done

if [ "$DOGRI_WAV" = 'YES' ]
then
nigrd=1
for grdID in $waveinterpGRD
do
ymdh_int=$($NDATE -${WAVHINDH} $ymdh); dt_int=3600.; n_int=9999 ;
echo "${USHgfs}/wave_grid_interp_sbs.sh $grdID $ymdh_int $dt_int $n_int > grint_$grdID.out 2>&1" >> ${fcmdigrd}.${nigrd}
if [ "$DOGRB_WAV" = 'YES' ]
then
gribFL=\'$(echo ${OUTPARS_WAV})\'
case $grdID in
glo_15mxt) GRDNAME='global' ; GRDRES=0p25 ; GRIDNR=255 ; MODNR=11 ;;
reg025) GRDNAME='global' ; GRDRES=0p25 ; GRIDNR=255 ; MODNR=11 ;;
glo_025) GRDNAME='global' ; GRDRES=0p25 ; GRIDNR=255 ; MODNR=11 ;;
glo_100) GRDNAME='global' ; GRDRES=1p00 ; GRIDNR=255 ; MODNR=11 ;;
glo_200) GRDNAME='global' ; GRDRES=2p00 ; GRIDNR=255 ; MODNR=11 ;;
glo_500) GRDNAME='global' ; GRDRES=5p00 ; GRIDNR=255 ; MODNR=11 ;;
glo_30mxt) GRDNAME='global' ; GRDRES=0p50 ; GRIDNR=255 ; MODNR=11 ;;
glo_30m) GRDNAME='global' ; GRDRES=0p50 ; GRIDNR=255 ; MODNR=11 ;;
at_10m) GRDNAME='atlocn' ; GRDRES=0p16 ; GRIDNR=255 ; MODNR=11 ;;
ep_10m) GRDNAME='epacif' ; GRDRES=0p16 ; GRIDNR=255 ; MODNR=11 ;;
wc_10m) GRDNAME='wcoast' ; GRDRES=0p16 ; GRIDNR=255 ; MODNR=11 ;;
ak_10m) GRDNAME='alaska' ; GRDRES=0p16 ; GRIDNR=255 ; MODNR=11 ;;
esac
echo "${USHgfs}/wave_grib2_sbs.sh $grdID $GRIDNR $MODNR $ymdh $fhr $GRDNAME $GRDRES $gribFL > grib_$grdID.out 2>&1" >> ${fcmdigrd}.${nigrd}
fi
echo "${GRIBDATA}/${fcmdigrd}.${nigrd}" >> ${fcmdnow}
chmod 744 ${fcmdigrd}.${nigrd}
nigrd=$((nigrd+1))
done
fi
${NLN} "${gfile}" "./out_grd.${wavGRD}"
done
Fixed Show fixed Hide fixed
Fixed Show fixed Hide fixed

if [ "$DOGRB_WAV" = 'YES' ]
then
for grdID in ${wavepostGRD} # First concatenate grib files for sbs grids
do
if [ "$DOGRI_WAV" = 'YES' ]
then
nigrd=1
for grdID in $waveinterpGRD
do
ymdh_int=$($NDATE -${WAVHINDH} $ymdh); dt_int=3600.; n_int=9999 ;
echo "${USHgfs}/wave_grid_interp_sbs.sh $grdID $ymdh_int $dt_int $n_int > grint_$grdID.out 2>&1" >> ${fcmdigrd}.${nigrd}
if [ "$DOGRB_WAV" = 'YES' ]
then
gribFL=\'$(echo ${OUTPARS_WAV})\'
case $grdID in
aoc_9km) GRDNAME='arctic' ; GRDRES=9km ; GRIDNR=255 ; MODNR=11 ;;
ant_9km) GRDNAME='antarc' ; GRDRES=9km ; GRIDNR=255 ; MODNR=11 ;;
glo_10m) GRDNAME='global' ; GRDRES=0p16 ; GRIDNR=255 ; MODNR=11 ;;
gnh_10m) GRDNAME='global' ; GRDRES=0p16 ; GRIDNR=255 ; MODNR=11 ;;
gsh_15m) GRDNAME='gsouth' ; GRDRES=0p25 ; GRIDNR=255 ; MODNR=11 ;;
glo_15m) GRDNAME='global' ; GRDRES=0p25 ; GRIDNR=255 ; MODNR=11 ;;
ao_20m) GRDNAME='arctic' ; GRDRES=0p33 ; GRIDNR=255 ; MODNR=11 ;;
so_20m) GRDNAME='antarc' ; GRDRES=0p33 ; GRIDNR=255 ; MODNR=11 ;;
glo_15mxt) GRDNAME='global' ; GRDRES=0p25 ; GRIDNR=255 ; MODNR=11 ;;
reg025) GRDNAME='global' ; GRDRES=0p25 ; GRIDNR=255 ; MODNR=11 ;;
glo_025) GRDNAME='global' ; GRDRES=0p25 ; GRIDNR=255 ; MODNR=11 ;;
glo_100) GRDNAME='global' ; GRDRES=1p00 ; GRIDNR=255 ; MODNR=11 ;;
glo_200) GRDNAME='global' ; GRDRES=2p00 ; GRIDNR=255 ; MODNR=11 ;;
glo_500) GRDNAME='global' ; GRDRES=5p00 ; GRIDNR=255 ; MODNR=11 ;;
gwes_30m) GRDNAME='global' ; GRDRES=0p50 ; GRIDNR=255 ; MODNR=10 ;;
glo_15mxt) GRDNAME='global' ; GRDRES=0p25 ; GRIDNR=255 ; MODNR=11 ;;
reg025) GRDNAME='global' ; GRDRES=0p25 ; GRIDNR=255 ; MODNR=11 ;;
glo_025) GRDNAME='global' ; GRDRES=0p25 ; GRIDNR=255 ; MODNR=11 ;;
glo_100) GRDNAME='global' ; GRDRES=1p00 ; GRIDNR=255 ; MODNR=11 ;;
glo_200) GRDNAME='global' ; GRDRES=2p00 ; GRIDNR=255 ; MODNR=11 ;;
glo_500) GRDNAME='global' ; GRDRES=5p00 ; GRIDNR=255 ; MODNR=11 ;;
glo_30mxt) GRDNAME='global' ; GRDRES=0p50 ; GRIDNR=255 ; MODNR=11 ;;
glo_30m) GRDNAME='global' ; GRDRES=0p50 ; GRIDNR=255 ; MODNR=11 ;;
at_10m) GRDNAME='atlocn' ; GRDRES=0p16 ; GRIDNR=255 ; MODNR=11 ;;
ep_10m) GRDNAME='epacif' ; GRDRES=0p16 ; GRIDNR=255 ; MODNR=11 ;;
wc_10m) GRDNAME='wcoast' ; GRDRES=0p16 ; GRIDNR=255 ; MODNR=11 ;;
ak_10m) GRDNAME='alaska' ; GRDRES=0p16 ; GRIDNR=255 ; MODNR=11 ;;
esac
echo "${USHgfs}/wave_grib2_sbs.sh $grdID $GRIDNR $MODNR $ymdh $fhr $GRDNAME $GRDRES $gribFL > grib_$grdID.out 2>&1" >> ${fcmdnow}
done
fi

echo "${USHgfs}/wave_grib2_sbs.sh $grdID $GRIDNR $MODNR $ymdh $fhr $GRDNAME $GRDRES $gribFL > grib_$grdID.out 2>&1" >> ${fcmdigrd}.${nigrd}
fi
echo "${GRIBDATA}/${fcmdigrd}.${nigrd}" >> ${fcmdnow}
chmod 744 ${fcmdigrd}.${nigrd}
nigrd=$((nigrd+1))
done
fi

if [ ${CFP_MP:-"NO"} = "YES" ]; then
nfile=0
ifile=0
iline=1
ifirst='yes'
nlines=$( wc -l ${fcmdnow} | awk '{print $1}' )
while [ $iline -le $nlines ]; do
line=$( sed -n ''$iline'p' ${fcmdnow} )
if [ -z "$line" ]; then
break
else
if [ "$ifirst" = 'yes' ]; then
echo "#!/bin/sh" > cmdmfile.$nfile
echo "$nfile cmdmfile.$nfile" >> cmdmprog
chmod 744 cmdmfile.$nfile
fi
echo $line >> cmdmfile.$nfile
nfile=$(( nfile + 1 ))
if [ $nfile -eq $NTASKS ]; then
nfile=0
ifirst='no'
fi
iline=$(( iline + 1 ))
fi
if [ "$DOGRB_WAV" = 'YES' ]
then
for grdID in ${wavepostGRD} # First concatenate grib files for sbs grids
do
gribFL=\'$(echo ${OUTPARS_WAV})\'
case $grdID in
aoc_9km) GRDNAME='arctic' ; GRDRES=9km ; GRIDNR=255 ; MODNR=11 ;;
ant_9km) GRDNAME='antarc' ; GRDRES=9km ; GRIDNR=255 ; MODNR=11 ;;
glo_10m) GRDNAME='global' ; GRDRES=0p16 ; GRIDNR=255 ; MODNR=11 ;;
gnh_10m) GRDNAME='global' ; GRDRES=0p16 ; GRIDNR=255 ; MODNR=11 ;;
gsh_15m) GRDNAME='gsouth' ; GRDRES=0p25 ; GRIDNR=255 ; MODNR=11 ;;
glo_15m) GRDNAME='global' ; GRDRES=0p25 ; GRIDNR=255 ; MODNR=11 ;;
ao_20m) GRDNAME='arctic' ; GRDRES=0p33 ; GRIDNR=255 ; MODNR=11 ;;
so_20m) GRDNAME='antarc' ; GRDRES=0p33 ; GRIDNR=255 ; MODNR=11 ;;
glo_15mxt) GRDNAME='global' ; GRDRES=0p25 ; GRIDNR=255 ; MODNR=11 ;;
reg025) GRDNAME='global' ; GRDRES=0p25 ; GRIDNR=255 ; MODNR=11 ;;
glo_025) GRDNAME='global' ; GRDRES=0p25 ; GRIDNR=255 ; MODNR=11 ;;
glo_100) GRDNAME='global' ; GRDRES=1p00 ; GRIDNR=255 ; MODNR=11 ;;
glo_200) GRDNAME='global' ; GRDRES=2p00 ; GRIDNR=255 ; MODNR=11 ;;
JessicaMeixner-NOAA marked this conversation as resolved.
Show resolved Hide resolved
glo_500) GRDNAME='global' ; GRDRES=5p00 ; GRIDNR=255 ; MODNR=11 ;;
gwes_30m) GRDNAME='global' ; GRDRES=0p50 ; GRIDNR=255 ; MODNR=10 ;;
esac
echo "${USHgfs}/wave_grib2_sbs.sh $grdID $GRIDNR $MODNR $ymdh $fhr $GRDNAME $GRDRES $gribFL > grib_$grdID.out 2>&1" >> ${fcmdnow}
done
fi

wavenproc=$(wc -l ${fcmdnow} | awk '{print $1}')
wavenproc=$(echo $((${wavenproc}<${NTASKS}?${wavenproc}:${NTASKS})))
fi

if [ ${CFP_MP:-"NO"} = "YES" ]; then
nfile=0
ifile=0
iline=1
ifirst='yes'
nlines=$( wc -l ${fcmdnow} | awk '{print $1}' )
while [ $iline -le $nlines ]; do
line=$( sed -n ''$iline'p' ${fcmdnow} )
if [ -z "$line" ]; then
break
else
if [ "$ifirst" = 'yes' ]; then
echo "#!/bin/sh" > cmdmfile.$nfile
echo "$nfile cmdmfile.$nfile" >> cmdmprog
chmod 744 "cmdmfile.$nfile"
fi
echo $line >> "cmdmfile.$nfile"
nfile=$(( nfile + 1 ))
if [ "$nfile" -eq "$NTASKS" ]; then
nfile=0
ifirst='no'
fi
iline=$(( iline + 1 ))
fi
done
fi

wavenproc=$(wc -l ${fcmdnow} | awk '{print $1}')
wavenproc=$(echo $((${wavenproc}<${NTASKS}?${wavenproc}:${NTASKS})))

set +x
echo ' '
echo " Executing the grib2_sbs scripts at : $(date)"
echo ' ------------------------------------'
echo ' '
set_trace

if [ "$wavenproc" -gt '1' ]
then
if [ ${CFP_MP:-"NO"} = "YES" ]; then
${wavempexec} -n ${wavenproc} ${wave_mpmd} cmdmprog
else
${wavempexec} ${wavenproc} ${wave_mpmd} ${fcmdnow}
fi
exit=$?
else
chmod 744 ${fcmdnow}
./${fcmdnow}
exit=$?
fi

if [ "$exit" != '0' ]
then
set +x
echo ' '
echo " Executing the grib2_sbs scripts at : $(date)"
echo ' ------------------------------------'
echo '*************************************'
echo '*** FATAL ERROR: CMDFILE FAILED ***'
echo '*************************************'
echo ' See Details Below '
echo ' '
set_trace
err=4; export err;${errchk}
exit "$err"
fi

if [ "$wavenproc" -gt '1' ]
then
if [ ${CFP_MP:-"NO"} = "YES" ]; then
${wavempexec} -n ${wavenproc} ${wave_mpmd} cmdmprog
else
${wavempexec} ${wavenproc} ${wave_mpmd} ${fcmdnow}
fi
exit=$?
else
chmod 744 ${fcmdnow}
./${fcmdnow}
exit=$?
fi
rm -f out_grd.* # Remove large binary grid output files

if [ "$exit" != '0' ]
then
cd $DATA


if [ "$fhr" = "$fhrg" ]
then
# Check if grib2 file created
ENSTAG=""
if [ ${waveMEMB} ]; then ENSTAG=".${membTAG}${waveMEMB}" ; fi
gribchk="${RUN}wave.${cycle}${ENSTAG}.${GRDNAME}.${GRDRES}.f${FH3}.grib2"
if [ ! -s ${COMOUT_WAVE_GRID}/${gribchk} ]; then
set +x
echo ' '
echo '*************************************'
echo '*** FATAL ERROR: CMDFILE FAILED ***'
echo '*************************************'
echo '********************************************'
echo "*** FATAL ERROR: $gribchk not generated "
echo '********************************************'
echo ' See Details Below '
echo ' '
set_trace
err=4; export err;${errchk}
exit $err
fi

rm -f out_grd.* # Remove large binary grid output files

cd $DATA

FHINCG=$(( DTFLD_WAV / 3600 ))
if [ $fhr = $fhrg ]
then
# Check if grib2 file created
ENSTAG=""
if [ ${waveMEMB} ]; then ENSTAG=".${membTAG}${waveMEMB}" ; fi
gribchk="${RUN}wave.${cycle}${ENSTAG}.${GRDNAME}.${GRDRES}.f${FH3}.grib2"
if [ ! -s ${COMOUT_WAVE_GRID}/${gribchk} ]; then
set +x
echo ' '
echo '********************************************'
echo "*** FATAL ERROR: $gribchk not generated "
echo '********************************************'
echo ' See Details Below '
echo ' '
set_trace
err=5; export err;${errchk}
exit $err
fi
if [ $FHMAX_HF_WAV -gt 0 ] && [ $FHOUT_HF_WAV -gt 0 ] && [ $fhr -lt $FHMAX_HF_WAV ]; then
FHINCG=$FHOUT_HF_WAV
else
FHINCG=$FHOUT_WAV
fi
fhrg=$((fhr+FHINCG))
err=5; export err;${errchk}
exit "$err"
fi
echo $fhrg

fhr=$fhrg #loop with out_grd stride

done
fi

# --------------------------------------------------------------------------- #
# 7. Ending output
Expand Down
Loading