Skip to content

Commit

Permalink
Additional top folder variable replacements
Browse files Browse the repository at this point in the history
Includes changing HOMEgfs/ush to USHgfs for preamble command

Refs NOAA-EMC#2332
  • Loading branch information
KateFriedman-NOAA committed Mar 6, 2024
1 parent 4f142a7 commit a2376ef
Show file tree
Hide file tree
Showing 41 changed files with 58 additions and 69 deletions.
10 changes: 5 additions & 5 deletions ush/forecast_postdet.sh
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ EOF
fi

# NoahMP table
local noahmptablefile="${HOMEgfs}/parm/ufs/noahmptable.tbl"
local noahmptablefile="${PARMgfs}/ufs/noahmptable.tbl"
if [[ ! -f ${noahmptablefile} ]]; then
echo "FATAL ERROR: missing noahmp table file ${noahmptablefile}"
exit 1
Expand Down Expand Up @@ -488,7 +488,7 @@ FV3_nml(){
# namelist output for a certain component
echo "SUB ${FUNCNAME[0]}: Creating name lists and model configure file for FV3"
# Call child scripts in current script directory
source "${HOMEgfs}/ush/parsing_namelists_FV3.sh"
source "${USHgfs}/parsing_namelists_FV3.sh"
FV3_namelists
echo "SUB ${FUNCNAME[0]}: FV3 name lists and model configure file created"
}
Expand Down Expand Up @@ -652,7 +652,7 @@ WW3_nml() {
exit 4
fi
fi
source "${HOMEgfs}/ush/parsing_namelists_WW3.sh"
source "${USHgfs}/parsing_namelists_WW3.sh"
WW3_namelists
}

Expand Down Expand Up @@ -803,7 +803,7 @@ MOM6_postdet() {

MOM6_nml() {
echo "SUB ${FUNCNAME[0]}: Creating name list for MOM6"
source "${HOMEgfs}/ush/parsing_namelists_MOM6.sh"
source "${USHgfs}/parsing_namelists_MOM6.sh"
MOM6_namelists
}

Expand Down Expand Up @@ -884,7 +884,7 @@ CICE_postdet() {

CICE_nml() {
echo "SUB ${FUNCNAME[0]}: Creating name list for CICE"
source "${HOMEgfs}/ush/parsing_namelists_CICE.sh"
source "${USHgfs}/parsing_namelists_CICE.sh"
CICE_namelists
}

Expand Down
2 changes: 1 addition & 1 deletion ush/fv3gfs_remap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#-- Fanglin Yang, October 2016
#--------------------------------------

source "${HOMEgfs}/ush/preamble.sh"
source "${USHgfs}/preamble.sh"

export CDATE=${CDATE:-"2016100300"}
export CASE=${CASE:-"C192"} # C48 C96 C192 C384 C768 C1152 C3072
Expand Down
13 changes: 1 addition & 12 deletions ush/gaussian_sfcanl.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,7 @@
# OUTPUT_FILE Output gaussian analysis file format. Default is "nemsio"
# Set to "netcdf" for netcdf output file
# Otherwise, output in nemsio.
# BASEDIR Root directory where all scripts and fixed files reside.
# Default is /nwprod2.
# HOMEgfs Directory for gfs version. Default is
# $BASEDIR/gfs_ver.v15.0.0}
# FIXWGTS Weight file to use for interpolation
# EXECgfs Directory of the program executable. Defaults to
# $HOMEgfs/exec
# DATA Working directory
# (if nonexistent will be made, used and deleted)
# Defaults to current working directory
Expand Down Expand Up @@ -106,7 +100,7 @@
#
################################################################################

source "$HOMEgfs/ush/preamble.sh"
source "${USHgfs}/preamble.sh"

CASE=${CASE:-C768}
res=$(echo $CASE | cut -c2-)
Expand All @@ -117,11 +111,6 @@ LATB_SFC=${LATB_SFC:-$LATB_CASE}
DONST=${DONST:-"NO"}
LEVS=${LEVS:-64}
LEVSP1=$(($LEVS+1))
# Directories.
gfs_ver=${gfs_ver:-v16.3.0}
BASEDIR=${BASEDIR:-${PACKAGEROOT:-/lfs/h1/ops/prod/packages}}
HOMEgfs=${HOMEgfs:-$BASEDIR/gfs.${gfs_ver}}
EXECgfs=${EXECgfs:-$HOMEgfs/exec}
FIXWGTS=${FIXWGTS:-${FIXgfs}/orog/${CASE}/fv3_SCRIP_${CASE}_GRIDSPEC_lon${LONB_SFC}_lat${LATB_SFC}.gaussian.neareststod.nc}
DATA=${DATA:-$(pwd)}

Expand Down
2 changes: 1 addition & 1 deletion ush/getdump.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#! /usr/bin/env bash

source "$HOMEgfs/ush/preamble.sh"
source "${USHgfs}/preamble.sh"

COMPONENT=${COMPONENT:-atmos}

Expand Down
2 changes: 1 addition & 1 deletion ush/getges.sh
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
################################################################################
#-------------------------------------------------------------------------------

source "$HOMEgfs/ush/preamble.sh"
source "${USHgfs}/preamble.sh"

# Set some default parameters.
fhbeg=03 # hour to begin searching backward for guess
Expand Down
2 changes: 1 addition & 1 deletion ush/gfs_bfr2gpk.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
# Log: #
# K. Brill/HPC 04/12/05 #
#########################################################################
source "${HOMEgfs}/ush/preamble.sh"
source "${USHgfs}/preamble.sh"

# Set GEMPAK paths.

Expand Down
2 changes: 1 addition & 1 deletion ush/gfs_bufr.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
# 2019-10-10 Guang Ping Lou: Read in NetCDF files
# echo "History: February 2003 - First implementation of this utility script"
#
source "${HOMEgfs:?}/ush/preamble.sh"
source "${USHgfs}/preamble.sh"

if [[ "${F00FLAG}" == "YES" ]]; then
f00flag=".true."
Expand Down
2 changes: 1 addition & 1 deletion ush/gfs_bufr_netcdf.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
# 2019-10-10 Guang Ping Lou: Read in NetCDF files
# echo "History: February 2003 - First implementation of this utility script"
#
source "$HOMEgfs/ush/preamble.sh"
source "${USHgfs}/preamble.sh"

if test "$F00FLAG" = "YES"
then
Expand Down
4 changes: 2 additions & 2 deletions ush/gfs_sndp.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# 1) 2004-09-10 Steve Gilbert First Implementation
################################################################

source "$HOMEgfs/ush/preamble.sh"
source "${USHgfs}/preamble.sh"

# Create "collectives" consisting of groupings of the soundings
# into files designated by geographical region. Each input
Expand All @@ -16,7 +16,7 @@ source "$HOMEgfs/ush/preamble.sh"
export m=$1
mkdir $DATA/$m
cd $DATA/$m
cp ${HOMEgfs}/fix/product/gfs_collective${m}.list $DATA/$m/.
cp ${FIXgfs}/product/gfs_collective${m}.list $DATA/$m/.
CCCC=KWBC
file_list=gfs_collective${m}.list

Expand Down
2 changes: 1 addition & 1 deletion ush/gfs_truncate_enkf.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#! /usr/bin/env bash

source "$HOMEgfs/ush/preamble.sh"
source "${USHgfs}/preamble.sh"

member=$1
export SIGINP=$2
Expand Down
2 changes: 1 addition & 1 deletion ush/global_savefits.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
########################################################
# save fit and horiz files for all analysis cycles
########################################################
source "$HOMEgfs/ush/preamble.sh"
source "${USHgfs}/preamble.sh"

export FIT_DIR=${FIT_DIR:-$COMOUT/fits}
export HORZ_DIR=${HORZ_DIR:-$COMOUT/horiz}
Expand Down
2 changes: 1 addition & 1 deletion ush/hpssarch_gen.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# Fanglin Yang, 20180318
# --create bunches of files to be archived to HPSS
###################################################
source "${HOMEgfs}/ush/preamble.sh"
source "${USHgfs}/preamble.sh"

type=${1:-gfs} ##gfs, gdas, enkfgdas or enkfggfs

Expand Down
4 changes: 2 additions & 2 deletions ush/interp_atmos_master.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# Generate 0.25 / 0.5 / 1 degree interpolated grib2 files for each input grib2 file
# trim's RH and tweaks sea-ice cover

source "${HOMEgfs}/ush/preamble.sh"
source "${USHgfs}/preamble.sh"

input_file=${1:-"pgb2file_in"} # Input pressure grib2 file
output_file_prefix=${2:-"pgb2file_out"} # Prefix for output grib2 file; the prefix is appended by resolution e.g. _0p25
Expand All @@ -29,7 +29,7 @@ grid0p50="latlon 0:720:0.5 90:361:-0.5"
grid1p00="latlon 0:360:1.0 90:181:-1.0"

# "Import" functions used in this script
source "${HOMEgfs}/ush/product_functions.sh"
source "${USHgfs}/product_functions.sh"

# Transform the input ${grid_string} into an array for processing
IFS=':' read -ra grids <<< "${grid_string}"
Expand Down
4 changes: 2 additions & 2 deletions ush/interp_atmos_sflux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# This script takes in a master flux file and creates interpolated flux files at various interpolated resolutions
# Generate 0.25 / 0.5 / 1 degree interpolated grib2 flux files for each input sflux grib2 file

source "${HOMEgfs}/ush/preamble.sh"
source "${USHgfs}/preamble.sh"

input_file=${1:-"sfluxfile_in"} # Input sflux grib2 file
output_file_prefix=${2:-"sfluxfile_out"} # Prefix for output sflux grib2 file; the prefix is appended by resolution e.g. _0p25
Expand Down Expand Up @@ -46,4 +46,4 @@ ${WGRIB2} "${input_file}" ${defaults} \
${output_grids}
export err=$?; err_chk

exit 0
exit 0
2 changes: 1 addition & 1 deletion ush/link_crtm_fix.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#! /usr/bin/env bash

source "$HOMEgfs/ush/preamble.sh"
source "${USHgfs}/preamble.sh"

# Get CRTM fix directory from (in this order):
# 1. First argument to script, or
Expand Down
2 changes: 1 addition & 1 deletion ush/oceanice_nc2grib2.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# This script contains functions to convert ocean/ice rectilinear netCDF files to grib2 format
# This script uses the wgrib2 utility to convert the netCDF files to grib2 format and then indexes it

source "${HOMEgfs}/ush/preamble.sh"
source "${USHgfs}/preamble.sh"

################################################################################
function _ice_nc2grib2 {
Expand Down
6 changes: 3 additions & 3 deletions ush/ozn_xtrct.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#! /usr/bin/env bash

source "${HOMEgfs}/ush/preamble.sh"
source "${USHgfs}/preamble.sh"

#------------------------------------------------------------------
# ozn_xtrct.sh
Expand Down Expand Up @@ -132,12 +132,12 @@ else
#--------------------------------------------------------------------
# Copy extraction programs to working directory
#
${NCP} "${HOMEgfs}/exec/oznmon_time.x" ./oznmon_time.x
${NCP} "${EXECgfs}/oznmon_time.x" ./oznmon_time.x
if [[ ! -e oznmon_time.x ]]; then
iret=2
exit ${iret}
fi
${NCP} "${HOMEgfs}/exec/oznmon_horiz.x" ./oznmon_horiz.x
${NCP} "${EXECgfs}/oznmon_horiz.x" ./oznmon_horiz.x
if [[ ! -e oznmon_horiz.x ]]; then
iret=3
exit ${iret}
Expand Down
4 changes: 2 additions & 2 deletions ush/parsing_model_configure_FV3.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,12 @@ local OUTPUT_FH=${FV3_OUTPUT_FH}
local IAU_OFFSET=${IAU_OFFSET:-0}

# Ensure the template exists
template="${HOMEgfs}/parm/ufs/model_configure.IN"
template="${PARMgfs}/ufs/model_configure.IN"
if [[ ! -f ${template} ]]; then
echo "FATAL ERROR: template '${template}' does not exist, ABORT!"
exit 1
fi
source "${HOMEgfs}/ush/atparse.bash"
source "${USHgfs}/atparse.bash"
rm -f "${DATA}/model_configure"
atparse < "${template}" >> "${DATA}/model_configure"
echo "Rendered model_configure"
Expand Down
4 changes: 2 additions & 2 deletions ush/parsing_namelists_CICE.sh
Original file line number Diff line number Diff line change
Expand Up @@ -104,12 +104,12 @@ local CICE_BLCKY=${block_size_y}
local CICE_DECOMP=${processor_shape}

# Ensure the template exists
local template=${CICE_TEMPLATE:-"${HOMEgfs}/parm/ufs/ice_in.IN"}
local template=${CICE_TEMPLATE:-"${PARMgfs}/ufs/ice_in.IN"}
if [[ ! -f "${template}" ]]; then
echo "FATAL ERROR: template '${template}' does not exist, ABORT!"
exit 1
fi
source "${HOMEgfs}/ush/atparse.bash"
source "${USHgfs}/atparse.bash"
rm -f "${DATA}/ice_in"
atparse < "${template}" >> "${DATA}/ice_in"
echo "Rendered ice_in:"
Expand Down
10 changes: 5 additions & 5 deletions ush/parsing_namelists_FV3.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
FV3_namelists(){

# setup the tables
DIAG_TABLE=${DIAG_TABLE:-${HOMEgfs}/parm/ufs/fv3/diag_table}
DIAG_TABLE_APPEND=${DIAG_TABLE_APPEND:-${HOMEgfs}/parm/ufs/fv3/diag_table_aod}
DATA_TABLE=${DATA_TABLE:-${HOMEgfs}/parm/ufs/MOM6_data_table.IN}
FIELD_TABLE=${FIELD_TABLE:-${HOMEgfs}/parm/ufs/fv3/field_table}
DIAG_TABLE=${DIAG_TABLE:-${PARMgfs}/ufs/fv3/diag_table}
DIAG_TABLE_APPEND=${DIAG_TABLE_APPEND:-${PARMgfs}/ufs/fv3/diag_table_aod}
DATA_TABLE=${DATA_TABLE:-${PARMgfs}/ufs/MOM6_data_table.IN}
FIELD_TABLE=${FIELD_TABLE:-${PARMgfs}/ufs/fv3/field_table}

# ensure non-prognostic tracers are set
dnats=${dnats:-0}
Expand All @@ -42,7 +42,7 @@ local SYEAR=${current_cycle:0:4}
local SMONTH=${current_cycle:4:2}
local SDAY=${current_cycle:6:2}
local CHOUR=${current_cycle:8:2}
source "${HOMEgfs}/ush/atparse.bash"
source "${USHgfs}/atparse.bash"
atparse < "${template}" >> "diag_table"


Expand Down
6 changes: 3 additions & 3 deletions ush/parsing_namelists_MOM6.sh
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ echo "Rendered input.nml:"
cat input.nml

# Source functions from this file for filling in templates
source "${HOMEgfs}/ush/atparse.bash"
source "${USHgfs}/atparse.bash"

# ================================================================
# MOM_input
Expand Down Expand Up @@ -107,7 +107,7 @@ else
local PERT_EPBL="False"
fi
# Ensure the template exists
local template=${MOM6_INPUT_TEMPLATE:-"${HOMEgfs}/parm/ufs/MOM_input_${OCNRES}.IN"}
local template=${MOM6_INPUT_TEMPLATE:-"${PARMgfs}/ufs/MOM_input_${OCNRES}.IN"}
if [[ ! -f "${template}" ]]; then
echo "FATAL ERROR: template '${template}' does not exist, ABORT!"
exit 1
Expand All @@ -124,7 +124,7 @@ cat "${DATA}/INPUT/MOM_input"
local MOM6_FRUNOFF=${FRUNOFF}

# Ensure the template exists
local template=${MOM6_DATA_TABLE_TEMPLATE:-"${HOMEgfs}/parm/ufs/MOM6_data_table.IN"}
local template=${MOM6_DATA_TABLE_TEMPLATE:-"${PARMgfs}/ufs/MOM6_data_table.IN"}
if [[ ! -f "${template}" ]]; then
echo "FATAL ERROR: template '${template}' does not exist, ABORT!"
exit 1
Expand Down
2 changes: 1 addition & 1 deletion ush/parsing_ufs_configure.sh
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ else
echo "INFO: using ufs.configure template: '${ufs_configure_template}'"
fi

source "${HOMEgfs}/ush/atparse.bash"
source "${USHgfs}/atparse.bash"
rm -f "${DATA}/ufs.configure"
atparse < "${ufs_configure_template}" >> "${DATA}/ufs.configure"
echo "Rendered ufs.configure:"
Expand Down
2 changes: 1 addition & 1 deletion ush/radmon_err_rpt.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#! /usr/bin/env bash

source "${HOMEgfs}/ush/preamble.sh"
source "${USHgfs}/preamble.sh"

################################################################################
#### UNIX Script Documentation Block
Expand Down
2 changes: 1 addition & 1 deletion ush/radmon_verf_angle.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#! /usr/bin/env bash

source "${HOMEgfs}/ush/preamble.sh"
source "${USHgfs}/preamble.sh"

################################################################################
#### UNIX Script Documentation Block
Expand Down
2 changes: 1 addition & 1 deletion ush/radmon_verf_bcoef.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#! /usr/bin/env bash

source "${HOMEgfs}/ush/preamble.sh"
source "${USHgfs}/preamble.sh"

################################################################################
#### UNIX Script Documentation Block
Expand Down
2 changes: 1 addition & 1 deletion ush/radmon_verf_bcor.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#! /usr/bin/env bash

source "${HOMEgfs}/ush/preamble.sh"
source "${USHgfs}/preamble.sh"

################################################################################
#### UNIX Script Documentation Block
Expand Down
2 changes: 1 addition & 1 deletion ush/radmon_verf_time.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#! /usr/bin/env bash

source "${HOMEgfs}/ush/preamble.sh"
source "${USHgfs}/preamble.sh"

################################################################################
#### UNIX Script Documentation Block
Expand Down
2 changes: 1 addition & 1 deletion ush/rstprod.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#! /usr/bin/env bash

source "$HOMEgfs/ush/preamble.sh"
source "${USHgfs}/preamble.sh"

#---------------------------------------------------------
# rstprod.sh
Expand Down
2 changes: 1 addition & 1 deletion ush/run_mpmd.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env bash

source "${HOMEgfs}/ush/preamble.sh"
source "${USHgfs}/preamble.sh"

cmdfile=${1:?"run_mpmd requires an input file containing commands to execute in MPMD mode"}

Expand Down
Loading

0 comments on commit a2376ef

Please sign in to comment.