/[MITgcm]/MITgcm/pkg/mnc/mnc_init.F
ViewVC logotype

Contents of /MITgcm/pkg/mnc/mnc_init.F

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


Revision 1.21 - (show annotations) (download)
Fri Feb 24 20:39:10 2006 UTC (18 years, 3 months ago) by edhill
Branch: MAIN
Changes since 1.20: +5 -1 lines
add missing-value capability to MNC:
 + currently off by default for everything
 + compiles and runs with GNU, Intel, & PGI
 + includes code to skip attributes writing for all but the initial
     write of any variable within any netCDF file

1 C $Header: /u/gcmpack/MITgcm/pkg/mnc/mnc_init.F,v 1.20 2005/09/10 18:30:07 edhill Exp $
2 C $Name: $
3
4 #include "MNC_OPTIONS.h"
5
6 C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
7 CBOP 0
8 C !ROUTINE: MNC_INIT
9
10 C !INTERFACE:
11 SUBROUTINE MNC_INIT( myThid )
12
13 C !DESCRIPTION:
14 C Initialize (zero) the look-up tables. This routine should
15 C \textbf{always} be run before any other MNC subroutines to ensure
16 C that the lookup tables start in a well-defined state.
17
18 C !USES:
19 #include "mnc_common.h"
20 #include "SIZE.h"
21 #include "EEPARAMS.h"
22 #include "EESUPPORT.h"
23 #include "PARAMS.h"
24
25 C !INPUT PARAMETERS:
26 integer myThid
27 CEOP
28
29 C !LOCAL VARIABLES:
30 integer i,j, g, v
31 character blank*(MNC_MAX_CHAR)
32
33 C Write blanks or zeros to all the internal names and ID tables
34 DO i = 1,MNC_MAX_CHAR
35 blank(i:i) = ' '
36 ENDDO
37 mnc_blank_name(1:MNC_MAX_CHAR) = blank(1:MNC_MAX_CHAR)
38 DO i = 1,MNC_MAX_ID
39 mnc_d_size(i) = 0
40 mnc_d_ids(i) = 0
41 mnc_f_names(i)(1:MNC_MAX_CHAR) = blank(1:MNC_MAX_CHAR)
42 mnc_g_names(i)(1:MNC_MAX_CHAR) = blank(1:MNC_MAX_CHAR)
43 mnc_v_names(i)(1:MNC_MAX_CHAR) = blank(1:MNC_MAX_CHAR)
44 mnc_d_names(i)(1:MNC_MAX_CHAR) = blank(1:MNC_MAX_CHAR)
45 DO j = 1,MNC_MAX_INFO
46 mnc_f_info(i,j) = 0
47 mnc_fv_ids(i,j) = 0
48 mnc_fd_ind(i,j) = 0
49 mnc_f_alld(i,j) = 0
50 ENDDO
51 ENDDO
52
53 C Blank the CW tables
54 DO g = 1,MNC_MAX_ID
55 mnc_cw_gname(g)(1:MNC_MAX_CHAR) = blank(1:MNC_MAX_CHAR)
56 mnc_cw_vname(g)(1:MNC_MAX_CHAR) = blank(1:MNC_MAX_CHAR)
57 mnc_cw_vgind(g) = 0
58 mnc_cw_vfmv(g) = 0
59 mnc_cw_ndim(g) = 0
60 mnc_cw_fgnm(g)(1:MNC_MAX_CHAR) = blank(1:MNC_MAX_CHAR)
61 mnc_cw_fgud(g) = 0
62 mnc_cw_fgis(g) = 0
63 mnc_cw_fgci(g) = 1
64 C mnc_cw_cvnm(g)(1:MNC_MAX_CHAR) = blank(1:MNC_MAX_CHAR)
65 DO i = 1,MNC_CW_MAX_I
66 mnc_cw_dn(i,g)(1:MNC_MAX_CHAR) = blank(1:MNC_MAX_CHAR)
67 mnc_cw_vtnm(i,g)(1:MNC_MAX_CHAR) = blank(1:MNC_MAX_CHAR)
68 mnc_cw_vinm(i,g)(1:MNC_MAX_CHAR) = blank(1:MNC_MAX_CHAR)
69 mnc_cw_vdnm(i,g)(1:MNC_MAX_CHAR) = blank(1:MNC_MAX_CHAR)
70 mnc_cw_vtat(i,g)(1:MNC_MAX_CHAR) = blank(1:MNC_MAX_CHAR)
71 mnc_cw_dims(i,g) = 0
72 mnc_cw_is(i,g) = 0
73 mnc_cw_ie(i,g) = 0
74 mnc_cw_viat(i,g) = 0
75 mnc_cw_vdat(i,g) = 0.0D0
76 ENDDO
77 DO i = 1,3
78 mnc_cw_vnat(i,g) = 0
79 ENDDO
80 DO i = 1,2
81 mnc_cw_vbij(i,g) = 0
82 mnc_cw_vmvi(i,g) = 0
83 mnc_cw_vmvr(i,g) = 0.0
84 mnc_cw_vmvd(i,g) = 0.0D0
85 C mnc_cw_cvse(i,g) = 0
86 ENDDO
87 ENDDO
88
89 DO i = 1,MNC_MAX_INFO
90 mnc_cw_cit(1,i) = 0
91 mnc_cw_cit(2,i) = 0
92 mnc_cw_cit(3,i) = -1
93 ENDDO
94
95 C The default for all file types is to add the iter to the name and
96 C grow them in "lock step" together
97 mnc_cw_cit(1,1) = 1
98 mnc_cw_cit(2,1) = nIter0
99
100 C Here, we do not add the iter to the file name
101 mnc_cw_cit(1,2) = -1
102 mnc_cw_cit(2,2) = -1
103
104 C For checkpoint files, we want to use the current iter but we do
105 C not (by default, anyway) want to update the current iter for
106 C everything else
107 mnc_cw_cit(1,3) = 3
108 mnc_cw_cit(2,3) = nIter0
109
110 C DO i = 1,MNC_CW_CVDAT
111 C mnc_cw_cvdt(i) = 0.0D0
112 C ENDDO
113
114 RETURN
115 END
116
117 C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|

  ViewVC Help
Powered by ViewVC 1.1.22