1 |
heimbach |
1.2 |
|
2 |
|
|
#include "CTRL_CPPOPTIONS.h" |
3 |
|
|
|
4 |
|
|
|
5 |
|
|
subroutine ctrl_mask_set_yz( |
6 |
|
|
& ip1, OB_I, nwetobcs, ymaskobcs, mythid ) |
7 |
|
|
|
8 |
|
|
c ================================================================== |
9 |
|
|
c SUBROUTINE ctrl_mask_set_yz |
10 |
|
|
c ================================================================== |
11 |
|
|
c |
12 |
|
|
c o count sliced (yz) wet points and set yz masks |
13 |
|
|
c |
14 |
|
|
c heimbach@mit.edu, 30-Aug-2001 |
15 |
|
|
c gebbie@mit.edu, corrected array bounds |
16 |
|
|
c |
17 |
|
|
c ================================================================== |
18 |
|
|
|
19 |
|
|
implicit none |
20 |
|
|
|
21 |
|
|
c == global variables == |
22 |
|
|
|
23 |
|
|
#include "EEPARAMS.h" |
24 |
|
|
#include "SIZE.h" |
25 |
|
|
#include "PARAMS.h" |
26 |
|
|
#include "GRID.h" |
27 |
|
|
#include "ctrl.h" |
28 |
|
|
#ifdef ALLOW_OBCS_CONTROL |
29 |
|
|
# include "OBCS.h" |
30 |
|
|
#endif |
31 |
|
|
|
32 |
|
|
c == routine arguments == |
33 |
|
|
|
34 |
|
|
integer ip1 |
35 |
|
|
integer OB_I (1-oly:sny+oly,nsx,nsy) |
36 |
|
|
integer nwetobcs (nsx,nsy,nr,nobcs) |
37 |
|
|
character*(80) ymaskobcs |
38 |
|
|
integer mythid |
39 |
|
|
|
40 |
|
|
c == local variables == |
41 |
|
|
|
42 |
|
|
integer bi,bj |
43 |
|
|
integer i,j,k |
44 |
|
|
integer itlo,ithi |
45 |
|
|
integer jtlo,jthi |
46 |
|
|
integer jmin,jmax |
47 |
|
|
integer imin,imax |
48 |
|
|
integer ntmp |
49 |
|
|
integer ivarindex |
50 |
|
|
|
51 |
|
|
integer iobcs |
52 |
|
|
integer il |
53 |
|
|
integer errio |
54 |
|
|
integer startrec |
55 |
|
|
integer endrec |
56 |
|
|
integer difftime(4) |
57 |
|
|
_RL diffsecs |
58 |
|
|
_RL dummy |
59 |
|
|
_RL maskyz (1-oly:sny+oly,nr,nsx,nsy,nobcs) |
60 |
|
|
_RL gg (1-oly:sny+oly,nr,nsx,nsy) |
61 |
|
|
|
62 |
|
|
character*( 80) fname |
63 |
|
|
|
64 |
|
|
c == external == |
65 |
|
|
|
66 |
|
|
integer ilnblnk |
67 |
|
|
external ilnblnk |
68 |
|
|
|
69 |
|
|
c == end of interface == |
70 |
|
|
|
71 |
|
|
jtlo = mybylo(mythid) |
72 |
|
|
jthi = mybyhi(mythid) |
73 |
|
|
itlo = mybxlo(mythid) |
74 |
|
|
ithi = mybxhi(mythid) |
75 |
|
|
jmin = 1 |
76 |
|
|
jmax = sny |
77 |
|
|
imin = 1 |
78 |
|
|
imax = snx |
79 |
|
|
|
80 |
|
|
_BEGIN_MASTER( myThid ) |
81 |
|
|
|
82 |
|
|
c-- Count wet points at Northern boundary. |
83 |
|
|
c-- mask conventions are adopted from obcs_apply_ts, obcs_apply_uv |
84 |
|
|
|
85 |
heimbach |
1.3 |
do iobcs = 1,nobcs |
86 |
|
|
do bj = jtlo,jthi |
87 |
|
|
do bi = itlo,ithi |
88 |
|
|
do k = 1,nr |
89 |
|
|
do j = 1-oly,sny+oly |
90 |
heimbach |
1.2 |
maskyz(j,k,bi,bj,iobcs) = 0. _d 0 |
91 |
|
|
enddo |
92 |
|
|
enddo |
93 |
|
|
enddo |
94 |
|
|
enddo |
95 |
|
|
enddo |
96 |
|
|
|
97 |
heimbach |
1.3 |
do iobcs = 1,nobcs |
98 |
|
|
do bj = jtlo,jthi |
99 |
|
|
do bi = itlo,ithi |
100 |
|
|
do k = 1,nr |
101 |
|
|
do j = jmin,jmax |
102 |
|
|
i = OB_I(J,bi,bj) |
103 |
heimbach |
1.2 |
if ( i .NE. 0 ) then |
104 |
heimbach |
1.3 |
c-- West mask for T, S, U on East/West boundaries. |
105 |
|
|
if(iobcs .eq.1 .or. iobcs .eq.2 .or. iobcs .eq.3) then |
106 |
|
|
if (maskW(i+ip1,j,k,bi,bj) .ne. 0.) then |
107 |
|
|
nwetobcs(bi,bj,k,iobcs) =nwetobcs(bi,bj,k,iobcs)+1 |
108 |
|
|
maskyz(j,k,bi,bj,iobcs) = 1 |
109 |
|
|
endif |
110 |
heimbach |
1.2 |
endif |
111 |
|
|
c-- South mask for V |
112 |
heimbach |
1.3 |
if (iobcs .eq. 4) then |
113 |
|
|
if (maskS(i,j,k,bi,bj) .eq. 1.) then |
114 |
|
|
nwetobcs(bi,bj,k,iobcs) =nwetobcs(bi,bj,k,iobcs)+1 |
115 |
|
|
maskyz(j,k,bi,bj,iobcs) = 1 |
116 |
|
|
endif |
117 |
heimbach |
1.2 |
endif |
118 |
|
|
endif |
119 |
heimbach |
1.3 |
enddo |
120 |
heimbach |
1.2 |
enddo |
121 |
|
|
enddo |
122 |
|
|
enddo |
123 |
|
|
enddo |
124 |
|
|
|
125 |
|
|
il=ilnblnk( ymaskobcs ) |
126 |
|
|
write(fname(1:80),'(80a)') ' ' |
127 |
|
|
write(fname(1:80),'(a)') ymaskobcs |
128 |
|
|
|
129 |
|
|
do iobcs = 1,nobcs |
130 |
|
|
do bj = jtlo,jthi |
131 |
|
|
do bi = itlo,ithi |
132 |
|
|
do k = 1,nr |
133 |
|
|
do j = jmin,jmax |
134 |
|
|
gg(j,k,bi,bj) = maskyz(j,k,bi,bj,iobcs) |
135 |
|
|
enddo |
136 |
|
|
enddo |
137 |
|
|
enddo |
138 |
|
|
enddo |
139 |
heimbach |
1.4 |
call active_write_yz_loc( fname, gg, iobcs, 0, mythid, dummy) |
140 |
heimbach |
1.2 |
enddo |
141 |
|
|
|
142 |
|
|
_END_MASTER( mythid ) |
143 |
|
|
|
144 |
|
|
return |
145 |
|
|
end |
146 |
|
|
|