Skip to content

Commit

Permalink
chgres_cube - Option to use RAP/HRRR MASSDEN as smoke IC/LBCs (#923)
Browse files Browse the repository at this point in the history
This smoke data is available in the RAP/HRRR GRIB2 data. 

This PR includes a new varmap file for using this data. 

A new regression test was added for testing this configuration.

Fixes #851
  • Loading branch information
jordanschnell authored Nov 12, 2024
1 parent c134505 commit a7f882f
Show file tree
Hide file tree
Showing 10 changed files with 263 additions and 14 deletions.
3 changes: 2 additions & 1 deletion docs/source/chgres_cube.rst
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,7 @@ Namelist variables with “input” in their name refer to data input to chgres_
Variable Mapping (VARMAP) table
-------------------------------

The VARMAP table, set in the chgres_cube namelist (variable varmap_file), controls how chgres_cube handles variables that might be missing from the GRIB2 files. Since there are so many different versions of GRIB2 files, it's often uncertain what fields are available even if you know what source model the data is coming from. Each file contains the following: (Note, only the GFS physics suite is currently supported.)
The VARMAP table, set in the chgres_cube namelist (variable varmap_file), controls how chgres_cube handles variables that might be missing from the GRIB2 files. Since there are so many different versions of GRIB2 files, it's often uncertain what fields are available even if you know what source model the data is coming from. Each file contains the following columns:

Column 1: Name the code searches for in the table. Do not change. Some definitions:

Expand Down Expand Up @@ -417,6 +417,7 @@ Column 1: Name the code searches for in the table. Do not change. Some definiti
* hice - sea/lake ice thickness
* weasd - snow liquid equivalent
* snod - physical snow depth
* massden - smoke mass mixing ratio

Column 2: Name of the variable in the output “coldstart” files. Unimplemented.

Expand Down
28 changes: 28 additions & 0 deletions parm/varmap_tables/GSDphys_smoke_var_map.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
dzdt dzdt set_to_fill 0 D
delta_p delp skip 0 D
sphum sphum intrp 1E-7 T
liq_wat liq_wat intrp 0 T
o3mr o3mr intrp 1E-7 T
rainwat rainwat intrp 0 T
ice_wat ice_wat intrp 0 T
snowwat snowwat intrp 0 T
graupel graupel intrp 0 T
ice_nc ice_nc intrp -1.0 T
rain_nc rain_nc intrp -1.0 T
water_nc water_nc intrp -1.0 T
liq_aero liq_aero intrp 0 T
ice_aero ice_aero intrp 0 T
sgs_tke sgs_tke intrp 0 T
vtype vtype skip 0 S
sotype stype skip 0 S
vfrac vfrac skip 0 S
fricv uustar skip 0 S
sfcr zorl set_to_fill 0.01 S
soilw smc stop 0 S
soilt stc stop 0 S
cnwat cnwat set_to_fill 0.0 S
icetk icetk set_to_fill 265.0 S
weasd weasd set_to_fill 0.0 S
snod snod set_to_fill 0.0 S
tprcp tprcp set_to_fill 0.0 S
massden smoke set_to_fill 1E-12 T
2 changes: 1 addition & 1 deletion parm/varmap_tables/GSDphys_var_map.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ cnwat cnwat set_to_fill 0.0 S
icetk icetk set_to_fill 265.0 S
weasd weasd set_to_fill 0.0 S
snod snod set_to_fill 0.0 S
tprcp tprcp set_to_fill 0.0 S
tprcp tprcp set_to_fill 0.0 S
103 changes: 103 additions & 0 deletions reg_tests/chgres_cube/13km.conus.rap-smoke.grib2.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
#!/bin/bash

#-----------------------------------------------------------------------------
# Invoke chgres to create 13-km CONUS coldstart files using RAP-SMOKE GRIB2 data
# as input. i.e., if one desires MASSDEN/SMOKE in the ICs/LBCS
# The coldstart files are then compared to baseline files
# using the 'nccmp' utility. This script is run by the machine specific
# driver script.
#-----------------------------------------------------------------------------

set -x

export DATA=$OUTDIR/13km_conus_rap-smoke_grib2
rm -fr $DATA

export CRES=778
export KMRES=13km
export FIXfv3=${HOMEreg}/fix/RRFS_CONUS_${KMRES}

export COMIN=${HOMEreg}/input_data/rap.grib2

export GRIB2_FILE_INPUT=1921221000900
export VCOORD_FILE=${HOMEufs}/fix/am/global_hyblev.l64.txt
export VARMAP_FILE=${HOMEufs}/parm/varmap_tables/GSDphys_smoke_var_map.txt
export INPUT_TYPE='grib2'
export CONVERT_NST=".false."
export OROG_FILES_TARGET_GRID="C778_oro_data.tile7.nc"
export REGIONAL=1
export HALO_BLEND=0
export HALO_BNDY=4
export CDATE=2019080100
export EXTERNAL_MODEL="RAP"
export NSOILL_OUT=9
export TRACERS_TARGET='"NULL"'
export TRACERS_INPUT='"NULL"'
export SOTYP_FROM_CLIMO=.false.
export VGTYP_FROM_CLIMO=.false.
export VGFRC_FROM_CLIMO=.true.
export MINMAX_VGFRC_FROM_CLIMO=.true.
export TG3_FROM_SOIL=.true.
export LAI_FROM_CLIMO=.true.
export GEOGRID_FILE_INPUT=${HOMEufs}/fix/am/geo_em.d01.nc_RAPX

export OMP_NUM_THREADS_CH=${OMP_NUM_THREADS:-1}

NCCMP=${NCCMP:-$(which nccmp)}

#-----------------------------------------------------------------------------
# Invoke chgres program.
#-----------------------------------------------------------------------------

echo "Starting at: " `date`

${HOMEufs}/ush/chgres_cube.sh

iret=$?
if [ $iret -ne 0 ]; then
set +x
echo "<<< 13-km CONUS RAP-SMOKE W/ GSD PHYSICS AND SFC FROM FILE GRIB2 TEST FAILED. <<<"
exit $iret
fi

echo "Ending at: " `date`

#-----------------------------------------------------------------------------
# Compare output from chgres to baseline set of data.
#
# orion's nccmp utility does not work with the netcdf
# required to run ufs_utils. So swap it.
#-----------------------------------------------------------------------------

machine=${machine:-NULL}
if [ $machine == 'orion' ]; then
module unload netcdfp/4.7.4.release
module load netcdf/4.7.2
fi

cd $DATA

test_failed=0
for files in *.nc
do
if [ -f $files ]; then
echo CHECK $files
$NCCMP -dmfqS $files $HOMEreg/baseline_data/13km_conus_rap-smoke_grib2/$files
iret=$?
if [ $iret -ne 0 ]; then
test_failed=1
fi
fi
done

set +x
if [ $test_failed -ne 0 ]; then
echo "<<< 13-km CONUS RAP-SMOKE W/ GSD PHYSICS AND SFC FROM FILE GRIB2 TEST FAILED. >>>"
if [ "$UPDATE_BASELINE" = "TRUE" ]; then
$HOMEufs/reg_tests/update_baseline.sh $HOMEreg "13km_conus_rap-smoke_grib2" $commit_num
fi
else
echo "<<< 13-km CONUS RAP-SMOKE W/ GSD PHYSICS AND SFC FROM FILE GRIB2 TEST PASSED. >>>"
fi

exit 0
13 changes: 12 additions & 1 deletion reg_tests/chgres_cube/driver.hera.sh
Original file line number Diff line number Diff line change
Expand Up @@ -187,14 +187,25 @@ export OMP_NUM_THREADS=1 # should match cpus-per-task
TEST13=$(sbatch --parsable --ntasks-per-node=6 --nodes=1 -t 0:05:00 -A $PROJECT_CODE -q $QUEUE -J c96.gefs.grib2 \
-o $LOG_FILE -e $LOG_FILE ./c96.gefs.grib2.sh)


#-----------------------------------------------------------------------------
# Initialize CONUS 13-KM USING RAP-SMOKE GRIB2 file WITH GSD PHYSICS .
#-----------------------------------------------------------------------------
LOG_FILE=consistency.log14
export OMP_NUM_THREADS=1 # should match cpus-per-task
TEST14=$(sbatch --parsable --ntasks-per-node=6 --nodes=1 -t 0:05:00 -A $PROJECT_CODE -q $QUEUE -J 13km.conus.rap-smoke.grib2.conus \
-o $LOG_FILE -e $LOG_FILE ./13km.conus.rap-smoke.grib2.sh)



#-----------------------------------------------------------------------------
# Create summary log.
#-----------------------------------------------------------------------------

LOG_FILE=consistency.log
sbatch --nodes=1 -t 0:01:00 -A $PROJECT_CODE -J chgres_summary -o $LOG_FILE -e $LOG_FILE \
--open-mode=append -q $QUEUE -d\
afterok:$TEST1:$TEST2:$TEST3:$TEST4:$TEST5:$TEST6:$TEST7:$TEST8:$TEST9:$TEST10:$TEST11:$TEST12:$TEST13 << EOF
afterok:$TEST1:$TEST2:$TEST3:$TEST4:$TEST5:$TEST6:$TEST7:$TEST8:$TEST9:$TEST10:$TEST11:$TEST12:$TEST13:$TEST14 << EOF
#!/bin/bash
grep -a '<<<' ${LOG_FILE}?? > summary.log
EOF
Expand Down
11 changes: 10 additions & 1 deletion reg_tests/chgres_cube/driver.hercules.sh
Original file line number Diff line number Diff line change
Expand Up @@ -188,13 +188,22 @@ export OMP_NUM_THREADS=1 # needs to match cpus-per-task
TEST13=$(sbatch --parsable --ntasks-per-node=6 --nodes=1 --mem=75G -t 0:05:00 -A $PROJECT_CODE -q $QUEUE -J c96.gefs.grib2 \
--open-mode=append -o $LOG_FILE13 -e $LOG_FILE13 ./c96.gefs.grib2.sh)

#-----------------------------------------------------------------------------
# Initialize CONUS 13-KM USING RAP-SMOKE GRIB2 file WITH GSD PHYSICS.
#-----------------------------------------------------------------------------

LOG_FILE14=${LOG_FILE}14
export OMP_NUM_THREADS=1 # should match cpus-per-task
TEST14=$(sbatch --parsable --ntasks-per-node=12 --nodes=1 --mem=75G -t 0:10:00 -A $PROJECT_CODE -q $QUEUE -J 13km.conus.rap-smoke.grib2 \
--open-mode=append -o $LOG_FILE14 -e $LOG_FILE14 ./13km.conus.rap-smoke.grib2.sh)

#-----------------------------------------------------------------------------
# Create summary log.
#-----------------------------------------------------------------------------

sbatch --nodes=1 -t 0:01:00 -A $PROJECT_CODE -J chgres_summary -o $LOG_FILE -e $LOG_FILE \
--open-mode=append -q $QUEUE \
-d afterok:$TEST1:$TEST2:$TEST3:$TEST4:$TEST5:$TEST6:$TEST7:$TEST8:$TEST9:$TEST10:$TEST11:$TEST12:$TEST13 << EOF
-d afterok:$TEST1:$TEST2:$TEST3:$TEST4:$TEST5:$TEST6:$TEST7:$TEST8:$TEST9:$TEST10:$TEST11:$TEST12:$TEST13:$TEST14 << EOF
#!/bin/bash
grep -a '<<<' ${LOG_FILE}* > $SUM_FILE
EOF
Expand Down
11 changes: 10 additions & 1 deletion reg_tests/chgres_cube/driver.jet.sh
Original file line number Diff line number Diff line change
Expand Up @@ -183,14 +183,23 @@ export OMP_NUM_THREADS=1
TEST13=$(sbatch --parsable --partition=xjet --nodes=1 --ntasks-per-node=6 -t 0:05:00 -A $PROJECT_CODE -q $QUEUE -J c96.gefs.grib2 \
--exclusive -o $LOG_FILE -e $LOG_FILE ./c96.gefs.grib2.sh)

#-----------------------------------------------------------------------------
# Initialize CONUS 13-KM USING RAP-SMOKE GRIB2 file WITH GSD PHYSICS .
#-----------------------------------------------------------------------------

LOG_FILE=consistency.log14
export OMP_NUM_THREADS=1 # should match cpus-per-task
TEST14=$(sbatch --parsable --partition=xjet --ntasks-per-node=6 --nodes=1 -t 0:05:00 -A $PROJECT_CODE -q $QUEUE -J 13km.conus.rap-smoke.grib2.conus \
--exclusive -o $LOG_FILE -e $LOG_FILE ./13km.conus.rap-smoke.grib2.sh)

#-----------------------------------------------------------------------------
# Create summary log.
#-----------------------------------------------------------------------------

LOG_FILE=consistency.log
sbatch --partition=xjet --nodes=1 -t 0:01:00 -A $PROJECT_CODE -J chgres_summary -o $LOG_FILE -e $LOG_FILE \
--open-mode=append -q $QUEUE -d\
afterok:$TEST1:$TEST2:$TEST3:$TEST4:$TEST5:$TEST6:$TEST7:$TEST8:$TEST9:$TEST10:$TEST11:$TEST12:$TEST13 << EOF
afterok:$TEST1:$TEST2:$TEST3:$TEST4:$TEST5:$TEST6:$TEST7:$TEST8:$TEST9:$TEST10:$TEST11:$TEST12:$TEST13:$TEST14 << EOF
#!/bin/bash
grep -a '<<<' $LOG_FILE* > $SUM_FILE
EOF
Expand Down
11 changes: 10 additions & 1 deletion reg_tests/chgres_cube/driver.orion.sh
Original file line number Diff line number Diff line change
Expand Up @@ -186,13 +186,22 @@ export OMP_NUM_THREADS=1 # needs to match cpus-per-task
TEST13=$(sbatch --parsable --ntasks-per-node=6 --nodes=1 --mem=75G -t 0:05:00 -A $PROJECT_CODE -q $QUEUE -J c96.gefs.grib2 \
--open-mode=append -o $LOG_FILE13 -e $LOG_FILE13 ./c96.gefs.grib2.sh)

#-----------------------------------------------------------------------------
# Initialize CONUS 13-KM USING RAP-SMOKE GRIB2 file WITH GSD PHYSICS.
#-----------------------------------------------------------------------------

LOG_FILE14=${LOG_FILE}14
export OMP_NUM_THREADS=1 # should match cpus-per-task
TEST14=$(sbatch --parsable --ntasks-per-node=12 --nodes=1 --mem=75G -t 0:10:00 -A $PROJECT_CODE -q $QUEUE -J 13km.conus.rap-smoke.grib2 \
--open-mode=append -o $LOG_FILE14 -e $LOG_FILE14 ./13km.conus.rap-smoke.grib2.sh)

#-----------------------------------------------------------------------------
# Create summary log.
#-----------------------------------------------------------------------------

sbatch --nodes=1 -t 0:01:00 -A $PROJECT_CODE -J chgres_summary -o $LOG_FILE -e $LOG_FILE \
--open-mode=append -q $QUEUE \
-d afterok:$TEST1:$TEST2:$TEST3:$TEST4:$TEST5:$TEST6:$TEST7:$TEST8:$TEST9:$TEST10:$TEST11:$TEST12:$TEST13 << EOF
-d afterok:$TEST1:$TEST2:$TEST3:$TEST4:$TEST5:$TEST6:$TEST7:$TEST8:$TEST9:$TEST10:$TEST11:$TEST12:$TEST13:$TEST14 << EOF
#!/bin/bash
grep -a '<<<' ${LOG_FILE}* > $SUM_FILE
EOF
Expand Down
11 changes: 10 additions & 1 deletion reg_tests/chgres_cube/driver.wcoss2.sh
Original file line number Diff line number Diff line change
Expand Up @@ -184,14 +184,23 @@ export APRUN="mpiexec -n 6 -ppn 6 --cpu-bind core"
TEST13=$(qsub -V -o $LOG_FILE -e $LOG_FILE -q $QUEUE -A $PROJECT_CODE -l walltime=00:05:00 \
-N c96.gefs.grib2 -l select=1:ncpus=6:ompthreads=1:mem=15GB $PWD/c96.gefs.grib2.sh)

#-----------------------------------------------------------------------------
# Initialize CONUS 13-KM USING RAP-SMOKE GRIB2 file WITH GSD PHYSICS.
#-----------------------------------------------------------------------------

LOG_FILE=consistency.log14
export APRUN="mpiexec -n 6 -ppn 6 --cpu-bind core"
TEST14=$(qsub -V -o $LOG_FILE -e $LOG_FILE -q $QUEUE -A $PROJECT_CODE -l walltime=00:05:00 \
-N 13km.conus.rap-smoke.grib2.conus -l select=1:ncpus=6:ompthreads=1:mem=15GB $PWD/13km.conus.rap-smoke.grib2.sh)

#-----------------------------------------------------------------------------
# Create summary log.
#-----------------------------------------------------------------------------

LOG_FILE=consistency.log
qsub -V -o ${LOG_FILE} -e ${LOG_FILE} -q $QUEUE -A $PROJECT_CODE -l walltime=00:01:00 \
-N chgres_summary -l select=1:ncpus=1:mem=100MB \
-W depend=afterok:$TEST1:$TEST2:$TEST3:$TEST4:$TEST5:$TEST6:$TEST7:$TEST8:$TEST9:$TEST10:$TEST11:$TEST12:$TEST13 << EOF
-W depend=afterok:$TEST1:$TEST2:$TEST3:$TEST4:$TEST5:$TEST6:$TEST7:$TEST8:$TEST9:$TEST10:$TEST11:$TEST12:$TEST13:$TEST14 << EOF
#!/bin/bash
cd ${this_dir}
grep -a '<<<' ${LOG_FILE}?? | grep -v echo > $SUM_FILE
Expand Down
Loading

0 comments on commit a7f882f

Please sign in to comment.