New URL for NEMO forge!   http://forge.nemo-ocean.eu

Since March 2022 along with NEMO 4.2 release, the code development moved to a self-hosted GitLab.
This present forge is now archived and remained online for history.
Changeset 14072 for NEMO/trunk/src/ICE/iceitd.F90 – NEMO

Ignore:
Timestamp:
2020-12-04T08:48:38+01:00 (3 years ago)
Author:
laurent
Message:

Merging branch "2020/dev_r13648_ASINTER-04_laurent_bulk_ice", ticket #2369

File:
1 edited

Legend:

Unmodified
Added
Removed
  • NEMO/trunk/src/ICE/iceitd.F90

    r14005 r14072  
    1818   !!---------------------------------------------------------------------- 
    1919   USE dom_oce        ! ocean domain 
    20    USE phycst         ! physical constants  
     20   USE phycst         ! physical constants 
    2121   USE ice1D          ! sea-ice: thermodynamic variables 
    2222   USE ice            ! sea-ice: variables 
     
    6666      !!                after thermodynamic growth of ice thickness 
    6767      !! 
    68       !! ** Method  :   Linear remapping  
     68      !! ** Method  :   Linear remapping 
    6969      !! 
    7070      !! References :   W.H. Lipscomb, JGR 2001 
    7171      !!------------------------------------------------------------------ 
    72       INTEGER , INTENT (in) ::   kt      ! Ocean time step  
     72      INTEGER , INTENT (in) ::   kt      ! Ocean time step 
    7373      ! 
    7474      INTEGER  ::   ji, jj, jl, jcat     ! dummy loop index 
     
    7676      REAL(wp) ::   zx1, zwk1, zdh0, zetamin, zdamax   ! local scalars 
    7777      REAL(wp) ::   zx2, zwk2, zda0, zetamax           !   -      - 
    78       REAL(wp) ::   zx3         
     78      REAL(wp) ::   zx3 
    7979      REAL(wp) ::   zslope          ! used to compute local thermodynamic "speeds" 
    8080      ! 
     
    9090      IF( ln_timing )   CALL timing_start('iceitd_rem') 
    9191 
    92       IF( kt == nit000 .AND. lwp )   WRITE(numout,*) '-- ice_itd_rem: remapping ice thickness distribution'  
     92      IF( kt == nit000 .AND. lwp )   WRITE(numout,*) '-- ice_itd_rem: remapping ice thickness distribution' 
    9393 
    9494      IF( ln_icediachk )   CALL ice_cons_hsm(0, 'iceitd_rem', rdiag_v, rdiag_s, rdiag_t, rdiag_fv, rdiag_fs, rdiag_ft) 
     
    107107         ENDIF 
    108108      END_2D 
    109        
     109 
    110110      !----------------------------------------------------------------------------------------------- 
    111111      !  2) Compute new category boundaries 
     
    143143               ELSEIF( a_ib_2d(ji,jl) <= epsi10 .AND. a_ib_2d(ji,jl+1) >  epsi10 ) THEN   ! a(jl)=0 => Hn* = Hn + fn+1*dt 
    144144                  zhbnew(ji,jl) = hi_max(jl) + zdhice(ji,jl+1) 
    145                ELSE                                                                       ! a(jl+1) & a(jl) = 0  
     145               ELSE                                                                       ! a(jl+1) & a(jl) = 0 
    146146                  zhbnew(ji,jl) = hi_max(jl) 
    147147               ENDIF 
    148148               ! 
    149149               ! --- 2 conditions for remapping --- ! 
    150                ! 1) hn(t+1)+espi < Hn* < hn+1(t+1)-epsi                
    151                !    Note: hn(t+1) must not be too close to either HR or HL otherwise a division by nearly 0 is possible  
     150               ! 1) hn(t+1)+espi < Hn* < hn+1(t+1)-epsi 
     151               !    Note: hn(t+1) must not be too close to either HR or HL otherwise a division by nearly 0 is possible 
    152152               !          in itd_glinear in the case (HR-HL) = 3(Hice - HL) or = 3(HR - Hice) 
    153153# if defined key_single 
     
    159159# endif 
    160160               ! 
    161                ! 2) Hn-1 < Hn* < Hn+1   
     161               ! 2) Hn-1 < Hn* < Hn+1 
    162162               IF( zhbnew(ji,jl) < hi_max(jl-1) )   nptidx(ji) = 0 
    163163               IF( zhbnew(ji,jl) > hi_max(jl+1) )   nptidx(ji) = 0 
     
    171171               zhbnew(ji,jpl) = MAX( hi_max(jpl-1), 3._wp * h_i_2d(ji,jpl) - 2._wp * zhbnew(ji,jpl-1) ) 
    172172            ELSE 
    173                zhbnew(ji,jpl) = hi_max(jpl)   
     173               zhbnew(ji,jpl) = hi_max(jpl) 
    174174            ENDIF 
    175175            ! 
    176176            ! --- 1 additional condition for remapping (1st category) --- ! 
    177             ! H0+epsi < h1(t) < H1-epsi  
    178             !    h1(t) must not be too close to either HR or HL otherwise a division by nearly 0 is possible  
     177            ! H0+epsi < h1(t) < H1-epsi 
     178            !    h1(t) must not be too close to either HR or HL otherwise a division by nearly 0 is possible 
    179179            !    in itd_glinear in the case (HR-HL) = 3(Hice - HL) or = 3(HR - Hice) 
    180180# if defined key_single 
     
    202202         ! 
    203203      ENDIF 
    204     
     204 
    205205      !----------------------------------------------------------------------------------------------- 
    206       !  4) Compute g(h)  
     206      !  4) Compute g(h) 
    207207      !----------------------------------------------------------------------------------------------- 
    208208      IF( npti > 0 ) THEN 
    209209         ! 
    210210         zhb0(:) = hi_max(0)   ;   zhb1(:) = hi_max(1) 
    211          g0(:,:) = 0._wp       ;   g1(:,:) = 0._wp  
    212          hL(:,:) = 0._wp       ;   hR(:,:) = 0._wp  
     211         g0(:,:) = 0._wp       ;   g1(:,:) = 0._wp 
     212         hL(:,:) = 0._wp       ;   hR(:,:) = 0._wp 
    213213         ! 
    214214         DO jl = 1, jpl 
     
    220220            ! 
    221221            IF( jl == 1 ) THEN 
    222                !   
     222               ! 
    223223               ! --- g(h) for category 1 --- ! 
    224224               CALL itd_glinear( zhb0(1:npti)  , zhb1(1:npti)  , h_ib_1d(1:npti)  , a_i_1d(1:npti)  ,  &   ! in 
     
    230230                  IF( a_i_1d(ji) > epsi10 ) THEN 
    231231                     ! 
    232                      zdh0 =  h_i_1d(ji) - h_ib_1d(ji)                 
     232                     zdh0 =  h_i_1d(ji) - h_ib_1d(ji) 
    233233                     IF( zdh0 < 0.0 ) THEN      ! remove area from category 1 
    234234                        zdh0 = MIN( -zdh0, hi_max(1) ) 
     
    238238                        IF( zetamax > 0.0 ) THEN 
    239239                           zx1    = zetamax 
    240                            zx2    = 0.5 * zetamax * zetamax  
     240                           zx2    = 0.5 * zetamax * zetamax 
    241241                           zda0   = g1(ji,1) * zx2 + g0(ji,1) * zx1                ! ice area removed 
    242                            zdamax = a_i_1d(ji) * (1.0 - h_i_1d(ji) / h_ib_1d(ji) ) ! Constrain new thickness <= h_i                 
     242                           zdamax = a_i_1d(ji) * (1.0 - h_i_1d(ji) / h_ib_1d(ji) ) ! Constrain new thickness <= h_i 
    243243                           zda0   = MIN( zda0, zdamax )                            ! ice area lost due to melting of thin ice (zdamax > 0) 
    244244                           ! Remove area, conserving volume 
     
    250250                     ELSE ! if ice accretion zdh0 > 0 
    251251                        ! zhbnew was 0, and is shifted to the right to account for thin ice growth in openwater (F0 = f1) 
    252                         zhbnew(ji,0) = MIN( zdh0, hi_max(1) )  
     252                        zhbnew(ji,0) = MIN( zdh0, hi_max(1) ) 
    253253                     ENDIF 
    254254                     ! 
     
    263263            ENDIF ! jl=1 
    264264            ! 
    265             ! --- g(h) for each thickness category --- !   
     265            ! --- g(h) for each thickness category --- ! 
    266266            CALL itd_glinear( zhbnew(1:npti,jl-1), zhbnew(1:npti,jl), h_i_1d(1:npti)   , a_i_1d(1:npti)   ,  &   ! in 
    267267               &              g0    (1:npti,jl  ), g1    (1:npti,jl), hL    (1:npti,jl), hR    (1:npti,jl)   )   ! out 
    268268            ! 
    269269         END DO 
    270           
     270 
    271271         !----------------------------------------------------------------------------------------------- 
    272272         !  5) Compute area and volume to be shifted across each boundary (Eq. 18) 
     
    278278               ! left and right integration limits in eta space 
    279279               IF (zhbnew(ji,jl) > hi_max(jl)) THEN ! Hn* > Hn => transfer from jl to jl+1 
    280                   zetamin = MAX( hi_max(jl)   , hL(ji,jl) ) - hL(ji,jl)   ! hi_max(jl) - hL  
     280                  zetamin = MAX( hi_max(jl)   , hL(ji,jl) ) - hL(ji,jl)   ! hi_max(jl) - hL 
    281281                  zetamax = MIN( zhbnew(ji,jl), hR(ji,jl) ) - hL(ji,jl)   ! hR - hL 
    282282                  jdonor(ji,jl) = jl 
     
    301301            END DO 
    302302         END DO 
    303           
     303 
    304304         !---------------------------------------------------------------------------------------------- 
    305305         ! 6) Shift ice between categories 
    306306         !---------------------------------------------------------------------------------------------- 
    307307         CALL itd_shiftice ( jdonor(1:npti,:), zdaice(1:npti,:), zdvice(1:npti,:) ) 
    308           
     308 
    309309         !---------------------------------------------------------------------------------------------- 
    310310         ! 7) Make sure h_i >= minimum ice thickness hi_min 
     
    316316         DO ji = 1, npti 
    317317            IF ( a_i_1d(ji) > epsi10 .AND. h_i_1d(ji) < rn_himin ) THEN 
    318                a_i_1d(ji) = a_i_1d(ji) * h_i_1d(ji) / rn_himin  
     318               a_i_1d(ji) = a_i_1d(ji) * h_i_1d(ji) / rn_himin 
    319319               IF( ln_pnd_LEV .OR. ln_pnd_TOPO )   a_ip_1d(ji) = a_ip_1d(ji) * h_i_1d(ji) / rn_himin 
    320320               h_i_1d(ji) = rn_himin 
     
    384384            pg1(ji) = 2._wp * zdhr * zwk1 * ( zwk2 - 0.5_wp )   ! Eq. 14 
    385385            ! 
    386          ELSE  ! remap_flag = .false. or a_i < epsi10  
     386         ELSE  ! remap_flag = .false. or a_i < epsi10 
    387387            phL(ji) = 0._wp 
    388388            phR(ji) = 0._wp 
     
    415415      REAL(wp), DIMENSION(jpij,nlay_s,jpl) ::   ze_s_2d 
    416416      !!------------------------------------------------------------------ 
    417           
     417 
    418418      CALL tab_3d_2d( npti, nptidx(1:npti), h_i_2d (1:npti,1:jpl), h_i  ) 
    419419      CALL tab_3d_2d( npti, nptidx(1:npti), a_i_2d (1:npti,1:jpl), a_i  ) 
     
    445445         END DO 
    446446      END DO 
    447        
     447 
    448448      !------------------------------------------------------------------------------- 
    449449      ! 2) Transfer volume and energy between categories 
     
    457457               ! 
    458458               IF ( jl1 == jl  ) THEN   ;   jl2 = jl1+1 
    459                ELSE                     ;   jl2 = jl  
     459               ELSE                     ;   jl2 = jl 
    460460               ENDIF 
    461461               ! 
     
    475475               ztrans         = v_s_2d(ji,jl1) * zworkv(ji)          ! Snow volumes 
    476476               v_s_2d(ji,jl1) = v_s_2d(ji,jl1) - ztrans 
    477                v_s_2d(ji,jl2) = v_s_2d(ji,jl2) + ztrans  
     477               v_s_2d(ji,jl2) = v_s_2d(ji,jl2) + ztrans 
    478478               ! 
    479479               ztrans          = oa_i_2d(ji,jl1) * zworka(ji)        ! Ice age 
     
    488488               zaTsfn(ji,jl1)  = zaTsfn(ji,jl1) - ztrans 
    489489               zaTsfn(ji,jl2)  = zaTsfn(ji,jl2) + ztrans 
    490                !   
     490               ! 
    491491               IF ( ln_pnd_LEV .OR. ln_pnd_TOPO ) THEN 
    492492                  ztrans          = a_ip_2d(ji,jl1) * zworka(ji)     ! Pond fraction 
    493493                  a_ip_2d(ji,jl1) = a_ip_2d(ji,jl1) - ztrans 
    494494                  a_ip_2d(ji,jl2) = a_ip_2d(ji,jl2) + ztrans 
    495                   !                                               
     495                  ! 
    496496                  ztrans          = v_ip_2d(ji,jl1) * zworkv(ji)     ! Pond volume 
    497497                  v_ip_2d(ji,jl1) = v_ip_2d(ji,jl1) - ztrans 
     
    555555            &   a_i_2d(1:npti,jl) = a_i_2d(1:npti,jl) * rn_amax_1d(1:npti) / zworka(1:npti) 
    556556      END DO 
    557        
     557 
    558558      !------------------------------------------------------------------------------- 
    559559      ! 4) Update ice thickness and temperature 
     
    564564      WHERE( a_i_2d(1:npti,:) >= epsi20 ) 
    565565# endif 
    566          h_i_2d (1:npti,:)  =  v_i_2d(1:npti,:) / a_i_2d(1:npti,:)  
    567          t_su_2d(1:npti,:)  =  zaTsfn(1:npti,:) / a_i_2d(1:npti,:)  
     566         h_i_2d (1:npti,:)  =  v_i_2d(1:npti,:) / a_i_2d(1:npti,:) 
     567         t_su_2d(1:npti,:)  =  zaTsfn(1:npti,:) / a_i_2d(1:npti,:) 
    568568      ELSEWHERE 
    569569         h_i_2d (1:npti,:)  = 0._wp 
     
    591591      ! 
    592592   END SUBROUTINE itd_shiftice 
    593     
     593 
    594594 
    595595   SUBROUTINE ice_itd_reb( kt ) 
     
    603603      !!              to the neighboring category 
    604604      !!------------------------------------------------------------------ 
    605       INTEGER , INTENT (in) ::   kt      ! Ocean time step  
     605      INTEGER , INTENT (in) ::   kt      ! Ocean time step 
    606606      INTEGER ::   ji, jj, jl   ! dummy loop indices 
    607607      ! 
     
    611611      IF( ln_timing )   CALL timing_start('iceitd_reb') 
    612612      ! 
    613       IF( kt == nit000 .AND. lwp )   WRITE(numout,*) '-- ice_itd_reb: rebining ice thickness distribution'  
     613      IF( kt == nit000 .AND. lwp )   WRITE(numout,*) '-- ice_itd_reb: rebining ice thickness distribution' 
    614614      ! 
    615615      IF( ln_icediachk )   CALL ice_cons_hsm(0, 'iceitd_reb', rdiag_v, rdiag_s, rdiag_t, rdiag_fv, rdiag_fs, rdiag_ft) 
     
    627627            IF( a_i(ji,jj,jl) > 0._wp .AND. v_i(ji,jj,jl) > (a_i(ji,jj,jl) * hi_max(jl)) ) THEN 
    628628               npti = npti + 1 
    629                nptidx( npti ) = (jj - 1) * jpi + ji                   
     629               nptidx( npti ) = (jj - 1) * jpi + ji 
    630630            ENDIF 
    631631         END_2D 
    632632         ! 
    633          IF( npti > 0 ) THEN             
     633         IF( npti > 0 ) THEN 
    634634            !!clem   CALL tab_2d_1d( npti, nptidx(1:npti), h_i_1d(1:npti), h_i(:,:,jl) ) 
    635635            CALL tab_2d_1d( npti, nptidx(1:npti), a_i_1d(1:npti), a_i(:,:,jl) ) 
     
    637637            ! 
    638638            DO ji = 1, npti 
    639                jdonor(ji,jl)  = jl  
     639               jdonor(ji,jl)  = jl 
    640640               ! how much of a_i you send in cat sup is somewhat arbitrary 
    641641               ! these are from CICE => transfer everything 
     
    663663            IF( a_i(ji,jj,jl+1) > 0._wp .AND. v_i(ji,jj,jl+1) <= (a_i(ji,jj,jl+1) * hi_max(jl)) ) THEN 
    664664               npti = npti + 1 
    665                nptidx( npti ) = (jj - 1) * jpi + ji                   
     665               nptidx( npti ) = (jj - 1) * jpi + ji 
    666666            ENDIF 
    667667         END_2D 
     
    672672            DO ji = 1, npti 
    673673               jdonor(ji,jl) = jl + 1 
    674                zdaice(ji,jl) = a_i_1d(ji)  
     674               zdaice(ji,jl) = a_i_1d(ji) 
    675675               zdvice(ji,jl) = v_i_1d(ji) 
    676676            END DO 
     
    721721         WRITE(numout,*) '         mean ice thickness in the domain                               rn_himean  = ', rn_himean 
    722722         WRITE(numout,*) '      Ice categories are defined by rn_catbnd                           ln_cat_usr = ', ln_cat_usr 
    723          WRITE(numout,*) '      minimum ice thickness allowed                                     rn_himin   = ', rn_himin  
    724          WRITE(numout,*) '      maximum ice thickness allowed                                     rn_himax   = ', rn_himax  
     723         WRITE(numout,*) '      minimum ice thickness allowed                                     rn_himin   = ', rn_himin 
     724         WRITE(numout,*) '      maximum ice thickness allowed                                     rn_himax   = ', rn_himax 
    725725      ENDIF 
    726726      ! 
     
    729729      !-----------------------------------! 
    730730      !                             !== set the choice of ice categories ==! 
    731       ioptio = 0  
     731      ioptio = 0 
    732732      IF( ln_cat_hfn ) THEN   ;   ioptio = ioptio + 1   ;   nice_catbnd = np_cathfn    ;   ENDIF 
    733733      IF( ln_cat_usr ) THEN   ;   ioptio = ioptio + 1   ;   nice_catbnd = np_catusr    ;   ENDIF 
Note: See TracChangeset for help on using the changeset viewer.