/[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.14 - (show annotations) (download)
Sat Sep 10 18:30:07 2005 UTC (18 years, 8 months ago) by edhill
Branch: MAIN
CVS Tags: checkpoint58l_post, checkpoint57t_post, checkpoint58e_post, checkpoint57v_post, checkpoint58u_post, checkpoint58w_post, checkpoint57s_post, checkpoint58r_post, checkpoint57y_post, checkpoint58n_post, checkpoint58x_post, checkpoint58t_post, checkpoint58h_post, checkpoint57y_pre, checkpoint58q_post, checkpoint58j_post, checkpoint59e, checkpoint59d, checkpoint59g, checkpoint59f, checkpoint59a, checkpoint59c, checkpoint59b, checkpoint59h, checkpoint59, checkpoint58, checkpoint58f_post, checkpoint57x_post, checkpoint58d_post, checkpoint58c_post, checkpoint57w_post, checkpint57u_post, checkpoint58a_post, checkpoint58i_post, checkpoint58g_post, checkpoint58o_post, checkpoint57z_post, checkpoint58y_post, checkpoint58k_post, checkpoint58v_post, checkpoint58s_post, checkpoint58p_post, checkpoint58b_post, checkpoint58m_post
Changes since 1.13: +2 -28 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
2 API Discussions:
3 ================
4
5 As discussed in our group meeting of 2003-12-17 (AJA, CNH, JMC, AM,
6 PH, EH3), the NetCDF interface should resemble the following FORTRAN
7 subroutines:
8
9 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)
12
13 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)
16
17 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
20 generalized to grids with dimensions other than [2,3,4] or grids with
21 non-horizontal orientations (eg. vertical slices).
22
23
24 Generalizing what we would like to write as "variables defined on 1-D
25 to n-D grids", one can imagine a small number of objects containing
26 all the relevant information:
27
28 a dimension: [ name, size, units ]
29 a grid: [ name, 1+ dim-ref ]
30 a variable: [ name, units, *1* grid-ref, data ]
31 an attribute: [ name, units, data ]
32 a NetCDF file: [ name, 0+ attr, 0+ grid-ref, 0+ var-ref ]
33
34 which can then be manipulated (created, associated, destroyed, etc.)
35 using a simple interface such as:
36
37 MNC_INIT( myThid )
38
39 MNC_FILE_CREATE( fname, myThid )
40 MNC_FILE_OPEN( fname, itype, myThid )
41 MNC_FILE_ADD_ATTR_STR( fname, atname, sval, myThid )
42 MNC_FILE_ADD_ATTR_DBL( fname, atname, len, dval, myThid )
43 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( fname, myThid )
48
49 MNC_DIM_INIT( fname, dname, dlen, myThid )
50
51 MNC_GRID_INIT( fname, gname, ndim, dnames, myThid )
52
53 MNC_VAR_INIT_DBL( fname, gname, vname, units, myThid )
54 MNC_VAR_INIT_REAL( fname, gname, vname, units, myThid )
55 MNC_VAR_INIT_INT( fname, gname, vname, units, myThid )
56 MNC_VAR_INIT_ANY( fname, gname, vname, units, type, myThid )
57 MNC_VAR_ADD_ATTR_STR( fname, vname, atname, sval, myThid )
58 MNC_VAR_ADD_ATTR_DBL( fname, vname, atname, nv, dval, myThid )
59 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( fname, vname, var, myThid )
68
69 MNC_FILE_SYNC( fname, myThid )
70 MNC_FILE_CLOSE( fname, myThid )
71
72
73 Heres a further "convenience wrapper" written on top of the above UI:
74
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
94 To-Do:
95 ======
96
97 1) NAMING -- We should (as much as possible) try to name variables so
98 that they are in agreement with the CF naming conventions.
99
100 2) UNITS -- as with the names we need to follow conventions
101
102 3) CNH pointed out that grid interpolation needs to be handled
103 "on-the-fly" since pre-processing would result in overly large
104 input files. We need an interpolation API...
105
106

  ViewVC Help
Powered by ViewVC 1.1.22