From c46577a0952cd1d99b7d37380fc4e5ce5cb6ea7b Mon Sep 17 00:00:00 2001 From: Christina Holt Date: Thu, 26 Sep 2024 09:20:27 -0600 Subject: [PATCH] UW-enabled job and ex-script --- jobs/JAQM_MAKE_ICS | 89 +----- scripts/exaqm_make_ics.sh | 617 +------------------------------------- 2 files changed, 19 insertions(+), 687 deletions(-) diff --git a/jobs/JAQM_MAKE_ICS b/jobs/JAQM_MAKE_ICS index 3660d0e0ae..29151f9507 100755 --- a/jobs/JAQM_MAKE_ICS +++ b/jobs/JAQM_MAKE_ICS @@ -8,21 +8,11 @@ set -xue export USHaqm=${EXECaqm:-${HOMEaqm}/ush} export PARMaqm=${PARMaqm:-${HOMEaqm}/parm} -export subcyc='00' -export SLASH_ENSMEM_SUBDIR='' -export ENSMEM_INDX='##' - export pid=${pid:-$$} export outid=${outid:-"LL$job"} -export DATA=${DATA:-${DATAROOT}/${jobid}} -mkdir -p ${DATA} -cd ${DATA} - . $USHaqm/aqm_nco_config.sh -. ${USHaqm}/source_util_funcs.sh - export cycle=${cycle:-t${cyc}z} setpdy.sh @@ -32,72 +22,18 @@ export CDATE=${PDY}${cyc} . $USHaqm/job_preamble.sh -export EXECaqm=${EXECaqm:-${HOMEaqm}/exec} -export FIXaqm=${FIXaqm:-${HOMEaqm}/fix} - -export COMINgfs="${COMINgfs:-$(compath.py gfs/${gfs_ver})}" -export COMIN="${COMIN:-$(compath.py ${NET}/${aqm_ver}/${RUN}.${PDY})}" -export COMINm1="${COMINm1:-$(compath.py ${NET}/${aqm_ver}/${RUN}.${PDYm1})}" -export COMOUT="${COMOUT:-$(compath.py -o ${NET}/${aqm_ver}/${RUN}.${PDY}/${cyc})}" -#----------------------------------------------------------------------- -# Get the full path to the file in which this script/function is located -# (scrfunc_fp), the name of that file (scrfunc_fn), and the directory in -# which the file is located (scrfunc_dir). -#----------------------------------------------------------------------- -# -scrfunc_fp=$( $READLINK -f "${BASH_SOURCE[0]}" ) -scrfunc_fn=$( basename "${scrfunc_fp}" ) -scrfunc_dir=$( dirname "${scrfunc_fp}" ) +cycle_iso=${PDY:04}-${PDY:4:2}-${PDY:6:2}T${cyc} +uw chgres_cube provisioned_rundir \ + --cycle $cycle_iso \ + --config ${USHaqm}/config.yaml \ + --key-path make_ics -#env -#----------------------------------------------------------------------- -# Print message indicating entry into script. -#----------------------------------------------------------------------- -# -print_info_msg " -======================================================================== -Entering script: \"${scrfunc_fn}\" -In directory: \"${scrfunc_dir}\" - -This is the J-job script for the task that generates initial condition -(IC), surface, and zeroth-hour lateral boundary condition (LBC0) files -for the FV3 (in NetCDF format). -========================================================================" -# -#----------------------------------------------------------------------- -# Set the name of and create the directory in which the output from this -# script will be placed (if that directory doesn't already exist). -#----------------------------------------------------------------------- -# -export INPUT_DATA="${INPUT_DATA:-${COMIN}/${cyc}}" -mkdir -p ${INPUT_DATA} -# -#----------------------------------------------------------------------- -# Set the run directory -#----------------------------------------------------------------------- -# -DATA="${DATA:-${COMIN}${SLASH_ENSMEM_SUBDIR}/tmp_MAKE_ICS}" -# -#----------------------------------------------------------------------- -# Set environment only when RUN_TASK_GET_EXTRN_ICS is false. -#----------------------------------------------------------------------- -# -if [ "${RUN_TASK_GET_EXTRN_ICS}" = "FALSE" ]; then - export TIME_OFFSET_HRS=${EXTRN_MDL_ICS_OFFSET_HRS:-0} - export EXTRN_MDL_NAME=${EXTRN_MDL_NAME_ICS} - GFS_FILE_FMT=${FV3GFS_FILE_FMT_ICS} - yyyymmdd=${PDY} - hh=${cyc} - export EXTRN_MDL_CDATE=`$NDATE -${TIME_OFFSET_HRS} $PDY$cyc` - export EXTRN_MDL_STAGING_DIR="${EXTRN_MDL_STAGING_DIR:-${DATA}}" -fi -# #----------------------------------------------------------------------- # Call the ex-script for this J-job and pass to it the necessary variables. #----------------------------------------------------------------------- # -${HOMEaqm}/scripts/exaqm_make_ics.sh +${HOMEaqm}/scripts/exaqm_make_ics.sh export err=$?; err_chk # #====================================================================== @@ -107,18 +43,5 @@ postmsg "${msg}" if [ "${KEEPDATA}" != "YES" ]; then rm -rf ${DATA} fi -#======================================================================= -# Print exit message -print_info_msg " -======================================================================== -Exiting script: \"${scrfunc_fn}\" -In directory: \"${scrfunc_dir}\" -========================================================================" -# -#----------------------------------------------------------------------- -# Restore the shell options saved at the beginning of this script/function. -#----------------------------------------------------------------------- -# -{ restore_shell_opts; } > /dev/null 2>&1 date diff --git a/scripts/exaqm_make_ics.sh b/scripts/exaqm_make_ics.sh index 92f55c9f77..1429debc61 100755 --- a/scripts/exaqm_make_ics.sh +++ b/scripts/exaqm_make_ics.sh @@ -4,7 +4,7 @@ set -x msg="JOB $job HAS BEGUN" postmsg "$msg" - + export pgm=aqm_make_ics #----------------------------------------------------------------------- # @@ -13,583 +13,13 @@ export pgm=aqm_make_ics #----------------------------------------------------------------------- # . $USHaqm/source_util_funcs.sh - source_config_for_task "task_make_ics|task_get_extrn_ics" ${GLOBAL_VAR_DEFNS_FP} -# -#----------------------------------------------------------------------- -# -# Save current shell options (in a global array). Then set new options -# for this script/function. -# -#----------------------------------------------------------------------- -# -{ save_shell_opts; . $USHaqm/preamble.sh; } > /dev/null 2>&1 -# -#----------------------------------------------------------------------- -# -# Get the full path to the file in which this script/function is located -# (scrfunc_fp), the name of that file (scrfunc_fn), and the directory in -# which the file is located (scrfunc_dir). -# -#----------------------------------------------------------------------- -# -scrfunc_fp=$( $READLINK -f "${BASH_SOURCE[0]}" ) -scrfunc_fn=$( basename "${scrfunc_fp}" ) -scrfunc_dir=$( dirname "${scrfunc_fp}" ) -# -#----------------------------------------------------------------------- -# -# Print message indicating entry into script. -# -#----------------------------------------------------------------------- -# -print_info_msg " -======================================================================== -Entering script: \"${scrfunc_fn}\" -In directory: \"${scrfunc_dir}\" - -This is the ex-script for the task that generates initial condition -(IC), surface, and zeroth hour lateral boundary condition (LBC0) files -(in NetCDF format) for the FV3-LAM. -========================================================================" -# -#----------------------------------------------------------------------- -# -# Set OpenMP variables. -# -#----------------------------------------------------------------------- -# -export KMP_AFFINITY=${KMP_AFFINITY_MAKE_ICS} -export OMP_NUM_THREADS=${OMP_NUM_THREADS_MAKE_ICS} -export OMP_STACKSIZE=${OMP_STACKSIZE_MAKE_ICS} -# -#----------------------------------------------------------------------- -# -# Set machine-dependent parameters. -# -#----------------------------------------------------------------------- -# -eval ${PRE_TASK_CMDS} - -nprocs=$(( NNODES_MAKE_ICS*PPN_MAKE_ICS )) - -if [ -z "${RUN_CMD_UTILS:-}" ] ; then - print_err_msg_exit "\ - Run command was not set in machine file. \ - Please set RUN_CMD_UTILS for your platform" -else - print_info_msg "$VERBOSE" " - All executables will be submitted with command \'${RUN_CMD_UTILS}\'." -fi -# -#----------------------------------------------------------------------- -# -# Link input data file only when RUN_TASK_GET_EXTRN_ICS is false -# -#----------------------------------------------------------------------- -# -if [ "${RUN_TASK_GET_EXTRN_ICS}" = "FALSE" ]; then - if [ ${TIME_OFFSET_HRS} -eq 0 ] ; then - file_set="anl" - else - file_set="fcst" - fi - fcst_hrs=${TIME_OFFSET_HRS} - file_names=${EXTRN_MDL_FILES_ICS[@]} - if [ ${EXTRN_MDL_NAME} = FV3GFS ] || [ "${EXTRN_MDL_NAME}" == "GDAS" ] ; then - file_type=$FV3GFS_FILE_FMT_ICS - fi - input_file_path=${EXTRN_MDL_SOURCE_BASEDIR_ICS:-$EXTRN_MDL_SYSBASEDIR_ICS} - - data_stores="${EXTRN_MDL_DATA_STORES}" - yyyymmddhh=${EXTRN_MDL_CDATE:0:10} - yyyy=${yyyymmddhh:0:4} - yyyymm=${yyyymmddhh:0:6} - yyyymmdd=${yyyymmddhh:0:8} - mm=${yyyymmddhh:4:2} - dd=${yyyymmddhh:6:2} - hh=${yyyymmddhh:8:2} - # Set to use the pre-defined data paths in the machine file (parm/machine/). - PDYext=${yyyymmdd} - cycext=${hh} +$SRWrun/chgres_cube.py \ + -c &GLOBAL_VAR_DEFNS_FP; \ + --cycle @Y-@m-@dT@H:@M:@S \ + --key-path task_make_ics - # Set an empty members directory - mem_dir="" - - input_file_path=$(eval echo ${input_file_path}) - if [[ $input_file_path = *" "* ]]; then - input_file_path=$(eval ${input_file_path}) - fi - - additional_flags="" - - if [ -n "${file_type:-}" ] ; then - additional_flags="$additional_flags --file_type ${file_type}" - fi - - if [ -n "${file_names:-}" ] ; then - additional_flags="$additional_flags --file_templates ${file_names[@]}" - fi - - if [ -n "${input_file_path:-}" ] ; then - data_stores="disk $data_stores" - additional_flags="$additional_flags --input_file_path ${input_file_path}" - fi - - if [ $SYMLINK_FIX_FILES = "TRUE" ]; then - additional_flags="$additional_flags --symlink" - fi - - if [ $DO_ENSEMBLE == "TRUE" ] ; then - mem_dir="/mem{mem:03d}" - member_list=(1 ${NUM_ENS_MEMBERS}) - additional_flags="$additional_flags --members ${member_list[@]}" - fi - - EXTRN_DEFNS="${NET}.${cycle}.${EXTRN_MDL_NAME}.ICS.${EXTRN_MDL_VAR_DEFNS_FN}.sh" - - cmd=" - ${USHaqm}/retrieve_data.py \ - --debug \ - --symlink \ - --file_set ${file_set} \ - --config ${PARMdir}/data_locations.yml \ - --cycle_date ${EXTRN_MDL_CDATE} \ - --data_stores ${data_stores} \ - --external_model ${EXTRN_MDL_NAME} \ - --fcst_hrs ${fcst_hrs[@]} \ - --ics_or_lbcs "ICS" \ - --output_path ${EXTRN_MDL_STAGING_DIR}${mem_dir} \ - --summary_file ${EXTRN_DEFNS} \ - $additional_flags" - - $cmd - export err=$? - - if [ $err -ne 0 ]; then - message_txt="FATAL ERROR Call to retrieve_data.py failed with a non-zero exit status. -The command was: -${cmd} -" - err_exit "${message_txt}" - fi -fi -# -#----------------------------------------------------------------------- -# -# Source the file containing definitions of variables associated with the -# external model for ICs. -# -#----------------------------------------------------------------------- -# -if [ "${RUN_TASK_GET_EXTRN_ICS}" = "FALSE" ]; then - extrn_mdl_staging_dir="${DATA}" -else - if [ "${WORKLFOW_MANAGER}" = "ecflow" ]; then - extrn_mdl_staging_dir="${DATAROOT}/${RUN}_get_extrn_ics_${cyc}.${share_pid}" - if [ ! -d ${extrn_mdl_staging_dir} ]; then - message_txt="FATAL ERROR ${extrn_mdl_staging_dir} not found in production mode" - err_exit "${message_txt}" - fi - else - extrn_mdl_staging_dir="${DATAROOT}/get_extrn_ics.${share_pid}" - fi -fi - extrn_mdl_var_defns_fp="${extrn_mdl_staging_dir}/${NET}.${cycle}.${EXTRN_MDL_NAME_ICS}.ICS.${EXTRN_MDL_VAR_DEFNS_FN}.sh" -. ${extrn_mdl_var_defns_fp} -# -#----------------------------------------------------------------------- -# -# Set physics-suite-dependent variable mapping table needed in the FORTRAN -# namelist file that the chgres_cube executable will read in. -# -#----------------------------------------------------------------------- -# -varmap_file="" - -case "${CCPP_PHYS_SUITE}" in -# - "FV3_GFS_2017_gfdlmp" | \ - "FV3_GFS_2017_gfdlmp_regional" | \ - "FV3_GFS_v16" | \ - "FV3_GFS_v15p2" ) - varmap_file="GFSphys_var_map.txt" - ;; - *) - message_txt="FATAL ERROR The variable \"varmap_file\" has not yet been specified for -this physics suite (CCPP_PHYS_SUITE): - CCPP_PHYS_SUITE = \"${CCPP_PHYS_SUITE}\"" - err_exit "${message_txt}" - ;; -# -esac -# -#----------------------------------------------------------------------- -# -# Set external-model-dependent variables that are needed in the FORTRAN -# namelist file that the chgres_cube executable will read in. These are de- -# scribed below. Note that for a given external model, usually only a -# subset of these all variables are set (since some may be irrelevant). -# -# external_model: -# Name of the external model from which we are obtaining the fields -# needed to generate the ICs. -# -# fn_atm: -# Name (not including path) of the nemsio or netcdf file generated by the -# external model that contains the atmospheric fields. Currently used for -# GSMGFS and FV3GFS external model data. -# -# fn_sfc: -# Name (not including path) of the nemsio or netcdf file generated by the -# external model that contains the surface fields. Currently used for -# GSMGFS and FV3GFS external model data. -# -# fn_grib2: -# Name (not including path) of the grib2 file generated by the external -# model. Currently used for NAM, RAP, and HRRR external model data. -# -# input_type: -# The "type" of input being provided to chgres_cube. This contains a combi- -# nation of information on the external model, external model file for- -# mat, and maybe other parameters. For clarity, it would be best to -# eliminate this variable in chgres_cube and replace with with 2 or 3 others -# (e.g. extrn_mdl, extrn_mdl_file_format, etc). -# -# tracers_input: -# List of atmospheric tracers to read in from the external model file -# containing these tracers. -# -# tracers: -# Names to use in the output NetCDF file for the atmospheric tracers -# specified in tracers_input. With the possible exception of GSD phys- -# ics, the elements of this array should have a one-to-one correspond- -# ence with the elements in tracers_input, e.g. if the third element of -# tracers_input is the name of the O3 mixing ratio, then the third ele- -# ment of tracers should be the name to use for the O3 mixing ratio in -# the output file. For GSD physics, three additional tracers -- ice, -# rain, and water number concentrations -- may be specified at the end -# of tracers, and these will be calculated by chgres_cube. -# -# nsoill_out: -# The number of soil layers to include in the output NetCDF file. -# -# FIELD_from_climo, where FIELD = "vgtyp", "sotyp", "vgfrc", "lai", or -# "minmax_vgfrc": -# Logical variable indicating whether or not to obtain the field in -# question from climatology instead of the external model. The field in -# question is one of vegetation type (FIELD="vgtyp"), soil type (FIELD= -# "sotyp"), vegetation fraction (FIELD="vgfrc"), leaf area index -# (FIELD="lai"), or min/max areal fractional coverage of annual green -# vegetation (FIELD="minmax_vfrr"). If FIELD_from_climo is set to -# ".true.", then the field is obtained from climatology (regardless of -# whether or not it exists in an external model file). If it is set -# to ".false.", then the field is obtained from the external model. -# If "false" is chosen and the external model file does not provide -# this field, then chgres_cube prints out an error message and stops. -# -# tg3_from_soil: -# Logical variable indicating whether or not to set the tg3 soil tempe- # Needs to be verified. -# rature field to the temperature of the deepest soil layer. -# -#----------------------------------------------------------------------- -# - -# GSK comments about chgres: -# -# The following are the three atmsopheric tracers that are in the atmo- -# spheric analysis (atmanl) nemsio file for CDATE=2017100700: -# -# "spfh","o3mr","clwmr" -# -# Note also that these are hardcoded in the code (file input_data.F90, -# subroutine read_input_atm_gfs_spectral_file), so that subroutine will -# break if tracers_input(:) is not specified as above. -# -# Note that there are other fields too ["hgt" (surface height (togography?)), -# pres (surface pressure), ugrd, vgrd, and tmp (temperature)] in the atmanl file, but those -# are not considered tracers (they're categorized as dynamics variables, -# I guess). -# -# Another note: The way things are set up now, tracers_input(:) and -# tracers(:) are assumed to have the same number of elements (just the -# atmospheric tracer names in the input and output files may be differ- -# ent). There needs to be a check for this in the chgres_cube code!! -# If there was a varmap table that specifies how to handle missing -# fields, that would solve this problem. -# -# Also, it seems like the order of tracers in tracers_input(:) and -# tracers(:) must match, e.g. if ozone mixing ratio is 3rd in -# tracers_input(:), it must also be 3rd in tracers(:). How can this be checked? -# -# NOTE: Really should use a varmap table for GFS, just like we do for -# RAP/HRRR. -# -# A non-prognostic variable that appears in the field_table for GSD physics -# is cld_amt. Why is that in the field_table at all (since it is a non- -# prognostic field), and how should we handle it here?? -# I guess this works for FV3GFS but not for the spectral GFS since these -# variables won't exist in the spectral GFS atmanl files. -# tracers_input="\"sphum\",\"liq_wat\",\"ice_wat\",\"rainwat\",\"snowwat\",\"graupel\",\"o3mr\"" -# -# Not sure if tracers(:) should include "cld_amt" since that is also in -# the field_table for CDATE=2017100700 but is a non-prognostic variable. - -external_model="" -fn_atm="" -fn_sfc="" -fn_grib2="" -input_type="" -tracers_input="\"\"" -tracers="\"\"" -nsoill_out="" -geogrid_file_input_grid="\"\"" -vgtyp_from_climo="" -sotyp_from_climo="" -vgfrc_from_climo="" -minmax_vgfrc_from_climo="" -lai_from_climo="" -tg3_from_soil="" -convert_nst="" -# -#----------------------------------------------------------------------- -# -# If the external model is not one that uses the RUC land surface model -# (LSM) -- which currently includes all valid external models except the -# HRRR and the RAP -- then we set the number of soil levels to include -# in the output NetCDF file that chgres_cube generates (nsoill_out; this -# is a variable in the namelist that chgres_cube reads in) to 4. This -# is because FV3 can handle this regardless of the LSM that it is using -# (which is specified in the suite definition file, or SDF), as follows. -# If the SDF does not use the RUC LSM (i.e. it uses the Noah or Noah MP -# LSM), then it will expect to see 4 soil layers; and if the SDF uses -# the RUC LSM, then the RUC LSM itself has the capability to regrid from -# 4 soil layers to the 9 layers that it uses. -# -# On the other hand, if the external model is one that uses the RUC LSM -# (currently meaning that it is either the HRRR or the RAP), then what -# we set nsoill_out to depends on whether the RUC or the Noah/Noah MP -# LSM is used in the SDF. If the SDF uses RUC, then both the external -# model and FV3 use RUC (which expects 9 soil levels), so we simply set -# nsoill_out to 9. In this case, chgres_cube does not need to do any -# regridding of soil levels (because the number of levels in is the same -# as the number out). If the SDF uses the Noah or Noah MP LSM, then the -# output from chgres_cube must contain 4 soil levels because that is what -# these LSMs expect, and the code in FV3 does not have the capability to -# regrid from the 9 levels in the external model to the 4 levels expected -# by Noah/Noah MP. In this case, chgres_cube does the regridding from -# 9 to 4 levels. -# -# In summary, we can set nsoill_out to 4 unless the external model is -# the HRRR or RAP AND the forecast model is using the RUC LSM. -# -#----------------------------------------------------------------------- -# -nsoill_out="4" -# -#----------------------------------------------------------------------- -# -# If the external model for ICs is one that does not provide the aerosol -# fields needed by Thompson microphysics (currently only the HRRR and -# RAP provide aerosol data) and if the physics suite uses Thompson -# microphysics, set the variable thomp_mp_climo_file in the chgres_cube -# namelist to the full path of the file containing aerosol climatology -# data. In this case, this file will be used to generate approximate -# aerosol fields in the ICs that Thompson MP can use. Otherwise, set -# thomp_mp_climo_file to a null string. -# -#----------------------------------------------------------------------- -# -thomp_mp_climo_file="" -if [ "${SDF_USES_THOMPSON_MP}" = "TRUE" ]; then - thomp_mp_climo_file="${THOMPSON_MP_CLIMO_FP}" -fi -# -#----------------------------------------------------------------------- -# -# Set other chgres_cube namelist variables depending on the external -# model used. -# -#----------------------------------------------------------------------- -# -case "${EXTRN_MDL_NAME_ICS}" in - -"FV3GFS") - if [ "${FV3GFS_FILE_FMT_ICS}" = "nemsio" ]; then - external_model="FV3GFS" - input_type="gaussian_nemsio" # For FV3GFS data on a Gaussian grid in nemsio format. - tracers_input="[\"spfh\",\"clwmr\",\"o3mr\",\"icmr\",\"rwmr\",\"snmr\",\"grle\"]" - tracers="[\"sphum\",\"liq_wat\",\"o3mr\",\"ice_wat\",\"rainwat\",\"snowwat\",\"graupel\"]" - fn_atm="${EXTRN_MDL_FNS[0]}" - fn_sfc="${EXTRN_MDL_FNS[1]}" - convert_nst=True - elif [ "${FV3GFS_FILE_FMT_ICS}" = "grib2" ]; then - external_model="GFS" - fn_grib2="${EXTRN_MDL_FNS[0]}" - input_type="grib2" - convert_nst=False - elif [ "${FV3GFS_FILE_FMT_ICS}" = "netcdf" ]; then - external_model="FV3GFS" - input_type="gaussian_netcdf" # For FV3GFS data on a Gaussian grid in netcdf format. - tracers_input="[\"spfh\",\"clwmr\",\"o3mr\",\"icmr\",\"rwmr\",\"snmr\",\"grle\"]" - tracers="[\"sphum\",\"liq_wat\",\"o3mr\",\"ice_wat\",\"rainwat\",\"snowwat\",\"graupel\"]" - fn_atm="${EXTRN_MDL_FNS[0]}" - fn_sfc="${EXTRN_MDL_FNS[1]}" - convert_nst=True - fi - vgtyp_from_climo=True - sotyp_from_climo=True - vgfrc_from_climo=True - minmax_vgfrc_from_climo=True - lai_from_climo=True - tg3_from_soil=False - ;; - -"GDAS") - 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="${EXTRN_MDL_FNS[0]}" - fn_sfc="${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 - ;; - -*) - message_txt="FATAL ERROR external-model-dependent namelist variables have not yet been specified -for this external IC model (EXTRN_MDL_NAME_ICS): - EXTRN_MDL_NAME_ICS = \"${EXTRN_MDL_NAME_ICS}\"" - err_exit "${message_txt}" - ;; - -esac -# -#----------------------------------------------------------------------- -# -# Get the starting month, day, and hour of the the external model forecast. -# -#----------------------------------------------------------------------- -# -mm="${EXTRN_MDL_CDATE:4:2}" -dd="${EXTRN_MDL_CDATE:6:2}" -hh="${EXTRN_MDL_CDATE:8:2}" -# -#----------------------------------------------------------------------- -# -# Check that the executable that generates the ICs exists. -# -#----------------------------------------------------------------------- -# -exec_fn="chgres_cube" -exec_fp="$EXECaqm/${exec_fn}" -if [ ! -s "${exec_fp}" ]; then - message_txt="FATAL ERROR The executable (exec_fp) for generating initial conditions -on the FV3-LAM native grid does not exist: - exec_fp = \"${exec_fp}\" -Please ensure that you've built this executable." - err_exit "${message_txt}" -fi -# -#----------------------------------------------------------------------- -# -# Build the FORTRAN namelist file that chgres_cube will read in. -# -#----------------------------------------------------------------------- -# -# Create a multiline variable that consists of a yaml-compliant string -# specifying the values that the namelist variables need to be set to -# (one namelist variable per line, plus a header and footer). Below, -# this variable will be passed to a python script that will create the -# namelist file. -# -# IMPORTANT: -# If we want a namelist variable to be removed from the namelist file, -# in the "settings" variable below, we need to set its value to the -# string "null". This is equivalent to setting its value to -# !!python/none -# in the base namelist file specified by FV3_NML_BASE_SUITE_FP or the -# suite-specific yaml settings file specified by FV3_NML_YAML_CONFIG_FP. -# -# It turns out that setting the variable to an empty string also works -# to remove it from the namelist! Which is better to use?? -# -settings=" -'config': { - 'fix_dir_target_grid': ${FIXlam}, - '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, - 'varmap_file': ${PARMdir}/ufs_utils/varmap_tables/${varmap_file}, - 'data_dir_input_grid': ${extrn_mdl_staging_dir}, - 'atm_files_input_grid': ${fn_atm}, - 'sfc_files_input_grid': ${fn_sfc}, - 'grib2_file_input_grid': \"${fn_grib2}\", - 'cycle_mon': $((10#${mm})), - 'cycle_day': $((10#${dd})), - 'cycle_hour': $((10#${hh})), - 'convert_atm': True, - 'convert_sfc': True, - 'convert_nst': ${convert_nst}, - 'regional': 1, - 'halo_bndy': $((10#${NH4})), - 'halo_blend': $((10#${HALO_BLEND})), - 'input_type': ${input_type}, - 'external_model': ${external_model}, - 'tracers_input': ${tracers_input}, - 'tracers': ${tracers}, - 'nsoill_out': $((10#${nsoill_out})), - 'geogrid_file_input_grid': ${geogrid_file_input_grid}, - 'vgtyp_from_climo': ${vgtyp_from_climo}, - 'sotyp_from_climo': ${sotyp_from_climo}, - 'vgfrc_from_climo': ${vgfrc_from_climo}, - 'minmax_vgfrc_from_climo': ${minmax_vgfrc_from_climo}, - 'lai_from_climo': ${lai_from_climo}, - 'tg3_from_soil': ${tg3_from_soil}, - 'thomp_mp_climo_file': ${thomp_mp_climo_file}, -} -" -# -# Call the python script to create the namelist file. -# -nml_fn="fort.41" -${USHaqm}/set_namelist.py -q -u "$settings" -o ${nml_fn} -err=$? -if [ $err -ne 0 ]; then - message_txt="FATAL ERROR Call to python script set_namelist.py to set the variables -in the namelist file read in by the ${exec_fn} executable failed. Parameters -passed to this script are: - Name of output namelist file: - nml_fn = \"${nml_fn}\" - Namelist settings specified on command line (these have highest precedence): - settings = -$settings" - err_exit "${message_txt}" -fi -# -#----------------------------------------------------------------------- -# -# Run chgres_cube. -# -#----------------------------------------------------------------------- -# -# NOTE: -# Often when the chgres_cube.exe run fails, it still returns a zero -# return code, so the failure isn't picked up the the logical OR (||) -# below. That should be fixed. This might be due to the RUN_CMD_UTILS -# command - maybe that is returning a zero exit code even though the -# exit code of chgres_cube is nonzero. A similar thing happens in the -# forecast task. -# -startmsg -eval ${RUN_CMD_UTILS} ${exec_fp} ${REDIRECT_OUT_ERR} >> $pgmout 2>errfile export err=$?; err_chk if [ -e "${pgmout}" ]; then cat ${pgmout} @@ -602,15 +32,16 @@ fi # #----------------------------------------------------------------------- # -mv out.atm.tile${TILE_RGNL}.nc \ - ${INPUT_DATA}/${NET}.${cycle}${dot_ensmem}.gfs_data.tile${TILE_RGNL}.halo${NH0}.nc +# +mv out.atm.tile7.nc \ + ${COMIN}/${cyc}/${NET}.${cycle}.gfs_data.tile7.halo0.nc -mv out.sfc.tile${TILE_RGNL}.nc \ - ${INPUT_DATA}/${NET}.${cycle}${dot_ensmem}.sfc_data.tile${TILE_RGNL}.halo${NH0}.nc +mv out.sfc.tile7.nc \ + ${COMIN}/${cyc}/${NET}.${cycle}.sfc_data.tile7.halo0.nc -mv gfs_ctrl.nc ${INPUT_DATA}/${NET}.${cycle}${dot_ensmem}.gfs_ctrl.nc +mv gfs_ctrl.nc ${COMIN}/${cyc}/${NET}.${cycle}.gfs_ctrl.nc -mv gfs.bndy.nc ${INPUT_DATA}/${NET}.${cycle}${dot_ensmem}.gfs_bndy.tile${TILE_RGNL}.f000.nc +mv gfs.bndy.nc ${COMIN}/${cyc}/${NET}.${cycle}.gfs_bndy.tile7.f000.nc # #----------------------------------------------------------------------- # @@ -619,7 +50,7 @@ mv gfs.bndy.nc ${INPUT_DATA}/${NET}.${cycle}${dot_ensmem}.gfs_bndy.tile${TILE_RG #----------------------------------------------------------------------- if [ "${DO_REAL_TIME}" == "TRUE" ] && [ "${CPL_AQM}" == "TRUE" ]; then - + export yyyy=$(echo $PDY | cut -c1-4) export mm=$(echo $PDY | cut -c5-6) export dd=$(echo $PDY | cut -c7-8) @@ -715,25 +146,3 @@ if [ "${DO_REAL_TIME}" == "TRUE" ] && [ "${CPL_AQM}" == "TRUE" ]; then fi fi -# -#----------------------------------------------------------------------- -# -# Print message indicating successful completion of script. -# -#----------------------------------------------------------------------- -# -print_info_msg " -======================================================================== -Initial condition, surface, and zeroth hour lateral boundary condition -files (in NetCDF format) for FV3 generated successfully!!! - -Exiting script: \"${scrfunc_fn}\" -In directory: \"${scrfunc_dir}\" -========================================================================" -# -#----------------------------------------------------------------------- -# -# Restore the shell options saved at the beginning of this script/func- -# tion. -# -#-----------------------------------------------------------------------