Back to home page

MITgcm

 
 

    


File indexing completed on 2022-04-19 05:09:08 UTC

view on githubraw file Latest commit a85293d0 on 2022-04-18 21:18:22 UTC
e9b72f2bd9 Ed H*0001 C
4de8f8c098 Ed H*0002 C     ==========================================
                0003 C     MNC : an MITgcm wrapper package for NetCDF
                0004 C     ==========================================
                0005 C
                0006 C     The following common block is the "state" for the MNC interface to
                0007 C     NetCDF.  The intent is to keep track of the associations between
                0008 C     files, attributes, variables, grids, and dimensions.  These
                0009 C     objects are roughly defined as:
a85293d087 Mart*0010 C
4de8f8c098 Ed H*0011 C     a dimension:
75987013ac Ed H*0012 C     - contains: [ name, size ]
                0013 C     - exists per-NetCDF-file
4de8f8c098 Ed H*0014 C
                0015 C     a grid:
                0016 C     - contains *ORDERED* sets of dimensions: [ name, 1+ dim-refs ]
                0017 C     - exists per-NetCDF-file
a85293d087 Mart*0018 C     - NOTE: when created, the name and dim-refs are embedded in
4de8f8c098 Ed H*0019 C         the NetCDF file attributes for later retrieval
a85293d087 Mart*0020 C     - NOTE: grid coordinates are implemented using variables with
                0021 C         special names (eg. lat, lon) and special units
4de8f8c098 Ed H*0022 C         (eg. degree_east)
a85293d087 Mart*0023 C
4de8f8c098 Ed H*0024 C     a variable:
                0025 C     - contains: [ name, units, 1 grid-ref, data ]
                0026 C     - exists per-NetCDF-file
                0027 C     - NOTE: is associated with *exactly* one grid
a85293d087 Mart*0028 C
4de8f8c098 Ed H*0029 C     an attribute:
                0030 C     - contains: [ name, units, data ]
                0031 C     - basically, a scalar (non-grid) variable
                0032 C     - exists per-NetCDF-file
a85293d087 Mart*0033 C
4de8f8c098 Ed H*0034 C     a NetCDF file:
                0035 C     - contains: [ name, 0+ attr, 0+ grid-ref, 0+ var-ref ]
75987013ac Ed H*0036 C
15688ab4b4 Ed H*0037 C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
d5d5c6127e Ed H*0038 
e6bb5b2cc3 Ed H*0039 CBOP 1
07155994b8 Mart*0040 C     !ROUTINE: MNC_COMMON.h
d5d5c6127e Ed H*0041 
                0042 C     !INTERFACE:
07155994b8 Mart*0043 C     #include "MNC_COMMON.h"
d5d5c6127e Ed H*0044 
                0045 C     !DESCRIPTION:
a85293d087 Mart*0046 C     Contains the "look-up" tables for the MNC package.  These tables
d5d5c6127e Ed H*0047 C     contain the mappings between the various names and the NetCDF
                0048 C     entities.
                0049 
                0050 C     !LOCAL VARIABLES:
a85293d087 Mart*0051 C     The following MNC "Internals" are implemented on a
d5d5c6127e Ed H*0052 C     PER-NetDCF-FILE basis:
                0053 C     .
                0054 C     mnc_blank_name    :: (convenience) just MNC_MAX_CHAR spaces
                0055 C     .
                0056 C     mnc_f_names (fi)  :: file names
1b5fb69d21 Ed H*0057 C     mnc_g_names (gi)  :: grid names    <----+
                0058 C     .                                       |
a85293d087 Mart*0059 C     mnc_f_info (fi,-) :: isDEF, fID, Ngrid, g1,ds1,de1,
1b5fb69d21 Ed H*0060 C     .                                       g2,ds2,de2, ...
                0061 C     .                                          |   |
                0062 C     mnc_fd_ind (fi,-) :: dim indicies  <-------+---+
d5d5c6127e Ed H*0063 C     .                              |
1b5fb69d21 Ed H*0064 C     mnc_d_names (di)  :: names  <--+  <--+  |
                0065 C     mnc_d_ids   (di)  :: IDs    <--+  <--+  +----+
                0066 C     mnc_d_size  (di)  :: sizes  <--+  <--+       | starting
                0067 C     .                                    |       | indicies of
                0068 C     mnc_f_alld (fi,di):: ndim, id1,id2,id3, ...  | grids in
                0069 C     .                                            | mnc_f_info
                0070 C     .                                 +----------++
d5d5c6127e Ed H*0071 C     .                                 |           |
                0072 C     mnc_fv_ids (fi,-) :: nVar, n1,ID1,ig1, n2,ID2,ig2, ...
                0073 C     .                          |           |
                0074 C     mnc_v_names (vi)  ::   <---+-----------+
15688ab4b4 Ed H*0075 C
d5d5c6127e Ed H*0076 C     fi                ::  file index
                0077 C     vi                ::  variable index
                0078 C     di                ::  dimension index
                0079 C     .
                0080 C     .
a85293d087 Mart*0081 C     The following MNC "Convenience Wrapper" variables are
d5d5c6127e Ed H*0082 C     implemented independently of any NetCDF files
                0083 C     .
3a6f2e4083 Ed H*0084 C     mnc_cw_fgnm  (f)  :: file group name (or "base name")
                0085 C     mnc_cw_fgud  (f)  :: file group unlimited dim value
                0086 C     mnc_cw_fgis  (f)  :: file group sequence number
ab11ba1276 Ed H*0087 C     mnc_cw_fgig  (f)  :: file group unlim dim is growing
5bc9611487 Ed H*0088 C     mnc_cw_fgci  (f)  :: file CITER group number (cig) ------+
                0089 C     .                                                        |
                0090 C     mnc_cw_cit (3,cig):: CITER (1) flag, (2) current, and    |
                0091 C     .                          (3) next model Iter values <--+
3a6f2e4083 Ed H*0092 C     .
d5d5c6127e Ed H*0093 C     mnc_cw_gname (g)  :: Gtype names              <--------+
                0094 C     mnc_cw_ndim  (g)  :: number of dimensions              |
                0095 C     mnc_cw_dn   (i,g) :: dname1, dname2, ...               |
                0096 C     mnc_cw_dims (i,g) :: d1, d2, d3, ...                   |
                0097 C     mnc_cw_is   (i,g) :: starting indicies: is1, is2, ...  |
                0098 C     mnc_cw_ie   (i,g) :: ending indicies:   ie1, ie2, ...  |
                0099 C     .                                                      |
                0100 C     mnc_cw_vname (v)  :: Vtype names                       |
                0101 C     mnc_cw_vgind (v)  :: index into                --------+
21c48a3add Ed H*0102 C     mnc_cw_vfmv  (v)  :: flag for missing values
                0103 C     .                      0 = ignore it (default)
                0104 C     .                      1 = use global value
                0105 C     .                      2 = use specific per-var value
                0106 C     mnc_cw_vmvi (2,v) :: integer missing values: 1=IN, 2=OUT
                0107 C     mnc_cw_vmvr (2,v) :: REAL*4  missing values: 1=IN, 2=OUT
                0108 C     mnc_cw_vmvd (2,v) :: REAL*8  missing values: 1=IN, 2=OUT
d5d5c6127e Ed H*0109 C     mnc_cw_vnat (3,v) :: number of attributes [T,I,D]
                0110 C     mnc_cw_vbij (2,v) :: bi,bi indicies (0 if not applicable)
                0111 C     mnc_cw_vtnm (i,v) :: text (character) attribute names
                0112 C     mnc_cw_vtat (i,v) :: text (character) attributes
                0113 C     mnc_cw_vinm (i,v) :: INT attribute names
                0114 C     mnc_cw_viat (i,v) :: INT attributes
                0115 C     mnc_cw_vdnm (i,v) :: REAL*8 attribute names
                0116 C     mnc_cw_vdat (i,v) :: REAL*8 attributes
                0117 C     .
d77e828db7 Ed H*0118 C     mnc_cw_cvnm  (c)  :: CV (coordinate variable) name
                0119 C     mnc_cw_cvse (2,c) :: CV start,end indicies  ----+
                0120 C     mnc_cw_cvdt (cdt) :: CV data pool       <-------+
                0121 C     .
3a6f2e4083 Ed H*0122 C     f                 :: file group index
d5d5c6127e Ed H*0123 C     g                 :: Gtype index
                0124 C     v                 :: Vtype index
d77e828db7 Ed H*0125 C     c                 :: CV index
5eef09f930 Ed H*0126 CEOP
4de8f8c098 Ed H*0127 
6d16ee5841 Jean*0128 #include "MNC_SIZE.h"
4de8f8c098 Ed H*0129 
ef92f00980 Ed H*0130 C=====================================================================
ab11ba1276 Ed H*0131       COMMON /MNC_VARS_C/
a85293d087 Mart*0132      &     mnc_blank_name,
                0133      &     mnc_g_names, mnc_v_names, mnc_d_names,
ef92f00980 Ed H*0134      &     mnc_out_path, mnc_f_names
15688ab4b4 Ed H*0135 
4de8f8c098 Ed H*0136       character*(MNC_MAX_CHAR) mnc_blank_name
                0137       character*(MNC_MAX_CHAR) mnc_g_names(MNC_MAX_ID)
                0138       character*(MNC_MAX_CHAR) mnc_v_names(MNC_MAX_ID)
                0139       character*(MNC_MAX_CHAR) mnc_d_names(MNC_MAX_ID)
5bc9611487 Ed H*0140 
ef92f00980 Ed H*0141       character*(MNC_MAX_PATH) mnc_out_path
                0142       character*(MNC_MAX_PATH) mnc_f_names(MNC_MAX_FID)
                0143 
                0144 C=====================================================================
5bc9611487 Ed H*0145       COMMON /MNC_VARS_I/
                0146      &     mnc_f_info,  mnc_fd_ind,  mnc_fv_ids,  mnc_f_alld,
                0147      &     mnc_d_size,  mnc_d_ids
                0148 
ef92f00980 Ed H*0149       integer mnc_f_info(MNC_MAX_FID,MNC_MAX_INFO)
                0150       integer mnc_fd_ind(MNC_MAX_FID,MNC_MAX_INFO)
                0151       integer mnc_fv_ids(MNC_MAX_FID,MNC_MAX_INFO)
                0152       integer mnc_f_alld(MNC_MAX_FID,MNC_MAX_INFO)
                0153 
4de8f8c098 Ed H*0154       integer mnc_d_size(MNC_MAX_ID)
75987013ac Ed H*0155       integer mnc_d_ids(MNC_MAX_ID)
ab11ba1276 Ed H*0156 
9705a0d5c6 Ed H*0157 C=====================================================================
ab11ba1276 Ed H*0158       COMMON /MNC_CW_VARS_C/
a85293d087 Mart*0159      &     mnc_cw_gname, mnc_cw_dn,
                0160      &     mnc_cw_vname,
ab11ba1276 Ed H*0161      &     mnc_cw_vtnm,  mnc_cw_vinm,  mnc_cw_vdnm,
a52c49e4a8 Ed H*0162      &     mnc_cw_fgnm,
                0163      &     mnc_cw_vtat
ab11ba1276 Ed H*0164 
9705a0d5c6 Ed H*0165       character*(MNC_MAX_CHAR) mnc_cw_gname(MNC_MAX_ID)
                0166       character*(MNC_MAX_CHAR) mnc_cw_dn(MNC_CW_MAX_I,MNC_MAX_ID)
                0167       character*(MNC_MAX_CHAR) mnc_cw_vname(MNC_MAX_ID)
                0168       character*(MNC_MAX_CHAR) mnc_cw_vtnm(MNC_CW_MAX_I,MNC_MAX_ID)
                0169       character*(MNC_MAX_CHAR) mnc_cw_vinm(MNC_CW_MAX_I,MNC_MAX_ID)
                0170       character*(MNC_MAX_CHAR) mnc_cw_vdnm(MNC_CW_MAX_I,MNC_MAX_ID)
                0171       character*(MNC_MAX_CHAR) mnc_cw_fgnm(MNC_MAX_ID)
                0172 
a52c49e4a8 Ed H*0173 C     Note the longer string length here
                0174       character*(MNC_MAX_CATT) mnc_cw_vtat(MNC_CW_MAX_I,MNC_MAX_ID)
                0175 
9705a0d5c6 Ed H*0176 C=====================================================================
ab11ba1276 Ed H*0177       COMMON /MNC_CW_VARS_I/
a85293d087 Mart*0178      &     mnc_cw_ndim,  mnc_cw_dims,
ab11ba1276 Ed H*0179      &     mnc_cw_is,    mnc_cw_ie,
21c48a3add Ed H*0180      &     mnc_cw_vgind, mnc_cw_vfmv,  mnc_cw_vmvi, mnc_cw_vnat,
ab11ba1276 Ed H*0181      &     mnc_cw_vbij,  mnc_cw_viat,
5bc9611487 Ed H*0182      &     mnc_cw_fgud,  mnc_cw_fgis,  mnc_cw_fgig, mnc_cw_fgci,
                0183      &     mnc_cw_cit
21c48a3add Ed H*0184 
e9b72f2bd9 Ed H*0185       integer mnc_cw_ndim(MNC_MAX_ID)
                0186       integer mnc_cw_dims(MNC_CW_MAX_I,MNC_MAX_ID)
                0187       integer mnc_cw_is(MNC_CW_MAX_I,MNC_MAX_ID)
                0188       integer mnc_cw_ie(MNC_CW_MAX_I,MNC_MAX_ID)
4de8f8c098 Ed H*0189 
15688ab4b4 Ed H*0190       integer mnc_cw_vgind(MNC_MAX_ID)
21c48a3add Ed H*0191       integer mnc_cw_vfmv(MNC_MAX_ID)
                0192       integer mnc_cw_vmvi(2,MNC_MAX_ID)
15688ab4b4 Ed H*0193       integer mnc_cw_vnat(3,MNC_MAX_ID)
ef84d10314 Ed H*0194       integer mnc_cw_vbij(2,MNC_MAX_ID)
15688ab4b4 Ed H*0195       integer mnc_cw_viat(MNC_CW_MAX_I,MNC_MAX_ID)
                0196 
85c5caf7c2 Ed H*0197       integer mnc_cw_fgud(MNC_MAX_ID)
3a6f2e4083 Ed H*0198       integer mnc_cw_fgis(MNC_MAX_ID)
ab11ba1276 Ed H*0199       integer mnc_cw_fgig(MNC_MAX_ID)
5bc9611487 Ed H*0200       integer mnc_cw_fgci(MNC_MAX_ID)
                0201 
                0202       integer mnc_cw_cit(3,MNC_MAX_INFO)
d5d5c6127e Ed H*0203 
ef92f00980 Ed H*0204 C=====================================================================
                0205       COMMON /MNC_CW_VARS_D/
                0206      &     mnc_cw_vdat,  mnc_cw_vmvd
                0207 C     &     mnc_cw_cvdt
                0208 
                0209       REAL*8  mnc_cw_vmvd(2,MNC_MAX_ID)
                0210       REAL*8  mnc_cw_vdat(MNC_CW_MAX_I,MNC_MAX_ID)
                0211 
                0212 C=====================================================================
                0213       COMMON /MNC_CW_VARS_R4/
                0214      &     mnc_cw_vmvr
                0215 
                0216       REAL*4  mnc_cw_vmvr(2,MNC_MAX_ID)
                0217 
d77e828db7 Ed H*0218 
15688ab4b4 Ed H*0219 C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
d5d5c6127e Ed H*0220 
4de8f8c098 Ed H*0221 CEH3 ;;; Local Variables: ***
                0222 CEH3 ;;; mode:fortran ***
                0223 CEH3 ;;; End: ***