168 |
ENDDO |
ENDDO |
169 |
|
|
170 |
#ifdef ALLOW_AUTODIFF_TAMC |
#ifdef ALLOW_AUTODIFF_TAMC |
171 |
CADJ STORE iceHeight(i,j,bi,bj) |
CADJ STORE iceHeight(i,j,bi,bj) |
172 |
CADJ & = comlev1_bibj, key=iicekey, byte=isbyte |
CADJ & = comlev1_bibj, key=iicekey, byte=isbyte |
173 |
CADJ STORE snowHeight(i,j,bi,bj) |
CADJ STORE snowHeight(i,j,bi,bj) |
174 |
CADJ & = comlev1_bibj, key=iicekey, byte=isbyte |
CADJ & = comlev1_bibj, key=iicekey, byte=isbyte |
175 |
#endif |
#endif |
176 |
IF ( thSIce_diffK .GT. 0. ) THEN |
IF ( thSIce_diffK .GT. 0. ) THEN |
407 |
#endif |
#endif |
408 |
|
|
409 |
#ifdef ALLOW_AUTODIFF_TAMC |
#ifdef ALLOW_AUTODIFF_TAMC |
410 |
CADJ STORE iceHeight(:,:,bi,bj) = |
CADJ STORE iceHeight(:,:,bi,bj) = |
411 |
CADJ & comlev1_bibj, key=iicekey, byte=isbyte |
CADJ & comlev1_bibj, key=iicekey, byte=isbyte |
412 |
CADJ STORE snowHeight(:,:,bi,bj) = |
CADJ STORE snowHeight(:,:,bi,bj) = |
413 |
CADJ & comlev1_bibj, key=iicekey, byte=isbyte |
CADJ & comlev1_bibj, key=iicekey, byte=isbyte |
414 |
CADJ STORE iceFrc(:,:) = |
CADJ STORE iceFrc(:,:) = |
415 |
CADJ & comlev1_bibj, key=iicekey, byte=isbyte |
CADJ & comlev1_bibj, key=iicekey, byte=isbyte |
416 |
#endif |
#endif |
417 |
|
|
436 |
ENDIF |
ENDIF |
437 |
ENDDO |
ENDDO |
438 |
ENDDO |
ENDDO |
439 |
C- adjust sea-ice state if not enough ice. |
C- adjust sea-ice state if ice is too thin. |
440 |
DO j=1,sNy |
DO j=1,sNy |
441 |
DO i=1,sNx |
DO i=1,sNx |
442 |
IF ( iceHeight(i,j,bi,bj).LT.hIceMin ) THEN |
IF ( iceHeight(i,j,bi,bj).LT.hIceMin ) THEN |
443 |
|
iceVol(i,j) = iceMask(i,j,bi,bj)*iceHeight(i,j,bi,bj) |
444 |
|
c IF ( dBug(i,j,bi,bj) ) |
445 |
|
IF ( iceVol(i,j).GE.hIceMin*iceMaskMin ) THEN |
446 |
|
iceMask(i,j,bi,bj) = iceVol(i,j)/hIceMin |
447 |
|
snowHeight(i,j,bi,bj) = snowHeight(i,j,bi,bj) |
448 |
|
& *hIceMin/iceHeight(i,j,bi,bj) |
449 |
|
iceHeight(i,j,bi,bj) = hIceMin |
450 |
|
ELSE |
451 |
C- Not enough ice, melt the tiny amount of snow & ice: |
C- Not enough ice, melt the tiny amount of snow & ice: |
452 |
C and return fresh-water, salt & energy to the ocean (flx > 0 = into ocean) |
C and return fresh-water, salt & energy to the ocean (flx > 0 = into ocean) |
453 |
C- - Note: using 1rst.Order Upwind, I can get the same results as when |
C- - Note: using 1rst.Order Upwind, I can get the same results as when |
464 |
& *( Qice1(i,j,bi,bj) |
& *( Qice1(i,j,bi,bj) |
465 |
& +Qice2(i,j,bi,bj) )*0.5 _d 0 |
& +Qice2(i,j,bi,bj) )*0.5 _d 0 |
466 |
& )*iceMask(i,j,bi,bj)/thSIce_deltaT |
& )*iceMask(i,j,bi,bj)/thSIce_deltaT |
|
c IF ( dBug(i,j,bi,bj) ) |
|
467 |
C- - |
C- - |
468 |
c flx2oc (i,j) = flx2oc (i,j) + |
c flx2oc (i,j) = flx2oc (i,j) + |
469 |
c frw2oc (i,j) = frw2oc (i,j) + |
c frw2oc (i,j) = frw2oc (i,j) + |
474 |
Qice1 (i,j,bi,bj) = 0. _d 0 |
Qice1 (i,j,bi,bj) = 0. _d 0 |
475 |
Qice2 (i,j,bi,bj) = 0. _d 0 |
Qice2 (i,j,bi,bj) = 0. _d 0 |
476 |
snowAge (i,j,bi,bj) = 0. _d 0 |
snowAge (i,j,bi,bj) = 0. _d 0 |
477 |
|
ENDIF |
478 |
ENDIF |
ENDIF |
479 |
ENDDO |
ENDDO |
480 |
ENDDO |
ENDDO |