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 is SAME, then the differences will be for (slices of) variables within the same file; if REPORT is LOG, then the statistics-report will be written to standard output (or the program log).


The MPASDIFF program performs the standard binary 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 write 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,

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/
setenv INFILEB  /tmp/
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

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.

See Also:

Copyright © 2017 Carlie J. Coats, Jr., Ph.D.
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.


Up: Related Programs

To: Models-3/EDSS I/O API: The Help Pages