22 |
#include "PARAMS.h" |
#include "PARAMS.h" |
23 |
#include "GRID.h" |
#include "GRID.h" |
24 |
#include "SEAICE_PARAMS.h" |
#include "SEAICE_PARAMS.h" |
25 |
|
#include "SEAICE.h" |
26 |
|
|
27 |
#ifdef ALLOW_AUTODIFF_TAMC |
#ifdef ALLOW_AUTODIFF_TAMC |
28 |
# include "tamc.h" |
# include "tamc.h" |
55 |
INTEGER i, j, bi, bj |
INTEGER i, j, bi, bj |
56 |
C hFacU, hFacV - determine the no-slip boundary condition |
C hFacU, hFacV - determine the no-slip boundary condition |
57 |
INTEGER k |
INTEGER k |
58 |
_RS hFacU, hFacV |
_RS hFacU, hFacV, noSlipFac |
59 |
|
|
60 |
k = 1 |
k = 1 |
61 |
|
noSlipFac = 0. _d 0 |
62 |
|
IF ( SEAICE_no_slip ) noSlipFac = 1. _d 0 |
63 |
C |
C |
64 |
|
#ifndef SEAICE_OLD_AND_BAD_DISCRETIZATION |
65 |
|
DO bj=myByLo(myThid),myByHi(myThid) |
66 |
|
DO bi=myBxLo(myThid),myBxHi(myThid) |
67 |
|
DO j=1-Oly,sNy+Oly-1 |
68 |
|
DO i=1-Olx,sNx+Olx-1 |
69 |
|
C evaluate strain rates |
70 |
|
e11(I,J,bi,bj) = _recip_dxF(I,J,bi,bj) * |
71 |
|
& (uFld(I+1,J,1,bi,bj)-uFld(I,J,1,bi,bj)) |
72 |
|
& +HALF* |
73 |
|
& (vFld(I,J,1,bi,bj)+vFld(I,J+1,1,bi,bj)) |
74 |
|
& * k2AtC(I,J,bi,bj) |
75 |
|
e22(I,J,bi,bj) = _recip_dyF(I,J,bi,bj) * |
76 |
|
& (vFld(I,J+1,1,bi,bj)-vFld(I,J,1,bi,bj)) |
77 |
|
& +HALF* |
78 |
|
& (uFld(I,J,1,bi,bj)+uFld(I+1,J,1,bi,bj)) |
79 |
|
& * k1AtC(I,J,bi,bj) |
80 |
|
C one metric term is missing |
81 |
|
ENDDO |
82 |
|
ENDDO |
83 |
|
DO j=1-Oly+1,sNy+Oly |
84 |
|
DO i=1-Olx+1,sNx+Olx |
85 |
|
hFacU = _maskW(i,j,k,bi,bj) - _maskW(i,j-1,k,bi,bj) |
86 |
|
hFacV = _maskS(i,j,k,bi,bj) - _maskS(i-1,j,k,bi,bj) |
87 |
|
e12(I,J,bi,bj) = HALF*( |
88 |
|
& ( uFld(I,J,1,bi,bj) - uFld(I ,J-1,1,bi,bj) ) |
89 |
|
& * _recip_dyU(I,J,bi,bj) |
90 |
|
& + ( vFld(I,J,1,bi,bj) - vFld(I-1,J ,1,bi,bj) ) |
91 |
|
& * _recip_dxV(I,J,bi,bj) |
92 |
|
& - k1AtZ(I,J,bi,bj) |
93 |
|
& * 0.5 _d 0 * (vFld(I,J,1,bi,bj)+vFld(I-1,J ,1,bi,bj)) |
94 |
|
& - k2AtZ(I,J,bi,bj) |
95 |
|
& * 0.5 _d 0 * (uFld(I,J,1,bi,bj)+uFld(I ,J-1,1,bi,bj)) |
96 |
|
& ) |
97 |
|
& *maskC(I ,J ,k,bi,bj)*maskC(I-1,J ,k,bi,bj) |
98 |
|
& *maskC(I ,J-1,k,bi,bj)*maskC(I-1,J-1,k,bi,bj) |
99 |
|
& + 2.0 _d 0 * noSlipFac * ( |
100 |
|
& ( uFld(I,J,1,bi,bj) + uFld(I ,J-1,1,bi,bj) ) |
101 |
|
& * _recip_dyU(I,J,bi,bj) * hFacU |
102 |
|
& + ( vFld(I,J,1,bi,bj) + vFld(I-1,J ,1,bi,bj) ) |
103 |
|
& * _recip_dxV(I,J,bi,bj) * hFacV |
104 |
|
& ) |
105 |
|
C no slip at the boundary implies u(j)+u(j-1)=0 and v(i)+v(i-1)=0 |
106 |
|
C accross the boundary; this is already accomplished by masking so |
107 |
|
C that the following lines are not necessary |
108 |
|
c$$$ & - hFacV * k1AtZ(I,J,bi,bj) |
109 |
|
c$$$ & * 0.5 _d 0 * (vFld(I,J,1,bi,bj)+vFld(I-1,J ,1,bi,bj)) |
110 |
|
c$$$ & - hFacU * k2AtZ(I,J,bi,bj) |
111 |
|
c$$$ & * 0.5 _d 0 * (uFld(I,J,1,bi,bj)+uFld(I ,J-1,1,bi,bj)) |
112 |
|
ENDDO |
113 |
|
ENDDO |
114 |
|
|
115 |
|
c$$$ ENDIF |
116 |
|
ENDDO |
117 |
|
ENDDO |
118 |
|
#else |
119 |
|
C this the old and incomplete discretization, here I also erroneously |
120 |
|
C used finite-volumes to discretize the strain rates |
121 |
DO bj=myByLo(myThid),myByHi(myThid) |
DO bj=myByLo(myThid),myByHi(myThid) |
122 |
DO bi=myBxLo(myThid),myBxHi(myThid) |
DO bi=myBxLo(myThid),myBxHi(myThid) |
123 |
DO j=1-Oly,sNy+Oly-1 |
DO j=1-Oly,sNy+Oly-1 |
175 |
ENDIF |
ENDIF |
176 |
ENDDO |
ENDDO |
177 |
ENDDO |
ENDDO |
178 |
|
#endif /* SEAICE_OLD_AND_BAD_DISCRETIZATION */ |
179 |
#endif /* SEAICE_ALLOW_DYNAMICS */ |
#endif /* SEAICE_ALLOW_DYNAMICS */ |
180 |
#endif /* SEAICE_CGRID */ |
#endif /* SEAICE_CGRID */ |
181 |
RETURN |
RETURN |