/[MITgcm]/MITgcm/pkg/mnc/README.txt
ViewVC logotype

Diff of /MITgcm/pkg/mnc/README.txt

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

revision 1.2 by edhill, Tue Jan 6 23:19:27 2004 UTC revision 1.13 by edhill, Wed Mar 24 15:29:33 2004 UTC
# Line 8  subroutines: Line 8  subroutines:
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
# Line 35  all the relevant information: Line 34  all the relevant information:
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(       fname, myThid )
40    MNC_FILE_OPEN(         myThid, fname, itype )    MNC_FILE_OPEN(         fname, itype, myThid )
41    MNC_FILE_ADD_ATTR_STR( myThid, fname, atname, sval )    MNC_FILE_ADD_ATTR_STR( fname, atname, sval, myThid )
42    MNC_FILE_ADD_ATTR_INT( myThid, fname, atname, ival )    MNC_FILE_ADD_ATTR_DBL( fname, atname, len, dval, myThid )
43    MNC_FILE_ADD_ATTR_DBL( myThid, fname, atname, dval )    MNC_FILE_ADD_ATTR_REAL(fname, atname, len, rval, myThid )
44      MNC_FILE_ADD_ATTR_INT( fname, atname, len, ival, myThid )
45      MNC_FILE_ADD_ATTR_ANY( fname, atname, atype, cs,len,dv,rv,iv, myThid )
46    ...    ...
47    MNC_FILE_READ_HEADER(  myThid, fname )    MNC_FILE_READ_HEADER(  fname, myThid )
48    
49    MNC_DIM_INIT(          myThid, dname, dunits, dlen )    MNC_DIM_INIT(          fname, dname, dlen, myThid )
   MNC_DIM_REMOVE(        myThid, dname )  
50    
51    MNC_GRID_INIT(         myThid, fname, gname, ndim, dnames )    MNC_GRID_INIT(         fname, gname, ndim, dnames, myThid )
   MNC_GRID_SET_LL(       myThid, fname, gname, type, lats, lons )  
52    
53    MNC_VAR_INIT_DBL(      myThid, fname, gname, vname, fillval )    MNC_VAR_INIT_DBL(      fname, gname, vname, units, myThid )
54    MNC_VAR_INIT_REAL(     myThid, fname, gname, vname, fillval )    MNC_VAR_INIT_REAL(     fname, gname, vname, units, myThid )
55    MNC_VAR_INIT_INT(      myThid, fname, gname, vname, fillval )    MNC_VAR_INIT_INT(      fname, gname, vname, units, myThid )
56    MNC_VAR_ADD_ATTR_STR(  myThid, vname, name, sval )    MNC_VAR_INIT_ANY(      fname, gname, vname, units, type, myThid )
57    MNC_VAR_ADD_ATTR_INT(  myThid, vname, name, ival )    MNC_VAR_ADD_ATTR_STR(  fname, vname, atname, sval, myThid )
58    MNC_VAR_ADD_ATTR_DBL(  myThid, vname, name, dval )    MNC_VAR_ADD_ATTR_DBL(  fname, vname, atname, nv, dval, myThid )
59    MNC_VAR_WRITE(         myThid, vname, var )    MNC_VAR_ADD_ATTR_REAL( fname, vname, atname, nv, rval, myThid )
60      MNC_VAR_ADD_ATTR_INT(  fname, vname, atname, nv, ival, myThid )
61      MNC_VAR_ADD_ATTR_ANY(  fname, vname, atname, atype, cs,len,dv,rv,iv, myThid )
62      MNC_VAR_WRITE_DBL(     fname, vname, var, myThid )
63      MNC_VAR_WRITE_REAL(    fname, vname, var, myThid )
64      MNC_VAR_WRITE_INT(     fname, vname, var, myThid )
65      MNC_VAR_WRITE_ANY(     fname, vname, vtype, dv, rv, iv, myThid )
66    ...    ...
67    MNC_VAR_READ(          myThid, vname, var )    MNC_VAR_READ(          fname, vname, var, myThid )
68    
69    MNC_FILE_CLOSE(        myThid, fname )    MNC_FILE_SYNC(         fname, myThid )
70      MNC_FILE_CLOSE(        fname, myThid )
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(  Gtype, Htype, Hsub, Vtype, Ttype, wHalo, myThid )
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_SET_UDIM( fbname, udim, myThid )
84    
85      MNC_CW_RX_W( 'R|D|I', fbname,bi,bj, vtype, indu, var, myThid )
86      MNC_CW_RX_R( 'R|D|I', fbname,bi,bj, vtype, indu, var, myThid )
87              |
88              +--  RX = 'RL', 'RS', or 'I'
89    
90      MNC_COMP_VTYPE_VAR( ind_vt, ind_fv_ids, ires, myThid )
91    
92    
93  To-Do:  To-Do:
94  ======  ======
95    
96   1) CNH pointed out that grid interpolation needs to be handled   1) NAMING -- We should (as much as possible) try to name variables so
97        that they are in agreement with the CF naming conventions.
98    
99     2) UNITS -- as with the names we need to follow conventions
100    
101     3) AM described her "diags" (or "myDiags" or "mDiags") interface
102        which should use MNC for output.  The data storage idea is similar
103        to the MNC tables-of-indicies approach but also includes one huge
104        double-precision "accumulator" to hold all the temporary values
105        (eg. partial sums for averages, current max/mins):
106    
107          vname ( ni )
108          vlen  ( ni )
109          vind  ( ni ) ------+
110                             |
111    
112          vij_diag ( i, j, [...] )  w/ lat/lon indicies
113          vgl_diag ( [...] )        wo/ lat/lon indicies (global)
114    
115     4) CNH pointed out that grid interpolation needs to be handled
116      "on-the-fly" since pre-processing would result in overly large      "on-the-fly" since pre-processing would result in overly large
117      input files.  We need an interpolation API...      input files.  We need an interpolation API...
118    
119     5) From the group meeting on 2004/01/21, we need to define
120        "sub-grids" corresponding to:
121    
122             var_name       HGRID       VGRID       TIME
123             ===========================================
124             u              U_xy        r_c         t
125             eta            T_xy        -           t
126             rac            T_xy        -           -
127    
128        And write a convenience wrapper so that users can write variables
129        using just two function calls.  JMC and I worked out the
130        following:
131    
132    

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.13

  ViewVC Help
Powered by ViewVC 1.1.22