Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added alpha_fd coefficient for Beljaars TOFD in GSL drag #61

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions INFO
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
05-30-24
========
Added alpha_fd coefficient for Beljaars TOFD in GSL drag
effective 00Z 06/01/24

04-10-24
========
temporary fix for Rocky 8
Expand Down
110 changes: 110 additions & 0 deletions jobs/rocoto/remapgrib.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
#!/bin/bash --login

# this file remaps 1/4 degree lat/lon grids to other grids
# 236 201 244 130 224 242

# initialize
module load gnu/13.2.0 intel/2023.2.0 netcdf/4.7.0 wgrib2/3.1.2_ncep
module list
ECHO=echo

Check warning

Code scanning / shellcheck

Use var=$(command) to assign output (or quote to assign string). Warning

Use var=$(command) to assign output (or quote to assign string).
MKDIR=mkdir

Check warning

Code scanning / shellcheck

Use var=$(command) to assign output (or quote to assign string). Warning

Use var=$(command) to assign output (or quote to assign string).
LN=ln

Check warning

Code scanning / shellcheck

Use var=$(command) to assign output (or quote to assign string). Warning

Use var=$(command) to assign output (or quote to assign string).
echo entering remapgrib.sh....
echo "****************************"
echo "ROTDIR = ${ROTDIR}"
echo "CDUMP = ${CDUMP}"
echo "COMPONENT = ${COMPONENT}"
echo "yyyymmdd = ${yyyymmdd}"
echo "hh = ${hh}"
echo "fcst = ${fcst}"
echo "GRID_NAMES = ${GRID_NAMES}"
echo

echo `which wgrib2`

Check warning

Code scanning / shellcheck

Quote this to prevent word splitting. Warning

Quote this to prevent word splitting.

Check notice

Code scanning / shellcheck

Useless echo? Instead of 'echo $(cmd)', just use 'cmd'. Note

Useless echo? Instead of 'echo $(cmd)', just use 'cmd'.

Check notice

Code scanning / shellcheck

Use $(...) notation instead of legacy backticks .... Note

Use $(...) notation instead of legacy backticks ....

Check notice

Code scanning / shellcheck

'which' is non-standard. Use builtin 'command -v' instead. Note

'which' is non-standard. Use builtin 'command -v' instead.

Check notice

Code scanning / shellcheck

Consider invoking this command separately to avoid masking its return value (or use '|| true' to ignore). Note

Consider invoking this command separately to avoid masking its return value (or use '|| true' to ignore).

#########################
# Grid Definitions
#########################
# Full domain
#---------
# 32 km
export grid_specs_221="lambert:253:50.000000 214.500000:349:32463.000000 1.000000:277:32463.000000"

#---------
# CONUS
#---------
# 13 km
export grid_specs_130="lambert:265:25.000000 233.862000:451:13545.000000 16.281000:337:13545.000000"
# 20 km
export grid_specs_252="lambert:265:25.000000 233.862000:301:20318.000000 16.281000:225:20318.000000"
# 40 km
export grid_specs_236="lambert:265:25.000000 233.862000:151:40635.000000 16.281000:113:40635.000000"

#---------
# Alaska
#---------
export grid_specs_242="nps:225:60.000000 187.000000:553:11250.000000 30.000000:425:11250.000000"

#---------
# Hawaii
#---------
export grid_specs_243="latlon 190.0:126:0.400 10.000:101:0.400"

#---------
# Puerto Rico
#---------
export grid_specs_200="lambert:253:50.000000 285.720000:108:16232.000000 16.201000:94:16232.000000"

#---------
#HRRRE
#---------
export grid_specs_999="lambert:253:50.000000 227.500000:675:13545.000000 7.500000:500:13545.000000"

#---------
# North Polar Stereographic
#---------
export grid_specs_201="nps:-105:60.000000 -150.000000:259:94512.000000 -20.826000:259:94512.000000"

#---------
# South Polar Stereographic
#---------
export grid_specs_224="sps:75:-60.000000 120.000000:257:95250.000000 20.826000:257:95250.000000"

#---------
# North Atlantic
#---------
export grid_specs_244="latlon 261.750:275:0.25 0.250:203:0.25"
#########################

# make post directory if doesn't exist
postDir=${ROTDIR}/${CDUMP}.${yyyymmdd}/${hh}/products/${COMPONENT}/grib2/0p25/post
echo "postDir: $postDir"

Check notice

Code scanning / shellcheck

Prefer putting braces around variable references even when not strictly required. Note

Prefer putting braces around variable references even when not strictly required.
if [ ! -d ${postDir} ]

Check notice

Code scanning / shellcheck

Prefer [[ ]] over [ ] for tests in Bash/Ksh. Note

Prefer [[ ]] over [ ] for tests in Bash/Ksh.

Check notice

Code scanning / shellcheck

Double quote to prevent globbing and word splitting. Note

Double quote to prevent globbing and word splitting.
then
echo "creating ${postDir} "
mkdir -p ${postDir}

Check notice

Code scanning / shellcheck

Double quote to prevent globbing and word splitting. Note

Double quote to prevent globbing and word splitting.
fi

# parse out domain
grids=$(echo $GRID_NAMES|sed 's/D/ /g')

Check notice

Code scanning / shellcheck

See if you can use ${variable//search/replace} instead. Note

See if you can use ${variable//search/replace} instead.

Check notice

Code scanning / shellcheck

Double quote to prevent globbing and word splitting. Note

Double quote to prevent globbing and word splitting.

Check notice

Code scanning / shellcheck

Prefer putting braces around variable references even when not strictly required. Note

Prefer putting braces around variable references even when not strictly required.
src_gribfile=gfs.t${hh}z.pgrb2.0p25.f${fcst}

# loop through each domain and remap 1/4 degree grib2 file to new grid
grids=$(echo $GRID_NAMES|sed 's/D/ /g')

Check notice

Code scanning / shellcheck

See if you can use ${variable//search/replace} instead. Note

See if you can use ${variable//search/replace} instead.

Check notice

Code scanning / shellcheck

Double quote to prevent globbing and word splitting. Note

Double quote to prevent globbing and word splitting.

Check notice

Code scanning / shellcheck

Prefer putting braces around variable references even when not strictly required. Note

Prefer putting braces around variable references even when not strictly required.
for grid in $grids

Check notice

Code scanning / shellcheck

Prefer putting braces around variable references even when not strictly required. Note

Prefer putting braces around variable references even when not strictly required.
do
tgt_gribfile_dir=${postDir}/${grid}
${MKDIR} -p ${tgt_gribfile_dir}

Check notice

Code scanning / shellcheck

Double quote to prevent globbing and word splitting. Note

Double quote to prevent globbing and word splitting.
tgt_gribfile=${tgt_gribfile_dir}/${src_gribfile}
${ECHO} "Processing grids for grid ${grid}"
eval grid_specs=\${grid_specs_${grid}}

Check warning

Code scanning / shellcheck

This { is literal. Check expression (missing ;/\n?) or quote it. Warning

This { is literal. Check expression (missing ;/\n?) or quote it.

Check notice

Code scanning / shellcheck

Double quote to prevent globbing and word splitting. Note

Double quote to prevent globbing and word splitting.

Check warning

Code scanning / shellcheck

This } is literal. Check expression (missing ;/\n?) or quote it. Warning

This } is literal. Check expression (missing ;/\n?) or quote it.
wgrib2 ${postDir}/../${src_gribfile} -set_grib_type c3 -new_grid_winds grid \

Check notice

Code scanning / shellcheck

Double quote to prevent globbing and word splitting. Note

Double quote to prevent globbing and word splitting.

Check notice

Code scanning / shellcheck

Double quote to prevent globbing and word splitting. Note

Double quote to prevent globbing and word splitting.
-new_grid_interpolation bilinear \
-new_grid ${grid_specs} ${tgt_gribfile}

Check notice

Code scanning / shellcheck

Double quote to prevent globbing and word splitting. Note

Double quote to prevent globbing and word splitting.

Check notice

Code scanning / shellcheck

Double quote to prevent globbing and word splitting. Note

Double quote to prevent globbing and word splitting.
done

# make links for full domain
tgt_gribfile_dir=${postDir}/full
${MKDIR} -p ${tgt_gribfile_dir}

Check notice

Code scanning / shellcheck

Double quote to prevent globbing and word splitting. Note

Double quote to prevent globbing and word splitting.
cd ${tgt_gribfile_dir}

Check warning

Code scanning / shellcheck

Use 'cd ... || exit' or 'cd ... || return' in case cd fails. Warning

Use 'cd ... || exit' or 'cd ... || return' in case cd fails.

Check notice

Code scanning / shellcheck

Double quote to prevent globbing and word splitting. Note

Double quote to prevent globbing and word splitting.
${LN} -fs ../../${src_gribfile}

Check notice

Code scanning / shellcheck

Double quote to prevent globbing and word splitting. Note

Double quote to prevent globbing and word splitting.
1 change: 1 addition & 0 deletions parm/config/gfs/config.fcst
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ if (( gwd_opt == 2 )); then
export do_gsl_drag_ss=".true."
export do_gsl_drag_tofd=".true."
export do_ugwp_v1_orog_only=".false."
export alpha_fd=35.0
launch_level=$(echo "${LEVS}/2.35" |bc)
export launch_level
if [[ ${do_gsl_drag_ls_bl} == ".true." ]]; then
Expand Down
2 changes: 1 addition & 1 deletion sorc/ufs_model.fd
2 changes: 2 additions & 0 deletions ush/parsing_namelists_FV3.sh
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,7 @@ EOF
do_gsl_drag_ss = ${do_gsl_drag_ss:-".true."}
do_gsl_drag_tofd = ${do_gsl_drag_tofd:-".true."}
do_ugwp_v1_orog_only = ${do_ugwp_v1_orog_only:-".false."}
alpha_fd = ${alpha_fd:-"12.0"}
min_lakeice = ${min_lakeice:-"0.15"}
min_seaice = ${min_seaice:-"0.15"}
use_cice_alb = ${use_cice_alb:-".false."}
Expand Down Expand Up @@ -349,6 +350,7 @@ EOF
do_gsl_drag_ss = ${do_gsl_drag_ss:-".true."}
do_gsl_drag_tofd = ${do_gsl_drag_tofd:-".true."}
do_ugwp_v1_orog_only = ${do_ugwp_v1_orog_only:-".false."}
alpha_fd = ${alpha_fd:-"12.0"}
min_lakeice = ${min_lakeice:-"0.15"}
min_seaice = ${min_seaice:-"0.15"}
use_cice_alb = ${use_cice_alb:-".false."}
Expand Down
Loading