/[MITgcm]/MITgcm/pkg/thsice/thsice_calc_thickn.F
ViewVC logotype

Diff of /MITgcm/pkg/thsice/thsice_calc_thickn.F

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.22 by heimbach, Thu Oct 21 02:10:34 2010 UTC revision 1.23 by heimbach, Tue Oct 26 22:26:59 2010 UTC
# Line 879  C to sea-level OR if snow height is larg Line 879  C to sea-level OR if snow height is larg
879  C converted to ice to bring hSnow down to hsMax. Largest change is  C converted to ice to bring hSnow down to hsMax. Largest change is
880  C applied and enthalpy of top ice layer adjusted accordingly.  C applied and enthalpy of top ice layer adjusted accordingly.
881    
882  CML#ifdef ALLOW_AUTODIFF_TAMC  #ifdef ALLOW_AUTODIFF_TAMC
883  CMLCADJ STORE hIce(i,j) = comlev1_thsice_1, key=ikey_1          ikey_1 = i
884  CMLCADJ STORE hSnow(i,j) = comlev1_thsice_1, key=ikey_1       &       + sNx*(j-1)
885  CMLCADJ STORE hnew(i,j,:) = comlev1_thsice_1, key=ikey_1       &       + sNx*sNy*act1
886  CMLCADJ STORE qicen(i,j,:) = comlev1_thsice_1, key=ikey_1       &       + sNx*sNy*max1*act2
887  CML#endif       &       + sNx*sNy*max1*max2*act3
888         &       + sNx*sNy*max1*max2*max3*act4
889    #endif /* ALLOW_AUTODIFF_TAMC */
890    
891    #ifdef ALLOW_AUTODIFF_TAMC
892    CADJ STORE hIce(i,j) = comlev1_thsice_1, key=ikey_1
893    CADJ STORE hSnow(i,j) = comlev1_thsice_1, key=ikey_1
894    CADJ STORE hnew(i,j,:) = comlev1_thsice_1, key=ikey_1
895    CADJ STORE qicen(i,j,:) = comlev1_thsice_1, key=ikey_1
896    #endif
897            IF ( hSnow(i,j) .GT. hIce(i,j)*floodFac            IF ( hSnow(i,j) .GT. hIce(i,j)*floodFac
898       &         .OR. hSnow(i,j) .GT. hsMax ) THEN       &         .OR. hSnow(i,j) .GT. hsMax ) THEN
899  cBB               WRITE (6,*)  'Freeboard adjusts'  cBB               WRITE (6,*)  'Freeboard adjusts'
900  c          dhi = (hSnow(i,j) * rhos - hIce(i,j) * rhoiw) / rhosw  c          dhi = (hSnow(i,j) * rhos - hIce(i,j) * rhoiw) / rhosw
901  c          dhs = dhi * rhoi / rhos  c          dhs = dhi * rhoi / rhos
902    #ifdef ALLOW_AUTODIFF_TAMC
903    CADJ STORE hnew(i,j,:) = comlev1_thsice_1, key=ikey_1
904    #endif
905             dhs = (hSnow(i,j) - hIce(i,j)*floodFac) * rhoi / rhosw             dhs = (hSnow(i,j) - hIce(i,j)*floodFac) * rhoi / rhosw
906             dhs = MAX( hSnow(i,j) - hsMax, dhs )             dhs = MAX( hSnow(i,j) - hsMax, dhs )
907             dhi = dhs * rhos / rhoi             dhi = dhs * rhos / rhoi
 CML#ifdef ALLOW_AUTODIFF_TAMC  
 CMLCADJ STORE hnew(i,j,:) = comlev1_thsice_1, key=ikey_1  
 CML#endif  
908             rqh = rhoi*qicen(i,j,1)*hnew(i,j,1) + rhos*qsnow*dhs             rqh = rhoi*qicen(i,j,1)*hnew(i,j,1) + rhos*qsnow*dhs
909             hnew(i,j,1)    = hnew(i,j,1) + dhi             hnew(i,j,1)    = hnew(i,j,1) + dhi
910             qicen(i,j,1)   = rqh / (rhoi*hnew(i,j,1))             qicen(i,j,1)   = rqh / (rhoi*hnew(i,j,1))

Legend:
Removed from v.1.22  
changed lines
  Added in v.1.23

  ViewVC Help
Powered by ViewVC 1.1.22