1 |
C $Header: /u/gcmpack/MITgcm/pkg/mnc/mnc_common.h,v 1.14 2004/03/20 20:35:21 edhill 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 |
C |
41 |
C MNC "Internals" : implemented on a PER-NetDCF-FILE basis |
42 |
C |
43 |
C mnc_blank_name : (convenience) just MNC_MAX_CHAR spaces |
44 |
C |
45 |
C mnc_f_names (fi) : file names |
46 |
C mnc_g_names (gi) : grid names <----+-----------+ |
47 |
C . | | |
48 |
C mnc_f_info (fi,-) : isDEF, fID, Ngrid, g1,ds1,de1, g2,ds2,de2... |
49 |
C . | | | | |
50 |
C mnc_fd_ind (fi,-) : dim indicies <-------+---+-------+---+ |
51 |
C . | |
52 |
C mnc_d_names (di) : names <--+ <--+ | | |
53 |
C mnc_d_ids (di) : IDs <--+ <--+ +-----+-----+ |
54 |
C mnc_d_size (di) : sizes <--+ <--+ | starting |
55 |
C . | | indicies of |
56 |
C mnc_f_alld (fi,di): ndim, id1,id2,id3, ... | grids in |
57 |
C . | mnc_f_info |
58 |
C . +-----------+ |
59 |
C . | | |
60 |
C mnc_fv_ids (fi,-) : nVar, n1,ID1,ig1, n2,ID2,ig2, ... |
61 |
C . | | |
62 |
C mnc_v_names (vi) : <---+-----------+ |
63 |
C |
64 |
C fi : file index |
65 |
C vi : variable index |
66 |
C di : dimension index |
67 |
C |
68 |
C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----| |
69 |
C |
70 |
C MNC "Convenience Wrapper" : implemented independently of any |
71 |
C . NetCDF files |
72 |
C |
73 |
C mnc_cw_gname (g) : Gtype names <--------+ |
74 |
C mnc_cw_ndim (g) : number of dimensions | |
75 |
C mnc_cw_dn (i,g) : dname1, dname2, ... | |
76 |
C mnc_cw_dims (i,g) : d1, d2, d3, ... | |
77 |
C mnc_cw_is (i,g) : starting indicies: is1, is2, ... | |
78 |
C mnc_cw_ie (i,g) : ending indicies: ie1, ie2, ... | |
79 |
C . | |
80 |
C mnc_cw_vname (v) : Vtype names | |
81 |
C mnc_cw_vgind (v) : index into --------+ |
82 |
C mnc_cw_vnat (3,v) : number of attributes [T,I,D] |
83 |
C mnc_cw_vbij (2,v) : bi,bi indicies (0 if not applicable) |
84 |
C mnc_cw_vtnm (i,v) : text (character) attribute names |
85 |
C mnc_cw_vtat (i,v) : text (character) attributes |
86 |
C mnc_cw_vinm (i,v) : INT attribute names |
87 |
C mnc_cw_viat (i,v) : INT attributes |
88 |
C mnc_cw_vdnm (i,v) : REAL*8 attribute names |
89 |
C mnc_cw_vdat (i,v) : REAL*8 attributes |
90 |
C |
91 |
C g : Gtype index |
92 |
C v : Vtype index |
93 |
C |
94 |
C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----| |
95 |
|
96 |
integer MNC_MAX_ID, MNC_MAX_CHAR, MNC_MAX_INFO |
97 |
integer MNC_CW_MAX_I |
98 |
parameter ( MNC_MAX_ID = 1000 ) |
99 |
parameter ( MNC_MAX_CHAR = 100 ) |
100 |
parameter ( MNC_MAX_INFO = 150 ) |
101 |
parameter ( MNC_CW_MAX_I = 150 ) |
102 |
|
103 |
COMMON /MNC_VARS/ |
104 |
& mnc_blank_name, |
105 |
& mnc_f_names, mnc_g_names, mnc_v_names, |
106 |
& mnc_d_names, mnc_d_ids, mnc_d_size, |
107 |
& mnc_f_info, mnc_fd_ind, mnc_fv_ids, |
108 |
& mnc_f_alld, |
109 |
& mnc_out_path |
110 |
|
111 |
COMMON /MNC_CW_VARS/ |
112 |
& mnc_cw_gname, mnc_cw_ndim, mnc_cw_dims, |
113 |
& mnc_cw_dn, mnc_cw_is, mnc_cw_ie, |
114 |
& mnc_cw_vname, mnc_cw_vnat, mnc_cw_vgind, mnc_cw_vbij, |
115 |
& mnc_cw_vtnm, mnc_cw_vdnm, mnc_cw_vinm, |
116 |
& mnc_cw_vtat, mnc_cw_vdat, mnc_cw_viat, |
117 |
& mnc_cw_fgnm, mnc_cw_fgud |
118 |
|
119 |
character*(MNC_MAX_CHAR) mnc_blank_name |
120 |
character*(MNC_MAX_CHAR) mnc_f_names(MNC_MAX_ID) |
121 |
character*(MNC_MAX_CHAR) mnc_g_names(MNC_MAX_ID) |
122 |
character*(MNC_MAX_CHAR) mnc_v_names(MNC_MAX_ID) |
123 |
character*(MNC_MAX_CHAR) mnc_d_names(MNC_MAX_ID) |
124 |
integer mnc_f_info(MNC_MAX_ID,MNC_MAX_INFO) |
125 |
integer mnc_fd_ind(MNC_MAX_ID,MNC_MAX_INFO) |
126 |
integer mnc_fv_ids(MNC_MAX_ID,MNC_MAX_INFO) |
127 |
integer mnc_f_alld(MNC_MAX_ID,MNC_MAX_INFO) |
128 |
integer mnc_d_size(MNC_MAX_ID) |
129 |
integer mnc_d_ids(MNC_MAX_ID) |
130 |
|
131 |
character*(MNC_MAX_CHAR) mnc_cw_gname(MNC_MAX_ID) |
132 |
character*(MNC_MAX_CHAR) mnc_cw_dn(MNC_CW_MAX_I,MNC_MAX_ID) |
133 |
integer mnc_cw_ndim(MNC_MAX_ID) |
134 |
integer mnc_cw_dims(MNC_CW_MAX_I,MNC_MAX_ID) |
135 |
integer mnc_cw_is(MNC_CW_MAX_I,MNC_MAX_ID) |
136 |
integer mnc_cw_ie(MNC_CW_MAX_I,MNC_MAX_ID) |
137 |
|
138 |
character*(MNC_MAX_CHAR) mnc_cw_vname(MNC_MAX_ID) |
139 |
character*(MNC_MAX_CHAR) mnc_cw_vtnm(MNC_CW_MAX_I,MNC_MAX_ID) |
140 |
character*(MNC_MAX_CHAR) mnc_cw_vinm(MNC_CW_MAX_I,MNC_MAX_ID) |
141 |
character*(MNC_MAX_CHAR) mnc_cw_vdnm(MNC_CW_MAX_I,MNC_MAX_ID) |
142 |
character*(MNC_MAX_CHAR) mnc_cw_vtat(MNC_CW_MAX_I,MNC_MAX_ID) |
143 |
integer mnc_cw_vgind(MNC_MAX_ID) |
144 |
integer mnc_cw_vnat(3,MNC_MAX_ID) |
145 |
integer mnc_cw_vbij(2,MNC_MAX_ID) |
146 |
integer mnc_cw_viat(MNC_CW_MAX_I,MNC_MAX_ID) |
147 |
REAL*8 mnc_cw_vdat(MNC_CW_MAX_I,MNC_MAX_ID) |
148 |
|
149 |
character*(MNC_MAX_CHAR) mnc_cw_fgnm(MNC_MAX_ID) |
150 |
integer mnc_cw_fgud(MNC_MAX_ID) |
151 |
|
152 |
character*(MNC_MAX_CHAR) mnc_out_path |
153 |
|
154 |
C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----| |
155 |
CEH3 ;;; Local Variables: *** |
156 |
CEH3 ;;; mode:fortran *** |
157 |
CEH3 ;;; End: *** |