/[MITgcm]/MITgcm/pkg/grdchk/grdchk_init.F
ViewVC logotype

Contents of /MITgcm/pkg/grdchk/grdchk_init.F

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


Revision 1.9 - (show annotations) (download)
Sun Nov 19 23:17:17 2006 UTC (17 years, 5 months ago) by heimbach
Branch: MAIN
CVS Tags: checkpoint59, checkpoint58y_post, checkpoint58t_post, checkpoint58w_post, checkpoint59e, checkpoint59d, checkpoint59g, checkpoint59f, checkpoint59a, checkpoint59c, checkpoint59b, checkpoint59h, checkpoint58v_post, checkpoint58x_post, checkpoint58u_post, checkpoint58s_post
Changes since 1.8: +4 -3 lines
Several changes to test different tiles, independent of wether
yes or no useCubedSphereExchange.

1 C $Header: /u/gcmpack/MITgcm/pkg/grdchk/grdchk_init.F,v 1.8 2006/05/12 02:17:03 heimbach Exp $
2
3 #include "CTRL_CPPOPTIONS.h"
4
5
6 subroutine grdchk_init( mythid )
7
8 c ==================================================================
9 c SUBROUTINE grdchk_init
10 c ==================================================================
11 c
12 c o Get the location of a given component of the control vector for
13 c the current process.
14 c
15 c started: Christian Eckert eckert@mit.edu 04-Apr-2000
16 c continued: heimbach@mit.edu: 13-Jun-2001
17 c
18 c ==================================================================
19 c SUBROUTINE grdchk_init
20 c ==================================================================
21
22 implicit none
23
24 c == global variables ==
25
26 #include "EEPARAMS.h"
27 #include "SIZE.h"
28 #include "GRID.h"
29 #include "ctrl.h"
30 #include "grdchk.h"
31
32 c == routine arguments ==
33
34 integer mythid
35
36 #ifdef ALLOW_GRDCHK
37 c == local variables ==
38
39 integer bi,bj
40 integer i,j,k
41 integer irec
42 integer itlo,ithi
43 integer jtlo,jthi
44 integer jmin,jmax
45 integer imin,imax
46
47 integer itest,iobcs
48 integer icomptest
49
50 c == end of interface ==
51
52 jtlo = 1
53 jthi = nsy
54 itlo = 1
55 ithi = nsx
56 jmin = 1
57 jmax = sny
58 imin = 1
59 imax = snx
60
61 _BEGIN_MASTER( mythid )
62
63 c-- initialise
64 do bj = jtlo,jthi
65 do bi = itlo,ithi
66 do k = 1,ncvarnrmax(grdchkvarindex)
67 do iobcs = 1, nobcs
68 nwettile(bi,bj,k,iobcs) = 0
69 enddo
70 enddo
71 enddo
72 enddo
73
74 c-- Determine the number of components of the given
75 c-- control variable on the current tile.
76 if ( ncvargrd(grdchkvarindex) .eq. 'c' ) then
77 do bj = jtlo,jthi
78 do bi = itlo,ithi
79 do k = 1,ncvarnrmax(grdchkvarindex)
80 nwettile(bi,bj,k,1) = nwetctile(bi,bj,k)
81 enddo
82 enddo
83 enddo
84 else if ( ncvargrd(grdchkvarindex) .eq. 's' ) then
85 do bj = jtlo,jthi
86 do bi = itlo,ithi
87 do k = 1,ncvarnrmax(grdchkvarindex)
88 nwettile(bi,bj,k,1) = nwetstile(bi,bj,k)
89 enddo
90 enddo
91 enddo
92 else if ( ncvargrd(grdchkvarindex) .eq. 'w' ) then
93 do bj = jtlo,jthi
94 do bi = itlo,ithi
95 do k = 1,ncvarnrmax(grdchkvarindex)
96 nwettile(bi,bj,k,1) = nwetwtile(bi,bj,k)
97 enddo
98 enddo
99 enddo
100 else if ( ncvargrd(grdchkvarindex) .eq. 'v' ) then
101 do bj = jtlo,jthi
102 do bi = itlo,ithi
103 do k = 1,ncvarnrmax(grdchkvarindex)
104 nwettile(bi,bj,k,1) = nwetvtile(bi,bj,k)
105 enddo
106 enddo
107 enddo
108 else if ( ncvargrd(grdchkvarindex) .eq. 'm' ) then
109 do bj = jtlo,jthi
110 do bi = itlo,ithi
111 do k = 1,ncvarnrmax(grdchkvarindex)
112 do iobcs = 1, nobcs
113 if ( grdchkvarindex .eq. 11 ) then
114 #ifdef ALLOW_OBCSN_CONTROL
115 nwettile(bi,bj,k,iobcs) =
116 & nwetobcsn(bi,bj,k,iobcs)
117 #endif
118 else if ( grdchkvarindex .eq. 12 ) then
119 #ifdef ALLOW_OBCSS_CONTROL
120 nwettile(bi,bj,k,iobcs) =
121 & nwetobcss(bi,bj,k,iobcs)
122 #endif
123 else if ( grdchkvarindex .eq. 13 ) then
124 #ifdef ALLOW_OBCSW_CONTROL
125 nwettile(bi,bj,k,iobcs) =
126 & nwetobcsw(bi,bj,k,iobcs)
127 #endif
128 else if ( grdchkvarindex .eq. 14 ) then
129 #ifdef ALLOW_OBCSE_CONTROL
130 nwettile(bi,bj,k,iobcs) =
131 & nwetobcse(bi,bj,k,iobcs)
132 #endif
133 endif
134 enddo
135 enddo
136 enddo
137 enddo
138 else
139 ce --> wrong grid specification for the control variable.
140 endif
141
142 c-- get mask file for obcs
143 #ifdef ALLOW_OBCS_CONTROL
144 call grdchk_get_obcs_mask ( mythid )
145 #endif
146
147 c ----------------------------------------------------------------
148
149 c-- Determine the actual and the maximum possible number of
150 c-- components of the given control variable.
151 ncvarcomp = 0
152 maxncvarcomps = 0
153 do bj = jtlo,jthi
154 do bi = itlo,ithi
155 do k = 1,ncvarnrmax(grdchkvarindex)
156 do iobcs = 1, nobcs
157 ncvarcomp = ncvarcomp + nwettile(bi,bj,k,iobcs)
158 maxncvarcomps = maxncvarcomps +
159 & ncvarxmax(grdchkvarindex)*
160 & ncvarymax(grdchkvarindex)
161 enddo
162 enddo
163 enddo
164 enddo
165 ncvarcomp = ncvarcomp*ncvarrecs(grdchkvarindex)
166 maxncvarcomps = maxncvarcomps*ncvarrecs(grdchkvarindex)
167
168 do bj = jtlo,jthi
169 do bi = itlo,ithi
170 iwetsum(bi,bj,0) = 0
171 do k = 1,ncvarnrmax(grdchkvarindex)
172 iwetsum(bi,bj,k) = iwetsum(bi,bj,k-1) +
173 & nwettile(bi,bj,k,1)
174 enddo
175 enddo
176 enddo
177
178 _END_MASTER( mythid )
179
180 _BARRIER
181
182 #endif /* ALLOW_GRDCHK */
183
184 end
185

  ViewVC Help
Powered by ViewVC 1.1.22