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

GEFS Staging in exglobal_stage_ic #1892

Merged
Merged
Changes from 17 commits
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
43bdac8
start stagging the code
AnilKumar-NOAA Sep 12, 2023
1456514
Add gefs selections and modified source and target in ATMOS INPUT
AnilKumar-NOAA Sep 18, 2023
7d348dc
remove comment line
AnilKumar-NOAA Sep 18, 2023
4b7a978
gefs sourcing and target updates
AnilKumar-NOAA Sep 19, 2023
a05819c
updated code to read mem_dir in gefs
AnilKumar-NOAA Sep 19, 2023
2794a19
update the gefs ensemble source dir
AnilKumar-NOAA Sep 20, 2023
4b6e50a
updated source for the gfs_ctrl.nc
AnilKumar-NOAA Sep 20, 2023
944f49a
Add Ensemble flag check
AnilKumar-NOAA Sep 21, 2023
f78761e
Removed if block from gefs selection
AnilKumar-NOAA Sep 22, 2023
5c52db3
fixed loop in ATMOS sections
AnilKumar-NOAA Sep 25, 2023
9dd29b8
assign value to ensemble members
AnilKumar-NOAA Sep 25, 2023
1c9f446
GEFS Stagging in ocean, ice, and wave
AnilKumar-NOAA Sep 26, 2023
c3934a3
GEFS Stagging with NSEM_ENS fixed
AnilKumar-NOAA Sep 27, 2023
3fdd4a8
Removing Shell checks
AnilKumar-NOAA Sep 27, 2023
fc173ec
Removing Shell checks
AnilKumar-NOAA Sep 27, 2023
eac7d37
Removing Shell checks
AnilKumar-NOAA Sep 27, 2023
bb2cb50
Removing Shell checks
AnilKumar-NOAA Sep 27, 2023
7849bfb
made modifications with =GFS
AnilKumar-NOAA Sep 28, 2023
246854b
Fixed
AnilKumar-NOAA Sep 28, 2023
be72d5c
fixed if loops for gfs and gefs
AnilKumar-NOAA Sep 28, 2023
ac0a101
looping over memdir for all staging components
AnilKumar-NOAA Sep 28, 2023
f7e37fb
memdir loop over all the components of exglobal_stage_ic
AnilKumar-NOAA Sep 29, 2023
3197351
fixed shellcheck warning for memdir loop
AnilKumar-NOAA Sep 29, 2023
3d37401
Merge branch 'NOAA-EMC:develop' into upstream/develop
AnilKumar-NOAA Sep 29, 2023
5c3094a
completed patch for PR 1892
AnilKumar-NOAA Oct 2, 2023
e34a3c6
Checked all indent issues
AnilKumar-NOAA Oct 2, 2023
d0547a5
Merge branch 'NOAA-EMC:develop' into upstream/develop
AnilKumar-NOAA Oct 3, 2023
a4fe130
Fixed indent issues for exglobal_stage_ic.sh
AnilKumar-NOAA Oct 3, 2023
ebc0eba
removed -r switch for all the generate_com
AnilKumar-NOAA Oct 4, 2023
0967029
remove if condition and gefs manually staged condition in setup_expt.py
AnilKumar-NOAA Oct 5, 2023
bdd775c
Add stage_ic to GEFS job mesh and update dependencies
WalterKolczynski-NOAA Oct 5, 2023
0c1b0a1
Add BASE_CPLIC to GEFS config.base
WalterKolczynski-NOAA Oct 5, 2023
906e3e0
Add stage_ic to GEFS config
WalterKolczynski-NOAA Oct 5, 2023
2c3819b
Remove stale coupled_ic config from GEFS
WalterKolczynski-NOAA Oct 5, 2023
23b172d
Fix low-res staged IC directory names
WalterKolczynski-NOAA Oct 5, 2023
abb512f
Add GEFS forecast dependency on stage_ic
WalterKolczynski-NOAA Oct 5, 2023
26ca715
Fix indentation of print in setup_expt
WalterKolczynski-NOAA Oct 5, 2023
b1d9368
Load stage_ic config during exp setup for GEFS
WalterKolczynski-NOAA Oct 5, 2023
9fb206b
Change BASE_CPLIC location to temp new structure on Hera
WalterKolczynski-NOAA Oct 5, 2023
bd148ca
Update rocoto generation for new stage_ic and add GEFS from WalterKol…
AnilKumar-NOAA Oct 6, 2023
df68735
indent issue resolved
AnilKumar-NOAA Oct 10, 2023
b678b47
indent issue resolved
AnilKumar-NOAA Oct 10, 2023
cd2c740
Merge pull request #4 from WalterKolczynski-NOAA/feature/stage_gefs
AnilKumar-NOAA Oct 10, 2023
d3799d2
Merge branch 'NOAA-EMC:develop' into upstream/develop
AnilKumar-NOAA Oct 10, 2023
29f4144
gefs staging-exglobal_stage_ic.sh file is tested and code is running …
AnilKumar-NOAA Oct 19, 2023
5da2ab2
Merge branch 'NOAA-EMC:develop' into upstream/develop
AnilKumar-NOAA Oct 19, 2023
e925422
Update prototype IC paths for refactored directories
WalterKolczynski-NOAA Oct 19, 2023
b0bdc4c
successful- tested coupled ic for gefs and gfs
AnilKumar-NOAA Oct 26, 2023
5c168cf
Merge branch 'upstream/develop' of https://github.com/AnilKumar-NOAA/…
AnilKumar-NOAA Oct 26, 2023
5590aaa
Merge pull request #5 from WalterKolczynski-NOAA/feature/stage_gefs
AnilKumar-NOAA Oct 26, 2023
8113cae
changes write permission to config.resource file
AnilKumar-NOAA Oct 26, 2023
4e0604e
config file permission to write for gfs
AnilKumar-NOAA Oct 26, 2023
93621ee
undo permission for both gfs ad gefs
AnilKumar-NOAA Oct 26, 2023
b6c8e99
undo permission for gfs/config.ocn
AnilKumar-NOAA Oct 26, 2023
a271675
Merge branch 'develop' into upstream/develop
WalterKolczynski-NOAA Oct 26, 2023
bdc4846
Update scripts/exglobal_stage_ic.sh
aerorahul Oct 27, 2023
aeb1879
Update scripts/exglobal_stage_ic.sh
aerorahul Oct 27, 2023
3178ced
Delete parm/config/gefs/config.waveinit
aerorahul Oct 27, 2023
de8a7d9
Update workflow/rocoto/gefs_tasks.py
aerorahul Oct 27, 2023
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
139 changes: 125 additions & 14 deletions scripts/exglobal_stage_ic.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,28 @@ GDATE=$(date -d "${PDY} ${cyc} - ${assim_freq} hours" +%Y%m%d%H)
gPDY="${GDATE:0:8}"
gcyc="${GDATE:8:2}"

# Determine NMEM_ENS based on the configuration file (e.g., config.base)
# Assuming NMEM_ENS is defined in config.base as an integer

config_file="${EXPDIR}/config.base"

if [[ -e "${config_file}" ]]; then
NMEM_ENS=$(grep "NMEM_ENS" "${config_file}" | awk -F= '{print $2}' || true)
else
echo "Error: ${config_file} does not exist or is not accessible." >&2
exit 1
fi
AnilKumar-NOAA marked this conversation as resolved.
Show resolved Hide resolved

member_dirs=()

# Populate the member_dirs array based on the value of NMEM_ENS
for ((i = 0; i < "${NMEM_ENS}"; i++)); do
member_dirs+=("mem$(printf "%03d" "${i}")")
done
AnilKumar-NOAA marked this conversation as resolved.
Show resolved Hide resolved

# Now, member_dirs contains elements like "mem000," "mem001," ..., "memNNN" where NNN is the value of NMEM_ENS.


# Initialize return code
err=0

Expand All @@ -16,9 +38,21 @@ error_message(){
}

###############################################################
# Start staging
# Start staging gefs and gfs here

# Check for command line argument to select gfs or gefs
if [[ $# -ne 1 ]]; then
echo "Usage: ${0} [gfs | gefs]"
exit 1
fi


if [[ "${selection}" = "gfs" ]]; then
WalterKolczynski-NOAA marked this conversation as resolved.
Show resolved Hide resolved
# Stage the FV3 initial conditions to ROTDIR (cold start)

member_dir=""
NMEM_ENS=0

AnilKumar-NOAA marked this conversation as resolved.
Show resolved Hide resolved
YMD=${PDY} HH=${cyc} generate_com -r COM_ATMOS_INPUT
[[ ! -d "${COM_ATMOS_INPUT}" ]] && mkdir -p "${COM_ATMOS_INPUT}"
source="${BASE_CPLIC}/${CPL_ATMIC}/${PDY}${cyc}/${CDUMP}/${CASE}/INPUT/gfs_ctrl.nc"
Expand All @@ -27,19 +61,46 @@ ${NCP} "${source}" "${target}"
rc=$?
(( rc != 0 )) && error_message "${source}" "${target}" "${rc}"
err=$((err + rc))
for ftype in gfs_data sfc_data; do
for tt in $(seq 1 6); do
for ftype in gfs_data sfc_data; do
for tt in $(seq 1 6); do
aerorahul marked this conversation as resolved.
Show resolved Hide resolved
source="${BASE_CPLIC}/${CPL_ATMIC}/${PDY}${cyc}/${CDUMP}/${CASE}/INPUT/${ftype}.tile${tt}.nc"
target="${COM_ATMOS_INPUT}/${ftype}.tile${tt}.nc"
${NCP} "${source}" "${target}"
rc=$?
(( rc != 0 )) && error_message "${source}" "${target}" "${rc}"
err=$((err + rc))
done
done
done
elif [[ "${selection}" = "gefs" ]]; then

member_dir=""
YMD=${PDY} HH=${cyc} generate_com -r COM_ATMOS_INPUT
[[ ! -d "${COM_ATMOS_INPUT}" ]] && mkdir -p "${COM_ATMOS_INPUT}"
for member_dir in $(seq -w 0 $((NMEM_ENS - 1))); do
source="${BASE_CPLIC}/${CPL_ATMIC}/${YMD}${HH}/${member_dir}/atmos/gfs_ctrl.nc"
target="${COM_ATMOS_INPUT}/gfs_ctrl.nc"
${NCP} "${source}" "${target}"
rc=$?
(( rc != 0 )) && error_message "${source}" "${target}" "${rc}"
err=$((err + rc))
for ftype in gfs_data sfc_data; do
for tt in $(seq 1 6); do
source="${BASE_CPLIC}/${CPL_ATMIC}/${YMD}${HH}/${member_dir}/atmos/${ftype}.tile${tt}.nc"
target="${COM_ATMOS_INPUT}/${ftype}.tile${tt}.nc"
rc=$?
(( rc != 0 )) && error_message "${source}" "${target}" "${rc}"
err=$((err + rc))
done
done
done
fi

# Stage ocean initial conditions to ROTDIR (warm start)
if [[ "${DO_OCN:-}" = "YES" ]]; then
if [[ "${DO_OCN:-}" = "YES" && "${selection}" = "gfs" ]]; then

member_dir=""
NMEM_ENS=0

YMD=${gPDY} HH=${gcyc} generate_com -r COM_OCEAN_RESTART
[[ ! -d "${COM_OCEAN_RESTART}" ]] && mkdir -p "${COM_OCEAN_RESTART}"
source="${BASE_CPLIC}/${CPL_OCNIC}/${PDY}${cyc}/ocn/${OCNRES}/MOM.res.nc"
Expand All @@ -52,27 +113,44 @@ if [[ "${DO_OCN:-}" = "YES" ]]; then
"500" | "100") # Only 5 degree or 1 degree ocean does not have MOM.res_[1-4].nc files
;;
"025") # Only 1/4 degree ocean has MOM.res_[1-4].nc files
for nn in $(seq 1 4); do
source="${BASE_CPLIC}/${CPL_OCNIC}/${PDY}${cyc}/ocn/${OCNRES}/MOM.res_${nn}.nc"
if [[ -f "${source}" ]]; then
for nn in $(seq 1 4); do
source="${BASE_CPLIC}/${CPL_OCNIC}/${PDY}${cyc}/ocn/${OCNRES}/MOM.res_${nn}.nc"
if [[ -f "${source}" ]]; then
target="${COM_OCEAN_RESTART}/${PDY}.${cyc}0000.MOM.res_${nn}.nc"
${NCP} "${source}" "${target}"
rc=$?
(( rc != 0 )) && error_message "${source}" "${target}" "${rc}"
err=$((err + rc))
fi
done
fi
done
;;
*)
echo "FATAL ERROR: Unsupported ocean resolution ${OCNRES}"
rc=1
err=$((err + rc))
;;
esac
elif [[ "${DO_OCN:-}" = "YES" && "${selection}" = "gefs" ]]; then
member_dir=""
YMD=${gPDY} HH=${gcyc} generate_com -r COM_OCEAN_RESTART
[[ ! -d "${COM_OCEAN_RESTART}" ]] && mkdir -p "${COM_OCEAN_RESTART}"
for member_dir in $(seq -w 0 $((NMEM_ENS - 1))); do
source="${BASE_CPLIC}/${CPL_ATMIC}/${YMD}${HH}/${member_dir}/ocean/${PDY}.${cyc}0000.MOM.res.nc"
target="${COM_OCEAN_RESTART}/${PDY}.${cyc}0000.MOM.res.nc"
${NCP} "${source}" "${target}"
rc=$?
(( rc != 0 )) && error_message "${source}" "${target}" "${rc}"
err=$((err + rc))
done
echo "FATAL ERROR: Unsupported ocean resolution ${OCNRES}"
rc=1
err=$((err + rc))
;;
esac
fi

# Stage ice initial conditions to ROTDIR (warm start)
if [[ "${DO_ICE:-}" = "YES" ]]; then
if [[ "${DO_ICE:-}" = "YES" && "${selection}" = "gfs" ]]; then
member_dir=""
NMEM_ENS=0
YMD=${gPDY} HH=${gcyc} generate_com -r COM_ICE_RESTART
[[ ! -d "${COM_ICE_RESTART}" ]] && mkdir -p "${COM_ICE_RESTART}"
ICERESdec=$(echo "${ICERES}" | awk '{printf "%0.2f", $1/100}')
Expand All @@ -82,10 +160,28 @@ if [[ "${DO_ICE:-}" = "YES" ]]; then
rc=$?
(( rc != 0 )) && error_message "${source}" "${target}" "${rc}"
err=$((err + rc))

elif [[ "${DO_ICE:-}" = "YES" && "${selection}" = "gefs" ]]; then
member_dir=""
YMD=${gPDY} HH=${gcyc} generate_com -r COM_ICE_RESTART
[[ ! -d "${COM_ICE_RESTART}" ]] && mkdir -p "${COM_ICE_RESTART}"
for member_dir in $(seq -w 0 $((NMEM_ENS - 1))); do
source="${BASE_CPLIC}/${CPL_ATMIC}/${YMD}${HH}/${member_dir}/ice/${PDY}.${cyc}0000.cice_model.res.nc"
target="${COM_OCEAN_RESTART}/${PDY}.${cyc}0000.cice_model.res.nc"
${NCP} "${source}" "${target}"
rc=$?
(( rc != 0 )) && error_message "${source}" "${target}" "${rc}"
err=$((err + rc))
done
echo "FATAL ERROR: Unsupported ocean resolution ${OCNRES}"
rc=1
err=$((err + rc))
fi

# Stage the WW3 initial conditions to ROTDIR (warm start; TODO: these should be placed in $RUN.$gPDY/$gcyc)
if [[ "${DO_WAVE:-}" = "YES" ]]; then
if [[ "${DO_WAVE:-}" = "YES" && "${selection}" = "gfs" ]]; then
member_dir=""
NMEM_ENS=0
YMD=${PDY} HH=${cyc} generate_com -r COM_WAVE_RESTART
[[ ! -d "${COM_WAVE_RESTART}" ]] && mkdir -p "${COM_WAVE_RESTART}"
for grdID in ${waveGRD}; do # TODO: check if this is a bash array; if so adjust
Expand All @@ -96,6 +192,21 @@ if [[ "${DO_WAVE:-}" = "YES" ]]; then
(( rc != 0 )) && error_message "${source}" "${target}" "${rc}"
err=$((err + rc))
done
elif [[ "${DO_WAVE:-}" = "YES" && "${selection}" = "gefs" ]]; then
member_dir=""
YMD=${gPDY} HH=${gcyc} generate_com -r COM_WAVE_RESTART
[[ ! -d "${COM_WAVE_RESTART}" ]] && mkdir -p "${COM_WAVE_RESTART}"
for member_dir in $(seq -w 0 $((NMEM_ENS - 1))); do
source="${BASE_CPLIC}/${CPL_ATMIC}/${YMD}${HH}/${member_dir}/ice/${PDY}.${cyc}0000.restart.gwes_30m"
AnilKumar-NOAA marked this conversation as resolved.
Show resolved Hide resolved
target="${COM_OCEAN_RESTART}/${PDY}.${cyc}0000.restart.gwes_30m"
${NCP} "${source}" "${target}"
rc=$?
(( rc != 0 )) && error_message "${source}" "${target}" "${rc}"
err=$((err + rc))
done
echo "FATAL ERROR: Unsupported ocean resolution ${OCNRES}"
rc=1
err=$((err + rc))
fi

###############################################################
Expand Down