/[MITgcm]/MITgcm/pkg/ctrl/ctrl_mask_set_yz.F
ViewVC logotype

Contents of /MITgcm/pkg/ctrl/ctrl_mask_set_yz.F

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


Revision 1.11 - (show annotations) (download)
Mon Mar 23 21:07:37 2015 UTC (9 years, 1 month ago) by gforget
Branch: MAIN
CVS Tags: checkpoint65z, checkpoint65x, checkpoint65y, checkpoint65r, checkpoint65s, checkpoint65p, checkpoint65q, checkpoint65v, checkpoint65w, checkpoint65t, checkpoint65u, checkpoint65k, checkpoint65n, checkpoint65l, checkpoint65m, checkpoint66g, checkpoint66f, checkpoint66e, checkpoint66d, checkpoint66c, checkpoint66b, checkpoint66a, checkpoint66o, checkpoint66n, checkpoint66m, checkpoint66l, checkpoint66k, checkpoint66j, checkpoint66i, checkpoint66h, checkpoint65o, HEAD
Changes since 1.10: +3 -1 lines
- if autodiff is not compiled then use
  READ_REC_XY_RL/READ_REC_XYZ_RL instead
  of active read/write

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

  ViewVC Help
Powered by ViewVC 1.1.22