Skip to content

Commit 58071a6

Browse files
committed
Merge commit '1a16f94d20898ff2ffcc3c8b6e036a9a16ed19a4' into feature/hafsv2p2_baseline
2 parents 3c1e954 + 1a16f94 commit 58071a6

File tree

191 files changed

+15964
-6385
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

191 files changed

+15964
-6385
lines changed

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
parm/gefs/postcntrl_gefs.xml text eol=lf

ci/jobs-dev/atparse.sh

Lines changed: 125 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,125 @@
1+
#! /usr/bin/env bash
2+
function atparse {
3+
# Usage:
4+
# source atparse.bash # defines the "atparse" function; only do this once
5+
# atparse [ var1=value1 [ var2=value2 [...] ] ] < input_file > output_file
6+
# This function filters text from stdin to stdout. It scans for text sequences like:
7+
# @[varname]
8+
# And replaces them with the value of the corresponding ${varname} variable.
9+
# You can provide variables that are not set in bash by providing them on the command line.
10+
# If set -u is enabled, it will exit the process when a variable is empty or undefined via set -u.
11+
12+
# Use __ in names to avoid clashing with variables in {var} blocks.
13+
local __text # current line of text being parsed, or the current command-line argument being parsed
14+
local __before # all text before the next @[...] option
15+
local __after # all text after the next @[...] option
16+
local __during # the contents of the @[...] option, including the @[ and ]
17+
local __set_x=":" # will be "set -x" if the calling script had that option enabled
18+
local __set_u=":" # will be "set -u" if the calling script had that option enabled
19+
local __set_e=":" # will be "set -e" if the calling script had that option enabled
20+
local __abort_on_undefined=NO # YES = script should abort if a variable is undefined, NO otherwise
21+
22+
# Ensure "set -x -e -u" are all inactive, but remember if they
23+
# were active so we can reset them later.
24+
if [[ -o xtrace ]] ; then
25+
__set_x="set -x"
26+
fi
27+
if [[ -o errexit ]] ; then
28+
__set_e="set -e"
29+
fi
30+
if [[ -o nounset ]] ; then
31+
__set_u="set -u"
32+
fi
33+
set +eux
34+
35+
# Allow setting variables on the atparse command line rather than the environment.
36+
# They will be local variables in this function.
37+
for __text in "$@" ; do
38+
if [[ $__text =~ ^([a-zA-Z][a-zA-Z0-9_]*)=(.*)$ ]] ; then
39+
eval "local ${BASH_REMATCH[1]}"
40+
eval "${BASH_REMATCH[1]}="'"${BASH_REMATCH[2]}"'
41+
else
42+
echo "ERROR: Ignoring invalid argument $__text" 1>&2
43+
fi
44+
done
45+
46+
# Loop over all lines of text.
47+
while [[ 1 == 1 ]] ; do
48+
# Read the next line of text. This will "fail" if no more text
49+
# is left OR if the last line lacks an end-of-line character.
50+
read -d '' -r __text
51+
52+
# Stop when "read" reports it is done ($? -ne 0) AND the text is
53+
# non-empty (! -n "$__text"). This ensures we read the final line
54+
# even if it lacks an end-of-line character.
55+
if [[ $? -ne 0 ]] ; then
56+
if [[ -n "$__text" ]] ; then
57+
# Text remained, but it had no end-of-line.
58+
:
59+
else
60+
break
61+
fi
62+
fi
63+
# Search for strings like @[varname] or @['string'] or @[@]
64+
while [[ "$__text" =~ ^([^@]*)(@\[[a-zA-Z_][a-zA-Z_0-9]*\]|@\[\'[^\']*\'\]|@\[@\]|@)(.*) ]] ; do
65+
__before="${BASH_REMATCH[1]}"
66+
__during="${BASH_REMATCH[2]}"
67+
__after="${BASH_REMATCH[3]}"
68+
printf %s "$__before"
69+
# @['string'] inserts string
70+
if [[ "$__during" =~ ^@\[\'(.*)\'\]$ ]] ; then
71+
printf %s "${BASH_REMATCH[1]}"
72+
# @[@] inserts @
73+
elif [[ "$__during" == '@[@]' ]] ; then
74+
printf @
75+
# @[varname] inserts $varname
76+
elif [[ "$__during" =~ ^@\[([a-zA-Z_][a-zA-Z_0-9]*)\] ]] ; then
77+
# Flag unknown variables at this step only.
78+
if [[ ${__abort_on_undefined} == YES ]] ; then
79+
set -u
80+
fi
81+
eval 'printf %s "$'"${BASH_REMATCH[1]}"'"'
82+
if [[ ${__abort_on_undefined} == YES ]] ; then
83+
set +u
84+
fi
85+
# Unrecognized sequences are inserted verbatim.
86+
else
87+
printf '%s' "$__during"
88+
fi
89+
# Continue until we run out of text in this line.
90+
if [[ "$__after" == "$__text" ]] ; then
91+
break
92+
fi
93+
__text="$__after"
94+
done
95+
# Print the corrected text
96+
printf '%s\n' "$__text"
97+
done
98+
99+
# Restore the calling script's shell options.
100+
eval "$__set_x"
101+
eval "$__set_u"
102+
eval "$__set_e"
103+
}
104+
105+
function test_atparse {
106+
# Note that these cannot be local since they will be invisible
107+
# to atparse:
108+
testvar='[testvar]'
109+
var1='[var1]'
110+
var2='[var2]'
111+
var4='[var4]'
112+
( cat<<\EOF ; echo -n "line with no end-of-line character [var4] = @[var4]" ) | atparse var3='**'
113+
Nothing special here. = @['Nothing special here.']
114+
[testvar] = @[testvar]
115+
[var1] [var2] = @[var1] @[var2]
116+
** = @[var3]
117+
[var4] == @[var4]
118+
@ = @[@] = @['@']
119+
@[undefined_variable_that_should_exit_script_if_set_minus_u_is_used]
120+
-n
121+
eval "export PE$c=\${PE$c:-0}" = @[' eval "export PE$c=\${PE$c:-0}"']
122+
EOF
123+
echo " ... this text should be on the same line as the line with no end-of-line character"
124+
echo "After block, \$var3 = \"$var3\" should be empty"
125+
}

ci/jobs-dev/machine.sh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/bin/bash
2+
3+
# Set machine-specific variables
4+
5+
if [[ ${machine} = "URSA" ]]; then
6+
export EXCLUSIVE='--exclusive'
7+
export STACK_SIZE=''
8+
elif [[ ${machine} = "ORION" || ${machine} = "HERCULES" ]]; then
9+
ulimit -s unlimited
10+
export EXCLUSIVE=''
11+
else
12+
echo "${machine} is not a supported machine. Cannot set machine-specific variables."
13+
fi

ci/jobs-dev/run_ifi_standalone_fv3r_URSA.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/sh
1+
#!/bin/bash
22

33
#SBATCH -o out.post.ifi_standalone_fv3r
44
#SBATCH -e out.post.ifi_standalone_fv3r

ci/jobs-dev/run_ifi_standalone_hrrr_URSA.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/sh
1+
#!/bin/bash
22

33
#SBATCH -o out.post.ifi_standalone_hrrr
44
#SBATCH -e out.post.ifi_standalone_hrrr

ci/jobs-dev/run_post_3drtma_HERA.sh

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,13 @@
44
#SBATCH -e out.post.3drtma
55
#SBATCH -J 3drtma_test
66
#SBATCH -t 00:20:00
7-
##SBATCH -q debug
87
#SBATCH -q batch
98
#SBATCH -A ovp
109
#SBATCH -N 8 --ntasks-per-node=12
1110

1211
set -x
1312

14-
# specify computation resource
13+
# specify computation resources
1514
export MP_LABELIO=yes
1615
export threads=1
1716
export OMP_NUM_THREADS=$threads

ci/jobs-dev/run_post_3drtma_HERCULES.sh

Lines changed: 0 additions & 149 deletions
This file was deleted.

0 commit comments

Comments
 (0)