Skip to content

Commit

Permalink
Changes for initializing ensemble from GDASENKF netcdf files on HERA (N…
Browse files Browse the repository at this point in the history
…OAA-EMC#248)

* Changes for initializing ensemble from GDASENKF netcdf files on HERA

* Fix FV3GFS data path and filename on HERA

* Removing old lines related to Hera data path
  • Loading branch information
chunhuazhou authored Nov 6, 2021
1 parent 808286d commit 0544c58
Show file tree
Hide file tree
Showing 7 changed files with 147 additions and 17 deletions.
17 changes: 17 additions & 0 deletions scripts/exregional_make_ics.sh
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ case "${CCPP_PHYS_SUITE}" in
elif [ "${EXTRN_MDL_NAME_ICS}" = "NAM" ] || \
[ "${EXTRN_MDL_NAME_ICS}" = "FV3GFS" ] || \
[ "${EXTRN_MDL_NAME_ICS}" = "GEFS" ] || \
[ "${EXTRN_MDL_NAME_ICS}" = "GDASENKF" ] || \
[ "${EXTRN_MDL_NAME_ICS}" = "GSMGFS" ]; then
varmap_file="GFSphys_var_map.txt"
fi
Expand Down Expand Up @@ -429,6 +430,22 @@ case "${EXTRN_MDL_NAME_ICS}" in
tg3_from_soil=True
;;

"GDASENKF")
tracers_input="[\"spfh\",\"clwmr\",\"o3mr\",\"icmr\",\"rwmr\",\"snmr\",\"grle\"]"
tracers="[\"sphum\",\"liq_wat\",\"o3mr\",\"ice_wat\",\"rainwat\",\"snowwat\",\"graupel\"]"
external_model="GFS"
input_type="gaussian_netcdf"
convert_nst=False
fn_atm_nemsio="${EXTRN_MDL_FNS[0]}"
fn_sfc_nemsio="${EXTRN_MDL_FNS[1]}"
vgtyp_from_climo=True
sotyp_from_climo=True
vgfrc_from_climo=True
minmax_vgfrc_from_climo=True
lai_from_climo=True
tg3_from_soil=True
;;

"GEFS")
external_model="GFS"
fn_grib2="${EXTRN_MDL_FNS[0]}"
Expand Down
14 changes: 14 additions & 0 deletions scripts/exregional_make_lbcs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ case "${CCPP_PHYS_SUITE}" in
elif [ "${EXTRN_MDL_NAME_LBCS}" = "NAM" ] || \
[ "${EXTRN_MDL_NAME_LBCS}" = "FV3GFS" ] || \
[ "${EXTRN_MDL_NAME_LBCS}" = "GEFS" ] || \
[ "${EXTRN_MDL_NAME_LBCS}" = "GDASENKF" ] || \
[ "${EXTRN_MDL_NAME_LBCS}" = "GSMGFS" ]; then
varmap_file="GFSphys_var_map.txt"
fi
Expand Down Expand Up @@ -333,6 +334,15 @@ case "${EXTRN_MDL_NAME_LBCS}" in
fi
;;

"GDASENKF")
tracers_input="[\"spfh\",\"clwmr\",\"o3mr\",\"icmr\",\"rwmr\",\"snmr\",\"grle\"]"
tracers="[\"sphum\",\"liq_wat\",\"o3mr\",\"ice_wat\",\"rainwat\",\"snowwat\",\"graupel\"]"
external_model="GFS"
input_type="gaussian_netcdf"
fn_atm_nemsio="${EXTRN_MDL_FNS[0]}"
fn_sfc_nemsio="${EXTRN_MDL_FNS[1]}"
;;

"GEFS")
external_model="GFS"
fn_grib2="${EXTRN_MDL_FNS[0]}"
Expand Down Expand Up @@ -412,6 +422,10 @@ for (( i=0; i<${num_fhrs}; i++ )); do
fn_atm_nemsio="${EXTRN_MDL_FNS[$i]}"
fi
;;
"GDASENKF")
fn_atm_nemsio="${EXTRN_MDL_FNS[0][$i]}"
fn_sfc_nemsio="${EXTRN_MDL_FNS[1][$i]}"
;;
"GEFS")
fn_grib2="${EXTRN_MDL_FNS[$i]}"
;;
Expand Down
49 changes: 46 additions & 3 deletions ush/get_extrn_mdl_file_dir_info.sh
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,7 @@ fi
[ "${extrn_mdl_name}" = "FV3GFS" -a "${MACHINE}" = "ORION" ] || \
[ "${extrn_mdl_name}" = "GEFS" -a "${MACHINE}" = "JET" ] || \
[ "${extrn_mdl_name}" = "GEFS" -a "${MACHINE}" = "HERA" ] || \
[ "${extrn_mdl_name}" = "GDASENKF" -a "${MACHINE}" = "JET" ] || \
[ "${extrn_mdl_name}" = "FV3GFS" -a "${MACHINE}" = "JET" ] || \
[ "${extrn_mdl_name}" = "FV3GFS" -a "${MACHINE}" = "HERA" ]; then
#
Expand Down Expand Up @@ -395,8 +396,10 @@ fi
# fns=( "gfs.t${hh}z.pgrb2.0p25.anl" ) # Get only 0.25 degree files for now.
# fns=( "gfs.t${hh}z.pgrb2.0p25.f000" ) # Get only 0.25 degree files for now.

if [ "${MACHINE}" = "JET" ] || [ "${MACHINE}" = "HERA" ] || [ "${MACHINE}" = "ORION" ]; then
if [ "${MACHINE}" = "JET" ] || [ "${MACHINE}" = "ORION" ]; then
fns_on_disk=( "${yy}${ddd}${hh}0${fcst_mn}0${fcst_hh}" )
elif [ "${MACHINE}" = "HERA" ] ; then
fns_on_disk=( "gfs.t${hh}z.pgrb2.0p25.f0${fcst_hh}" )
else
fns_on_disk=( "gfs.t${hh}z.pgrb2.0p25.f0${fcst_hh}" "gfs.t${hh}z.sfcf0${fcst_hh}.nc") # use netcdf
fi
Expand All @@ -408,6 +411,13 @@ fi
fi
;;

"GDASENKF")
if [ "${MACHINE}" = "HERA" ] ; then
fns_on_disk=( "gdas.t${hh}z.atmf0${fcst_hh}.nc" "gdas.t${hh}z.sfcf0${fcst_hh}.nc") # use netcdf
fns_in_arcv=( "gfs.t${hh}z.pgrb2.0p25.f0${fcst_hh}" ) # Get only 0.25 degree files for now.
fi
;;

"GEFS")
fcst_hh=( $( printf "%02d " "${time_offset_hrs}" ) )
prefix="${yy}${ddd}${hh}${mn}${fcst_mn}"
Expand Down Expand Up @@ -493,7 +503,7 @@ and analysis or forecast (anl_or_fcst):

fcst_hhh=( $( printf "%03d " "${lbc_spec_fhrs[@]}" ) )

if [ "${MACHINE}" = "JET" ] || [ "${MACHINE}" = "HERA" ] || [ "${MACHINE}" = "ORION" ]; then
if [ "${MACHINE}" = "JET" ] || [ "${MACHINE}" = "ORION" ]; then
prefix=( "${yy}${ddd}${hh}${fcst_mn}0" )
fns_on_disk=( "${fcst_hhh[@]/#/$prefix}" )
else
Expand All @@ -511,6 +521,14 @@ and analysis or forecast (anl_or_fcst):
fi
;;

"GDASENKF")
fcst_hhh=( $( printf "%03d " "${lbc_spec_fhrs[@]}" ) )
if [ "${MACHINE}" = "HERA" ]; then
fns_on_disk=( "gdas.t${hh}z.atmf${fcst_hhh[@]}.nc" "gdas.t${hh}z.sfcf${fcst_hhh[@]}.nc") # use netcdf
fns_in_arcv=( "gdas.t${hh}z.atmf${fcst_hhh}.nc" "gdas.t${hh}z.sfcf${fcst_hhh}.nc" ) # for now.
fi
;;

"GEFS")
fcst_hh=( $( printf "%02d " "${lbc_spec_fhrs[@]}" ) )
prefix="${yy}${ddd}${hh}${mn}${fcst_mn}"
Expand Down Expand Up @@ -644,7 +662,7 @@ has not been specified for this external model and machine combination:
sysdir="$sysbasedir/gfs.${yyyymmdd}/${hh}/atmos"
;;
"HERA")
sysdir="$sysbasedir"
sysdir="$sysbasedir/gfs.${yyyymmdd}/${hh}/atmos"
;;
"ORION")
sysdir="$sysbasedir/gdas.${yyyymmdd}/${hh}/atmos"
Expand All @@ -664,6 +682,24 @@ has not been specified for this external model and machine combination:
*)
print_err_msg_exit "\
The system directory in which to look for external model output files
has not been specified for this external model and machine combination:
extrn_mdl_name = \"${extrn_mdl_name}\"
MACHINE = \"$MACHINE\""
;;
esac
;;

"GDASENKF")
case "$MACHINE" in
"HERA")
sysdir="$sysbasedir/enkfgdas.${yyyymmdd}/${hh}/atmos/${GDASENKF_INPUT_SUBDIR}"
;;
"JET")
sysdir="$sysbasedir"
;;
*)
print_err_msg_exit "\
The system directory in which to look for external model output files
has not been specified for this external model and machine combination:
extrn_mdl_name = \"${extrn_mdl_name}\"
MACHINE = \"$MACHINE\""
Expand Down Expand Up @@ -978,6 +1014,13 @@ has not been specified for this external model:
arcvrel_dir=""
;;

"GDASENKF")
arcv_dir=""
arcv_fmt="tar"
arcv_fns=""
arcv_fps="$arcv_dir/$arcv_fns"
arcvrel_dir=""
;;

*)
print_err_msg_exit "\
Expand Down
25 changes: 25 additions & 0 deletions ush/set_extrn_mdl_params.sh
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,17 @@ else
esac
;;

"GDASENKF")
case "$MACHINE" in
"HERA")
EXTRN_MDL_SYSBASEDIR_ICS="/scratch1/NCEPDEV/rstprod/com/gfs/prod"
;;
"JET")
EXTRN_MDL_SYSBASEDIR_ICS="/mnt/lfs4/BMC/public/data/grids/enkf/atm"
;;
esac
;;

"GEFS")
case "$MACHINE" in
"HERA")
Expand Down Expand Up @@ -205,6 +216,9 @@ if [[ -z ${EXTRN_MDL_LBCS_OFFSET_HRS} ]]; then
"FV3GFS")
EXTRN_MDL_LBCS_OFFSET_HRS="0"
;;
"GDASENKF")
EXTRN_MDL_LBCS_OFFSET_HRS="6"
;;
"GEFS")
EXTRN_MDL_LBCS_OFFSET_HRS="6"
;;
Expand Down Expand Up @@ -297,6 +311,17 @@ else
esac
;;

"GDASENKF")
case "$MACHINE" in
"HERA")
EXTRN_MDL_SYSBASEDIR_LBCS="/scratch1/NCEPDEV/rstprod/com/gfs/prod"
;;
"JET")
EXTRN_MDL_SYSBASEDIR_LBCS="/mnt/lfs4/BMC/public/data/grids/enkf/atm"
;;
esac
;;

"GEFS")
case "$MACHINE" in
"JET")
Expand Down
24 changes: 16 additions & 8 deletions ush/set_rrfs_config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,22 @@ if [[ $DO_RETRO == "TRUE" ]] ; then
fi
if [[ $MACHINE == "hera" ]] ; then

if [[ ${DO_ENSEMBLE} == "TRUE" ]]; then
if [[ ${EXTRN_MDL_NAME_ICS} == "GEFS" ]]; then
EXTRN_MDL_SOURCE_BASEDIR_ICS="/scratch1/BMC/wrfruc/chunhua/data/GEFS/pgrb2"
elif [[ ${EXTRN_MDL_NAME_ICS} == "HRRRDAS" ]]; then
EXTRN_MDL_SOURCE_BASEDIR_ICS="/scratch1/BMC/wrfruc/chunhua/data/HRRRDAS"
fi
EXTRN_MDL_SOURCE_BASEDIR_LBCS="/scratch1/BMC/wrfruc/chunhua/data/GEFS/pgrb2"
OBSPATH="/scratch1/BMC/wrfruc/chunhua/data/obs"
if [[ ${DO_ENSEMBLE} == "TRUE" ]]; then
if [[ ${EXTRN_MDL_NAME_ICS} == "GEFS" ]]; then
EXTRN_MDL_SOURCE_BASEDIR_ICS="/scratch1/BMC/wrfruc/chunhua/data/GEFS/pgrb2"
elif [[ ${EXTRN_MDL_NAME_ICS} == "HRRRDAS" ]]; then
EXTRN_MDL_SOURCE_BASEDIR_ICS="/scratch1/BMC/wrfruc/chunhua/data/HRRRDAS"
elif [[ ${EXTRN_MDL_NAME_ICS} == "GDASENKF" ]]; then
EXTRN_MDL_SOURCE_BASEDIR_ICS="/scratch1/BMC/wrfruc/chunhua/data/GDASENKF"
fi
if [[ ${EXTRN_MDL_NAME_LBCS} == "GEFS" ]]; then
EXTRN_MDL_SOURCE_BASEDIR_LBCS="/scratch1/BMC/wrfruc/chunhua/data/GEFS/pgrb2"
elif [[ ${EXTRN_MDL_NAME_LBCS} == "GDASENKF" ]]; then
EXTRN_MDL_SOURCE_BASEDIR_LBCS="/scratch1/BMC/wrfruc/chunhua/data/GDASENKF"
elif [[ ${EXTRN_MDL_NAME_LBCS} == "FV3GFS" ]]; then
EXTRN_MDL_SOURCE_BASEDIR_LBCS="/scratch1/BMC/wrfruc/chunhua/data/FV3GFS"
fi
OBSPATH="/scratch1/BMC/wrfruc/chunhua/data/obs"
else
# EXTRN_MDL_SOURCE_BASEDIR_ICS=/scratch2/BMC/zrtrr/rli/data/hrrr/conus/wrfnat/grib2
# EXTRN_MDL_SOURCE_BASEDIR_LBCS=/scratch2/BMC/zrtrr/rli/data/rap/full/wrfnat/grib2
Expand Down
31 changes: 27 additions & 4 deletions ush/templates/FV3LAM_wflow.xml
Original file line number Diff line number Diff line change
Expand Up @@ -318,10 +318,11 @@ MODULES_RUN_TASK_FP script.
{%- if do_enscontrol %}
<var name="subdirGE">/gec00{% for m in range(2, num_ens_members+1) %}{{ " /gep%02d"%m }}{% endfor %}</var>
<var name="memNameWRF">_mem0000{% for m in range(2, num_ens_members+1) %}{{ " _mem%04d"%m }}{% endfor %} </var>
{%- else -%}
{%- else %}
<var name="subdirGE">{% for m in range(1, num_ens_members+1) %}{{ " /gep%02d"%m }}{% endfor %}</var>
<var name="memNameWRF">{% for m in range(1, num_ens_members+1) %}{{ " _mem%04d"%m }}{% endfor %} </var>
{%- endif %}
<var name="subdirGDAS">{% for m in range(1, num_ens_members+1) %}{{ " /mem%03d"%m }}{% endfor %}</var>
{%- endif %}

<!--
Expand Down Expand Up @@ -354,6 +355,7 @@ MODULES_RUN_TASK_FP script.
<envar><name>SLASH_ENSMEM_SUBDIR</name><value>{{ slash_ensmem_subdir }}</value></envar>
<envar><name>GEFS_INPUT_SUBDIR</name><value>#subdirGE#</value></envar>
<envar><name>WRF_MEM_NAME</name><value>#memNameWRF#</value></envar>
<envar><name>GDASENKF_INPUT_SUBDIR</name><value>#subdirGDAS#</value></envar>

<dependency>
{%- if machine in ["WCOSS_DELL_P3", "WCOSS_CRAY"] %}
Expand All @@ -362,11 +364,22 @@ MODULES_RUN_TASK_FP script.
<datadep age="00:00:05:00"><cyclestr offset="-{{ extrn_mdl_ics_offset_hrs }}:00:00">{{ extrn_mdl_sysbasedir_ics }}/gdas.@Y@m@d/@H/atmos/[email protected]{{ "%03d" % extrn_mdl_ics_offset_hrs }}.nc</cyclestr></datadep>
{% else %}
{%- if extrn_mdl_name_ics in ["GEFS"] %}
<datadep age="00:00:05:00"><cyclestr offset="-{{ extrn_mdl_ics_offset_hrs }}:00:00">{{ extrn_mdl_sysbasedir_ics }}#subdirGE#/@y@j@H00000{{ extrn_mdl_ics_offset_hrs }}</cyclestr></datadep>
<datadep age="00:00:05:00"><cyclestr offset="-{{ extrn_mdl_ics_offset_hrs }}:00:00">{{ extrn_mdl_sysbasedir_ics }}/#subdirGE#/@y@j@H00000{{ extrn_mdl_ics_offset_hrs }}</cyclestr></datadep>
{%- elif extrn_mdl_name_ics in ["GDASENKF"] %}
<and>
{%- if machine in ["HERA"] %}
<datadep age="00:00:05:00"><cyclestr offset="-{{ extrn_mdl_ics_offset_hrs }}:00:00">{{ extrn_mdl_sysbasedir_ics }}/enkfgdas.@Y@m@d/@H/atmos/#subdirGDAS#/[email protected]{{ extrn_mdl_ics_offset_hrs }}.nc</cyclestr></datadep>
<datadep age="00:00:05:00"><cyclestr offset="-{{ extrn_mdl_ics_offset_hrs }}:00:00">{{ extrn_mdl_sysbasedir_ics }}/enkfgdas.@Y@m@d/@H/atmos/#subdirGDAS#/[email protected]{{ extrn_mdl_ics_offset_hrs }}.nc</cyclestr></datadep>
{%- endif %}
</and>
{%- elif extrn_mdl_name_ics in ["HRRRDAS"] %}
<datadep age="00:00:05:00"><cyclestr offset="-{{ extrn_mdl_ics_offset_hrs }}:00:00">{{ extrn_mdl_sysbasedir_ics }}/@Y@m@d@H/postprd#memNameWRF#/wrfnat#memNameWRF#_00.grib2</cyclestr></datadep>
{%- else %}
{%- if machine in ["JET"] %}
<datadep age="00:00:05:00"><cyclestr offset="-{{ extrn_mdl_ics_offset_hrs }}:00:00">{{ extrn_mdl_sysbasedir_ics }}/@y@j@H000{{ "%03d" % extrn_mdl_ics_offset_hrs }}</cyclestr></datadep>
{%- elif machine in ["HERA"] %}
<datadep age="00:00:05:00"><cyclestr offset="-{{ extrn_mdl_ics_offset_hrs }}:00:00">{{ extrn_mdl_sysbasedir_ics }}/gfs.@Y@m@d/@H/atmos/[email protected]{{ "%03d" % extrn_mdl_ics_offset_hrs }}</cyclestr></datadep>
{%- endif %}
{%- endif %}
{%- endif %}
</dependency>
Expand Down Expand Up @@ -402,6 +415,7 @@ MODULES_RUN_TASK_FP script.
<envar><name>BOUNDARY_LEN</name><value>{{ boundary_len_hrs }}</value></envar>
<envar><name>SLASH_ENSMEM_SUBDIR</name><value>{{ slash_ensmem_subdir }}</value></envar>
<envar><name>GEFS_INPUT_SUBDIR</name><value>#subdirGE#</value></envar>
<envar><name>GDASENKF_INPUT_SUBDIR</name><value>#subdirGDAS#</value></envar>

<dependency>
<and>
Expand All @@ -412,9 +426,18 @@ MODULES_RUN_TASK_FP script.
<datadep age="00:00:05:00"><cyclestr>{{ extrn_mdl_sysbasedir_ics }}/gdas.@Y@m@d/@H/atmos/[email protected]{{ "%03d" % h }}.nc</cyclestr></datadep>
{%- else %}
{%- if extrn_mdl_name_lbcs in ["GEFS"] %}
<datadep age="00:00:05:00"> <cyclestr offset="-{{ extrn_mdl_lbcs_offset_hrs }}:00:00">{{ extrn_mdl_sysbasedir_lbcs }}#subdirGE#/@y@j@H000{{ "%03d" % h }}</cyclestr></datadep>
<datadep age="00:00:05:00"> <cyclestr offset="-{{ extrn_mdl_lbcs_offset_hrs }}:00:00">{{ extrn_mdl_sysbasedir_lbcs }}/#subdirGE#/@y@j@H000{{ "%03d" % h }}</cyclestr></datadep>
{%- elif extrn_mdl_name_lbcs in ["GDASENKF"] %}
{%- if machine in ["HERA"] %}
<datadep age="00:00:05:00"><cyclestr offset="-{{ extrn_mdl_lbcs_offset_hrs }}:00:00">{{ extrn_mdl_sysbasedir_lbcs }}/enkfgdas.@Y@m@d/@H/atmos/#subdirGDAS#/[email protected]{{ "%03d" % h }}.nc</cyclestr></datadep>
<datadep age="00:00:05:00"><cyclestr offset="-{{ extrn_mdl_lbcs_offset_hrs }}:00:00">{{ extrn_mdl_sysbasedir_lbcs }}/enkfgdas.@Y@m@d/@H/atmos/#subdirGDAS#/[email protected]{{ "%03d" % h }}.nc</cyclestr></datadep>
{%- endif %}
{%- else %}
<datadep age="00:00:05:00"> <cyclestr offset="-{{ extrn_mdl_lbcs_offset_hrs }}:00:00">{{ extrn_mdl_sysbasedir_lbcs }}/@y@j@H000{{ "%03d" % h }}</cyclestr></datadep>
{%- if machine in ["JET"] %}
<datadep age="00:00:05:00"><cyclestr offset="-{{ extrn_mdl_lbcs_offset_hrs }}:00:00">{{ extrn_mdl_sysbasedir_lbcs }}/@y@j@H000{{ "%03d" % h }}</cyclestr></datadep>
{%- elif machine in ["HERA"] %}
<datadep age="00:00:05:00"><cyclestr offset="-{{ extrn_mdl_lbcs_offset_hrs }}:00:00">{{ extrn_mdl_sysbasedir_lbcs }}/gfs.@Y@m@d/@H/atmos/[email protected]{{ "%03d" % h }}</cyclestr></datadep>
{%- endif %}
{%- endif %}
{%- endif %}
{%- endfor %}
Expand Down
4 changes: 2 additions & 2 deletions ush/valid_param_vals.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ valid_vals_CCPP_PHYS_SUITE=( \
"FV3_RAP" \
)
valid_vals_GFDLgrid_RES=("48" "96" "192" "384" "768" "1152" "3072")
valid_vals_EXTRN_MDL_NAME_ICS=("GSMGFS" "FV3GFS" "RAP" "HRRR" "NAM" "HRRRDAS" "GEFS")
valid_vals_EXTRN_MDL_NAME_LBCS=("GSMGFS" "FV3GFS" "RAP" "HRRR" "NAM" "GEFS")
valid_vals_EXTRN_MDL_NAME_ICS=("GSMGFS" "FV3GFS" "RAP" "HRRR" "NAM" "HRRRDAS" "GEFS" "GDASENKF")
valid_vals_EXTRN_MDL_NAME_LBCS=("GSMGFS" "FV3GFS" "RAP" "HRRR" "NAM" "GEFS" "GDASENKF")
valid_vals_USE_USER_STAGED_EXTRN_FILES=("TRUE" "true" "YES" "yes" "FALSE" "false" "NO" "no")
valid_vals_FV3GFS_FILE_FMT_ICS=("nemsio" "grib2" "netcdf")
valid_vals_FV3GFS_FILE_FMT_LBCS=("nemsio" "grib2" "netcdf")
Expand Down

0 comments on commit 0544c58

Please sign in to comment.