Skip to content

Commit

Permalink
Fixed several bugs in using parallel prdgen for NA3km grid. (NOAA-EMC…
Browse files Browse the repository at this point in the history
…#468)

Fixed a bug a workflow for cold start ensemble forecast.
  • Loading branch information
hu5970 authored Dec 29, 2022
1 parent efa8e81 commit a0cd84e
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 18 deletions.
5 changes: 5 additions & 0 deletions modulefiles/tasks/wcoss2/run_prdgen.local
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#%Module

module load python/3.8.6
module load cfp/2.0.4

42 changes: 25 additions & 17 deletions scripts/exregional_run_prdgen.sh
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,13 @@ fi
# and hh are calculated above, i.e. start_date is just cdate but with a
# space inserted between the dd and hh. If so, just use "$yyyymmdd $hh"
# instead of calling sed.

gridname=""
if [ ${PREDEF_GRID_NAME} = "RRFS_CONUS_3km" ]; then
gridname="conus_3km."
elif [ ${PREDEF_GRID_NAME} = "RRFS_NA_3km" ]; then
gridname=""
fi
basetime=$( date +%y%j%H%M -d "${yyyymmdd} ${hh}" )
cp_vrfy ${bgdawp} ${comout}/${NET}.t${cyc}z.bgdawpf${fhr}.${tmmark}.grib2
cp_vrfy ${bgrd3d} ${comout}/${NET}.t${cyc}z.bgrd3df${fhr}.${tmmark}.grib2
Expand All @@ -235,14 +242,14 @@ ln_vrfy -sf --relative ${comout}/${NET}.t${cyc}z.bgifif${fhr}.${tmmark}.grib2 ${
ln_vrfy -sf --relative ${comout}/${NET}.t${cyc}z.bgsfcf${fhr}.${tmmark}.grib2 ${comout}/BGSFC_${basetime}${post_fhr}

net4=$(echo ${NET:0:4} | tr '[:upper:]' '[:lower:]')
ln_vrfy -sf --relative ${comout}/${NET}.t${cyc}z.bgdawpf${fhr}.${tmmark}.grib2 ${comout}/${net4}.t${cyc}z.prslev.f${fhr}.conus_3km.grib2
wgrib2 ${comout}/${net4}.t${cyc}z.prslev.f${fhr}.conus_3km.grib2 -s > ${comout}/${net4}.t${cyc}z.prslev.f${fhr}.conus_3km.grib2.idx
ln_vrfy -sf --relative ${comout}/${NET}.t${cyc}z.bgrd3df${fhr}.${tmmark}.grib2 ${comout}/${net4}.t${cyc}z.natlev.f${fhr}.conus_3km.grib2
wgrib2 ${comout}/${net4}.t${cyc}z.natlev.f${fhr}.conus_3km.grib2 -s > ${comout}/${net4}.t${cyc}z.natlev.f${fhr}.conus_3km.grib2.idx
ln_vrfy -sf --relative ${comout}/${NET}.t${cyc}z.bgifif${fhr}.${tmmark}.grib2 ${comout}/${net4}.t${cyc}z.ififip.f${fhr}.conus_3km.grib2
wgrib2 ${comout}/${net4}.t${cyc}z.ififip.f${fhr}.conus_3km.grib2 -s > ${comout}/${net4}.t${cyc}z.ififip.f${fhr}.conus_3km.grib2.idx
ln_vrfy -sf --relative ${comout}/${NET}.t${cyc}z.bgsfcf${fhr}.${tmmark}.grib2 ${comout}/${net4}.t${cyc}z.testbed.f${fhr}.conus_3km.grib2
wgrib2 ${comout}/${net4}.t${cyc}z.testbed.f${fhr}.conus_3km.grib2 -s > ${comout}/${net4}.t${cyc}z.testbed.f${fhr}.conus_3km.grib2.idx
ln_vrfy -sf --relative ${comout}/${NET}.t${cyc}z.bgdawpf${fhr}.${tmmark}.grib2 ${comout}/${net4}.t${cyc}z.prslev.f${fhr}.${gridname}grib2
wgrib2 ${comout}/${net4}.t${cyc}z.prslev.f${fhr}.${gridname}grib2 -s > ${comout}/${net4}.t${cyc}z.prslev.f${fhr}.${gridname}grib2.idx
ln_vrfy -sf --relative ${comout}/${NET}.t${cyc}z.bgrd3df${fhr}.${tmmark}.grib2 ${comout}/${net4}.t${cyc}z.natlev.f${fhr}.${gridname}grib2
wgrib2 ${comout}/${net4}.t${cyc}z.natlev.f${fhr}.${gridname}grib2 -s > ${comout}/${net4}.t${cyc}z.natlev.f${fhr}.${gridname}grib2.idx
ln_vrfy -sf --relative ${comout}/${NET}.t${cyc}z.bgifif${fhr}.${tmmark}.grib2 ${comout}/${net4}.t${cyc}z.ififip.f${fhr}.${gridname}grib2
wgrib2 ${comout}/${net4}.t${cyc}z.ififip.f${fhr}.${gridname}grib2 -s > ${comout}/${net4}.t${cyc}z.ififip.f${fhr}.${gridname}grib2.idx
ln_vrfy -sf --relative ${comout}/${NET}.t${cyc}z.bgsfcf${fhr}.${tmmark}.grib2 ${comout}/${net4}.t${cyc}z.testbed.f${fhr}.${gridname}grib2
wgrib2 ${comout}/${net4}.t${cyc}z.testbed.f${fhr}.${gridname}grib2 -s > ${comout}/${net4}.t${cyc}z.testbed.f${fhr}.${gridname}grib2.idx
# Remap to additional output grids if requested

if [ ${DO_PARALLEL_PRDGEN} == "TRUE" ]; then
Expand All @@ -252,8 +259,9 @@ if [ ${DO_PARALLEL_PRDGEN} == "TRUE" ]; then

if [ ${PREDEF_GRID_NAME} = "RRFS_NA_3km" ]; then

module load cfp/2.0.4
DATA=$postprd_dir
export $DATA
export DATA=$postprd_dir
USHrrfs=$USHDIR/prdgen

wgrib2 ${comout}/rrfs.t${cyc}z.prslev.f${fhr}.grib2 >& $DATA/prslevf${fhr}.txt
Expand Down Expand Up @@ -440,23 +448,23 @@ if [ ${#ADDNL_OUTPUT_GRIDS[@]} -gt 0 ]; then
cp_vrfy ${bg_remap} ${comout}/${grid}_grid/${NET}.t${cyc}z.bg${leveltype}f${fhr}.${tmmark}.grib2

if [ $leveltype = 'dawp' ]; then
ln_vrfy -fs --relative ${comout}/${grid}_grid/${NET}.t${cyc}z.bg${leveltype}f${fhr}.${tmmark}.grib2 ${comout}/${net4}.t${cyc}z.prslev.f${fhr}.conus_3km.grib2
wgrib2 ${comout}/${net4}.t${cyc}z.prslev.f${fhr}.conus_3km.grib2 -s > ${comout}/${net4}.t${cyc}z.prslev.f${fhr}.conus_3km.grib2.idx
ln_vrfy -fs --relative ${comout}/${grid}_grid/${NET}.t${cyc}z.bg${leveltype}f${fhr}.${tmmark}.grib2 ${comout}/${net4}.t${cyc}z.prslev.f${fhr}.${gridname}grib2
wgrib2 ${comout}/${net4}.t${cyc}z.prslev.f${fhr}.${gridname}grib2 -s > ${comout}/${net4}.t${cyc}z.prslev.f${fhr}.${gridname}grib2.idx
fi

if [ $leveltype = 'rd3d' ]; then
ln_vrfy -fs --relative ${comout}/${grid}_grid/${NET}.t${cyc}z.bg${leveltype}f${fhr}.${tmmark}.grib2 ${comout}/${net4}.t${cyc}z.natlev.f${fhr}.conus_3km.grib2
wgrib2 ${comout}/${net4}.t${cyc}z.natlev.f${fhr}.conus_3km.grib2 -s > ${comout}/${net4}.t${cyc}z.natlev.f${fhr}.conus_3km.grib2.idx
ln_vrfy -fs --relative ${comout}/${grid}_grid/${NET}.t${cyc}z.bg${leveltype}f${fhr}.${tmmark}.grib2 ${comout}/${net4}.t${cyc}z.natlev.f${fhr}.${gridname}grib2
wgrib2 ${comout}/${net4}.t${cyc}z.natlev.f${fhr}.${gridname}grib2 -s > ${comout}/${net4}.t${cyc}z.natlev.f${fhr}.${gridname}grib2.idx
fi

if [ $leveltype = 'ifi' ]; then
ln_vrfy -fs --relative ${comout}/${grid}_grid/${NET}.t${cyc}z.bg${leveltype}f${fhr}.${tmmark}.grib2 ${comout}/${net4}.t${cyc}z.ififip.f${fhr}.conus_3km.grib2
wgrib2 ${comout}/${net4}.t${cyc}z.ififip.f${fhr}.conus_3km.grib2 -s > ${comout}/${net4}.t${cyc}z.ififip.f${fhr}.conus_3km.grib2.idx
ln_vrfy -fs --relative ${comout}/${grid}_grid/${NET}.t${cyc}z.bg${leveltype}f${fhr}.${tmmark}.grib2 ${comout}/${net4}.t${cyc}z.ififip.f${fhr}.${gridname}grib2
wgrib2 ${comout}/${net4}.t${cyc}z.ififip.f${fhr}.${gridname}grib2 -s > ${comout}/${net4}.t${cyc}z.ififip.f${fhr}.${gridname}grib2.idx
fi

if [ $leveltype = 'sfc' ]; then
ln_vrfy -fs --relative ${comout}/${grid}_grid/${NET}.t${cyc}z.bg${leveltype}f${fhr}.${tmmark}.grib2 ${comout}/${net4}.t${cyc}z.testbed.f${fhr}.conus_3km.grib2
wgrib2 ${comout}/${net4}.t${cyc}z.testbed.f${fhr}.conus_3km.grib2 -s > ${comout}/${net4}.t${cyc}z.testbed.f${fhr}.conus_3km.grib2.idx
ln_vrfy -fs --relative ${comout}/${grid}_grid/${NET}.t${cyc}z.bg${leveltype}f${fhr}.${tmmark}.grib2 ${comout}/${net4}.t${cyc}z.testbed.f${fhr}.${gridname}grib2
wgrib2 ${comout}/${net4}.t${cyc}z.testbed.f${fhr}.${gridname}grib2 -s > ${comout}/${net4}.t${cyc}z.testbed.f${fhr}.${gridname}grib2.idx
fi

# Link output for transfer from Jet to web
Expand Down
2 changes: 1 addition & 1 deletion ush/templates/FV3LAM_wflow.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1039,7 +1039,7 @@ MODULES_RUN_TASK_FP script.
<envar><name>CYCLE_TYPE</name><value><cyclestr>spinup</cyclestr></value></envar>
<envar><name>CYCLE_SUBTYPE</name><value><cyclestr>ensinit</cyclestr></value></envar>
<envar><name>NWGES_BASEDIR</name><value>&NWGES_BASEDIR;</value></envar>
<envar><name>RESTART_HRS</name><value><cyclestr>1</cyclestr></value></envar>
<envar><name>RESTART_HRS</name><value><cyclestr>0</cyclestr></value></envar>

<dependency>
<and>
Expand Down

0 comments on commit a0cd84e

Please sign in to comment.