/[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.2 - (show annotations) (download)
Fri Jul 13 14:50:46 2001 UTC (22 years, 10 months ago) by heimbach
Branch: MAIN
CVS Tags: checkpoint44e_post, checkpoint44f_post, checkpoint43a-release1mods, checkpoint40pre3, checkpoint40pre7, checkpoint40pre6, checkpoint40pre9, checkpoint40pre8, chkpt44d_post, release1_p1, release1_p2, release1_p3, checkpoint44e_pre, release1_b1, checkpoint43, release1_chkpt44d_post, checkpoint40pre2, release1-branch_tutorials, chkpt44a_post, checkpoint44h_pre, checkpoint40pre4, chkpt44c_pre, checkpoint45a_post, ecco_c44_e19, ecco_c44_e18, ecco_c44_e17, ecco_c44_e16, checkpoint44g_post, checkpoint45b_post, release1-branch-end, release1_final_v1, checkpoint44b_post, checkpoint44h_post, ecco_c44_e22, checkpoint40pre5, chkpt44a_pre, ecco_c44_e23, ecco_c44_e20, ecco_c44_e21, ecco-branch-mod1, ecco-branch-mod2, ecco-branch-mod3, ecco-branch-mod4, ecco-branch-mod5, release1_beta1, checkpoint44b_pre, checkpoint42, checkpoint40, checkpoint41, checkpoint44, checkpoint45, chkpt44c_post, checkpoint44f_pre, release1-branch_branchpoint
Branch point for: release1_final, release1-branch, release1, ecco-branch, release1_coupled
Changes since 1.1: +119 -0 lines
Adding gradient check package.

1 C $Header: /u/gcmpack/development/heimbach/ecco_env/pkg/grdchk/grdchk_init.F,v 1.5 2001/06/27 02:18:45 heimbach Exp $
2
3 #include "CTRL_CPPOPTIONS.h"
4
5
6 subroutine grdchk_init(
7 I mythid
8 & )
9
10 c ==================================================================
11 c SUBROUTINE grdchk_init
12 c ==================================================================
13 c
14 c o Get the location of a given component of the control vector for
15 c the current process.
16 c
17 c started: Christian Eckert eckert@mit.edu 04-Apr-2000
18 c continued: heimbach@mit.edu: 13-Jun-2001
19 c
20 c ==================================================================
21 c SUBROUTINE grdchk_init
22 c ==================================================================
23
24 implicit none
25
26 c == global variables ==
27
28 #include "EEPARAMS.h"
29 #include "SIZE.h"
30 #include "GRID.h"
31 #include "ctrl.h"
32 #include "grdchk.h"
33
34 c == routine arguments ==
35
36 integer mythid
37
38 #ifdef ALLOW_GRADIENT_CHECK
39 c == local variables ==
40
41 integer bi,bj
42 integer i,j,k
43 integer irec
44 integer itlo,ithi
45 integer jtlo,jthi
46 integer jmin,jmax
47 integer imin,imax
48
49 integer itest
50 integer icomptest
51
52 c == end of interface ==
53
54 jtlo = 1
55 jthi = nsy
56 itlo = 1
57 ithi = nsx
58 jmin = 1
59 jmax = sny
60 imin = 1
61 imax = snx
62
63 _BEGIN_MASTER( mythid )
64
65 c-- Determine the number of components of the given
66 c-- control variable on the current tile.
67 if ( ncvargrd(grdchkvarindex) .eq. 'c' ) then
68 do bj = jtlo,jthi
69 do bi = itlo,ithi
70 do k = 1,ncvarnrmax(grdchkvarindex)
71 nwettile(bi,bj,k) = nwetctile(bi,bj,k)
72 enddo
73 enddo
74 enddo
75 else if ( ncvargrd(grdchkvarindex) .eq. 's' ) then
76 do bj = jtlo,jthi
77 do bi = itlo,ithi
78 do k = 1,ncvarnrmax(grdchkvarindex)
79 nwettile(bi,bj,k) = nwetstile(bi,bj,k)
80 enddo
81 enddo
82 enddo
83 else if ( ncvargrd(grdchkvarindex) .eq. 'w' ) then
84 do bj = jtlo,jthi
85 do bi = itlo,ithi
86 do k = 1,ncvarnrmax(grdchkvarindex)
87 nwettile(bi,bj,k) = nwetwtile(bi,bj,k)
88 enddo
89 enddo
90 enddo
91 else
92 ce --> wrong grid specification for the control variable.
93 endif
94
95 c ----------------------------------------------------------------
96
97 c-- Determine the actual and the maximum possible number of
98 c-- components of the given control variable.
99 ncvarcomp = 0
100 maxncvarcomps = 0
101 do bj = jtlo,jthi
102 do bi = itlo,ithi
103 do k = 1,ncvarnrmax(grdchkvarindex)
104 ncvarcomp = ncvarcomp + nwettile(bi,bj,k)
105 maxncvarcomps = maxncvarcomps + snx*sny
106 enddo
107 enddo
108 enddo
109 ncvarcomp = ncvarcomp*ncvarrecs(grdchkvarindex)
110 maxncvarcomps = maxncvarcomps*ncvarrecs(grdchkvarindex)
111
112 _END_MASTER( mythid )
113
114 _BARRIER
115
116 #endif /* ALLOW_GRADIENT_CHECK */
117
118 end
119

  ViewVC Help
Powered by ViewVC 1.1.22