8 |
|
|
9 |
1) "stubs" of the form: MNC_WV_[G|L]2D_R[S|L] () |
1) "stubs" of the form: MNC_WV_[G|L]2D_R[S|L] () |
10 |
|
|
11 |
2) MNC_INIT_VGRID( 'V_GRID_TYPE', nx, ny, nz, zc, zg ) |
2) MNC_INIT_VGRID('V_GRID_TYPE', nx, ny, nz, zc, zg) |
|
1 1 |
|
12 |
|
|
13 |
3) MNC_INIT_HGRID( 'H_GRID_TYPE', nx, ny, xc, yc, xg, yg ) |
3) MNC_INIT_HGRID('H_GRID_TYPE', nx, ny, xc, yc, xg, yg) |
14 |
|
|
15 |
4) MNC_INIT_VAR( 'file', 'Vname', 'Vunits', 'H_GTYPE', 'V_GTYPE', PREC, FillVal ) |
4) MNC_INIT_VAR('file', 'Vname', 'Vunits', 'H_GTYPE', 'V_GTYPE', PREC, FillVal) |
16 |
|
|
17 |
5) MNC_WRITE_VAR( 'file', 'Vname', var, bi, bj, myThid ) |
5) MNC_WRITE_VAR('file', 'Vname', var, bi, bj, myThid) |
18 |
|
|
19 |
This is a reasonable start but its inflexible since it isn't easily |
This is a reasonable start but its inflexible since it isn't easily |
20 |
generalized to grids with dimensions other than [2,3,4] or grids with |
generalized to grids with dimensions other than [2,3,4] or grids with |
34 |
which can then be manipulated (created, associated, destroyed, etc.) |
which can then be manipulated (created, associated, destroyed, etc.) |
35 |
using a simple interface such as: |
using a simple interface such as: |
36 |
|
|
37 |
MNC_INIT( myThid ) |
MNC_INIT( myThid ) |
38 |
|
|
39 |
MNC_FILE_CREATE( myThid, fname ) |
MNC_FILE_CREATE( myThid, fname ) |
40 |
MNC_FILE_OPEN( myThid, fname, itype ) |
MNC_FILE_OPEN( myThid, fname, itype ) |
41 |
MNC_FILE_ADD_ATTR_STR( myThid, fname, atname, sval ) |
MNC_FILE_ADD_ATTR_STR( myThid, fname, atname, sval ) |
42 |
MNC_FILE_ADD_ATTR_DBL( myThid, fname, atname, len, dval ) |
MNC_FILE_ADD_ATTR_DBL( myThid, fname, atname, len, dval ) |
43 |
MNC_FILE_ADD_ATTR_REAL(myThid, fname, atname, len, rval ) |
MNC_FILE_ADD_ATTR_REAL(myThid, fname, atname, len, rval ) |
46 |
... |
... |
47 |
MNC_FILE_READ_HEADER( myThid, fname ) |
MNC_FILE_READ_HEADER( myThid, fname ) |
48 |
|
|
49 |
MNC_DIM_INIT( myThid, dname, dunits, dlen ) |
MNC_DIM_INIT( myThid, fname, dname, dlen ) |
|
MNC_DIM_REMOVE( myThid, dname ) |
|
50 |
|
|
51 |
MNC_GRID_INIT( myThid, fname, gname, ndim, dnames ) |
MNC_GRID_INIT( myThid, fname, gname, ndim, dnames ) |
|
MNC_GRID_SET_LL( myThid, fname, gname, type, lats, lons ) |
|
52 |
|
|
53 |
MNC_VAR_INIT_DBL( myThid, fname, gname, vname, units ) |
MNC_VAR_INIT_DBL( myThid, fname, gname, vname, units ) |
54 |
MNC_VAR_INIT_REAL( myThid, fname, gname, vname, units ) |
MNC_VAR_INIT_REAL( myThid, fname, gname, vname, units ) |
55 |
MNC_VAR_INIT_INT( myThid, fname, gname, vname, units ) |
MNC_VAR_INIT_INT( myThid, fname, gname, vname, units ) |
56 |
MNC_VAR_INIT_ANY( myThid, fname, gname, vname, units, type ) |
MNC_VAR_INIT_ANY( myThid, fname, gname, vname, units, type ) |
57 |
MNC_VAR_ADD_ATTR_STR( myThid, fname, vname, atname, nv, sval ) |
MNC_VAR_ADD_ATTR_STR( myThid, fname, vname, atname, sval ) |
58 |
MNC_VAR_ADD_ATTR_DBL( myThid, fname, vname, atname, nv, dval ) |
MNC_VAR_ADD_ATTR_DBL( myThid, fname, vname, atname, nv, dval ) |
59 |
MNC_VAR_ADD_ATTR_REAL( myThid, fname, vname, atname, nv, rval ) |
MNC_VAR_ADD_ATTR_REAL( myThid, fname, vname, atname, nv, rval ) |
60 |
MNC_VAR_ADD_ATTR_INT( myThid, fname, vname, atname, nv, ival ) |
MNC_VAR_ADD_ATTR_INT( myThid, fname, vname, atname, nv, ival ) |
61 |
MNC_VAR_ADD_ATTR_ANY( myThid, fname, vname, atname, atype, cs,len,dv,rv,iv ) |
MNC_VAR_ADD_ATTR_ANY( myThid, fname, vname, atname, atype, cs,len,dv,rv,iv ) |
62 |
MNC_VAR_WRITE_DBL( myThid, fname, vname, var ) |
MNC_VAR_WRITE_DBL( myThid, fname, vname, var ) |
63 |
MNC_VAR_WRITE_REAL( myThid, fname, vname, var ) |
MNC_VAR_WRITE_REAL( myThid, fname, vname, var ) |
64 |
MNC_VAR_WRITE_INT( myThid, fname, vname, var ) |
MNC_VAR_WRITE_INT( myThid, fname, vname, var ) |
65 |
MNC_VAR_WRITE_ANY( myThid, fname, vname, vtype, dv, rv, iv ) |
MNC_VAR_WRITE_ANY( myThid, fname, vname, vtype, dv, rv, iv ) |
66 |
... |
... |
67 |
MNC_VAR_READ( myThid, fname, vname, var ) |
MNC_VAR_READ( myThid, fname, vname, var ) |
68 |
|
|
69 |
MNC_FILE_CLOSE( myThid, fname ) |
MNC_FILE_SYNC( myThid, fname ) |
70 |
|
MNC_FILE_CLOSE( myThid, fname ) |
71 |
|
|
72 |
The above interface is powerful yet easy to use (easier than the |
|
73 |
entire NetCDF interface) since it helps the user keep track of the |
Heres a further "convenience wrapper" written on top of the above UI: |
74 |
associations between files, "grids", variables, and dimensions. |
|
75 |
|
MNC_CW_INIT( myThid, Gtype, Htype, Hsub, Vtype, Ttype, wHalo ) |
76 |
|
|
77 |
|
with pre-defined - xy - - n |
78 |
|
combinations: U x c t y |
79 |
|
'Cen_xy_c_t_Hn' V y i |
80 |
|
'U_xy_i_t_Hn', Cen |
81 |
|
'Cor_x_-_-_Hy' Cor |
82 |
|
|
83 |
|
MNC_CW_WRITE( myThid,myIter, filebn,bi,bj, Gtype, RX, vname, var ) |
84 |
|
MNC_CW_READ( myThid,myIter, filebn,bi,bj, Gtype, RX, vname, var ) |
85 |
|
|
86 |
|
MNC_CW_RX_WRITES_YY( myThid, fbname,bi,bj, vtype, indu, var ) |
87 |
|
|
88 |
|
|
89 |
To-Do: |
To-Do: |
90 |
====== |
====== |
91 |
|
|
92 |
1) CNH pointed out that grid interpolation needs to be handled |
1) NAMING -- We should (as much as possible) try to name variables so |
93 |
"on-the-fly" since pre-processing would result in overly large |
that they are in agreement with the CF naming conventions. |
94 |
input files. We need an interpolation API... |
|
95 |
|
2) UNITS -- as with the names we need to follow conventions |
96 |
|
|
97 |
2) AM described her "diags" (or "myDiags" or "mDiags") interface |
3) AM described her "diags" (or "myDiags" or "mDiags") interface |
98 |
which should use MNC for output. The data storage idea is similar |
which should use MNC for output. The data storage idea is similar |
99 |
to the MNC tables-of-indicies approach but also includes one huge |
to the MNC tables-of-indicies approach but also includes one huge |
100 |
double-precision "accumulator" to hold all the temporary values |
double-precision "accumulator" to hold all the temporary values |
102 |
|
|
103 |
vname ( ni ) |
vname ( ni ) |
104 |
vlen ( ni ) |
vlen ( ni ) |
105 |
vind ( ni ) -----+ |
vind ( ni ) ------+ |
106 |
| |
| |
107 |
|
|
108 |
vij_diag ( i, j, [...] ) w/ lat/lon indicies |
vij_diag ( i, j, [...] ) w/ lat/lon indicies |
109 |
vgl_diag ( [...] ) wo/ lat/lon indicies (global) |
vgl_diag ( [...] ) wo/ lat/lon indicies (global) |
110 |
|
|
111 |
|
4) CNH pointed out that grid interpolation needs to be handled |
112 |
|
"on-the-fly" since pre-processing would result in overly large |
113 |
|
input files. We need an interpolation API... |
114 |
|
|
115 |
|
5) From the group meeting on 2004/01/21, we need to define |
116 |
|
"sub-grids" corresponding to: |
117 |
|
|
118 |
|
var_name HGRID VGRID TIME |
119 |
|
=========================================== |
120 |
|
u U_xy r_c t |
121 |
|
eta T_xy - t |
122 |
|
rac T_xy - - |
123 |
|
|
124 |
|
And write a convenience wrapper so that users can write variables |
125 |
|
using just two function calls. JMC and I worked out the |
126 |
|
following: |
127 |
|
|
128 |
|
|