setenv INFILEA <path name> setenv INFILEB <path name> or "SAME" setenv REPORT <path name> or "LOG" mpasdiff <and respond to the prompts>where INFILEA and INFILEB are the logical names of the input MPAS-format-netCDF files, and REPORT is the logical name of the report file (to which the statistical comparisoon report is printed). If INFILEB isSAME
, then the differences will be for (slices of) variables within the same file; if REPORT isLOG
, then the statistics-report will be written to standard output (or the program log).
The m3toolsSee Also:MPASDIFF
program performs the standard binaryGRIDOPS
grid-comparison operations on pairs of variables or layer-ranges of variables from a user-specified pair of MPAS-format-netCDF files INFILEA and INFILEB, computes statistics (mean, sigma, max and its location, min and its location) for each specified variable and for the specified "difference" operation and writes the statistical result to the program-log or to a specified ASCII REPORT file.
Note that the program displays the variables by name-and-number, then requests them by number rather than by name. It will at least give you a numbered menu, in any case; however, you may also want to look at output for the following commands to see in advance what the variables are:ncdump -h ${INFILA}
ncdump -h ${INFILB}The spatial dimensions of the (layer-ranges of) variables must be the same — one may not compare a vertex-subscripted variable with a cell-subscripted variable nor a single-layer variable with a 50-layer variable. Likewise, the time-step ranges for the two variables must have the same number of records. However,
- one may compare a time independent variable with a time stepped variable of the same dimensionality; the result will be a time stepped comparison.
- if INFILEA and INFILEB both have 1-hour time steps, but for different ranges of dates, one may compare
N
days (24*N
time steps) of data from INFILEA with a differentN
days of data from INFILEB- one may compare a specified layer (e.g., layer-1) of a layered (3-D) variable with a non-layered (2D) variable of the same dimensionality; the result will be a non-layered comparison;
- one may even compare two specified layers (e.g., layer-1 and layer-2) or layer ranges (e.g., layers 1-3 and 5-7) the same or a different 3-D variable, or two different time steps of the same variable...
- one may compare vertex- or edge-subscripted variables, or variables whose vertical dimension is different from
nVertLevels
ornVertLevelsP1
— e.g.,nEmisLevels
— unlike certain other unnecessarily-brittle A&V packages.The program will prompt you for the variable-names, and (as appropriate) for the starting and ending date&time for the report period, and for the layer ranges for the variables.
Note that the set of analyses which can be performed by one execution is quite complex and context-dependent (being determined by the files and variaaables being compared). If you want to run this program in batch mode (from a script), the recommended way to develop the script is to run the program once interactively noting the pattern of responses to prompts which generate the particular analysis you want. The pattern of responses then becomes either a command-input file which is redirected into the program in the script, or becomes a "here-document" fed into the execution. The following is an excerpt of a script which does an analysis on two variables (the first one time stepped 2-D from INFILEA, the second time independent 3-D from INFILEB, examining layer 4), from /tmp/myfile.A and /tmp/myfile.B, using the here-document approach:
... setenv INFILEA /tmp/myfile.A.nc setenv INFILEB /tmp/myfile.B.nc setenv REPORT /tmp/myfile.A-B.txt mpasdiff << !DONE 43 # use variable-43 from INFILEA # use default starting date for this variable # use default starting time for this variable # use default ending date for this variable # use default ending time for this variable 47 # use variable-47 from INFILEB 4 # use layer-4 as the starting layer for this variable 4 # use layer-4 as the ending layer for this variable 1 # use difference (A - B) as the comparison-operation !DONE ...Source code for program
mpasdiff
is available under the GNU GPL License, Version 2, and can be downloaded here from CMAS or here from GitHub.Copyright © 2017 Carlie J. Coats, Jr.
MODULE
MODMPASFIO
with state-variables for MPAS
unstructured-grid description, utilities for computations
on those grids, and routines for input and output of data
in MPAS-format-netCDF files.
SUBROUTINE
GRIDOPS
to compute various array-operations
(differences, normalized differences, ratios, etc.).
Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts.Previous: TIMESHIFT
To: Models-3/EDSS I/O API: The Help Pages