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

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

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


Revision 1.15 - (show annotations) (download)
Mon Oct 8 17:00:17 2007 UTC (16 years, 7 months ago) by jmc
Branch: MAIN
CVS Tags: checkpoint64y, checkpoint64x, checkpoint64z, checkpoint64q, checkpoint64p, checkpoint64s, checkpoint64r, checkpoint64u, checkpoint64t, checkpoint64w, checkpoint64v, checkpoint64i, checkpoint64h, checkpoint64k, checkpoint64j, checkpoint64m, checkpoint64l, checkpoint64o, checkpoint64n, checkpoint64a, checkpoint64c, checkpoint64b, checkpoint64e, checkpoint64d, checkpoint64g, checkpoint64f, checkpoint63p, checkpoint63q, checkpoint63r, checkpoint63s, checkpoint63l, checkpoint63m, checkpoint63n, checkpoint63o, checkpoint63h, checkpoint63i, checkpoint63j, checkpoint63k, checkpoint63d, checkpoint63e, checkpoint63f, checkpoint63g, checkpoint63a, checkpoint63b, checkpoint63c, checkpoint64, checkpoint65, checkpoint60, checkpoint61, checkpoint62, checkpoint63, checkpoint66g, checkpoint66f, checkpoint66e, checkpoint66d, checkpoint66c, checkpoint66b, checkpoint66a, checkpoint66o, checkpoint66n, checkpoint66m, checkpoint66l, checkpoint66k, checkpoint66j, checkpoint66i, checkpoint66h, checkpoint65z, checkpoint65x, checkpoint65y, checkpoint65r, checkpoint65s, checkpoint65p, checkpoint65q, checkpoint65v, checkpoint65w, checkpoint65t, checkpoint65u, checkpoint65j, checkpoint65k, checkpoint65h, checkpoint65i, checkpoint65n, checkpoint65o, checkpoint65l, checkpoint65m, checkpoint65b, checkpoint65c, checkpoint65a, checkpoint65f, checkpoint65g, checkpoint65d, checkpoint65e, checkpoint59q, checkpoint59p, checkpoint59r, checkpoint59m, checkpoint59l, checkpoint59o, checkpoint59n, checkpoint59i, checkpoint59k, checkpoint59j, checkpoint62c, checkpoint62b, checkpoint62a, checkpoint62g, checkpoint62f, checkpoint62e, checkpoint62d, checkpoint62k, checkpoint62j, checkpoint62i, checkpoint62h, checkpoint62o, checkpoint62n, checkpoint62m, checkpoint62l, checkpoint62s, checkpoint62r, checkpoint62q, checkpoint62p, checkpoint62w, checkpoint62v, checkpoint62u, checkpoint62t, checkpoint62z, checkpoint62y, checkpoint62x, checkpoint61f, checkpoint61g, checkpoint61d, checkpoint61e, checkpoint61b, checkpoint61c, checkpoint61a, checkpoint61n, checkpoint61o, checkpoint61l, checkpoint61m, checkpoint61j, checkpoint61k, checkpoint61h, checkpoint61i, checkpoint61v, checkpoint61w, checkpoint61t, checkpoint61u, checkpoint61r, checkpoint61s, checkpoint61p, checkpoint61q, checkpoint61z, checkpoint61x, checkpoint61y, HEAD
Changes since 1.14: +2 -0 lines
File MIME type: text/plain
add cvs $Header:$ or $Name:$ where they were missing

1 # $Header: $
2 # $Name: $
3
4 API Discussions:
5 ================
6
7 As discussed in our group meeting of 2003-12-17 (AJA, CNH, JMC, AM,
8 PH, EH3), the NetCDF interface should resemble the following FORTRAN
9 subroutines:
10
11 1) "stubs" of the form: MNC_WV_[G|L]2D_R[S|L] ()
12
13 2) MNC_INIT_VGRID('V_GRID_TYPE', nx, ny, nz, zc, zg)
14
15 3) MNC_INIT_HGRID('H_GRID_TYPE', nx, ny, xc, yc, xg, yg)
16
17 4) MNC_INIT_VAR('file', 'Vname', 'Vunits', 'H_GTYPE', 'V_GTYPE', PREC, FillVal)
18
19 5) MNC_WRITE_VAR('file', 'Vname', var, bi, bj, myThid)
20
21 This is a reasonable start but its inflexible since it isn't easily
22 generalized to grids with dimensions other than [2,3,4] or grids with
23 non-horizontal orientations (eg. vertical slices).
24
25
26 Generalizing what we would like to write as "variables defined on 1-D
27 to n-D grids", one can imagine a small number of objects containing
28 all the relevant information:
29
30 a dimension: [ name, size, units ]
31 a grid: [ name, 1+ dim-ref ]
32 a variable: [ name, units, *1* grid-ref, data ]
33 an attribute: [ name, units, data ]
34 a NetCDF file: [ name, 0+ attr, 0+ grid-ref, 0+ var-ref ]
35
36 which can then be manipulated (created, associated, destroyed, etc.)
37 using a simple interface such as:
38
39 MNC_INIT( myThid )
40
41 MNC_FILE_CREATE( fname, myThid )
42 MNC_FILE_OPEN( fname, itype, myThid )
43 MNC_FILE_ADD_ATTR_STR( fname, atname, sval, myThid )
44 MNC_FILE_ADD_ATTR_DBL( fname, atname, len, dval, myThid )
45 MNC_FILE_ADD_ATTR_REAL(fname, atname, len, rval, myThid )
46 MNC_FILE_ADD_ATTR_INT( fname, atname, len, ival, myThid )
47 MNC_FILE_ADD_ATTR_ANY( fname, atname, atype, cs,len,dv,rv,iv, myThid )
48 ...
49 MNC_FILE_READ_HEADER( fname, myThid )
50
51 MNC_DIM_INIT( fname, dname, dlen, myThid )
52
53 MNC_GRID_INIT( fname, gname, ndim, dnames, myThid )
54
55 MNC_VAR_INIT_DBL( fname, gname, vname, units, myThid )
56 MNC_VAR_INIT_REAL( fname, gname, vname, units, myThid )
57 MNC_VAR_INIT_INT( fname, gname, vname, units, myThid )
58 MNC_VAR_INIT_ANY( fname, gname, vname, units, type, myThid )
59 MNC_VAR_ADD_ATTR_STR( fname, vname, atname, sval, myThid )
60 MNC_VAR_ADD_ATTR_DBL( fname, vname, atname, nv, dval, myThid )
61 MNC_VAR_ADD_ATTR_REAL( fname, vname, atname, nv, rval, myThid )
62 MNC_VAR_ADD_ATTR_INT( fname, vname, atname, nv, ival, myThid )
63 MNC_VAR_ADD_ATTR_ANY( fname, vname, atname, atype, cs,len,dv,rv,iv, myThid )
64 MNC_VAR_WRITE_DBL( fname, vname, var, myThid )
65 MNC_VAR_WRITE_REAL( fname, vname, var, myThid )
66 MNC_VAR_WRITE_INT( fname, vname, var, myThid )
67 MNC_VAR_WRITE_ANY( fname, vname, vtype, dv, rv, iv, myThid )
68 ...
69 MNC_VAR_READ( fname, vname, var, myThid )
70
71 MNC_FILE_SYNC( fname, myThid )
72 MNC_FILE_CLOSE( fname, myThid )
73
74
75 Heres a further "convenience wrapper" written on top of the above UI:
76
77 MNC_CW_INIT( Gtype, Htype, Hsub, Vtype, Ttype, wHalo, myThid )
78
79 with pre-defined - xy - - n
80 combinations: U x c t y
81 'Cen_xy_c_t_Hn' V y i
82 'U_xy_i_t_Hn', Cen
83 'Cor_x_-_-_Hy' Cor
84
85 MNC_CW_SET_UDIM( fbname, udim, myThid )
86
87 MNC_CW_RX_W( 'R|D|I', fbname,bi,bj, vtype, indu, var, myThid )
88 MNC_CW_RX_R( 'R|D|I', fbname,bi,bj, vtype, indu, var, myThid )
89 |
90 +-- RX = 'RL', 'RS', or 'I'
91
92 MNC_COMP_VTYPE_VAR( ind_vt, ind_fv_ids, ires, myThid )
93
94
95
96 To-Do:
97 ======
98
99 1) NAMING -- We should (as much as possible) try to name variables so
100 that they are in agreement with the CF naming conventions.
101
102 2) UNITS -- as with the names we need to follow conventions
103
104 3) CNH pointed out that grid interpolation needs to be handled
105 "on-the-fly" since pre-processing would result in overly large
106 input files. We need an interpolation API...
107
108

  ViewVC Help
Powered by ViewVC 1.1.22