1 |
|
2 |
#include "CTRL_CPPOPTIONS.h" |
3 |
|
4 |
|
5 |
subroutine ctrl_mask_set_xz( |
6 |
& jp1, OB_J, nwetobcs, ymaskobcs, mythid ) |
7 |
|
8 |
c ================================================================== |
9 |
c SUBROUTINE ctrl_mask_set_xz |
10 |
c ================================================================== |
11 |
c |
12 |
c o count sliced (xz) wet points and set xz 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 jp1 |
35 |
integer OB_J (1-olx:snx+olx,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 maskxz (1-olx:snx+olx,nr,nsx,nsy,nobcs) |
60 |
_RL gg (1-olx:snx+olx,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 |
do iobcs = 1,nobcs |
85 |
do bj = jtlo,jthi |
86 |
do bi = itlo,ithi |
87 |
do k = 1,nr |
88 |
do i = 1-olx,snx+olx |
89 |
maskxz(i,k,bi,bj,iobcs) = 0. _d 0 |
90 |
enddo |
91 |
enddo |
92 |
enddo |
93 |
enddo |
94 |
enddo |
95 |
|
96 |
do iobcs = 1,nobcs |
97 |
do bj = jtlo,jthi |
98 |
do bi = itlo,ithi |
99 |
do k = 1,nr |
100 |
do i = imin,imax |
101 |
j = OB_J(I,bi,bj) |
102 |
if ( j .NE. 0 ) then |
103 |
c-- South mask for T, S, V |
104 |
if (iobcs.eq.1 .or. iobcs .eq.2 .or. iobcs.eq.3) then |
105 |
if (maskS(i,j+jp1,k,bi,bj) .ne. 0.) then |
106 |
nwetobcs(bi,bj,k,iobcs) =nwetobcs(bi,bj,k,iobcs)+1 |
107 |
maskxz(i,k,bi,bj,iobcs) = 1 |
108 |
endif |
109 |
endif |
110 |
c-- West mask for U |
111 |
if (iobcs .eq. 4) then |
112 |
if (maskW(i,j,k,bi,bj) .eq. 1.) then |
113 |
nwetobcs(bi,bj,k,iobcs) =nwetobcs(bi,bj,k,iobcs)+1 |
114 |
maskxz(i,k,bi,bj,iobcs) = 1 |
115 |
endif |
116 |
endif |
117 |
endif |
118 |
enddo |
119 |
enddo |
120 |
enddo |
121 |
enddo |
122 |
enddo |
123 |
|
124 |
il=ilnblnk( ymaskobcs ) |
125 |
write(fname(1:80),'(80a)') ' ' |
126 |
write(fname(1:80),'(a)') ymaskobcs |
127 |
|
128 |
do iobcs = 1,nobcs |
129 |
do bj = jtlo,jthi |
130 |
do bi = itlo,ithi |
131 |
do k = 1,nr |
132 |
do i = imin,imax |
133 |
gg(i,k,bi,bj) = maskxz(i,k,bi,bj,iobcs) |
134 |
enddo |
135 |
enddo |
136 |
enddo |
137 |
enddo |
138 |
call active_write_xz_loc( fname, gg, iobcs, 0, mythid, dummy ) |
139 |
|
140 |
enddo |
141 |
|
142 |
_END_MASTER( mythid ) |
143 |
|
144 |
return |
145 |
end |
146 |
|
147 |
|
148 |
|
149 |
|