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

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

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


Revision 1.6 - (hide annotations) (download)
Tue Jun 24 16:08:45 2003 UTC (20 years, 10 months ago) by heimbach
Branch: MAIN
CVS Tags: checkpoint51k_post, checkpoint51o_pre, checkpoint51l_post, checkpoint51, checkpoint51f_post, checkpoint51d_post, checkpoint51n_post, checkpoint51j_post, checkpoint51n_pre, checkpoint51l_pre, checkpoint51b_pre, checkpoint51h_pre, branchpoint-genmake2, checkpoint51i_post, checkpoint51b_post, checkpoint51c_post, checkpoint51i_pre, checkpoint51e_post, checkpoint51f_pre, checkpoint51g_post, checkpoint51m_post, checkpoint51a_post
Branch point for: branch-genmake2, tg2-branch, checkpoint51n_branch
Changes since 1.5: +58 -8 lines
Merging for c51 vs. e34

1 heimbach 1.6 C $Header: /u/gcmpack/MITgcm/pkg/grdchk/grdchk_init.F,v 1.2.6.4 2003/06/20 19:38:59 heimbach Exp $
2 heimbach 1.2
3     #include "CTRL_CPPOPTIONS.h"
4    
5    
6 heimbach 1.5 subroutine grdchk_init( mythid )
7 heimbach 1.2
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_GRADIENT_CHECK
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 heimbach 1.6 integer itest,iobcs
48 heimbach 1.2 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 heimbach 1.6 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 heimbach 1.2 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 heimbach 1.6 nwettile(bi,bj,k,1) = nwetctile(bi,bj,k)
81 heimbach 1.2 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 heimbach 1.6 nwettile(bi,bj,k,1) = nwetstile(bi,bj,k)
89 heimbach 1.2 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 heimbach 1.6 nwettile(bi,bj,k,1) = nwetwtile(bi,bj,k)
97 heimbach 1.4 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 heimbach 1.6 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 heimbach 1.2 enddo
136     enddo
137     enddo
138     else
139     ce --> wrong grid specification for the control variable.
140     endif
141    
142 heimbach 1.6 c-- get mask file for obcs
143     #ifdef ALLOW_OBCS_CONTROL
144     call grdchk_get_obcs_mask ( mythid )
145     #endif
146    
147 heimbach 1.2 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 heimbach 1.6 do iobcs = 1, nobcs
157     ncvarcomp = ncvarcomp + nwettile(bi,bj,k,iobcs)
158     maxncvarcomps = maxncvarcomps +
159     & ncvarxmax(grdchkvarindex)*
160     & ncvarymax(grdchkvarindex)
161     enddo
162 heimbach 1.2 enddo
163     enddo
164     enddo
165     ncvarcomp = ncvarcomp*ncvarrecs(grdchkvarindex)
166     maxncvarcomps = maxncvarcomps*ncvarrecs(grdchkvarindex)
167    
168     _END_MASTER( mythid )
169    
170     _BARRIER
171    
172     #endif /* ALLOW_GRADIENT_CHECK */
173    
174     end
175    

  ViewVC Help
Powered by ViewVC 1.1.22