Last change
on this file since 4098 was
1907,
checked in by lguez, 11 years ago
|
Added a copyright property to every file of the distribution, except
for the fcm files (which have their own copyright). Use svn propget on
a file to see the copyright. For instance:
$ svn propget copyright libf/phylmd/physiq.F90
Name of program: LMDZ
Creation date: 1984
Version: LMDZ5
License: CeCILL version 2
Holder: Laboratoire de m\'et\'eorologie dynamique, CNRS, UMR 8539
See the license file in the root directory
Also added the files defining the CeCILL version 2 license, in French
and English, at the top of the LMDZ tree.
|
-
Property copyright set to
Name of program: LMDZ Creation date: 1984 Version: LMDZ5 License: CeCILL version 2 Holder: Laboratoire de m\'et\'eorologie dynamique, CNRS, UMR 8539 See the license file in the root directory
-
Property svn:executable set to
*
|
File size:
1.8 KB
|
Line | |
---|
1 | # This is a script in Bash. |
---|
2 | # Author: Lionel GUEZ |
---|
3 | |
---|
4 | # This script is a wrapper for a Fortran program. It compares NetCDF |
---|
5 | # variables of type "NF90_FLOAT" or "NF90_DOUBLE" and of rank 1 to 4 |
---|
6 | # in two files. NetCDF variables are read into Fortran variables of |
---|
7 | # type "double precision". The program computes the maximum of the |
---|
8 | # absolute value of the difference and the maximum of the absolute |
---|
9 | # value of the relative difference. The program either compares |
---|
10 | # variables with the same varid or variables with the same name, or a |
---|
11 | # single variable selected on the command line. Compared variables are |
---|
12 | # assumed to have the same type. The program checks that compared |
---|
13 | # variables have the same shape. |
---|
14 | |
---|
15 | USAGE="usage: `basename $0` [-s] [-m] [-i] [-q] [-v <var>] file file |
---|
16 | -s: report identical variables |
---|
17 | -m: compute average order of magnitude |
---|
18 | -i: compare variables with same varid, regardless of variable name |
---|
19 | -q: only report names of variables which differ, without maximum difference |
---|
20 | -v <var>: only compare variable <var>" |
---|
21 | |
---|
22 | # Default values: |
---|
23 | report_id=False |
---|
24 | comp_mag=False |
---|
25 | same_varid=False |
---|
26 | quiet=False |
---|
27 | |
---|
28 | while getopts smiqv: name |
---|
29 | do |
---|
30 | case $name in |
---|
31 | s) report_id=True;; |
---|
32 | m) comp_mag=True;; |
---|
33 | i) same_varid=True;; |
---|
34 | q) quiet=True;; |
---|
35 | v) name1=$OPTARG;; |
---|
36 | \?) echo "$USAGE" |
---|
37 | exit 1;; |
---|
38 | esac |
---|
39 | done |
---|
40 | |
---|
41 | shift $((OPTIND - 1)) |
---|
42 | |
---|
43 | if (($# != 2)) |
---|
44 | then |
---|
45 | echo "$USAGE" >&2 |
---|
46 | exit 1 |
---|
47 | fi |
---|
48 | |
---|
49 | ##set -x |
---|
50 | trap 'exit 1' ERR |
---|
51 | |
---|
52 | for argument in $* |
---|
53 | do |
---|
54 | if [[ ! -f $argument ]] |
---|
55 | then |
---|
56 | echo "$argument not found" |
---|
57 | exit 1 |
---|
58 | fi |
---|
59 | done |
---|
60 | |
---|
61 | max_diff_nc=... |
---|
62 | if [[ ! -x $max_diff_nc ]] |
---|
63 | then |
---|
64 | echo "Fortran executable not found" >&2 |
---|
65 | exit 1 |
---|
66 | fi |
---|
67 | |
---|
68 | ln -s $1 in1.nc |
---|
69 | ln -s $2 in2.nc |
---|
70 | |
---|
71 | trap 'rm in1.nc in2.nc; exit 1' ERR |
---|
72 | |
---|
73 | # Run the Fortran program: |
---|
74 | $max_diff_nc <<EOF |
---|
75 | $same_varid |
---|
76 | $report_id |
---|
77 | $quiet |
---|
78 | $comp_mag |
---|
79 | $name1 |
---|
80 | EOF |
---|
81 | |
---|
82 | rm in1.nc in2.nc |
---|
Note: See
TracBrowser
for help on using the repository browser.