PROGRAM replace_wrf_fields

DART project logo

Jump to DART Documentation Main Index
version information for this file:
$Id: replace_wrf_fields.html 6382 2013-08-07 20:45:16Z nancy $



Program to copy various fields from one WRF netCDF file to another.

There are many existing utilities to process netCDF files, i.e. the NCO operators and NCL scripts, which have more functionality than this program. The only purpose for having this one is that it is a standalone program with no prerequisites or dependencies other than the netCDF libraries. If you already have other tools available they can do the same functions that this program does.

This program copies the given data fields from the input file to the output file, failing if their sizes, shapes, or data types do not match exactly. The expected use is to copy fields which are updated by the WRF program but are not part of the DART state vector, for example, sea surface temperature or soil fields. After DART has updated the WRF restart wrfinput_d01 file, this program can be used to update other fields in the file before running the model.



This namelist is read from the file input.nml. Namelists start with an ampersand '&' and terminate with a slash '/'. Character strings that contain a '/' must be enclosed in quotes to prevent them from prematurely terminating the namelist.

   fieldnames = 'SST',
   fieldlist_file = '',
   fail_on_missing_field = .true.
   debug = .false.,

Item Type Description
fieldnames character(len=129) (:) An array of ASCII field names to be copied from the input netCDF file to the output netCDF file. The names must match exactly, and the size and shape of the data must be the same in the input and output files for the data to be copied. If the field names are set here, the fieldlist_file item must be ' '.
fieldlist_file character(len=129) An alternative to an explicit list of field names to copy. This is a single string, the name of a file which contains a single field name, one per line. If this option is set, the fieldnames namelist item must be ' '.
fail_on_missing_field logical If any fields in the input list are not found in either the input or output netcdf files, fail if this is set to true. If false, a warning message will be printed but execution will continue.
debug logical If true, print out debugging messages about which fields are found in the input and output files.





File formats

This utility works on any pair of netCDF files, doing a simple read and copy from one to the other.





replace_wrf_fields Usage: echo | ./replace_wrf_fields The program did not read 2 filenames from the console.
replace_wrf_fields cannot specify both fieldnames and fieldlist_file In the namelist you must either specify an explicit list of fieldnames to copy between the files, or give a single filename which contains the list of field names. You cannot specify both.
replace_wrf_fields field not found in input/output file If 'fail_on_missing_field' is true in the namelist and a field is not found in either the input or output file.
replace_wrf_fields field does not match If the input and output files have different sizes, number of dimensions, or data types, the program cannot copy the data.







Terms of Use

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

Contact: Glen Romine, Nancy Collins
Revision: $Revision: 6382 $
Source: $URL: $
Change Date: $Date: 2013-08-07 14:45:16 -0600 (Wed, 07 Aug 2013) $
Change history:  try "svn log" or "svn diff"