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 5064 for branches/2015/dev_r5044_CNRS_LIM3CLEAN/NEMOGCM/NEMO/LIM_SRC_3/limthd.F90 – NEMO

Ignore:
Timestamp:
2015-02-05T18:54:24+01:00 (9 years ago)
Author:
clem
Message:

LIM3 now includes specific physics to run with only 1 sea ice category (i.e. LIM2 type)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2015/dev_r5044_CNRS_LIM3CLEAN/NEMOGCM/NEMO/LIM_SRC_3/limthd.F90

    r5055 r5064  
    109109      ! 1.2) Heat content     
    110110      !-------------------- 
    111       ! Change the units of heat content; from global units to J.m3 
     111      ! Change the units of heat content; from J/m2 to J/m3 
    112112      DO jl = 1, jpl 
    113113         DO jk = 1, nlay_i 
     
    115115               DO ji = 1, jpi 
    116116                  !0 if no ice and 1 if yes 
    117                   rswitch = 1.0 - MAX(  0.0 , SIGN( 1.0 , - v_i(ji,jj,jl) + epsi10 )  ) 
     117                  rswitch = 1.0 - MAX(  0.0 , SIGN( 1.0 , - v_i(ji,jj,jl) + epsi20 )  ) 
    118118                  !Energy of melting q(S,T) [J.m-3] 
    119                   e_i(ji,jj,jk,jl) = rswitch * e_i(ji,jj,jk,jl) / ( area(ji,jj) * MAX( v_i(ji,jj,jl) , epsi10 ) ) * REAL( nlay_i ) 
    120                   !convert units ! very important that this line is here         
    121                   e_i(ji,jj,jk,jl) = e_i(ji,jj,jk,jl) * unit_fac  
     119                  e_i(ji,jj,jk,jl) = rswitch * e_i(ji,jj,jk,jl) / MAX( v_i(ji,jj,jl) , epsi20 ) * REAL( nlay_i ) 
    122120               END DO 
    123121            END DO 
     
    127125               DO ji = 1, jpi 
    128126                  !0 if no ice and 1 if yes 
    129                   rswitch = 1.0 - MAX(  0.0 , SIGN( 1.0 , - v_s(ji,jj,jl) + epsi10 )  ) 
     127                  rswitch = 1.0 - MAX(  0.0 , SIGN( 1.0 , - v_s(ji,jj,jl) + epsi20 )  ) 
    130128                  !Energy of melting q(S,T) [J.m-3] 
    131                   e_s(ji,jj,jk,jl) = rswitch * e_s(ji,jj,jk,jl) / ( area(ji,jj) * MAX( v_s(ji,jj,jl) , epsi10 ) ) * REAL( nlay_s ) 
    132                   !convert units ! very important that this line is here 
    133                   e_s(ji,jj,jk,jl) = e_s(ji,jj,jk,jl) * unit_fac  
     129                  e_s(ji,jj,jk,jl) = rswitch * e_s(ji,jj,jk,jl) / MAX( v_s(ji,jj,jl) , epsi20 ) * REAL( nlay_s ) 
    134130               END DO 
    135131            END DO 
     
    453449      ! Ice heat content               
    454450      !------------------------ 
    455       ! Enthalpies are global variables we have to readjust the units (heat content in Joules) 
     451      ! Enthalpies are global variables we have to readjust the units (heat content in J/m2) 
    456452      DO jl = 1, jpl 
    457453         DO jk = 1, nlay_i 
    458             e_i(:,:,jk,jl) = e_i(:,:,jk,jl) * area(:,:) * a_i(:,:,jl) * ht_i(:,:,jl) / ( unit_fac * REAL( nlay_i ) ) 
     454            e_i(:,:,jk,jl) = e_i(:,:,jk,jl) * a_i(:,:,jl) * ht_i(:,:,jl) / REAL( nlay_i ) 
    459455         END DO 
    460456      END DO 
     
    463459      ! Snow heat content               
    464460      !------------------------ 
    465       ! Enthalpies are global variables we have to readjust the units (heat content in Joules) 
     461      ! Enthalpies are global variables we have to readjust the units (heat content in J/m2) 
    466462      DO jl = 1, jpl 
    467463         DO jk = 1, nlay_s 
    468             e_s(:,:,jk,jl) = e_s(:,:,jk,jl) * area(:,:) * a_i(:,:,jl) * ht_s(:,:,jl) / ( unit_fac * REAL( nlay_s ) ) 
     464            e_s(:,:,jk,jl) = e_s(:,:,jk,jl) * a_i(:,:,jl) * ht_s(:,:,jl) / REAL( nlay_s ) 
    469465         END DO 
    470466      END DO 
     
    489485         CALL prt_ctl_info(' - Cell values : ') 
    490486         CALL prt_ctl_info('   ~~~~~~~~~~~~~ ') 
    491          CALL prt_ctl(tab2d_1=area , clinfo1=' lim_thd  : cell area :') 
     487         CALL prt_ctl(tab2d_1=e12t , clinfo1=' lim_thd  : cell area :') 
    492488         CALL prt_ctl(tab2d_1=at_i , clinfo1=' lim_thd  : at_i      :') 
    493489         CALL prt_ctl(tab2d_1=vt_i , clinfo1=' lim_thd  : vt_i      :') 
     
    520516      CALL wrk_dealloc( jpi, jpj, zqsr, zqns ) 
    521517 
     518      IF( ln_limdiahsb ) CALL lim_cons_hsm(1, 'limthd', zvi_b, zsmv_b, zei_b, zfw_b, zfs_b, zft_b) 
    522519      !------------------------------------------------------------------------------| 
    523520      !  1) Transport of ice between thickness categories.                           | 
    524521      !------------------------------------------------------------------------------| 
    525       ! Given thermodynamic growth rates, transport ice between 
    526       ! thickness categories. 
     522      IF( ln_limdiahsb ) CALL lim_cons_hsm(0, 'limitd_th_rem', zvi_b, zsmv_b, zei_b, zfw_b, zfs_b, zft_b) 
     523 
     524      ! Given thermodynamic growth rates, transport ice between thickness categories. 
    527525      IF( jpl > 1 )   CALL lim_itd_th_rem( 1, jpl, kt ) 
    528526      ! 
     
    530528      CALL lim_var_agg(1) 
    531529 
     530      IF( ln_limdiahsb ) CALL lim_cons_hsm(1, 'limitd_th_rem', zvi_b, zsmv_b, zei_b, zfw_b, zfs_b, zft_b) 
     531      IF( ln_limdiahsb ) CALL lim_cons_hsm(0, 'limthd_lac', zvi_b, zsmv_b, zei_b, zfw_b, zfs_b, zft_b) 
    532532      !------------------------------------------------------------------------------| 
    533533      !  3) Add frazil ice growing in leads. 
     
    536536      CALL lim_var_glo2eqv    ! only for info 
    537537       
     538      ! conservation test 
     539      IF( ln_limdiahsb ) CALL lim_cons_hsm(1, 'limthd_lac', zvi_b, zsmv_b, zei_b, zfw_b, zfs_b, zft_b) 
     540 
    538541      IF(ln_ctl) THEN   ! Control print 
    539542         CALL prt_ctl_info(' ') 
    540543         CALL prt_ctl_info(' - Cell values : ') 
    541544         CALL prt_ctl_info('   ~~~~~~~~~~~~~ ') 
    542          CALL prt_ctl(tab2d_1=area , clinfo1=' lim_itd_th  : cell area :') 
     545         CALL prt_ctl(tab2d_1=e12t , clinfo1=' lim_itd_th  : cell area :') 
    543546         CALL prt_ctl(tab2d_1=at_i , clinfo1=' lim_itd_th  : at_i      :') 
    544547         CALL prt_ctl(tab2d_1=vt_i , clinfo1=' lim_itd_th  : vt_i      :') 
     
    568571      ENDIF 
    569572      ! 
    570       ! conservation test 
    571       IF( ln_limdiahsb ) CALL lim_cons_hsm(1, 'limthd', zvi_b, zsmv_b, zei_b, zfw_b, zfs_b, zft_b) 
    572  
    573573      IF( nn_timing == 1 )  CALL timing_stop('limthd') 
    574574 
     
    614614      !!                          ( dA = A/2h dh ) 
    615615      !!----------------------------------------------------------------------- 
    616       INTEGER, INTENT(in) ::   kideb, kiut   ! bounds for the spatial loop 
    617       INTEGER             ::   ji            ! dummy loop indices 
    618       REAL(wp)            ::   zhi_bef       ! ice thickness before thermo 
    619       REAL(wp)            ::   zdh_mel       ! net melting 
     616      INTEGER, INTENT(in) ::   kideb, kiut        ! bounds for the spatial loop 
     617      INTEGER             ::   ji                 ! dummy loop indices 
     618      REAL(wp)            ::   zhi_bef            ! ice thickness before thermo 
     619      REAL(wp)            ::   zdh_mel, zda_mel   ! net melting 
     620      REAL(wp)            ::   zv                 ! ice volume  
    620621 
    621622      DO ji = kideb, kiut 
    622          zhi_bef = ht_i_1d(ji) - ( dh_i_surf(ji) + dh_i_bott(ji) + dh_snowice(ji) ) 
    623          zdh_mel = MIN( 0._wp,     dh_i_surf(ji) + dh_i_bott(ji) + dh_snowice(ji) ) 
    624          IF( zdh_mel < 0._wp )   & 
    625             &   a_i_1d(ji) = MAX( 0._wp, a_i_1d(ji) + a_i_1d(ji) * zdh_mel / ( 2._wp * MAX( zhi_bef, epsi10 ) ) )  
     623         zdh_mel = MIN( 0._wp, dh_i_surf(ji) + dh_i_bott(ji) + dh_snowice(ji) ) 
     624         IF( zdh_mel < 0._wp )  THEN 
     625            zv         = a_i_1d(ji) * ht_i_1d(ji) 
     626            ! lateral melting = concentration change 
     627            zhi_bef     = ht_i_1d(ji) - zdh_mel 
     628            zda_mel     =  a_i_1d(ji) * zdh_mel / ( 2._wp * MAX( zhi_bef, epsi10 ) ) 
     629            a_i_1d(ji)  = MAX( 0._wp, a_i_1d(ji) + zda_mel )  
     630            ! adjust thickness 
     631            rswitch     = 1._wp - MAX( 0._wp , SIGN( 1._wp , - a_i_1d(ji) + epsi20 ) ) 
     632            ht_i_1d(ji) = rswitch * zv / MAX( a_i_1d(ji), epsi20 ) 
     633            ! adjust thickness 
     634            at_i_1d(ji) = a_i_1d(ji) 
     635         END IF 
    626636      END DO 
    627       at_i_1d(:) = a_i_1d(:) 
    628637       
    629638   END SUBROUTINE lim_thd_lam 
     
    665674      IF ( ( jpl > 1 ) .AND. ( nn_monocat == 1 ) ) THEN  
    666675         nn_monocat = 0 
    667          WRITE(numout, *) ' nn_monocat must be 0 in multi-category case ' 
     676         IF(lwp) WRITE(numout, *) '  nn_monocat must be 0 in multi-category case ' 
    668677      ENDIF 
    669678 
Note: See TracChangeset for help on using the changeset viewer.