/[MITgcm]/MITgcm/pkg/mnc/mnc_common.h
ViewVC logotype

Contents of /MITgcm/pkg/mnc/mnc_common.h

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.28 - (show annotations) (download)
Sat Sep 10 18:30:07 2005 UTC (18 years, 8 months ago) by edhill
Branch: MAIN
CVS Tags: checkpoint57t_post, checkpoint57v_post, checkpoint57s_post, checkpoint57y_post, checkpoint57x_post, checkpoint57y_pre, checkpoint58, checkpoint57w_post, checkpint57u_post, checkpoint58a_post, checkpoint57z_post
Changes since 1.27: +16 -13 lines
File MIME type: text/plain
 o various changes to mnc including:
   - all files use the new "BASENAME[[.ITER].{t|f}NUM].nc" format
   - output can now be grouped so that all files within a group
       change the ITER portion of their names in lock-step together
   - can now read ("global") PER-FACE (in addition to PER-TILE) files
       and works with both EXCH1 and EXCH2 (but needs more testing)
   - writing works for all verification test cases w/ g77 on Linux

1 C $Header: /u/gcmpack/MITgcm/pkg/mnc/mnc_common.h,v 1.27 2005/07/06 21:17:08 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
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_vnat (3,v) :: number of attributes [T,I,D]
105 C mnc_cw_vbij (2,v) :: bi,bi indicies (0 if not applicable)
106 C mnc_cw_vtnm (i,v) :: text (character) attribute names
107 C mnc_cw_vtat (i,v) :: text (character) attributes
108 C mnc_cw_vinm (i,v) :: INT attribute names
109 C mnc_cw_viat (i,v) :: INT attributes
110 C mnc_cw_vdnm (i,v) :: REAL*8 attribute names
111 C mnc_cw_vdat (i,v) :: REAL*8 attributes
112 C .
113 C mnc_cw_cvnm (c) :: CV (coordinate variable) name
114 C mnc_cw_cvse (2,c) :: CV start,end indicies ----+
115 C mnc_cw_cvdt (cdt) :: CV data pool <-------+
116 C .
117 C f :: file group index
118 C g :: Gtype index
119 C v :: Vtype index
120 C c :: CV index
121 CEOP
122
123 #include "MNC_SIZE.h"
124
125 COMMON /MNC_VARS_C/
126 & mnc_blank_name,
127 & mnc_f_names, mnc_g_names, mnc_v_names, mnc_d_names,
128 & mnc_out_path
129
130 character*(MNC_MAX_CHAR) mnc_blank_name
131 character*(MNC_MAX_CHAR) mnc_f_names(MNC_MAX_ID)
132 character*(MNC_MAX_CHAR) mnc_g_names(MNC_MAX_ID)
133 character*(MNC_MAX_CHAR) mnc_v_names(MNC_MAX_ID)
134 character*(MNC_MAX_CHAR) mnc_d_names(MNC_MAX_ID)
135
136 COMMON /MNC_VARS_I/
137 & mnc_f_info, mnc_fd_ind, mnc_fv_ids, mnc_f_alld,
138 & mnc_d_size, mnc_d_ids
139
140 integer mnc_f_info(MNC_MAX_ID,MNC_MAX_INFO)
141 integer mnc_fd_ind(MNC_MAX_ID,MNC_MAX_INFO)
142 integer mnc_fv_ids(MNC_MAX_ID,MNC_MAX_INFO)
143 integer mnc_f_alld(MNC_MAX_ID,MNC_MAX_INFO)
144 integer mnc_d_size(MNC_MAX_ID)
145 integer mnc_d_ids(MNC_MAX_ID)
146 character*(MNC_MAX_CHAR) mnc_out_path
147
148 COMMON /MNC_CW_VARS_C/
149 & mnc_cw_gname, mnc_cw_dn,
150 & mnc_cw_vname,
151 & mnc_cw_vtnm, mnc_cw_vinm, mnc_cw_vdnm,
152 & mnc_cw_vtat,
153 & mnc_cw_fgnm
154 C & mnc_cw_cvnm
155
156 COMMON /MNC_CW_VARS_I/
157 & mnc_cw_ndim, mnc_cw_dims,
158 & mnc_cw_is, mnc_cw_ie,
159 & mnc_cw_vgind, mnc_cw_vnat,
160 & mnc_cw_vbij, mnc_cw_viat,
161 & mnc_cw_fgud, mnc_cw_fgis, mnc_cw_fgig, mnc_cw_fgci,
162 & mnc_cw_cit
163 C & mnc_cw_cvse
164
165 COMMON /MNC_CW_VARS_R/
166 & mnc_cw_vdat
167 C & mnc_cw_cvdt
168
169 character*(MNC_MAX_CHAR) mnc_cw_gname(MNC_MAX_ID)
170 character*(MNC_MAX_CHAR) mnc_cw_dn(MNC_CW_MAX_I,MNC_MAX_ID)
171 integer mnc_cw_ndim(MNC_MAX_ID)
172 integer mnc_cw_dims(MNC_CW_MAX_I,MNC_MAX_ID)
173 integer mnc_cw_is(MNC_CW_MAX_I,MNC_MAX_ID)
174 integer mnc_cw_ie(MNC_CW_MAX_I,MNC_MAX_ID)
175
176 character*(MNC_MAX_CHAR) mnc_cw_vname(MNC_MAX_ID)
177 character*(MNC_MAX_CHAR) mnc_cw_vtnm(MNC_CW_MAX_I,MNC_MAX_ID)
178 character*(MNC_MAX_CHAR) mnc_cw_vinm(MNC_CW_MAX_I,MNC_MAX_ID)
179 character*(MNC_MAX_CHAR) mnc_cw_vdnm(MNC_CW_MAX_I,MNC_MAX_ID)
180 character*(MNC_MAX_CHAR) mnc_cw_vtat(MNC_CW_MAX_I,MNC_MAX_ID)
181 integer mnc_cw_vgind(MNC_MAX_ID)
182 integer mnc_cw_vnat(3,MNC_MAX_ID)
183 integer mnc_cw_vbij(2,MNC_MAX_ID)
184 integer mnc_cw_viat(MNC_CW_MAX_I,MNC_MAX_ID)
185 REAL*8 mnc_cw_vdat(MNC_CW_MAX_I,MNC_MAX_ID)
186
187 character*(MNC_MAX_CHAR) mnc_cw_fgnm(MNC_MAX_ID)
188 integer mnc_cw_fgud(MNC_MAX_ID)
189 integer mnc_cw_fgis(MNC_MAX_ID)
190 integer mnc_cw_fgig(MNC_MAX_ID)
191 integer mnc_cw_fgci(MNC_MAX_ID)
192
193 integer mnc_cw_cit(3,MNC_MAX_INFO)
194
195 C character*(MNC_MAX_CHAR) mnc_cw_cvnm(MNC_MAX_ID)
196 C integer mnc_cw_cvse(2,MNC_MAX_ID)
197 C REAL*8 mnc_cw_cvdt(MNC_CW_CVDAT)
198
199 C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
200
201 CEH3 ;;; Local Variables: ***
202 CEH3 ;;; mode:fortran ***
203 CEH3 ;;; End: ***

  ViewVC Help
Powered by ViewVC 1.1.22