File indexing completed on 2023-02-03 06:10:33 UTC
view on githubraw file Latest commit edb66560 on 2023-02-02 23:32:31 UTC
a4eca6e929 Jean*0001 #include "THSICE_OPTIONS.h"
e7f517b398 Jean*0002 #ifdef ALLOW_GENERIC_ADVDIFF
0003 # include "GAD_OPTIONS.h"
0004 #endif
6b47d550f4 Mart*0005 #ifdef ALLOW_AUTODIFF
0006 # include "AUTODIFF_OPTIONS.h"
0007 #endif
a4eca6e929 Jean*0008
0009
0010
0011
0012
0013 SUBROUTINE THSICE_ADVDIFF(
0014 U uIce, vIce,
0015 I bi, bj, myTime, myIter, myThid )
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027 IMPLICIT NONE
0028
0029
0030
ba0b047096 Mart*0031
a4eca6e929 Jean*0032
0033
0034 #include "SIZE.h"
0035 #include "EEPARAMS.h"
0036 #include "PARAMS.h"
0037 #include "GRID.h"
0038 #include "THSICE_SIZE.h"
0039 #include "THSICE_PARAMS.h"
0040 #include "THSICE_VARS.h"
e7f517b398 Jean*0041 #ifdef ALLOW_GENERIC_ADVDIFF
0042 # include "GAD.h"
0043 #endif
d6f06800ae Patr*0044 #ifdef ALLOW_AUTODIFF_TAMC
0045 # include "tamc.h"
0046 #endif
a4eca6e929 Jean*0047
0048
0049
0050
0051
0052
0053
0054
0055 _RL uIce (1-OLx:sNx+OLx,1-OLy:sNy+OLy)
0056 _RL vIce (1-OLx:sNx+OLx,1-OLy:sNy+OLy)
0057 INTEGER bi,bj
0058 _RL myTime
0059 INTEGER myIter
0060 INTEGER myThid
0061
0062
0063 #ifdef ALLOW_THSICE
0064
0065
0066
0067
0068
0069
0070
0071
0072
0073
0074
0075
7c0d02fed1 Jean*0076
a4eca6e929 Jean*0077 INTEGER i, j
0078 LOGICAL thSIce_multiDimAdv
0079 CHARACTER*(MAX_LEN_MBUF) msgBuf
0080
0081 _RL uTrans (1-OLx:sNx+OLx,1-OLy:sNy+OLy)
0082 _RL vTrans (1-OLx:sNx+OLx,1-OLy:sNy+OLy)
0083 _RL uTrIce (1-OLx:sNx+OLx,1-OLy:sNy+OLy)
0084 _RL vTrIce (1-OLx:sNx+OLx,1-OLy:sNy+OLy)
0085 _RL afx (1-OLx:sNx+OLx,1-OLy:sNy+OLy)
0086 _RL afy (1-OLx:sNx+OLx,1-OLy:sNy+OLy)
0087 _RS maskOce (1-OLx:sNx+OLx,1-OLy:sNy+OLy)
0088 _RL iceFrc (1-OLx:sNx+OLx,1-OLy:sNy+OLy)
7c0d02fed1 Jean*0089 _RL iceVol (1-OLx:sNx+OLx,1-OLy:sNy+OLy)
0090 _RL oldVol (1-OLx:sNx+OLx,1-OLy:sNy+OLy)
68ae87c30f Patr*0091 _RL iceTmp (1-OLx:sNx+OLx,1-OLy:sNy+OLy)
8db81c2271 Jean*0092 _RL r_minArea
a4eca6e929 Jean*0093 _RL meanCellArea, areaEpsil, vol_Epsil
0094 #ifdef ALLOW_DIAGNOSTICS
0095 CHARACTER*8 diagName
0096 CHARACTER*4 THSICE_DIAG_SUFX, diagSufx
0097 EXTERNAL THSICE_DIAG_SUFX
0e322d6e56 Jean*0098 LOGICAL DIAGNOSTICS_IS_ON
0099 EXTERNAL DIAGNOSTICS_IS_ON
0100 _RL tmpFac
a4eca6e929 Jean*0101 #endif
7c50f07931 Mart*0102 #ifdef ALLOW_AUTODIFF_TAMC
edb6656069 Mart*0103
0104 INTEGER tkey
7c50f07931 Mart*0105 #endif
03026c2540 Jean*0106 #ifdef ALLOW_DBUG_THSICE
0107 _RL tmpVar, sumVar1, sumVar2
0108 #endif
0109 LOGICAL dBugFlag
0110 #include "THSICE_DEBUG.h"
a4eca6e929 Jean*0111
0112
0113
d6f06800ae Patr*0114
0115 #ifdef ALLOW_AUTODIFF_TAMC
edb6656069 Mart*0116 tkey = bi + (bj-1)*nSx + (ikey_dynamics-1)*nSx*nSy
d6f06800ae Patr*0117 #endif /* ALLOW_AUTODIFF_TAMC */
0118
a4eca6e929 Jean*0119
0120
0121
0122
0123
c2c29a499f Jean*0124
a4eca6e929 Jean*0125
0126
ae605e558b Jean*0127 dBugFlag = debugLevel.GE.debLevC
a4eca6e929 Jean*0128
0129
0130
0131 meanCellArea = Nx*Ny
0132 meanCellArea = globalArea / meanCellArea
0133 areaEpsil = 1. _d -10 * meanCellArea
0134 vol_Epsil = 1. _d -15 * meanCellArea
0135
0136 r_minArea = 0. _d 0
8db81c2271 Jean*0137 IF ( iceMaskMin.GT.0. _d 0 ) r_minArea = 1. _d 0 / iceMaskMin
a4eca6e929 Jean*0138
0139 thSIce_multiDimAdv = .TRUE.
e7f517b398 Jean*0140 #ifdef ALLOW_GENERIC_ADVDIFF
a4eca6e929 Jean*0141 IF ( thSIceAdvScheme.EQ.ENUM_CENTERED_2ND
0142 & .OR.thSIceAdvScheme.EQ.ENUM_UPWIND_3RD
0143 & .OR.thSIceAdvScheme.EQ.ENUM_CENTERED_4TH ) THEN
0144 thSIce_multiDimAdv = .FALSE.
0145 ENDIF
e7f517b398 Jean*0146 #endif /* ALLOW_GENERIC_ADVDIFF */
a4eca6e929 Jean*0147
7c0d02fed1 Jean*0148 #ifdef ALLOW_DIAGNOSTICS
0149 IF ( useDiagnostics ) THEN
0150 CALL DIAGNOSTICS_FILL(iceMask,'SI_AdvFr',0,1,1,bi,bj,myThid)
0151
0152 tmpFac = 1. _d 0
0153 CALL DIAGNOSTICS_FRACT_FILL(
0154 I iceHeight, iceMask,tmpFac,1,'SI_AdvHi',
0155 I 0,1,1,bi,bj,myThid)
0156 CALL DIAGNOSTICS_FRACT_FILL(
0157 I snowHeight,iceMask,tmpFac,1,'SI_AdvHs',
0158 I 0,1,1,bi,bj,myThid)
0159
0160 IF ( DIAGNOSTICS_IS_ON('SI_AdvQ1',myThid) .OR.
0161 & DIAGNOSTICS_IS_ON('SI_AdvQ2',myThid) ) THEN
0162 DO j=1,sNy
0163 DO i=1,sNx
68ae87c30f Patr*0164 iceTmp(i,j) = iceMask(i,j,bi,bj)*iceHeight(i,j,bi,bj)
7c0d02fed1 Jean*0165 ENDDO
0166 ENDDO
0167 CALL DIAGNOSTICS_FRACT_FILL(
0168 I Qice1(1-OLx,1-OLy,bi,bj),
68ae87c30f Patr*0169 I iceTmp,tmpFac,1,'SI_AdvQ1',
7c0d02fed1 Jean*0170 I 0,1,2,bi,bj,myThid)
0171 CALL DIAGNOSTICS_FRACT_FILL(
0172 I Qice2(1-OLx,1-OLy,bi,bj),
68ae87c30f Patr*0173 I iceTmp,tmpFac,1,'SI_AdvQ2',
7c0d02fed1 Jean*0174 I 0,1,2,bi,bj,myThid)
0175 ENDIF
0176 ENDIF
0177 #endif /* ALLOW_DIAGNOSTICS */
0178
a4eca6e929 Jean*0179
0180 DO j=1-OLy,sNy+OLy
0181 DO i=1-OLx,sNx+OLx
0182 maskOce(i,j) = 0. _d 0
0183 IF ( hOceMxL(i,j,bi,bj).GT.0. ) maskOce(i,j) = 1.
0184 iceVol(i,j) = 0. _d 0
0185 uTrans(i,j) = 0. _d 0
0186 vTrans(i,j) = 0. _d 0
0187 uTrIce(i,j) = 0. _d 0
0188 vTrIce(i,j) = 0. _d 0
0189 oceFWfx(i,j,bi,bj) = 0. _d 0
0190 oceSflx(i,j,bi,bj) = 0. _d 0
0191 oceQnet(i,j,bi,bj) = 0. _d 0
0192 ENDDO
0193 ENDDO
0194
d6f06800ae Patr*0195 #ifdef ALLOW_AUTODIFF_TAMC
edb6656069 Mart*0196
0197
d6f06800ae Patr*0198 #endif
a4eca6e929 Jean*0199 IF ( thSIce_diffK .GT. 0. ) THEN
0200 CALL THSICE_DIFFUSION(
0201 I maskOce,
0202 U uIce, vIce,
0203 I bi, bj, myTime, myIter, myThid )
0204 ENDIF
0205
0206 IF ( thSIce_multiDimAdv ) THEN
0207
0208
7c0d02fed1 Jean*0209 DO j=1-OLy,sNy+OLy
0210 DO i=1-OLx+1,sNx+OLx
a4eca6e929 Jean*0211 uTrIce(i,j) = uIce(i,j)*_dyG(i,j,bi,bj)
0212 & *maskOce(i-1,j)*maskOce(i,j)
0213 ENDDO
0214 ENDDO
7c0d02fed1 Jean*0215 DO j=1-OLy+1,sNy+OLy
0216 DO i=1-OLx,sNx+OLx
a4eca6e929 Jean*0217 vTrIce(i,j) = vIce(i,j)*_dxG(i,j,bi,bj)
0218 & *maskOce(i,j-1)*maskOce(i,j)
0219 ENDDO
0220 ENDDO
0221
0222
7c0d02fed1 Jean*0223 DO j=1-OLy,sNy+OLy
0224 DO i=1-OLx,sNx+OLx
a4eca6e929 Jean*0225 iceFrc(i,j) = iceMask(i,j,bi,bj)
0226 ENDDO
0227 ENDDO
d6f06800ae Patr*0228 #ifdef ALLOW_AUTODIFF_TAMC
edb6656069 Mart*0229
0230
d6f06800ae Patr*0231 #endif
a4eca6e929 Jean*0232 CALL THSICE_ADVECTION(
0233 I GAD_SI_FRAC, thSIceAdvScheme, .TRUE.,
0234 I uTrIce, vTrIce, maskOce, thSIce_deltaT, areaEpsil,
0235 U iceVol, iceFrc,
0236 O uTrans, vTrans,
0237 I bi, bj, myTime, myIter, myThid )
0238
0239
7c0d02fed1 Jean*0240 DO j=1-OLy,sNy+OLy
0241 DO i=1-OLx,sNx+OLx
a4eca6e929 Jean*0242 iceVol(i,j) = iceMask(i,j,bi,bj)*rA(i,j,bi,bj)
0243 ENDDO
0244 ENDDO
a85293d087 Mart*0245 #ifdef ALLOW_AUTODIFF_TAMC
edb6656069 Mart*0246
0247
a85293d087 Mart*0248 #endif
a4eca6e929 Jean*0249 CALL THSICE_ADVECTION(
0250 I GAD_SI_HSNOW, thSIceAdvScheme, .FALSE.,
0251 I uTrans, vTrans, maskOce, thSIce_deltaT, areaEpsil,
7c0d02fed1 Jean*0252 U iceVol, snowHeight(1-OLx,1-OLy,bi,bj),
a4eca6e929 Jean*0253 O afx, afy,
0254 I bi, bj, myTime, myIter, myThid )
0255
d6f06800ae Patr*0256 #ifdef ALLOW_AUTODIFF_TAMC
edb6656069 Mart*0257
0258
d6f06800ae Patr*0259 #endif
a4eca6e929 Jean*0260
7c0d02fed1 Jean*0261 DO j=1-OLy,sNy+OLy
0262 DO i=1-OLx,sNx+OLx
a4eca6e929 Jean*0263 iceVol(i,j) = iceMask(i,j,bi,bj)*rA(i,j,bi,bj)
0264 oldVol(i,j) = iceVol(i,j)*iceHeight(i,j,bi,bj)
0265 ENDDO
0266 ENDDO
0267 CALL THSICE_ADVECTION(
0268 I GAD_SI_HICE, thSIceAdvScheme, .FALSE.,
0269 I uTrans, vTrans, maskOce, thSIce_deltaT, areaEpsil,
7c0d02fed1 Jean*0270 U iceVol, iceHeight(1-OLx,1-OLy,bi,bj),
a4eca6e929 Jean*0271 O uTrIce, vTrIce,
0272 I bi, bj, myTime, myIter, myThid )
d6f06800ae Patr*0273
0274 #ifdef ALLOW_AUTODIFF_TAMC
edb6656069 Mart*0275
0276
d6f06800ae Patr*0277 #endif
0278
a4eca6e929 Jean*0279 #ifdef ALLOW_DBUG_THSICE
0280 IF ( dBugFlag ) THEN
0281 sumVar1 = 0.
0282 sumVar2 = 0.
0283 DO j=1,sNy
0284 DO i=1,sNx
0285
0286 tmpVar = ABS(iceVol(i,j)-iceFrc(i,j)*rA(i,j,bi,bj))
0287 IF ( tmpVar.GT.0. ) THEN
0288 sumVar1 = sumVar1 + 1.
0289 sumVar2 = sumVar2 + tmpVar
0290 ENDIF
0291 IF ( tmpVar.GT.vol_Epsil ) THEN
0292 WRITE(6,'(A,2I4,2I2,I12)') 'ARE_ADV: ij,bij,it=',
0293 & i,j,bi,bj,myIter
0294 WRITE(6,'(2(A,1P2E14.6))') 'ARE_ADV: iceVol,iceFrc*rA=',
0295 & iceVol(i,j),iceFrc(i,j)*rA(i,j,bi,bj),
0296 & ' , diff=', tmpVar
0297 ENDIF
0298 IF ( dBug(i,j,bi,bj) ) THEN
0299 WRITE(6,'(A,2I4,2I2,I12)') 'ICE_ADV: ij,bij,it=',
0300 & i,j,bi,bj,myIter
0301 WRITE(6,'(2(A,1P2E14.6))')
0302 & 'ICE_ADV: uIce=', uIce(i,j), uIce(i+1,j),
0303 & ' , vIce=', vIce(i,j), vIce(i,j+1)
0304 WRITE(6,'(2(A,1P2E14.6))')
0e322d6e56 Jean*0305 & 'ICE_ADV: area_b,a=', iceMask(i,j,bi,bj), iceFrc(i,j),
0306 & ' , Heff_b,a=', oldVol(i,j)*recip_rA(i,j,bi,bj),
0307 & iceHeight(i,j,bi,bj)*iceFrc(i,j)
a4eca6e929 Jean*0308 ENDIF
0309 ENDDO
0310 ENDDO
0311 IF ( sumVar2.GT.vol_Epsil )
0312 & WRITE(6,'(A,2I2,I10,A,I4,1P2E14.6)') 'ARE_ADV: bij,it:',
0313 & bi,bj,myIter, ' ; Npts,aveDiff,Epsil=',
0314 & INT(sumVar1),sumVar2/sumVar1,vol_Epsil
0315 ENDIF
0316 #endif
0317 #ifdef ALLOW_DIAGNOSTICS
0318
0319 IF ( useDiagnostics ) THEN
0320 diagSufx = THSICE_DIAG_SUFX( GAD_SI_FRAC, myThid )
0321 diagName = 'ADVx'//diagSufx
0322 CALL DIAGNOSTICS_FILL( uTrans, diagName, 1,1,2,bi,bj, myThid )
0323 diagName = 'ADVy'//diagSufx
0324 CALL DIAGNOSTICS_FILL( vTrans, diagName, 1,1,2,bi,bj, myThid )
0325
0326 diagSufx = THSICE_DIAG_SUFX( GAD_SI_HSNOW, myThid )
0327 diagName = 'ADVx'//diagSufx
0328 CALL DIAGNOSTICS_FILL( afx, diagName, 1,1,2,bi,bj, myThid )
0329 diagName = 'ADVy'//diagSufx
0330 CALL DIAGNOSTICS_FILL( afy, diagName, 1,1,2,bi,bj, myThid )
0331
0332 diagSufx = THSICE_DIAG_SUFX( GAD_SI_HICE, myThid )
0333 diagName = 'ADVx'//diagSufx
0334 CALL DIAGNOSTICS_FILL( uTrIce, diagName, 1,1,2,bi,bj, myThid )
0335 diagName = 'ADVy'//diagSufx
0336 CALL DIAGNOSTICS_FILL( vTrIce, diagName, 1,1,2,bi,bj, myThid )
0337 ENDIF
0338 #endif
0339
0340
7c0d02fed1 Jean*0341 DO j=1-OLy,sNy+OLy
0342 DO i=1-OLx,sNx+OLx
a4eca6e929 Jean*0343 iceVol(i,j) = oldVol(i,j)
0344 ENDDO
0345 ENDDO
0346 CALL THSICE_ADVECTION(
0347 I GAD_SI_QICE1, thSIceAdvScheme, .FALSE.,
0348 I uTrIce, vTrIce, maskOce, thSIce_deltaT, vol_Epsil,
7c0d02fed1 Jean*0349 U iceVol, Qice1(1-OLx,1-OLy,bi,bj),
a4eca6e929 Jean*0350 O afx, afy,
0351 I bi, bj, myTime, myIter, myThid )
0352 #ifdef ALLOW_DBUG_THSICE
0353 IF ( dBugFlag ) THEN
0354 DO j=1,sNy
0355 DO i=1,sNx
0356 IF ( dBug(i,j,bi,bj) ) THEN
0357
0358
0359
0360
0361
0362 ENDIF
0363 ENDDO
0364 ENDDO
0365 ENDIF
0366 #endif
0367 #ifdef ALLOW_DIAGNOSTICS
0368 IF ( useDiagnostics ) THEN
0369 diagSufx = THSICE_DIAG_SUFX( GAD_SI_QICE1, myThid )
0370 diagName = 'ADVx'//diagSufx
0371 CALL DIAGNOSTICS_FILL( afx, diagName, 1,1,2,bi,bj, myThid )
0372 diagName = 'ADVy'//diagSufx
0373 CALL DIAGNOSTICS_FILL( afy, diagName, 1,1,2,bi,bj, myThid )
0374 ENDIF
0375 #endif
0376
0377
7c0d02fed1 Jean*0378 DO j=1-OLy,sNy+OLy
0379 DO i=1-OLx,sNx+OLx
a4eca6e929 Jean*0380 iceVol(i,j) = oldVol(i,j)
0381 ENDDO
0382 ENDDO
0383 CALL THSICE_ADVECTION(
0384 I GAD_SI_QICE2, thSIceAdvScheme, .FALSE.,
0385 I uTrIce, vTrIce, maskOce, thSIce_deltaT, vol_Epsil,
7c0d02fed1 Jean*0386 U iceVol, Qice2(1-OLx,1-OLy,bi,bj),
a4eca6e929 Jean*0387 O afx, afy,
0388 I bi, bj, myTime, myIter, myThid )
0389 #ifdef ALLOW_DBUG_THSICE
0390 IF ( dBugFlag ) THEN
0391 sumVar1 = 0.
0392 sumVar2 = 0.
0393 DO j=1,sNy
0394 DO i=1,sNx
0395
0396 tmpVar = ABS(iceVol(i,j)
0397 & -iceHeight(i,j,bi,bj)*iceFrc(i,j)*rA(i,j,bi,bj))
0398 IF ( tmpVar.GT.0. ) THEN
0399 sumVar1 = sumVar1 + 1.
0400 sumVar2 = sumVar2 + tmpVar
0401 ENDIF
0402 IF ( tmpVar.GT.vol_Epsil ) THEN
0403 WRITE(6,'(A,2I4,2I2,I12)') 'VOL_ADV: ij,bij,it=',
0404 & i,j,bi,bj,myIter
0405 WRITE(6,'(2(A,1P2E14.6))') 'VOL_ADV: iceVol,Hic*Frc*rA=',
0406 & iceVol(i,j),iceHeight(i,j,bi,bj)*iceFrc(i,j)*rA(i,j,bi,bj),
0407 & ' , diff=', tmpVar
0408 ENDIF
0409 IF ( dBug(i,j,bi,bj) ) THEN
0410
0411
0412
0413
0414
0415 ENDIF
0416 ENDDO
0417 ENDDO
0418 IF ( sumVar2.GT.vol_Epsil )
0419 & WRITE(6,'(A,2I2,I10,A,I4,1P2E14.6)') 'VOL_ADV: bij,it:',
0420 & bi,bj,myIter, ' ; Npts,aveDiff,Epsil=',
0421 & INT(sumVar1),sumVar2/sumVar1,vol_Epsil
0422 ENDIF
0423 #endif
0424 #ifdef ALLOW_DIAGNOSTICS
0425 IF ( useDiagnostics ) THEN
0426 diagSufx = THSICE_DIAG_SUFX( GAD_SI_QICE2, myThid )
0427 diagName = 'ADVx'//diagSufx
0428 CALL DIAGNOSTICS_FILL( afx, diagName, 1,1,2,bi,bj, myThid )
0429 diagName = 'ADVy'//diagSufx
0430 CALL DIAGNOSTICS_FILL( afy, diagName, 1,1,2,bi,bj, myThid )
0431 ENDIF
0432 #endif
0433
d6f06800ae Patr*0434 #ifdef ALLOW_AUTODIFF_TAMC
edb6656069 Mart*0435
0436
0437
d6f06800ae Patr*0438 #endif
0439
8db81c2271 Jean*0440
0441
a4eca6e929 Jean*0442 DO j=1,sNy
0443 DO i=1,sNx
8db81c2271 Jean*0444 IF ( iceFrc(i,j) .GT. 1. _d 0 ) THEN
0e322d6e56 Jean*0445
a4eca6e929 Jean*0446 iceMask(i,j,bi,bj) = 1. _d 0
8db81c2271 Jean*0447 iceHeight(i,j,bi,bj) = iceHeight(i,j,bi,bj) *iceFrc(i,j)
a4eca6e929 Jean*0448 snowHeight(i,j,bi,bj) = snowHeight(i,j,bi,bj)*iceFrc(i,j)
8db81c2271 Jean*0449 ELSEIF ( iceFrc(i,j) .LT. iceMaskMin ) THEN
0e322d6e56 Jean*0450
8db81c2271 Jean*0451 iceMask(i,j,bi,bj) = iceMaskMin
0452 iceHeight(i,j,bi,bj) = iceHeight(i,j,bi,bj)
0453 & *iceFrc(i,j)*r_minArea
a4eca6e929 Jean*0454 snowHeight(i,j,bi,bj) = snowHeight(i,j,bi,bj)
0455 & *iceFrc(i,j)*r_minArea
0456 ELSE
8db81c2271 Jean*0457 iceMask(i,j,bi,bj) = iceFrc(i,j)
0458 ENDIF
0459 ENDDO
0460 ENDDO
a85293d087 Mart*0461 #ifdef ALLOW_AUTODIFF_TAMC
0462
edb6656069 Mart*0463
0464
0465
0466
0467
a85293d087 Mart*0468 #endif
d680aaaecd Jean*0469
8db81c2271 Jean*0470 DO j=1,sNy
0471 DO i=1,sNx
c2c29a499f Jean*0472 IF ( iceHeight(i,j,bi,bj).LT.hIceMin ) THEN
d680aaaecd Jean*0473 iceVol(i,j) = iceMask(i,j,bi,bj)*iceHeight(i,j,bi,bj)
0474
0475 IF ( iceVol(i,j).GE.hIceMin*iceMaskMin ) THEN
0476 iceMask(i,j,bi,bj) = iceVol(i,j)/hIceMin
0477 snowHeight(i,j,bi,bj) = snowHeight(i,j,bi,bj)
0478 & *hIceMin/iceHeight(i,j,bi,bj)
0479 iceHeight(i,j,bi,bj) = hIceMin
0480 ELSE
03026c2540 Jean*0481
8db81c2271 Jean*0482
03026c2540 Jean*0483
0484
0485
0486
8db81c2271 Jean*0487 oceFWfx(i,j,bi,bj) = ( rhos*snowHeight(i,j,bi,bj)
0488 & +rhoi*iceHeight(i,j,bi,bj)
0489 & )*iceMask(i,j,bi,bj)/thSIce_deltaT
c2c29a499f Jean*0490 oceSflx(i,j,bi,bj) = rhoi*iceHeight(i,j,bi,bj)*saltIce
8db81c2271 Jean*0491 & *iceMask(i,j,bi,bj)/thSIce_deltaT
0492 oceQnet(i,j,bi,bj) = -( rhos*snowHeight(i,j,bi,bj)*qsnow
0493 & +rhoi*iceHeight(i,j,bi,bj)
0494 & *( Qice1(i,j,bi,bj)
0495 & +Qice2(i,j,bi,bj) )*0.5 _d 0
0496 & )*iceMask(i,j,bi,bj)/thSIce_deltaT
03026c2540 Jean*0497
a4eca6e929 Jean*0498
0499
0500
0501 iceMask (i,j,bi,bj) = 0. _d 0
0502 iceHeight (i,j,bi,bj) = 0. _d 0
0503 snowHeight(i,j,bi,bj) = 0. _d 0
0504 Qice1 (i,j,bi,bj) = 0. _d 0
0505 Qice2 (i,j,bi,bj) = 0. _d 0
0506 snowAge (i,j,bi,bj) = 0. _d 0
d680aaaecd Jean*0507 ENDIF
a4eca6e929 Jean*0508 ENDIF
0509 ENDDO
0510 ENDDO
0511
0512 #ifdef ALLOW_DBUG_THSICE
0513 IF ( dBugFlag ) THEN
0514 DO j=1,sNy
0515 DO i=1,sNx
0516 IF ( dBug(i,j,bi,bj) ) THEN
0517 WRITE(6,'(2(A,1P2E14.6))')
0518
0519
0520 ENDIF
0521 ENDDO
0522 ENDDO
0523 ENDIF
0524 #endif
0525
0526 ELSE
0527
0528
0529 WRITE(msgBuf,'(2A)') 'S/R THSICE_ADVDIFF: ',
0530 & 'traditional advection/diffusion not yet implemented'
0531 CALL PRINT_ERROR( msgBuf , myThid)
0532 WRITE(msgBuf,'(2A)') ' ',
0533 & 'for ThSice variable Qice1, Qice2, SnowHeight. Sorry!'
0534 CALL PRINT_ERROR( msgBuf , myThid)
0535 STOP 'ABNORMAL: END: S/R THSICE_ADVDIFF'
0536
0537
0538 ENDIF
0539
0540 #endif /* ALLOW_THSICE */
0541
0542 RETURN
0543 END