89 |
seaiceMassC(i,j,bi,bj)=0. _d 0 |
seaiceMassC(i,j,bi,bj)=0. _d 0 |
90 |
seaiceMassU(i,j,bi,bj)=0. _d 0 |
seaiceMassU(i,j,bi,bj)=0. _d 0 |
91 |
seaiceMassV(i,j,bi,bj)=0. _d 0 |
seaiceMassV(i,j,bi,bj)=0. _d 0 |
92 |
|
#ifdef ALLOW_AUTODIFF_TAMC |
93 |
seaiceMaskU(i,j,bi,bj)=0. _d 0 |
seaiceMaskU(i,j,bi,bj)=0. _d 0 |
94 |
seaiceMaskV(i,j,bi,bj)=0. _d 0 |
seaiceMaskV(i,j,bi,bj)=0. _d 0 |
95 |
|
#endif /* ALLOW_AUTODIFF_TAMC */ |
96 |
stressDivergenceX(i,j,bi,bj) = 0. _d 0 |
stressDivergenceX(i,j,bi,bj) = 0. _d 0 |
97 |
stressDivergenceY(i,j,bi,bj) = 0. _d 0 |
stressDivergenceY(i,j,bi,bj) = 0. _d 0 |
98 |
# ifdef SEAICE_ALLOW_EVP |
# ifdef SEAICE_ALLOW_EVP |
103 |
#else /* SEAICE_CGRID */ |
#else /* SEAICE_CGRID */ |
104 |
AMASS(i,j,bi,bj) = 0. _d 0 |
AMASS(i,j,bi,bj) = 0. _d 0 |
105 |
DAIRN(i,j,bi,bj) = 0. _d 0 |
DAIRN(i,j,bi,bj) = 0. _d 0 |
|
UVM(i,j,bi,bj) = 0. _d 0 |
|
106 |
WINDX(i,j,bi,bj) = 0. _d 0 |
WINDX(i,j,bi,bj) = 0. _d 0 |
107 |
WINDY(i,j,bi,bj) = 0. _d 0 |
WINDY(i,j,bi,bj) = 0. _d 0 |
108 |
GWATX(i,j,bi,bj) = 0. _d 0 |
GWATX(i,j,bi,bj) = 0. _d 0 |
109 |
GWATY(i,j,bi,bj) = 0. _d 0 |
GWATY(i,j,bi,bj) = 0. _d 0 |
|
KGEO(i,j,bi,bj) = 0 |
|
110 |
#endif /* SEAICE_CGRID */ |
#endif /* SEAICE_CGRID */ |
111 |
DWATN(i,j,bi,bj) = 0. _d 0 |
DWATN(i,j,bi,bj) = 0. _d 0 |
112 |
PRESS0(i,j,bi,bj) = 0. _d 0 |
PRESS0(i,j,bi,bj) = 0. _d 0 |
121 |
#ifdef SEAICE_AGE |
#ifdef SEAICE_AGE |
122 |
ICEAGE(i,j,bi,bj) = 0. _d 0 |
ICEAGE(i,j,bi,bj) = 0. _d 0 |
123 |
#endif |
#endif |
|
HEFFM(i,j,bi,bj) = 0. _d 0 |
|
124 |
YNEG (i,j,bi,bj) = 0. _d 0 |
YNEG (i,j,bi,bj) = 0. _d 0 |
125 |
RIVER(i,j,bi,bj) = 0. _d 0 |
RIVER(i,j,bi,bj) = 0. _d 0 |
126 |
TMIX(i,j,bi,bj) = 0. _d 0 |
TMIX(i,j,bi,bj) = 0. _d 0 |
139 |
ENDDO |
ENDDO |
140 |
ENDDO |
ENDDO |
141 |
|
|
142 |
C-- Initialize grid info |
C-- Initialize (variable) grid info. As long as we allow masking of |
143 |
|
C-- velocities outside of ice covered areas (in seaice_dynsolver) |
144 |
|
C-- we need to re-initialize seaiceMaskU/V here for TAF/TAMC |
145 |
|
#ifdef ALLOW_AUTODIFF_TAMC |
146 |
|
#ifdef SEAICE_CGRID |
147 |
DO bj=myByLo(myThid),myByHi(myThid) |
DO bj=myByLo(myThid),myByHi(myThid) |
148 |
DO bi=myBxLo(myThid),myBxHi(myThid) |
DO bi=myBxLo(myThid),myBxHi(myThid) |
|
DO j=1-OLy,sNy+OLy |
|
|
DO i=1-OLx,sNx+OLx |
|
|
HEFFM(i,j,bi,bj)=ONE |
|
|
IF (_hFacC(i,j,1,bi,bj).eq.0.) HEFFM(i,j,bi,bj)=0. _d 0 |
|
|
ENDDO |
|
|
ENDDO |
|
149 |
DO j=1-OLy+1,sNy+OLy |
DO j=1-OLy+1,sNy+OLy |
150 |
DO i=1-OLx+1,sNx+OLx |
DO i=1-OLx+1,sNx+OLx |
|
#ifdef SEAICE_CGRID |
|
151 |
seaiceMaskU(i,j,bi,bj)= 0.0 _d 0 |
seaiceMaskU(i,j,bi,bj)= 0.0 _d 0 |
152 |
seaiceMaskV(i,j,bi,bj)= 0.0 _d 0 |
seaiceMaskV(i,j,bi,bj)= 0.0 _d 0 |
153 |
mask_uice=HEFFM(i,j,bi,bj)+HEFFM(i-1,j ,bi,bj) |
mask_uice=HEFFM(i,j,bi,bj)+HEFFM(i-1,j ,bi,bj) |
154 |
IF(mask_uice.GT.1.5) seaiceMaskU(i,j,bi,bj)=ONE |
IF(mask_uice.GT.1.5) seaiceMaskU(i,j,bi,bj)=ONE |
155 |
mask_uice=HEFFM(i,j,bi,bj)+HEFFM(i ,j-1,bi,bj) |
mask_uice=HEFFM(i,j,bi,bj)+HEFFM(i ,j-1,bi,bj) |
156 |
IF(mask_uice.GT.1.5) seaiceMaskV(i,j,bi,bj)=ONE |
IF(mask_uice.GT.1.5) seaiceMaskV(i,j,bi,bj)=ONE |
|
#else |
|
|
UVM(i,j,bi,bj)=0. _d 0 |
|
|
mask_uice=HEFFM(i,j, bi,bj)+HEFFM(i-1,j-1,bi,bj) |
|
|
& +HEFFM(i,j-1,bi,bj)+HEFFM(i-1,j, bi,bj) |
|
|
IF(mask_uice.GT.3.5) UVM(i,j,bi,bj)=ONE |
|
|
#endif /* SEAICE_CGRID */ |
|
|
ENDDO |
|
|
ENDDO |
|
|
#ifdef SEAICE_CGRID |
|
|
C coefficients for metric terms |
|
|
DO j=1-OLy,sNy+OLy |
|
|
DO i=1-OLx,sNx+OLx |
|
|
k1AtC(I,J,bi,bj) = 0.0 _d 0 |
|
|
k1AtZ(I,J,bi,bj) = 0.0 _d 0 |
|
|
k2AtC(I,J,bi,bj) = 0.0 _d 0 |
|
|
k2AtZ(I,J,bi,bj) = 0.0 _d 0 |
|
157 |
ENDDO |
ENDDO |
158 |
ENDDO |
ENDDO |
159 |
IF ( usingSphericalPolarGrid .AND. SEAICEuseMetricTerms ) THEN |
ENDDO |
160 |
C This is the only case where tan(phi) is not zero. In this case |
ENDDO |
|
C C and U points, and Z and V points have the same phi, so that we |
|
|
C only need a copy here. Do not use tan(YC) and tan(YG), because these |
|
|
C can be the geographical coordinates and not the correct grid |
|
|
C coordinates when the grid is rotated (phi/theta/psiEuler .NE. 0) |
|
|
DO j=1-OLy,sNy+OLy |
|
|
DO i=1-OLx,sNx+OLx |
|
|
k2AtC(I,J,bi,bj) = - _tanPhiAtU(I,J,bi,bj)*recip_rSphere |
|
|
k2AtZ(I,J,bi,bj) = - _tanPhiAtV(I,J,bi,bj)*recip_rSphere |
|
|
ENDDO |
|
|
ENDDO |
|
|
ELSEIF ( usingCurvilinearGrid .AND. SEAICEuseMetricTerms ) THEN |
|
|
C compute metric term coefficients from finite difference approximation |
|
|
DO j=1-OLy,sNy+OLy |
|
|
DO i=1-OLx,sNx+OLx-1 |
|
|
k1AtC(I,J,bi,bj) = _recip_dyF(I,J,bi,bj) |
|
|
& * ( _dyG(I+1,J,bi,bj) - _dyG(I,J,bi,bj) ) |
|
|
& * _recip_dxF(I,J,bi,bj) |
|
|
ENDDO |
|
|
ENDDO |
|
|
DO j=1-OLy,sNy+OLy |
|
|
DO i=1-OLx+1,sNx+OLx |
|
|
k1AtZ(I,J,bi,bj) = _recip_dyU(I,J,bi,bj) |
|
|
& * ( _dyC(I,J,bi,bj) - _dyC(I-1,J,bi,bj) ) |
|
|
& * _recip_dxV(I,J,bi,bj) |
|
|
ENDDO |
|
|
ENDDO |
|
|
DO j=1-OLy,sNy+OLy-1 |
|
|
DO i=1-OLx,sNx+OLx |
|
|
k2AtC(I,J,bi,bj) = _recip_dxF(I,J,bi,bj) |
|
|
& * ( _dxG(I,J+1,bi,bj) - _dxG(I,J,bi,bj) ) |
|
|
& * _recip_dyF(I,J,bi,bj) |
|
|
ENDDO |
|
|
ENDDO |
|
|
DO j=1-OLy+1,sNy+OLy |
|
|
DO i=1-OLx,sNx+OLx |
|
|
k2AtC(I,J,bi,bj) = _recip_dxV(I,J,bi,bj) |
|
|
& * ( _dxC(I,J,bi,bj) - _dxC(I,J-1,bi,bj) ) |
|
|
& * _recip_dyU(I,J,bi,bj) |
|
|
ENDDO |
|
|
ENDDO |
|
|
ENDIF |
|
161 |
#endif /* SEAICE_CGRID */ |
#endif /* SEAICE_CGRID */ |
162 |
|
#endif /* ALLOW_AUTODIFF_TAMC */ |
163 |
|
|
164 |
|
DO bj=myByLo(myThid),myByHi(myThid) |
165 |
|
DO bi=myBxLo(myThid),myBxHi(myThid) |
166 |
#ifdef ALLOW_OBCS |
#ifdef ALLOW_OBCS |
167 |
IF (useOBCS) THEN |
IF (useOBCS) THEN |
168 |
C-- If OBCS is turned on, close southern and western boundaries |
C-- If OBCS is turned on, close southern and western boundaries |
245 |
ENDDO |
ENDDO |
246 |
ENDDO |
ENDDO |
247 |
|
|
|
#ifndef SEAICE_CGRID |
|
|
C-- Choose a proxy level for geostrophic velocity, |
|
|
DO j=1-OLy,sNy+OLy |
|
|
DO i=1-OLx,sNx+OLx |
|
|
#ifdef SEAICE_BICE_STRESS |
|
|
KGEO(i,j,bi,bj) = 1 |
|
|
#else /* SEAICE_BICE_STRESS */ |
|
|
IF (klowc(i,j,bi,bj) .LT. 2) THEN |
|
|
KGEO(i,j,bi,bj) = 1 |
|
|
ELSE |
|
|
KGEO(i,j,bi,bj) = 2 |
|
|
DO WHILE ( abs(rC(KGEO(i,j,bi,bj))) .LT. 50.0 .AND. |
|
|
& KGEO(i,j,bi,bj) .LT. (klowc(i,j,bi,bj)-1) ) |
|
|
KGEO(i,j,bi,bj) = KGEO(i,j,bi,bj) + 1 |
|
|
ENDDO |
|
|
ENDIF |
|
|
#endif /* SEAICE_BICE_STRESS */ |
|
|
ENDDO |
|
|
ENDDO |
|
|
#endif /* SEAICE_CGRID */ |
|
|
|
|
248 |
ENDDO |
ENDDO |
249 |
ENDDO |
ENDDO |
250 |
|
|