Skip to content

Commit

Permalink
Update get_extrn_ics/lbcs and make_ics/lbcs.
Browse files Browse the repository at this point in the history
  • Loading branch information
danielabdi-noaa committed Mar 10, 2023
1 parent ff6f103 commit 815b357
Show file tree
Hide file tree
Showing 5 changed files with 63 additions and 21 deletions.
4 changes: 4 additions & 0 deletions jobs/JREGIONAL_MAKE_ICS
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,14 @@ for the FV3 (in NetCDF format).
#
if [ $RUN_ENVIR = "nco" ]; then
export INPUT_DATA="${COMIN}"
export INPUT_DATA_NWGES="${NWGES_DIR}${SLASH_ENSMEM_SUBDIR}/ics"
else
export INPUT_DATA="${COMIN}${SLASH_ENSMEM_SUBDIR}/INPUT"
export INPUT_DATA_NWGES="${NWGES_DIR}${SLASH_ENSMEM_SUBDIR}/ics"
fi
mkdir_vrfy -p "${INPUT_DATA}"
mkdir_vrfy -p "${INPUT_DATA_NWGES}"
#
#
#-----------------------------------------------------------------------
#
Expand Down
3 changes: 3 additions & 0 deletions jobs/JREGIONAL_MAKE_LBCS
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,13 @@ hour zero).
#
if [ $RUN_ENVIR = "nco" ]; then
export INPUT_DATA="${COMIN}"
export INPUT_DATA_NWGES="${NWGES_DIR}${SLASH_ENSMEM_SUBDIR}/lbcs"
else
export INPUT_DATA="${COMIN}${SLASH_ENSMEM_SUBDIR}/INPUT"
export INPUT_DATA_NWGES="${NWGES_DIR}${SLASH_ENSMEM_SUBDIR}/lbcs"
fi
mkdir_vrfy -p "${INPUT_DATA}"
mkdir_vrfy -p "${INPUT_DATA_NWGES}"
#
#-----------------------------------------------------------------------
#
Expand Down
18 changes: 16 additions & 2 deletions scripts/exregional_get_extrn_mdl_files.sh
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ if [ "${ICS_OR_LBCS}" = "ICS" ]; then

elif [ "${ICS_OR_LBCS}" = "LBCS" ]; then
file_set="fcst"
first_time=$((TIME_OFFSET_HRS + LBC_SPEC_INTVL_HRS))
if [ "${FCST_LEN_HRS}" = "-1" ]; then
for i_cdate in "${!ALL_CDATES[@]}"; do
if [ "${ALL_CDATES[$i_cdate]}" = "${PDY}${cyc}" ]; then
Expand All @@ -79,7 +78,22 @@ elif [ "${ICS_OR_LBCS}" = "LBCS" ]; then
fi
done
fi
last_time=$((TIME_OFFSET_HRS + FCST_LEN_HRS))
end_hr=$FCST_LEN_HRS
if [ $BOUNDARY_LEN_HRS -gt $end_hr ]; then
end_hr=$BOUNDARY_LEN_HRS
fi
# There is a difference between RRFS_dev & SRW regarding download of 0th
# hour lbcs. RRFS_dev downloads 0th hour lbcs while SRW does not.
# I tried to make them the same but RRFS_dev workflow skips make_ics for
# some cycles so it needs to download 0th hour lbcs.
if [ ${DO_RRFS_DEV} = "TRUE" ]; then
first_time=$((TIME_OFFSET_HRS))
else
first_time=$((TIME_OFFSET_HRS + LBC_SPEC_INTVL_HRS ))
fi
last_time=$((TIME_OFFSET_HRS + end_hr))


fcst_hrs="${first_time} ${last_time} ${LBC_SPEC_INTVL_HRS}"
file_names=${EXTRN_MDL_FILES_LBCS[@]}
if [ ${EXTRN_MDL_NAME} = FV3GFS ] || [ "${EXTRN_MDL_NAME}" == "GDAS" ] ; then
Expand Down
19 changes: 17 additions & 2 deletions scripts/exregional_make_ics.sh
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,8 @@ case "${CCPP_PHYS_SUITE}" in
"FV3_GFS_v15_thompson_mynn_lam3km" | \
"FV3_GFS_v17_p8" | \
"FV3_WoFS_v0" | \
"FV3_HRRR" )
"FV3_HRRR" | \
"FV3_RAP" )
if [ "${EXTRN_MDL_NAME_ICS}" = "RAP" ] || \
[ "${EXTRN_MDL_NAME_ICS}" = "HRRR" ]; then
varmap_file="GSDphys_var_map.txt"
Expand Down Expand Up @@ -534,7 +535,7 @@ settings="
'mosaic_file_target_grid': ${FIXlam}/${CRES}${DOT_OR_USCORE}mosaic.halo$((10#${NH4})).nc,
'orog_dir_target_grid': ${FIXlam},
'orog_files_target_grid': ${CRES}${DOT_OR_USCORE}oro_data.tile${TILE_RGNL}.halo$((10#${NH4})).nc,
'vcoord_file_target_grid': ${FIXam}/global_hyblev.l65.txt,
'vcoord_file_target_grid': ${FIXam}/global_hyblev_fcst_rrfsL65.txt,
'varmap_file': ${PARMdir}/ufs_utils/varmap_tables/${varmap_file},
'data_dir_input_grid': ${extrn_mdl_staging_dir},
'atm_files_input_grid': ${fn_atm},
Expand Down Expand Up @@ -674,6 +675,20 @@ fi
#
#-----------------------------------------------------------------------
#
# Symlink files to NWGES directory, dropping prefix
#
#-----------------------------------------------------------------------
#
for i in ${INPUT_DATA}/*.nc; do
file=$(basename $i)
prefix="${NET}.${cycle}${dot_ensmem}."
file=${file#"$prefix"}
file=${file/f000/000}
ln_vrfy -sf $i ${INPUT_DATA_NWGES}/${file}
done
#
#-----------------------------------------------------------------------
#
# Print message indicating successful completion of script.
#
#-----------------------------------------------------------------------
Expand Down
40 changes: 23 additions & 17 deletions scripts/exregional_make_lbcs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -101,19 +101,6 @@ fi
DATA="${DATA}/tmp_LBCS"
mkdir_vrfy -p "$DATA"
cd_vrfy $DATA

if [ "${FCST_LEN_HRS}" = "-1" ]; then
for i_cdate in "${!ALL_CDATES[@]}"; do
if [ "${ALL_CDATES[$i_cdate]}" = "${PDY}${cyc}" ]; then
FCST_LEN_HRS="${FCST_LEN_CYCL_ALL[$i_cdate]}"
break
fi
done
fi
LBC_SPEC_FCST_HRS=()
for i_lbc in $(seq ${LBC_SPEC_INTVL_HRS} ${LBC_SPEC_INTVL_HRS} $(( FCST_LEN_HRS+LBC_SPEC_INTVL_HRS )) ); do
LBC_SPEC_FCST_HRS+=("$i_lbc")
done
#
#-----------------------------------------------------------------------
#
Expand All @@ -137,7 +124,8 @@ case "${CCPP_PHYS_SUITE}" in
"FV3_GFS_v15_thompson_mynn_lam3km" | \
"FV3_GFS_v17_p8" | \
"FV3_WoFS_v0" | \
"FV3_HRRR" )
"FV3_HRRR" | \
"FV3_RAP")
if [ "${EXTRN_MDL_NAME_LBCS}" = "RAP" ] || \
[ "${EXTRN_MDL_NAME_LBCS}" = "HRRR" ]; then
varmap_file="GSDphys_var_map.txt"
Expand Down Expand Up @@ -369,7 +357,12 @@ fi
#-----------------------------------------------------------------------
#
num_fhrs="${#EXTRN_MDL_FHRS[@]}"
for (( i=0; i<${num_fhrs}; i++ )); do
bcgrp10=${bcgrp#0}
bcgrpnum10=${bcgrpnum#0}
for (( ii=0; ii<${num_fhrs}; ii=ii+bcgrpnum10 )); do
i=$(( ii + bcgrp10 ))
if [ ${i} -lt ${num_fhrs} ]; then
echo " group ${bcgrp10} processes member ${i}"
#
# Get the forecast hour of the external model.
#
Expand Down Expand Up @@ -462,7 +455,7 @@ settings="
'mosaic_file_target_grid': ${FIXlam}/${CRES}${DOT_OR_USCORE}mosaic.halo$((10#${NH4})).nc,
'orog_dir_target_grid': ${FIXlam},
'orog_files_target_grid': ${CRES}${DOT_OR_USCORE}oro_data.tile${TILE_RGNL}.halo$((10#${NH4})).nc,
'vcoord_file_target_grid': ${FIXam}/global_hyblev.l65.txt,
'vcoord_file_target_grid': ${FIXam}/global_hyblev_fcst_rrfsL65.txt,
'varmap_file': ${PARMdir}/ufs_utils/varmap_tables/${varmap_file},
'data_dir_input_grid': ${extrn_mdl_staging_dir},
'atm_files_input_grid': ${fn_atm},
Expand Down Expand Up @@ -529,9 +522,22 @@ located in the following directory:
# the forecast hour of the FV3-LAM (which is not necessarily the same as
# that of the external model since their start times may be offset).
#
fcst_hhh_FV3LAM=$( printf "%03d" "${LBC_SPEC_FCST_HRS[$i]}" )
lbc_spec_fhrs=( "${EXTRN_MDL_FHRS[$i]}" )
fcst_hhh=$(( ${lbc_spec_fhrs} - ${EXTRN_MDL_LBCS_OFFSET_HRS} ))
fcst_hhh_FV3LAM=$( printf "%03d" "$fcst_hhh" )
mv_vrfy gfs.bndy.nc ${INPUT_DATA}/${NET}.${cycle}${dot_ensmem}.gfs_bndy.tile7.f${fcst_hhh_FV3LAM}.nc

#
#-----------------------------------------------------------------------
#
# Symlink files to NWGES directory, dropping prefix
#
#-----------------------------------------------------------------------
#
ln_vrfy -sf ${INPUT_DATA}/${NET}.${cycle}${dot_ensmem}.gfs_bndy.tile7.f${fcst_hhh_FV3LAM}.nc \
${INPUT_DATA_NWGES}/gfs_bndy.tile7.${fcst_hhh_FV3LAM}.nc

fi
done
#
#-----------------------------------------------------------------------
Expand Down

0 comments on commit 815b357

Please sign in to comment.