1 |
C $Header: /u/gcmpack/MITgcm/pkg/mnc/MNC_COMMON.h,v 1.1 2008/05/22 12:21:19 mlosch Exp $ |
2 |
C $Name: $ |
3 |
C |
4 |
C ========================================== |
5 |
C MNC : an MITgcm wrapper package for NetCDF |
6 |
C ========================================== |
7 |
C |
8 |
C The following common block is the "state" for the MNC interface to |
9 |
C NetCDF. The intent is to keep track of the associations between |
10 |
C files, attributes, variables, grids, and dimensions. These |
11 |
C objects are roughly defined as: |
12 |
C |
13 |
C a dimension: |
14 |
C - contains: [ name, size ] |
15 |
C - exists per-NetCDF-file |
16 |
C |
17 |
C a grid: |
18 |
C - contains *ORDERED* sets of dimensions: [ name, 1+ dim-refs ] |
19 |
C - exists per-NetCDF-file |
20 |
C - NOTE: when created, the name and dim-refs are embedded in |
21 |
C the NetCDF file attributes for later retrieval |
22 |
C - NOTE: grid coordinates are implemented using variables with |
23 |
C special names (eg. lat, lon) and special units |
24 |
C (eg. degree_east) |
25 |
C |
26 |
C a variable: |
27 |
C - contains: [ name, units, 1 grid-ref, data ] |
28 |
C - exists per-NetCDF-file |
29 |
C - NOTE: is associated with *exactly* one grid |
30 |
C |
31 |
C an attribute: |
32 |
C - contains: [ name, units, data ] |
33 |
C - basically, a scalar (non-grid) variable |
34 |
C - exists per-NetCDF-file |
35 |
C |
36 |
C a NetCDF file: |
37 |
C - contains: [ name, 0+ attr, 0+ grid-ref, 0+ var-ref ] |
38 |
C |
39 |
C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----| |
40 |
|
41 |
CBOP 1 |
42 |
C !ROUTINE: MNC_COMMON.h |
43 |
|
44 |
C !INTERFACE: |
45 |
C #include "MNC_COMMON.h" |
46 |
|
47 |
C !DESCRIPTION: |
48 |
C Contains the ``look-up'' tables for the MNC package. These tables |
49 |
C contain the mappings between the various names and the NetCDF |
50 |
C entities. |
51 |
|
52 |
C !LOCAL VARIABLES: |
53 |
C The following MNC "Internals" are implemented on a |
54 |
C PER-NetDCF-FILE basis: |
55 |
C . |
56 |
C mnc_blank_name :: (convenience) just MNC_MAX_CHAR spaces |
57 |
C . |
58 |
C mnc_f_names (fi) :: file names |
59 |
C mnc_g_names (gi) :: grid names <----+ |
60 |
C . | |
61 |
C mnc_f_info (fi,-) :: isDEF, fID, Ngrid, g1,ds1,de1, |
62 |
C . g2,ds2,de2, ... |
63 |
C . | | |
64 |
C mnc_fd_ind (fi,-) :: dim indicies <-------+---+ |
65 |
C . | |
66 |
C mnc_d_names (di) :: names <--+ <--+ | |
67 |
C mnc_d_ids (di) :: IDs <--+ <--+ +----+ |
68 |
C mnc_d_size (di) :: sizes <--+ <--+ | starting |
69 |
C . | | indicies of |
70 |
C mnc_f_alld (fi,di):: ndim, id1,id2,id3, ... | grids in |
71 |
C . | mnc_f_info |
72 |
C . +----------++ |
73 |
C . | | |
74 |
C mnc_fv_ids (fi,-) :: nVar, n1,ID1,ig1, n2,ID2,ig2, ... |
75 |
C . | | |
76 |
C mnc_v_names (vi) :: <---+-----------+ |
77 |
C |
78 |
C fi :: file index |
79 |
C vi :: variable index |
80 |
C di :: dimension index |
81 |
C . |
82 |
C . |
83 |
C The following MNC "Convenience Wrapper" variables are |
84 |
C implemented independently of any NetCDF files |
85 |
C . |
86 |
C mnc_cw_fgnm (f) :: file group name (or "base name") |
87 |
C mnc_cw_fgud (f) :: file group unlimited dim value |
88 |
C mnc_cw_fgis (f) :: file group sequence number |
89 |
C mnc_cw_fgig (f) :: file group unlim dim is growing |
90 |
C mnc_cw_fgci (f) :: file CITER group number (cig) ------+ |
91 |
C . | |
92 |
C mnc_cw_cit (3,cig):: CITER (1) flag, (2) current, and | |
93 |
C . (3) next model Iter values <--+ |
94 |
C . |
95 |
C mnc_cw_gname (g) :: Gtype names <--------+ |
96 |
C mnc_cw_ndim (g) :: number of dimensions | |
97 |
C mnc_cw_dn (i,g) :: dname1, dname2, ... | |
98 |
C mnc_cw_dims (i,g) :: d1, d2, d3, ... | |
99 |
C mnc_cw_is (i,g) :: starting indicies: is1, is2, ... | |
100 |
C mnc_cw_ie (i,g) :: ending indicies: ie1, ie2, ... | |
101 |
C . | |
102 |
C mnc_cw_vname (v) :: Vtype names | |
103 |
C mnc_cw_vgind (v) :: index into --------+ |
104 |
C mnc_cw_vfmv (v) :: flag for missing values |
105 |
C . 0 = ignore it (default) |
106 |
C . 1 = use global value |
107 |
C . 2 = use specific per-var value |
108 |
C mnc_cw_vmvi (2,v) :: integer missing values: 1=IN, 2=OUT |
109 |
C mnc_cw_vmvr (2,v) :: REAL*4 missing values: 1=IN, 2=OUT |
110 |
C mnc_cw_vmvd (2,v) :: REAL*8 missing values: 1=IN, 2=OUT |
111 |
C mnc_cw_vnat (3,v) :: number of attributes [T,I,D] |
112 |
C mnc_cw_vbij (2,v) :: bi,bi indicies (0 if not applicable) |
113 |
C mnc_cw_vtnm (i,v) :: text (character) attribute names |
114 |
C mnc_cw_vtat (i,v) :: text (character) attributes |
115 |
C mnc_cw_vinm (i,v) :: INT attribute names |
116 |
C mnc_cw_viat (i,v) :: INT attributes |
117 |
C mnc_cw_vdnm (i,v) :: REAL*8 attribute names |
118 |
C mnc_cw_vdat (i,v) :: REAL*8 attributes |
119 |
C . |
120 |
C mnc_cw_cvnm (c) :: CV (coordinate variable) name |
121 |
C mnc_cw_cvse (2,c) :: CV start,end indicies ----+ |
122 |
C mnc_cw_cvdt (cdt) :: CV data pool <-------+ |
123 |
C . |
124 |
C f :: file group index |
125 |
C g :: Gtype index |
126 |
C v :: Vtype index |
127 |
C c :: CV index |
128 |
CEOP |
129 |
|
130 |
#include "MNC_SIZE.h" |
131 |
|
132 |
C===================================================================== |
133 |
COMMON /MNC_VARS_C/ |
134 |
& mnc_blank_name, |
135 |
& mnc_g_names, mnc_v_names, mnc_d_names, |
136 |
& mnc_out_path, mnc_f_names |
137 |
|
138 |
character*(MNC_MAX_CHAR) mnc_blank_name |
139 |
character*(MNC_MAX_CHAR) mnc_g_names(MNC_MAX_ID) |
140 |
character*(MNC_MAX_CHAR) mnc_v_names(MNC_MAX_ID) |
141 |
character*(MNC_MAX_CHAR) mnc_d_names(MNC_MAX_ID) |
142 |
|
143 |
character*(MNC_MAX_PATH) mnc_out_path |
144 |
character*(MNC_MAX_PATH) mnc_f_names(MNC_MAX_FID) |
145 |
|
146 |
C===================================================================== |
147 |
COMMON /MNC_VARS_I/ |
148 |
& mnc_f_info, mnc_fd_ind, mnc_fv_ids, mnc_f_alld, |
149 |
& mnc_d_size, mnc_d_ids |
150 |
|
151 |
integer mnc_f_info(MNC_MAX_FID,MNC_MAX_INFO) |
152 |
integer mnc_fd_ind(MNC_MAX_FID,MNC_MAX_INFO) |
153 |
integer mnc_fv_ids(MNC_MAX_FID,MNC_MAX_INFO) |
154 |
integer mnc_f_alld(MNC_MAX_FID,MNC_MAX_INFO) |
155 |
|
156 |
integer mnc_d_size(MNC_MAX_ID) |
157 |
integer mnc_d_ids(MNC_MAX_ID) |
158 |
|
159 |
C===================================================================== |
160 |
COMMON /MNC_CW_VARS_C/ |
161 |
& mnc_cw_gname, mnc_cw_dn, |
162 |
& mnc_cw_vname, |
163 |
& mnc_cw_vtnm, mnc_cw_vinm, mnc_cw_vdnm, |
164 |
& mnc_cw_fgnm, |
165 |
& mnc_cw_vtat |
166 |
|
167 |
character*(MNC_MAX_CHAR) mnc_cw_gname(MNC_MAX_ID) |
168 |
character*(MNC_MAX_CHAR) mnc_cw_dn(MNC_CW_MAX_I,MNC_MAX_ID) |
169 |
character*(MNC_MAX_CHAR) mnc_cw_vname(MNC_MAX_ID) |
170 |
character*(MNC_MAX_CHAR) mnc_cw_vtnm(MNC_CW_MAX_I,MNC_MAX_ID) |
171 |
character*(MNC_MAX_CHAR) mnc_cw_vinm(MNC_CW_MAX_I,MNC_MAX_ID) |
172 |
character*(MNC_MAX_CHAR) mnc_cw_vdnm(MNC_CW_MAX_I,MNC_MAX_ID) |
173 |
character*(MNC_MAX_CHAR) mnc_cw_fgnm(MNC_MAX_ID) |
174 |
|
175 |
C Note the longer string length here |
176 |
character*(MNC_MAX_CATT) mnc_cw_vtat(MNC_CW_MAX_I,MNC_MAX_ID) |
177 |
|
178 |
C===================================================================== |
179 |
COMMON /MNC_CW_VARS_I/ |
180 |
& mnc_cw_ndim, mnc_cw_dims, |
181 |
& mnc_cw_is, mnc_cw_ie, |
182 |
& mnc_cw_vgind, mnc_cw_vfmv, mnc_cw_vmvi, mnc_cw_vnat, |
183 |
& mnc_cw_vbij, mnc_cw_viat, |
184 |
& mnc_cw_fgud, mnc_cw_fgis, mnc_cw_fgig, mnc_cw_fgci, |
185 |
& mnc_cw_cit |
186 |
|
187 |
integer mnc_cw_ndim(MNC_MAX_ID) |
188 |
integer mnc_cw_dims(MNC_CW_MAX_I,MNC_MAX_ID) |
189 |
integer mnc_cw_is(MNC_CW_MAX_I,MNC_MAX_ID) |
190 |
integer mnc_cw_ie(MNC_CW_MAX_I,MNC_MAX_ID) |
191 |
|
192 |
integer mnc_cw_vgind(MNC_MAX_ID) |
193 |
integer mnc_cw_vfmv(MNC_MAX_ID) |
194 |
integer mnc_cw_vmvi(2,MNC_MAX_ID) |
195 |
integer mnc_cw_vnat(3,MNC_MAX_ID) |
196 |
integer mnc_cw_vbij(2,MNC_MAX_ID) |
197 |
integer mnc_cw_viat(MNC_CW_MAX_I,MNC_MAX_ID) |
198 |
|
199 |
integer mnc_cw_fgud(MNC_MAX_ID) |
200 |
integer mnc_cw_fgis(MNC_MAX_ID) |
201 |
integer mnc_cw_fgig(MNC_MAX_ID) |
202 |
integer mnc_cw_fgci(MNC_MAX_ID) |
203 |
|
204 |
integer mnc_cw_cit(3,MNC_MAX_INFO) |
205 |
|
206 |
C===================================================================== |
207 |
COMMON /MNC_CW_VARS_D/ |
208 |
& mnc_cw_vdat, mnc_cw_vmvd |
209 |
C & mnc_cw_cvdt |
210 |
|
211 |
REAL*8 mnc_cw_vmvd(2,MNC_MAX_ID) |
212 |
REAL*8 mnc_cw_vdat(MNC_CW_MAX_I,MNC_MAX_ID) |
213 |
|
214 |
C===================================================================== |
215 |
COMMON /MNC_CW_VARS_R4/ |
216 |
& mnc_cw_vmvr |
217 |
|
218 |
REAL*4 mnc_cw_vmvr(2,MNC_MAX_ID) |
219 |
|
220 |
|
221 |
C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----| |
222 |
|
223 |
CEH3 ;;; Local Variables: *** |
224 |
CEH3 ;;; mode:fortran *** |
225 |
CEH3 ;;; End: *** |