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

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

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


Revision 1.4 - (show annotations) (download)
Thu May 22 12:21:19 2008 UTC (15 years, 11 months ago) by mlosch
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, checkpoint59r, 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.3: +2 -2 lines
replace mnc_common.h and mnc_id_header.h with corresponding upper case
versions

1 C $Header: /u/gcmpack/MITgcm/pkg/mnc/mnc_cw_init.F,v 1.3 2005/02/23 05:17:36 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_CW_INIT
9
10 C !INTERFACE:
11 SUBROUTINE MNC_CW_INIT(
12 I sNx,sNy, OLx,OLy, nSx,nSy, nPx,nPy, Nr,
13 I myThid )
14
15 C !DESCRIPTION:
16 C Create the pre-defined grid types and variable types.
17
18 C The grid type is a character string that encodes the presence and
19 C types associated with the four possible dimensions. The character
20 C string follows the format
21 C \begin{center}
22 C \texttt{H0\_H1\_H2\_\_V\_\_T}
23 C \end{center}
24 C where the terms \textit{H0}, \textit{H1}, \textit{H2}, \textit{V},
25 C \textit{T} can be almost any combination of the following:
26 C \begin{center}
27 C \begin{tabular}[h]{|ccc|c|c|}\hline
28 C \multicolumn{3}{|c|}{Horizontal} & Vertical & Time \\
29 C \textit{H0}: location & \textit{H1}: dimensions & \textit{H2}: halo
30 C & \textit{V}: location & \textit{T}: level \\\hline
31 C \texttt{-} & xy & Hn & \texttt{-} & \texttt{-} \\
32 C U & x & Hy & i & t \\
33 C V & y & & c & \\
34 C Cen & & & & \\
35 C Cor & & & & \\\hline
36 C \end{tabular}
37 C \end{center}
38
39
40 C !USES:
41 implicit none
42 #include "MNC_COMMON.h"
43 #include "EEPARAMS.h"
44
45 C !INPUT PARAMETERS:
46 integer myThid
47 integer sNx,sNy, OLx,OLy, nSx,nSy, nPx,nPy, Nr
48 CEOP
49
50 C !LOCAL VARIABLES:
51 integer CW_MAX_LOC
52 parameter ( CW_MAX_LOC = 6 )
53 integer i, ihorz,ihsub,ivert,itime,ihalo, is,ih, n,ntot
54 integer ndim, ncomb, nvch
55 character*(MNC_MAX_CHAR) name
56 character*(MNC_MAX_CHAR) dn(CW_MAX_LOC)
57 character*(5) horz_dat(CW_MAX_LOC), hsub_dat(CW_MAX_LOC),
58 & vert_dat(CW_MAX_LOC), time_dat(CW_MAX_LOC),
59 & halo_dat(CW_MAX_LOC)
60 integer dim(CW_MAX_LOC), ib(CW_MAX_LOC), ie(CW_MAX_LOC)
61
62 C Functions
63 integer ILNBLNK
64 external ILNBLNK
65
66 C ......12345....12345....12345....12345....12345...
67 data horz_dat /
68 & '- ', 'U ', 'V ', 'Cen ', 'Cor ', ' ' /
69 data hsub_dat /
70 & 'xy ', 'x ', 'y ', '- ', ' ', ' ' /
71 data halo_dat /
72 & 'Hn ', 'Hy ', '-- ', ' ', ' ', ' ' /
73 data vert_dat /
74 & '- ', 'C ', 'I ', 'L ', 'U ', 'S ' /
75 data time_dat /
76 & '- ', 't ', ' ', ' ', ' ', ' ' /
77
78 C Create the types
79 ncomb = 0
80 DO ihorz = 1,5
81 DO is = 1,3
82 DO ih = 1,2
83
84 C Loop just ONCE if the Horiz component is "-"
85 ihsub = is
86 ihalo = ih
87 IF (ihorz .EQ. 1) THEN
88 IF ((is .EQ. 1) .AND. (ih .EQ. 1)) THEN
89 ihsub = 4
90 ihalo = 3
91 ELSE
92 GOTO 10
93 ENDIF
94 ENDIF
95
96 DO ivert = 1,6
97 DO itime = 1,2
98
99 C horiz and hsub
100 name(1:MNC_MAX_CHAR) = mnc_blank_name(1:MNC_MAX_CHAR)
101 n = ILNBLNK(horz_dat(ihorz))
102 name(1:n) = horz_dat(ihorz)(1:n)
103 ntot = n + 1
104 name(ntot:ntot) = '_'
105 n = ILNBLNK(hsub_dat(ihsub))
106 name((ntot+1):(ntot+n)) = hsub_dat(ihsub)(1:n)
107 ntot = ntot + n
108
109 C halo, vert, and time
110 write(name((ntot+1):(ntot+5)), '(a1,2a2)')
111 & '_', halo_dat(ihalo)(1:2), '__'
112 nvch = ILNBLNK(vert_dat(ivert))
113 n = ntot+6+nvch-1
114 name((ntot+6):(n)) = vert_dat(ivert)(1:nvch)
115 write(name((n+1):(n+3)), '(a2,a1)')
116 & '__', time_dat(itime)(1:1)
117
118 ndim = 0
119 DO i = 1,CW_MAX_LOC
120 dn(i)(1:MNC_MAX_CHAR)=mnc_blank_name(1:MNC_MAX_CHAR)
121 dim(i) = 0
122 ib(i) = 0
123 ie(i) = 0
124 ENDDO
125
126 C Horizontal dimensions
127 IF (halo_dat(ihalo)(1:5) .EQ. 'Hn ') THEN
128
129 IF (hsub_dat(ihsub)(1:1) .EQ. 'x') THEN
130 ndim = ndim + 1
131 IF ( (horz_dat(ihorz)(1:3) .EQ. 'Cen')
132 & .OR. (horz_dat(ihorz)(1:1) .EQ. 'V') ) THEN
133 dn(ndim)(1:1) = 'X'
134 dim(ndim) = sNx + 2*OLx
135 ib(ndim) = OLx + 1
136 ie(ndim) = OLx + sNx
137 ENDIF
138 IF ( (horz_dat(ihorz)(1:3) .EQ. 'Cor')
139 & .OR. (horz_dat(ihorz)(1:1) .EQ. 'U') ) THEN
140 dn(ndim)(1:3) = 'Xp1'
141 dim(ndim) = sNx + 2*OLx
142 ib(ndim) = OLx + 1
143 ie(ndim) = OLx + sNx + 1
144 ENDIF
145 ENDIF
146 IF ((hsub_dat(ihsub)(1:1) .EQ. 'y')
147 & .OR. (hsub_dat(ihsub)(2:2) .EQ. 'y')) THEN
148 ndim = ndim + 1
149 IF ( (horz_dat(ihorz)(1:3) .EQ. 'Cen')
150 & .OR. (horz_dat(ihorz)(1:1) .EQ. 'U') ) THEN
151 dn(ndim)(1:1) = 'Y'
152 dim(ndim) = sNy + 2*OLy
153 ib(ndim) = OLy + 1
154 ie(ndim) = OLy + sNy
155 ENDIF
156 IF ( (horz_dat(ihorz)(1:3) .EQ. 'Cor')
157 & .OR. (horz_dat(ihorz)(1:1) .EQ. 'V') ) THEN
158 dn(ndim)(1:3) = 'Yp1'
159 dim(ndim) = sNy + 2*OLy
160 ib(ndim) = OLy + 1
161 ie(ndim) = OLy + sNy + 1
162 ENDIF
163 ENDIF
164
165 ELSEIF (halo_dat(ihalo)(1:5) .EQ. 'Hy ') THEN
166
167 IF (hsub_dat(ihsub)(1:1) .EQ. 'x') THEN
168 ndim = ndim + 1
169 dn(ndim)(1:3) = 'Xwh'
170 dim(ndim) = sNx + 2*OLx
171 ib(ndim) = 1
172 ie(ndim) = sNx + 2*OLx
173 ENDIF
174 IF ((hsub_dat(ihsub)(1:1) .EQ. 'y')
175 & .OR. (hsub_dat(ihsub)(2:2) .EQ. 'y')) THEN
176 ndim = ndim + 1
177 dn(ndim)(1:3) = 'Ywh'
178 dim(ndim) = sNy + 2*OLy
179 ib(ndim) = 1
180 ie(ndim) = sNy + 2*OLy
181 ENDIF
182
183 ENDIF
184
185 C Vertical dimension
186 IF (vert_dat(ivert)(1:1) .EQ. 'C') THEN
187 ndim = ndim + 1
188 dn(ndim)(1:1) = 'Z'
189 dim(ndim) = Nr
190 ib(ndim) = 1
191 ie(ndim) = Nr
192 ENDIF
193 IF (vert_dat(ivert)(1:1) .EQ. 'I') THEN
194 ndim = ndim + 1
195 dn(ndim)(1:3) = 'Zp1'
196 dim(ndim) = Nr + 1
197 ib(ndim) = 1
198 ie(ndim) = Nr + 1
199 ENDIF
200 IF (vert_dat(ivert)(1:1) .EQ. 'L') THEN
201 ndim = ndim + 1
202 dn(ndim)(1:2) = 'Zl'
203 dim(ndim) = Nr
204 ib(ndim) = 1
205 ie(ndim) = Nr
206 ENDIF
207 IF (vert_dat(ivert)(1:1) .EQ. 'U') THEN
208 ndim = ndim + 1
209 dn(ndim)(1:2) = 'Zu'
210 dim(ndim) = Nr
211 ib(ndim) = 1
212 ie(ndim) = Nr
213 ENDIF
214 IF (vert_dat(ivert)(1:1) .EQ. 'M') THEN
215 ndim = ndim + 1
216 dn(ndim)(1:3) = 'Zm1'
217 dim(ndim) = Nr - 1
218 ib(ndim) = 1
219 ie(ndim) = Nr - 1
220 ENDIF
221
222 C Time dimension
223 IF (time_dat(itime)(1:1) .EQ. 't') THEN
224 ndim = ndim + 1
225 dn(ndim)(1:1) = 'T'
226 dim(ndim) = -1
227 ib(ndim) = 1
228 ie(ndim) = 1
229 ENDIF
230
231 IF (ndim .GT. 0) THEN
232 #ifdef MNC_DEBUG
233 ncomb = ncomb + 1
234 write(*,'(i4,a3,a15,i3,a3,5i4,a4,5i4,a4,5i4,6a4)')
235 & ncomb, ' : ', name(1:15), ndim,
236 & ' : ', (dim(i), i=1,5),
237 & ' | ', (ib(i), i=1,5),
238 & ' | ', (ie(i), i=1,5),
239 & ' | ', (dn(i)(1:4), i=1,5)
240 #endif
241
242 CALL MNC_CW_ADD_GNAME(name, ndim,
243 & dim, dn, ib, ie, myThid)
244 ENDIF
245
246 ENDDO
247 ENDDO
248
249 10 CONTINUE
250 ENDDO
251 ENDDO
252 ENDDO
253
254 RETURN
255 END
256
257 C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|

  ViewVC Help
Powered by ViewVC 1.1.22