27 |
#endif /* ALLOW_EXCH2 */ |
#endif /* ALLOW_EXCH2 */ |
28 |
|
|
29 |
#ifdef ALLOW_AUTODIFF_TAMC |
#ifdef ALLOW_AUTODIFF_TAMC |
|
c # include "EEPARAMS.h" |
|
30 |
# include "tamc.h" |
# include "tamc.h" |
31 |
# include "tamc_keys.h" |
# include "tamc_keys.h" |
32 |
#endif |
#endif |
59 |
_RL hFacZOpenI(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
_RL hFacZOpenI(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
60 |
_RL hFacZOpenJ(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
_RL hFacZOpenJ(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
61 |
# ifdef USE_SMOOTH_MIN |
# ifdef USE_SMOOTH_MIN |
62 |
_RS smoothMin_R4 |
_RS SMOOTHMIN_RS |
63 |
EXTERNAL smoothMin_R4 |
EXTERNAL SMOOTHMIN_RS |
64 |
# endif /* USE_SMOOTH_MIN */ |
# endif /* USE_SMOOTH_MIN */ |
65 |
#else |
#else |
66 |
_RS hFacZOpen |
_RS hFacZOpen |
94 |
C-- Calculate open water fraction at vorticity points |
C-- Calculate open water fraction at vorticity points |
95 |
|
|
96 |
#ifdef ALLOW_DEPTH_CONTROL |
#ifdef ALLOW_DEPTH_CONTROL |
97 |
DO j=1-Oly,sNy+Oly |
DO j=1-OLy,sNy+OLy |
98 |
DO i=1-Olx,sNx+Olx |
DO i=1-OLx,sNx+OLx |
99 |
hFacZ(i,j) =0. |
hFacZ(i,j) =0. |
100 |
r_hFacZ(i,j) =0. |
r_hFacZ(i,j) =0. |
101 |
hFacZOpen(i,j) =0. |
hFacZOpen(i,j) =0. |
108 |
CADJ STORE hFacZ(:,:) = comlev1_bibj_k , key=kkey, byte=isbyte |
CADJ STORE hFacZ(:,:) = comlev1_bibj_k , key=kkey, byte=isbyte |
109 |
CADJ STORE r_hFacZ(:,:) = comlev1_bibj_k , key=kkey, byte=isbyte |
CADJ STORE r_hFacZ(:,:) = comlev1_bibj_k , key=kkey, byte=isbyte |
110 |
#endif /* ALLOW_AUTODIFF_TAMC */ |
#endif /* ALLOW_AUTODIFF_TAMC */ |
111 |
DO j=2-Oly,sNy+Oly |
DO j=2-OLy,sNy+OLy |
112 |
DO i=2-Olx,sNx+Olx |
DO i=2-OLx,sNx+OLx |
113 |
hFacZOpenJ(i,j)= |
hFacZOpenJ(i,j)= |
114 |
#ifdef USE_SMOOTH_MIN |
#ifdef USE_SMOOTH_MIN |
115 |
& smoothMin_R4(_hFacW(i ,j ,k,bi,bj), |
& SMOOTHMIN_RS(_hFacW(i ,j ,k,bi,bj), |
116 |
#else |
#else |
117 |
& MIN(_hFacW(i ,j ,k,bi,bj), |
& MIN(_hFacW(i ,j ,k,bi,bj), |
118 |
#endif /* USE_SMOOTH_MIN */ |
#endif /* USE_SMOOTH_MIN */ |
120 |
& *maskW(i,j,k,bi,bj)*maskW(i,j-1,k,bi,bj) |
& *maskW(i,j,k,bi,bj)*maskW(i,j-1,k,bi,bj) |
121 |
hFacZOpenI(i,j)= |
hFacZOpenI(i,j)= |
122 |
#ifdef USE_SMOOTH_MIN |
#ifdef USE_SMOOTH_MIN |
123 |
& smoothMin_R4(_hFacS(i ,j ,k,bi,bj), |
& SMOOTHMIN_RS(_hFacS(i ,j ,k,bi,bj), |
124 |
#else |
#else |
125 |
& MIN(_hFacS(i ,j ,k,bi,bj), |
& MIN(_hFacS(i ,j ,k,bi,bj), |
126 |
#endif /* USE_SMOOTH_MIN */ |
#endif /* USE_SMOOTH_MIN */ |
134 |
CADJ STORE hFacZOpenJ(:,:) = comlev1_bibj_k , key=kkey, byte=isbyte |
CADJ STORE hFacZOpenJ(:,:) = comlev1_bibj_k , key=kkey, byte=isbyte |
135 |
#endif /* ALLOW_DEPTH_CONTROL */ |
#endif /* ALLOW_DEPTH_CONTROL */ |
136 |
#endif /* ALLOW_AUTODIFF_TAMC */ |
#endif /* ALLOW_AUTODIFF_TAMC */ |
137 |
DO j=2-Oly,sNy+Oly |
DO j=2-OLy,sNy+OLy |
138 |
DO i=2-Olx,sNx+Olx |
DO i=2-OLx,sNx+OLx |
139 |
hFacZ(i,j) = |
hFacZ(i,j) = |
140 |
#ifdef USE_SMOOTH_MIN |
#ifdef USE_SMOOTH_MIN |
141 |
& smoothMin_R4(hFacZOpenI(i,j),hFacZOpenJ(i,j)) |
& SMOOTHMIN_RS(hFacZOpenI(i,j),hFacZOpenJ(i,j)) |
142 |
#else |
#else |
143 |
& MIN(hFacZOpenI(i,j),hFacZOpenJ(i,j)) |
& MIN(hFacZOpenI(i,j),hFacZOpenJ(i,j)) |
144 |
#endif /* USE_SMOOTH_MIN */ |
#endif /* USE_SMOOTH_MIN */ |
151 |
CADJ STORE hFacZ(:,:) = comlev1_bibj_k , key=kkey, byte=isbyte |
CADJ STORE hFacZ(:,:) = comlev1_bibj_k , key=kkey, byte=isbyte |
152 |
#endif /* ALLOW_DEPTH_CONTROL */ |
#endif /* ALLOW_DEPTH_CONTROL */ |
153 |
#endif /* ALLOW_AUTODIFF_TAMC */ |
#endif /* ALLOW_AUTODIFF_TAMC */ |
154 |
DO j=2-Oly,sNy+Oly |
DO j=2-OLy,sNy+OLy |
155 |
DO i=2-Olx,sNx+Olx |
DO i=2-OLx,sNx+OLx |
156 |
IF (hFacZ(i,j).EQ.0.) THEN |
IF (hFacZ(i,j).EQ.0.) THEN |
157 |
r_hFacZ(i,j)=0. |
r_hFacZ(i,j)=0. |
158 |
ELSE |
ELSE |
171 |
C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----| |
C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----| |
172 |
|
|
173 |
C- Initialize hFacZ: |
C- Initialize hFacZ: |
174 |
c DO j=1-Oly,sNy+Oly |
c DO j=1-OLy,sNy+OLy |
175 |
c DO i=1-Olx,sNx+Olx |
c DO i=1-OLx,sNx+OLx |
176 |
c hFacZ(i,j)=0. |
c hFacZ(i,j)=0. |
177 |
c ENDDO |
c ENDDO |
178 |
c ENDDO |
c ENDDO |
179 |
|
|
180 |
C-- 1rst row & column are not computed: fill with zero |
C-- 1rst row & column are not computed: fill with zero |
181 |
DO i=1-Olx,sNx+Olx |
DO i=1-OLx,sNx+OLx |
182 |
hFacZ(i,1-Oly)=0. |
hFacZ(i,1-OLy)=0. |
183 |
ENDDO |
ENDDO |
184 |
DO j=2-Oly,sNy+Oly |
DO j=2-OLy,sNy+OLy |
185 |
hFacZ(1-Olx,j)=0. |
hFacZ(1-OLx,j)=0. |
186 |
ENDDO |
ENDDO |
187 |
|
|
188 |
C-- Calculate open water fraction at vorticity points |
C-- Calculate open water fraction at vorticity points |
189 |
|
|
190 |
IF ( hZoption.EQ.2 ) THEN |
IF ( hZoption.EQ.2 ) THEN |
191 |
DO j=2-Oly,sNy+Oly |
DO j=2-OLy,sNy+OLy |
192 |
DO i=2-Olx,sNx+Olx |
DO i=2-OLx,sNx+OLx |
193 |
c hFacZOpen= |
c hFacZOpen= |
194 |
c & ( _hFacW(i, j ,k,bi,bj)*rAw(i, j ,bi,bj) |
c & ( _hFacW(i, j ,k,bi,bj)*rAw(i, j ,bi,bj) |
195 |
c & +_hFacW(i,j-1,k,bi,bj)*rAw(i,j-1,bi,bj) ) |
c & +_hFacW(i,j-1,k,bi,bj)*rAw(i,j-1,bi,bj) ) |
205 |
ENDDO |
ENDDO |
206 |
ENDDO |
ENDDO |
207 |
ELSEIF ( hZoption.EQ.1 ) THEN |
ELSEIF ( hZoption.EQ.1 ) THEN |
208 |
DO j=2-Oly,sNy+Oly |
DO j=2-OLy,sNy+OLy |
209 |
DO i=2-Olx,sNx+Olx |
DO i=2-OLx,sNx+OLx |
210 |
c hFacZOpen=MIN( |
c hFacZOpen=MIN( |
211 |
c & _hFacW(i, j ,k,bi,bj)*rAw(i, j ,bi,bj) |
c & _hFacW(i, j ,k,bi,bj)*rAw(i, j ,bi,bj) |
212 |
c & + _hFacW(i,j-1,k,bi,bj)*rAw(i,j-1,bi,bj) |
c & + _hFacW(i,j-1,k,bi,bj)*rAw(i,j-1,bi,bj) |
224 |
ENDDO |
ENDDO |
225 |
ENDDO |
ENDDO |
226 |
ELSE |
ELSE |
227 |
DO j=2-Oly,sNy+Oly |
DO j=2-OLy,sNy+OLy |
228 |
DO i=2-Olx,sNx+Olx |
DO i=2-OLx,sNx+OLx |
229 |
hFacZOpen=MIN(_hFacW(i,j,k,bi,bj), |
hFacZOpen=MIN(_hFacW(i,j,k,bi,bj), |
230 |
& _hFacW(i,j-1,k,bi,bj)) |
& _hFacW(i,j-1,k,bi,bj)) |
231 |
hFacZOpen=MIN(_hFacS(i,j,k,bi,bj),hFacZOpen) |
hFacZOpen=MIN(_hFacS(i,j,k,bi,bj),hFacZOpen) |
371 |
C---+----1----+----2----+----3----+----4 |
C---+----1----+----2----+----3----+----4 |
372 |
|
|
373 |
C-- Calculate reciprol: |
C-- Calculate reciprol: |
374 |
DO j=1-Oly,sNy+Oly |
DO j=1-OLy,sNy+OLy |
375 |
DO i=1-Olx,sNx+Olx |
DO i=1-OLx,sNx+OLx |
376 |
IF (hFacZ(i,j).EQ.0.) THEN |
IF (hFacZ(i,j).EQ.0.) THEN |
377 |
r_hFacZ(i,j) = 0. |
r_hFacZ(i,j) = 0. |
378 |
ELSE |
ELSE |