1 |
heimbach |
1.4 |
C $Header: /u/gcmpack/MITgcm/pkg/grdchk/grdchk_get_obcs_mask.F,v 1.3 2003/07/18 21:10:16 heimbach Exp $ |
2 |
heimbach |
1.2 |
|
3 |
|
|
#include "CTRL_CPPOPTIONS.h" |
4 |
|
|
|
5 |
|
|
|
6 |
|
|
subroutine grdchk_get_obcs_mask( mythid ) |
7 |
|
|
|
8 |
|
|
c ================================================================== |
9 |
|
|
c SUBROUTINE grdchk_get_obcs_mask |
10 |
|
|
c ================================================================== |
11 |
|
|
c |
12 |
|
|
c o Get obcs masks from file |
13 |
|
|
c |
14 |
|
|
c started: heimbach@mit.edu: 22-Apr-2003 |
15 |
|
|
c |
16 |
|
|
c ================================================================== |
17 |
|
|
c SUBROUTINE grdchk_get_obcs_mask |
18 |
|
|
c ================================================================== |
19 |
|
|
|
20 |
|
|
implicit none |
21 |
|
|
|
22 |
|
|
c == global variables == |
23 |
|
|
|
24 |
|
|
#include "EEPARAMS.h" |
25 |
|
|
#include "SIZE.h" |
26 |
|
|
#include "GRID.h" |
27 |
|
|
#include "ctrl.h" |
28 |
|
|
#include "grdchk.h" |
29 |
|
|
|
30 |
|
|
c == routine arguments == |
31 |
|
|
|
32 |
|
|
integer mythid |
33 |
|
|
|
34 |
heimbach |
1.4 |
#if (defined (ALLOW_GRDCHK) && defined (ALLOW_OBCS_CONTROL)) |
35 |
heimbach |
1.2 |
c == local variables == |
36 |
|
|
|
37 |
|
|
integer bi,bj |
38 |
|
|
integer i,j,k |
39 |
|
|
integer irec,iobcs |
40 |
|
|
integer itlo,ithi |
41 |
|
|
integer jtlo,jthi |
42 |
|
|
integer jmin,jmax |
43 |
|
|
integer imin,imax |
44 |
|
|
|
45 |
|
|
_RL dummy |
46 |
|
|
|
47 |
|
|
character*( 80) fname |
48 |
|
|
|
49 |
|
|
c == external == |
50 |
|
|
|
51 |
|
|
integer ilnblnk |
52 |
|
|
external ilnblnk |
53 |
|
|
|
54 |
|
|
c == end of interface == |
55 |
|
|
|
56 |
|
|
jtlo = 1 |
57 |
|
|
jthi = nsy |
58 |
|
|
itlo = 1 |
59 |
|
|
ithi = nsx |
60 |
|
|
jmin = 1 |
61 |
|
|
jmax = sny |
62 |
|
|
imin = 1 |
63 |
|
|
imax = snx |
64 |
|
|
|
65 |
|
|
_BEGIN_MASTER( mythid ) |
66 |
|
|
|
67 |
heimbach |
1.3 |
if ( grdchkvarindex .EQ. 11 ) then |
68 |
heimbach |
1.2 |
#ifdef ALLOW_OBCSN_CONTROL |
69 |
|
|
write(fname(1:80),'(80a)') ' ' |
70 |
|
|
write(fname(1:80),'(a)') 'maskobcsn' |
71 |
|
|
c |
72 |
|
|
do iobcs = 1,nobcs |
73 |
heimbach |
1.3 |
call active_read_xz_loc( fname, tmpfldxz, iobcs, |
74 |
heimbach |
1.2 |
& .false., .false., 0, mythid, dummy) |
75 |
|
|
c |
76 |
|
|
do bj = jtlo,jthi |
77 |
|
|
do bi = itlo,ithi |
78 |
|
|
do k = 1,nr |
79 |
|
|
do i = imin,imax |
80 |
|
|
grdchk_maskxz(i,k,bi,bj,iobcs) = |
81 |
|
|
& tmpfldxz(i,k,bi,bj) |
82 |
|
|
enddo |
83 |
|
|
enddo |
84 |
|
|
enddo |
85 |
|
|
enddo |
86 |
|
|
c |
87 |
|
|
enddo |
88 |
|
|
#endif |
89 |
|
|
|
90 |
heimbach |
1.3 |
else if ( grdchkvarindex .EQ. 12 ) then |
91 |
heimbach |
1.2 |
#ifdef ALLOW_OBCSS_CONTROL |
92 |
|
|
write(fname(1:80),'(80a)') ' ' |
93 |
|
|
write(fname(1:80),'(a)') 'maskobcss' |
94 |
|
|
c |
95 |
|
|
do iobcs = 1,nobcs |
96 |
heimbach |
1.3 |
call active_read_xz_loc( fname, tmpfldxz, iobcs, |
97 |
heimbach |
1.2 |
& .false., .false., 0, mythid, dummy) |
98 |
|
|
c |
99 |
|
|
do bj = jtlo,jthi |
100 |
|
|
do bi = itlo,ithi |
101 |
|
|
do k = 1,nr |
102 |
|
|
do i = imin,imax |
103 |
|
|
grdchk_maskxz(i,k,bi,bj,iobcs) = |
104 |
|
|
& tmpfldxz(i,k,bi,bj) |
105 |
|
|
enddo |
106 |
|
|
enddo |
107 |
|
|
enddo |
108 |
|
|
enddo |
109 |
|
|
c |
110 |
|
|
enddo |
111 |
|
|
#endif |
112 |
|
|
|
113 |
heimbach |
1.3 |
else if ( grdchkvarindex .EQ. 13 ) then |
114 |
heimbach |
1.2 |
#ifdef ALLOW_OBCSW_CONTROL |
115 |
|
|
write(fname(1:80),'(80a)') ' ' |
116 |
|
|
write(fname(1:80),'(a)') 'maskobcsw' |
117 |
|
|
c |
118 |
|
|
do iobcs = 1,nobcs |
119 |
heimbach |
1.3 |
call active_read_yz_loc( fname, tmpfldyz, iobcs, |
120 |
heimbach |
1.2 |
& .false., .false., 0, mythid, dummy) |
121 |
|
|
c |
122 |
|
|
do bj = jtlo,jthi |
123 |
|
|
do bi = itlo,ithi |
124 |
|
|
do k = 1,nr |
125 |
|
|
do j = jmin,jmax |
126 |
|
|
grdchk_maskyz(j,k,bi,bj,iobcs) = |
127 |
|
|
& tmpfldyz(j,k,bi,bj) |
128 |
|
|
enddo |
129 |
|
|
enddo |
130 |
|
|
enddo |
131 |
|
|
enddo |
132 |
|
|
c |
133 |
|
|
enddo |
134 |
|
|
#endif |
135 |
|
|
|
136 |
heimbach |
1.3 |
else if ( grdchkvarindex .EQ. 14 ) then |
137 |
heimbach |
1.2 |
#ifdef ALLOW_OBCSE_CONTROL |
138 |
|
|
write(fname(1:80),'(80a)') ' ' |
139 |
|
|
write(fname(1:80),'(a)') 'maskobcse' |
140 |
|
|
c |
141 |
|
|
do iobcs = 1,nobcs |
142 |
heimbach |
1.3 |
call active_read_yz_loc( fname, tmpfldyz, iobcs, |
143 |
heimbach |
1.2 |
& .false., .false., 0, mythid, dummy) |
144 |
|
|
c |
145 |
|
|
do bj = jtlo,jthi |
146 |
|
|
do bi = itlo,ithi |
147 |
|
|
do k = 1,nr |
148 |
|
|
do j = jmin,jmax |
149 |
|
|
grdchk_maskyz(j,k,bi,bj,iobcs) = |
150 |
|
|
& tmpfldyz(j,k,bi,bj) |
151 |
|
|
enddo |
152 |
|
|
enddo |
153 |
|
|
enddo |
154 |
|
|
enddo |
155 |
|
|
c |
156 |
|
|
enddo |
157 |
|
|
#endif |
158 |
heimbach |
1.3 |
endif |
159 |
heimbach |
1.2 |
|
160 |
|
|
_END_MASTER( mythid ) |
161 |
|
|
|
162 |
|
|
_BARRIER |
163 |
|
|
|
164 |
heimbach |
1.4 |
#endif /* ALLOW_GRDCHK */ |
165 |
heimbach |
1.2 |
|
166 |
|
|
end |
167 |
|
|
|