Skip to content

Commit

Permalink
WRF shell scripts switch to rundir input.nml
Browse files Browse the repository at this point in the history
WRF shell scripts now generate links to DART
input.nml within run dir, not template directory.
Corrects missing updates from setup.csh.
  • Loading branch information
braczka committed Apr 4, 2023
1 parent 08aba5e commit 63a5748
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 13 deletions.
4 changes: 2 additions & 2 deletions models/wrf/shell_scripts/diagnostics_obs.csh
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
source $paramfile

cd $OBS_DIAG_DIR
${COPY} ${TEMPLATE_DIR}/input.nml.template input.nml
${COPY} ${RUN_DIR}/input.nml input.nml
set gdate = (`echo $datea 0 -g | ${DART_DIR}/models/wrf/work/advance_time`)
set yyyy2 = `echo $datea | cut -b1-4`
set mm2 = `echo $datea | cut -b5-6`
Expand Down Expand Up @@ -95,7 +95,7 @@
EOF


sed -f script.sed ${TEMPLATE_DIR}/input.nml.template >! input.nml
sed -f script.sed ${RUN_DIR}/input.nml >! input.nml

# create the state-space diagnostic summary

Expand Down
2 changes: 1 addition & 1 deletion models/wrf/shell_scripts/gen_retro_icbc.csh
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ while ( 1 == 1 )
if ( ! -d ${OUTPUT_DIR}/${datea} ) mkdir -p ${OUTPUT_DIR}/${datea}

cd ${ICBC_DIR}
${LINK} ${TEMPLATE_DIR}/input.nml.template input.nml
${LINK} ${RUN_DIR}/input.nml input.nml
${REMOVE} gfs*pgrb2* *grib2

# prepare to run WPS ungrib and metgrid
Expand Down
6 changes: 1 addition & 5 deletions models/wrf/shell_scripts/init_ensemble_var.csh
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ set dd = `echo $initial_date | cut -b7-8`
set hh = `echo $initial_date | cut -b9-10`

${COPY} ${TEMPLATE_DIR}/namelist.input.meso namelist.input
${COPY} ${TEMPLATE_DIR}/input.nml.template input.nml
${REMOVE} ${RUN_DIR}/WRF
${LINK} ${OUTPUT_DIR}/${initial_date} WRF

Expand All @@ -61,11 +60,8 @@ while ( $n <= $NUM_ENS )

mkdir -p ${RUN_DIR}/advance_temp${n}

# TJH why does the run_dir/*/input.nml come from the template_dir and not the rundir?
# TJH furthermore, template_dir/input.nml.template and rundir/input.nml are identical. SIMPLIFY.

${LINK} ${RUN_DIR}/WRF_RUN/* ${RUN_DIR}/advance_temp${n}/.
${LINK} ${TEMPLATE_DIR}/input.nml.template ${RUN_DIR}/advance_temp${n}/input.nml
${LINK} ${RUN_DIR}/input.nml ${RUN_DIR}/advance_temp${n}/input.nml

${COPY} ${OUTPUT_DIR}/${initial_date}/wrfinput_d01_${gdate[1]}_${gdate[2]}_mean \
${RUN_DIR}/advance_temp${n}/wrfvar_output.nc
Expand Down
9 changes: 5 additions & 4 deletions models/wrf/shell_scripts/new_advance_model.csh
Original file line number Diff line number Diff line change
Expand Up @@ -219,11 +219,12 @@ while($state_copy <= $num_states) # MULTIPLE DOMAINS - we don't expect advan
# endif

# link WRF-runtime files (required) and be.dat (if using WRF-Var)
${LN} ${CENTRALDIR}/WRF_RUN/* .

# link DART namelist
${COPY} ${CENTRALDIR}/input.nml .
${LN} ${CENTRALDIR}/WRF_RUN/* .

# Copy DART namelist if necessary
if ( ! -e input.nml) then
${COPY} ${CENTRALDIR}/input.nml .
endif
# append LSM data from previous cycle
if ( -e ${CENTRALDIR}/append_lsm_data ) then
${LN} ${CENTRALDIR}/LSM/lsm_data_${ensemble_member}.nc lsm_data.nc
Expand Down
2 changes: 1 addition & 1 deletion models/wrf/shell_scripts/setup.csh
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ ${COPY} ${SHELL_SCRIPTS_DIR}/add_bank_perts.ncl ${RUN_DIR} || exit 8
${COPY} ${SHELL_SCRIPTS_DIR}/new_advance_model.csh ${RUN_DIR} || exit 9

# Edit input.nml.template so that its ens_size is set to the same value as $NUM_ENS in param.csh
sed "s/ens_size.*/ens_size =$NUM_ENS,/g" ${DART_DIR}/models/wrf/tutorial/template/input.nml.template > ${RUN_DIR}/input.nml || exit 8
sed "s/ens_size.*/ens_size = $NUM_ENS,/g" ${DART_DIR}/models/wrf/tutorial/template/input.nml.template > ${RUN_DIR}/input.nml || exit 8

echo "$myname complete at "`date`
echo
Expand Down

0 comments on commit 63a5748

Please sign in to comment.