Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
8c9a214
Add wrf nest shell script template
braczka Oct 13, 2025
34b722d
Updating WPS related nest scripting
braczka Oct 22, 2025
a27026d
Adding 3dvar perturbation template
braczka Oct 23, 2025
4b3289b
Update namelist 3dvar
braczka Oct 24, 2025
d01f642
Wrf nested tutorial edits through perts
braczka Oct 31, 2025
d014f88
Edit fill_inflation_restart for 2 domains
braczka Nov 12, 2025
09b21f9
Adding multiple domain functionality
braczka Nov 15, 2025
e1009ed
Syntax edits for nested driver.csh
braczka Nov 18, 2025
bc9f6b1
Adding bash WRF-DART shell scripting
braczka Dec 30, 2025
ab9d35c
Removing shell_script_nest folder
braczka Dec 30, 2025
afe0707
Updating WRF nested template scripts
braczka Jan 2, 2026
213205b
WRF diagnostic and coordinate fixes
braczka Jan 6, 2026
f504e84
Merge remote-tracking branch 'upstream/main' into WRF_nest
braczka Jan 6, 2026
e820d9b
Generalize multi domain to single domain
braczka Jan 8, 2026
841be05
Updated WRF tutorial documentation
braczka Jan 12, 2026
56e72ef
WRF tutorial docs syntax corrections
braczka Jan 12, 2026
7b351ac
Merge remote-tracking branch 'upstream/main' into WRF_nest
braczka Jan 12, 2026
472df99
Updating tutorial tarred file
braczka Jan 12, 2026
38bdb27
Fine tuning nested tutorial settings
braczka Jan 13, 2026
3d8e001
Updating tutorial diagnostics for new domain
braczka Jan 13, 2026
3de2ccb
Updating WRF tutorial images
braczka Jan 13, 2026
384b569
Tutorial docs syntax correction
braczka Jan 13, 2026
7f22fe0
Tutorial docs fix of table
braczka Jan 13, 2026
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
Binary file added guide/images/WRF_tutorial_domain.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified guide/images/WRF_tutorial_linkobs1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified guide/images/WRF_tutorial_linkobs2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified guide/images/WRF_tutorial_ncview1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified guide/images/WRF_tutorial_ncview2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified guide/images/WRF_tutorial_oneline1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified guide/images/WRF_tutorial_oneline2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified guide/images/WRF_tutorial_profile1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified guide/images/WRF_tutorial_profile2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added guide/images/WRF_tutorial_radar1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added guide/images/WRF_tutorial_radar2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added guide/images/WRF_tutorial_radiosonde_obs1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added guide/images/WRF_tutorial_radiosonde_obs2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed guide/images/WRF_tutorial_surface_obs.png
Binary file not shown.
16 changes: 12 additions & 4 deletions models/wrf/shell_scripts/add_bank_perts.ncl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
; Simple utility to add perturbation fields from the
; perturbation bank files to a provided wrfinput file.
; consistent with use in the advance_model.csh script
; consistent with use in the advance_model.sh script
; where we are substituting this call for running
; da_wrfvar.exe, so the wrfinput file to perturb
; should be called 'wrfinput_next', and is the mean
Expand All @@ -16,15 +16,23 @@ begin
ens_mem_num = ""+MEM_NUM
pert_bank_path = PERTS_DIR

; perturbation scaling:
;perturbation scaling: default tutorial settings
scale_T = 1.3
scale_U = 1.3
scale_V = 1.3
scale_Q = 1.3
scale_M = 0.6

; Shuts off perturbations, only used for forecast mode
;perturbation scaling:
; scale_T = 0.0
; scale_U = 0.0
; scale_V = 0.0
; scale_Q = 0.0
; scale_M = 0.0

; for random pert, pick from larger bank
bank_size = 100
bank_size = 60
con = bank_size / 32766.0 ; 32766.0 forces a 0.0 to 1.0 range
; get a seed
wallClock = stringtoint(systemfunc("date -u +%N"))
Expand All @@ -45,7 +53,7 @@ begin


;For WRFv4 or later prognostic temp variable is THM
pert_fields = (/"U", "V", "T", "QVAPOR","MU"/)
pert_fields = (/"U", "V", "THM", "QVAPOR","MU"/)
wrf_fields = (/"U", "V", "THM", "QVAPOR","MU"/)
pert_scale = (/scale_U,scale_V,scale_T,scale_Q,scale_M/)
nperts = dimsizes(pert_fields)
Expand Down
107 changes: 107 additions & 0 deletions models/wrf/shell_scripts/assim_advance.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
#!/usr/bin/env bash
#
# DART software - Copyright UCAR. This open source software is provided
# by UCAR, "as is", without charge, subject to all terms of use at
# http://www.image.ucar.edu/DAReS/DART/DART_download
#
# datea, emember, paramfile are command-line arguments - OR -
# are set by a string editor (sed) command.

set -uo pipefail

datea="${1:-}"
emember="${2:-}"
paramfile="${3:-}"

if [[ -z "${datea}" || -z "${emember}" || -z "${paramfile}" ]]; then
echo "usage: $0 <datea> <emember> <paramfile>"
exit 2
fi

source "${paramfile}"

domains="${NUM_DOMAINS}"

start_time="$(date +%s)"
echo "host is $(hostname)"
echo "assim_advance.sh is running in $(pwd)"

cd "${RUN_DIR}"

read -r -a gdate < <(echo "${datea} 0 -g" | "${RUN_DIR}/advance_time")

if (( ASSIM_INT_MINUTES <= 0 )); then
read -r -a gdatef < <(echo "${datea} ${ASSIM_INT_HOURS} -g" | "${RUN_DIR}/advance_time")
else
read -r -a gdatef < <(echo "${datea} ${ASSIM_INT_MINUTES}m -g" | "${RUN_DIR}/advance_time")
fi

yyyy="${datea:0:4}"
mm="${datea:4:2}"
dd="${datea:6:2}"
hh="${datea:8:2}"
nn="00"
ss="00"

# Copy files to appropriate location
echo "${start_time}" > "${RUN_DIR}/start_member_${emember}"

# Go into member directory and generate the needed wrf.info file
cd "${RUN_DIR}/advance_temp${emember}"

icnum="$(printf "%04d" "${emember}")"
if [[ -e "${RUN_DIR}/advance_temp${emember}/wrf.info" ]]; then
${REMOVE} "${RUN_DIR}/advance_temp${emember}/wrf.info"
fi
: > wrf.info

if [[ "${SUPER_PLATFORM}" == "LSF queuing system" ]]; then

cat > "${RUN_DIR}/advance_temp${emember}/wrf.info" <<EOF
${gdatef[1]} ${gdatef[0]}
${gdate[1]} ${gdate[0]}
$yyyy $mm $dd $hh $nn $ss
$domains
mpirun.lsf ./wrf.exe
EOF

elif [[ "${SUPER_PLATFORM}" == "derecho" ]]; then

# module load openmpi
cat > "${RUN_DIR}/advance_temp${emember}/wrf.info" <<EOF
${gdatef[1]} ${gdatef[0]}
${gdate[1]} ${gdate[0]}
$yyyy $mm $dd $hh $nn $ss
$domains
mpiexec -n 4 -ppn 4 ./wrf.exe
EOF

fi

cd "${RUN_DIR}"

# filter_control accounts for multiple domains
# Appends input (filter_restart) and output (prior) in consecutive pairs
# Should be consistent with filter_control setup for first_advance.sh
# during intial forecast step

echo "${emember}" > "${RUN_DIR}/filter_control${icnum}"

dn=1
while (( dn <= domains )); do
dchar="$(printf "%02d" "${dn}")"
echo "filter_restart_d${dchar}.${icnum}" >> "${RUN_DIR}/filter_control${icnum}"
echo "prior_d${dchar}.${icnum}" >> "${RUN_DIR}/filter_control${icnum}"
(( dn++ ))
done # loop through domains

# integrate the model forward in time
"${RUN_DIR}/new_advance_model.sh" "${emember}" "${domains}" "filter_control${icnum}" "${paramfile}"
${REMOVE} "${RUN_DIR}/filter_control${icnum}"

end_time="$(date +%s)"
length_time=$(( end_time - start_time ))
echo "duration = ${length_time}"

exit 0

59 changes: 59 additions & 0 deletions models/wrf/shell_scripts/assimilate.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
#!/bin/bash
#
# DART software - Copyright UCAR. This open source software is provided
# by UCAR, "as is", without charge, subject to all terms of use at
# http://www.image.ucar.edu/DAReS/DART/DART_download

# datea and paramfile are command-line arguments - OR -
# are set by a string editor (sed) command.

set -uo pipefail

datea="$1"
paramfile="$2"

# shellcheck disable=SC1090
source "$paramfile"

start_time="$(date +%s)"
echo "host is $(hostname)"

cd "${RUN_DIR}"
echo "${start_time}" > "${RUN_DIR}/filter_started"

# Make sure the previous results are not hanging around
if [[ -e "${RUN_DIR}/obs_seq.final" ]]; then
${REMOVE} "${RUN_DIR}/obs_seq.final"
fi
if [[ -e "${RUN_DIR}/filter_done" ]]; then
${REMOVE} "${RUN_DIR}/filter_done"
fi

# run data assimilation system
if [[ "${SUPER_PLATFORM}" == "LSF queuing system" ]]; then

export TARGET_CPU_LIST=-1
export FORT_BUFFERED=true
mpirun.lsf ./filter || exit 1

elif [[ "${SUPER_PLATFORM}" == "derecho" ]]; then

export MPI_SHEPHERD=FALSE
export TMPDIR=/dev/shm

ulimit -s unlimited

mpiexec -n 256 -ppn 128 ./filter || exit 1

fi

if [[ -e "${RUN_DIR}/obs_seq.final" ]]; then
touch "${RUN_DIR}/filter_done"
fi

end_time="$(date +%s)"
length_time=$(( end_time - start_time ))
echo "duration = $length_time"

exit 0

138 changes: 138 additions & 0 deletions models/wrf/shell_scripts/diagnostics_obs.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,138 @@
#!/bin/bash
#
# DART software - Copyright UCAR. This open source software is provided
# by UCAR, "as is", without charge, subject to all terms of use at
# http://www.image.ucar.edu/DAReS/DART/DART_download

# diagnostics_obs.sh - shell script that computes observation
# specific diagnostics.
#
# $1 - analysis date
# $2 - parameter file
#

set -uo pipefail

datea="${1:?usage: diagnostics_obs.sh YYYYMMDDHH paramfile}"
paramfile="${2:?usage: diagnostics_obs.sh YYYYMMDDHH paramfile}"

source "${paramfile}"

cd "${OBS_DIAG_DIR}"
${COPY} "${RUN_DIR}/input.nml" input.nml

read -r -a gdate < <(echo "${datea} 0 -g" | "${DART_DIR}/models/wrf/work/advance_time")
yyyy2="${datea:0:4}"
mm2="${datea:4:2}"
dd2="${datea:6:2}"
hh2="${datea:8:2}"

# Determine appropriate dates for observation diagnostics
datef="$(echo "${datea} -${ASSIM_INT_HOURS}" | "${DART_DIR}/models/wrf/work/advance_time")"
# Forcing the obs_diag_output.nc diagnostic to be the last analysis time only (not cumulative)
yyyy1="${datea:0:4}"
mm1="${datea:4:2}"
dd1="${datea:6:2}"
hh1="${datea:8:2}"

half_bin=$(( ASSIM_INT_HOURS / 2 ))
datefbs="$(echo "${datef} -${half_bin}" | "${DART_DIR}/models/wrf/work/advance_time")"
fbs_yyyy1="${datefbs:0:4}"
fbs_mm1="${datefbs:4:2}"
fbs_dd1="${datefbs:6:2}"
fbs_hh1="${datefbs:8:2}"

datefbe="$(echo "${datef} ${half_bin}" | "${DART_DIR}/models/wrf/work/advance_time")"
fbe_yyyy1="${datefbe:0:4}"
fbe_mm1="${datefbe:4:2}"
fbe_dd1="${datefbe:6:2}"
fbe_hh1="${datefbe:8:2}"

datelbe="$(echo "${datea} ${half_bin}" | "${DART_DIR}/models/wrf/work/advance_time")"
lbe_yyyy1="${datelbe:0:4}"
lbe_mm1="${datelbe:4:2}"
lbe_dd1="${datelbe:6:2}"
lbe_hh1="${datelbe:8:2}"

while [[ "${datef}" -le "${datea}" ]]; do
if [[ -e "${OUTPUT_DIR}/${datef}/obs_seq.final" ]]; then
${LINK} "${OUTPUT_DIR}/${datef}/obs_seq.final" "obs_seq.final_${datef}"
fi
datef="$(echo "${datef} ${ASSIM_INT_HOURS}" | "${DART_DIR}/models/wrf/work/advance_time")"
done

# Create flist (absolute paths)
readlink -f obs_seq.final_* > flist

cat > script.sed <<EOF
/obs_sequence_name/c\\
obs_sequence_name = '',
/obs_sequence_list/c\\
obs_sequence_list = 'flist',
/first_bin_center/c\\
first_bin_center = ${yyyy1}, ${mm1}, ${dd1}, ${hh1}, 0, 0,
/last_bin_center/c\\
last_bin_center = ${yyyy2}, ${mm2}, ${dd2}, ${hh2}, 0, 0,
/filename_seq /c\\
filename_seq = 'obs_seq.final',
/filename_seq_list/c\\
filename_seq_list = '',
/filename_out/c\\
filename_out = 'obs_seq.final_reduced',
/first_obs_days/c\\
first_obs_days = -1,
/first_obs_seconds/c\\
first_obs_seconds = -1,
/last_obs_days/c\\
last_obs_days = -1,
/last_obs_seconds/c\\
last_obs_seconds = -1,
/edit_copies/c\\
edit_copies = .true.,
/new_copy_index/c\\
new_copy_index = 1, 2, 3, 4, 5,
/first_bin_start/c\\
first_bin_start = ${fbs_yyyy1}, ${fbs_mm1}, ${fbs_dd1}, ${fbs_hh1}, 0, 0,
/first_bin_end/c\\
first_bin_end = ${fbe_yyyy1}, ${fbe_mm1}, ${fbe_dd1}, ${fbe_hh1}, 0, 0,
/last_bin_end/c\\
last_bin_end = ${lbe_yyyy1}, ${lbe_mm1}, ${lbe_dd1}, ${lbe_hh1}, 0, 0,
EOF

sed -f script.sed "${RUN_DIR}/input.nml" > input.nml

# Create the state-space diagnostic summary
"${DART_DIR}/models/wrf/work/obs_diag"
${MOVE} obs_diag_output.nc "${OUTPUT_DIR}/${datea}/."
${MOVE} "$(ls -1 observation_locations.*.dat | tail -1)" "${OUTPUT_DIR}/${datea}/observation_locations.dat"

# Create a netCDF file with the original observation data (may not have some of the unusual metadata)
"${DART_DIR}/models/wrf/work/obs_seq_to_netcdf"
${MOVE} obs_epoch* "${OUTPUT_DIR}/${datea}/"
${REMOVE} ./*.txt obs_seq.final_* flist observation_locations.*.dat

# Prune the obs_seq.final and store result keeps first 5 copies? why not set num_output_obs = 0
# is it the time subsetting that is of interest?
${LINK} "${OUTPUT_DIR}/${datea}/obs_seq.final" .
"${DART_DIR}/models/wrf/work/obs_sequence_tool"
${MOVE} obs_seq.final_reduced "${OUTPUT_DIR}/${datea}/."
${REMOVE} obs_seq.final

# Process the mean analysis increment
cd "${OUTPUT_DIR}/${datea}"
${COPY} "${SHELL_SCRIPTS_DIR}/mean_increment.ncl" .
dn=1
while (( dn <= ${NUM_DOMAINS} )); do
dchar="$(echo "${dn} + 100" | bc | cut -b2-3)"
analysis_in="analysis_increment_d${dchar}.nc"
mean_out="mean_increments_d${dchar}.nc"

ncl "fname=\"${analysis_in}\"" "fout=\"${mean_out}\"" "${OUTPUT_DIR}/${datea}/mean_increment.ncl" > nclrun_d${dchar}.out

(( dn++ ))
done # loop through domains

touch "${OUTPUT_DIR}/${datea}/obs_diags_done"

exit 0

Loading