SHELL SCRIPT advance_model.csh

$Id: advance_model.html 11305 2017-03-14 17:52:08Z $

A note about documentation style. Optional arguments are enclosed in brackets [like this].
Since we use the Portable Batch Queuing system, many of the variables and discussions will contain the acronymn PBS. We are fans of the Public Broadcast System, but this is not what we mean.

The scripts are logically divided into two categories: site-specific and model-specific. Site-specific scripts will have to be (substantially?) modified if your system is not a linux cluster using PBS that has some sort of filesystem available to all the compute nodes. The model-specific scripts generally only need be modified by the person who inserts the model in the first place.


Shell script to run the WRF model from DART input. This is required to advance the DART state(s) to the next observational time. The script takes the initial condition assim_model_state_ic# from the directory where DART is running and replace it by the file assim_model_state_ud#, the DART state at the appropriate time.

filesystem requirements ... visible to master node, visible to compute node

advance_model.csh  PBS_O_WORKDIR  element  temp_dir

Copies necessary programs, data, and input files from a common (master) filesystem into a unique temporary directory and advances the DART state.

PBS_O_WORKDIR is the 'master' directory containing all the executables, data files, and control files (namelists, etc.).
element the ensemble member It is used as the unique part of the input and output data files.
temp_dir is the temporary working directory on the compute node. It is destroyed if already exits, created, and used.

This script is invoked by advance_ens.csh


Scripts use many kinds of variables; internal, external, inherited, exported, etc... The only external variables used in this script are the input arguments described above. We will happily ignore documenting those variables necessary for interim tasks internal to the workings of the scripts. We attempt to write scripts that are easy to understand rather than utilize some obscure but compact syntax. If you believe there are some variables that are omitted but should be documented, please drop us a line.

Programs Executed

dart_to_wrf and wrf_to_dart Fortran programs to convert DART to/from WRF format. dart_to_wrf converts from DART format to WRF NetCDF files. wrf_to_dart converts from WRF NetCDF files to DART initial condition/restart file format.
update_wrf_bc Fortran program to update the boundary condition tendencies.
wrf.exe Fortran program to run the WRF model.

File Overview

Much of the logic of the execution sequence is controlled by the existence of tiny files. There are segments of scripts that wait for a file to come into existence, then proceed with the appointed tasks. We will call those files flag files. The names of these files is not negotiable, as they are used by multiple scripts.

There are also files needed to control the execution of program units, like input.nml. Other files that simply log the run-time diagnostics. Finally, there are data files; the information needed to pass from one program to another. The different classes of files are summarized in the following table:

flag A file whose existence or contents are examined for the purpose of determining when to continue a task.
control A file whose contents are read by program units e.g. input.nml
log contains the run-time output and/or diagnostics of some program unit.
data examples are the state vector files assim_model_state_ud, the observation sequence files, the prior and posterior model states,

File Specifics

Class File Modification Purpose
control input.nml readonly the namelist parameters needed by dart_tf_wrf and update_wrf_bc
control nfile readonly Generated by the script itself and needed when mpirun is used to execute wrf.exe
control readonly Generated by the program dart_tf_wrf. Provides time information, number of domains, and the command to execute wrf.exe for the script. It is also used again by the program dart_tf_wrf in the conversion back to DART.
control namelist.input readonly The script copies the template of this file, which resides in the directory where DART is running, and edit the time_control section. This control file is also queried by the script to know if boundary conditions has to be provided. The program update_wrf_bc consults it for the microphysics used, which determined the number of moist variables in the DART state vector. Finally, this control file is required by the program wrf.exe.
log out.dart_to_wrf writeonly monitor advancement of the program dart_tf_wrf during the conversion from DART to WRF.
log out.wrf_to_dart writeonly monitor advancement of the program dart_tf_wrf during the conversion from WRF back to DART.
log out.update_wrf_bc writeonly monitor advancement of the program update_wrf_bc.
log rsl.* writeonly monitor advancement of the program wrf.exe.
log dart_log.out writeonly monitor advancement of programs dart_tf_wrf and update_wrf_bc.
data assim_model_state_ic# readonly DART initial condition file as named in the directory where DART is running. This file is moved in the temporary directory on the compute node and renamed dart_wrf_vector
data dart_wrf_vector read/write input/output to the program dart_tf_wrf. At the end of the script, this file is move to the directory where DART is running and rename assim_model_state_ud#
data RRTM_DATA readonly data file required to run the WRF model
data LANDUSE.TBL " "
data VEGPARM.TBL " "
data GENPARM.TBL " "
data wrfinput_d01 read/write In input, provides auxilliary information not available from the DART state vector to the program dart_tf_wrf for the conversion from DART to WRF. One is required for each domain. The program dart_tf_wrf then writes in these files to provide initial conditions for WRF. After the WRF integration, the wrfout_d files are renamed wrfinput_d to be used as input to the program dart_tf_wrf for the conversion back to DART format
data wrfbdy_d01 read/write Input and output to the program update_wrf_bc, providing appropriate boundary conditions for WRF.


dart_tf_wrf reading error Usually, a wrfinput file is missing in this case.




  1. A number of small auxilliary files are created by the script to determine the boundary condition files available and pick the appropriate ones for the integration. This is not very elegant. It would be better if this task could be performed internally without the creation of these auxilliary files.
  2. Replace the extension of the wrfbdy_d01 files, which is the DART time, with the date.

Terms of Use

DART software - Copyright UCAR. This open source software is provided by UCAR, "as is", without charge, subject to all terms of use at

Contact: Hui Liu, David Dowell
Revision: $Revision: 11305 $
Source: $URL: $
Change Date: $Date: 2017-03-14 11:52:08 -0600 (Tue, 14 Mar 2017) $
Change history:  try "svn log" or "svn diff"