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/icethd.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/icethd.F90

    r14005 r14072  
    6969   SUBROUTINE ice_thd( kt ) 
    7070      !!------------------------------------------------------------------- 
    71       !!                ***  ROUTINE ice_thd  ***        
    72       !!   
     71      !!                ***  ROUTINE ice_thd  *** 
     72      !! 
    7373      !! ** Purpose : This routine manages ice thermodynamics 
    74       !!          
     74      !! 
    7575      !! ** Action : - computation of oceanic sensible heat flux at the ice base 
    7676      !!                              energy budget in the leads 
     
    114114         ztice_cvgerr = 0._wp ; ztice_cvgstp = 0._wp 
    115115      ENDIF 
    116        
     116 
    117117      !---------------------------------------------! 
    118118      ! computation of friction velocity at T points 
     
    157157         ! --- Sensible ocean-to-ice heat flux (W/m2) --- ! 
    158158         !     (mostly>0 but <0 if supercooling) 
    159          zfric_u            = MAX( SQRT( zfric(ji,jj) ), zfric_umin )  
     159         zfric_u            = MAX( SQRT( zfric(ji,jj) ), zfric_umin ) 
    160160         qsb_ice_bot(ji,jj) = rswitch * rho0 * rcp * zch * zfric_u * ( ( sst_m(ji,jj) + rt0 ) - t_bo(ji,jj) ) 
    161           
    162          ! upper bound for qsb_ice_bot: the heat retrieved from the ocean must be smaller than the heat necessary to reach  
     161 
     162         ! upper bound for qsb_ice_bot: the heat retrieved from the ocean must be smaller than the heat necessary to reach 
    163163         !                              the freezing point, so that we do not have SST < T_freeze 
    164164         !                              This implies: qsb_ice_bot(ji,jj) * at_i(ji,jj) * rtdice <= - zqfr_neg 
     
    210210         ! 
    211211      END_2D 
    212        
     212 
    213213      ! In case we bypass open-water ice formation 
    214214      IF( .NOT. ln_icedO )  qlead(:,:) = 0._wp 
     
    227227         npti = 0 ; nptidx(:) = 0 
    228228         DO_2D( 1, 1, 1, 1 ) 
    229             IF ( a_i(ji,jj,jl) > epsi10 ) THEN      
     229            IF ( a_i(ji,jj,jl) > epsi10 ) THEN 
    230230               npti         = npti  + 1 
    231231               nptidx(npti) = (jj - 1) * jpi + ji 
     
    234234 
    235235         IF( npti > 0 ) THEN  ! If there is no ice, do nothing. 
    236             !                                                                 
     236            ! 
    237237                              CALL ice_thd_1d2d( jl, 1 )            ! --- Move to 1D arrays --- ! 
    238238            !                                                       ! --- & Change units of e_i, e_s from J/m2 to J/m3 --- ! 
    239239            ! 
    240             s_i_new   (1:npti) = 0._wp ; dh_s_tot(1:npti) = 0._wp   ! --- some init --- !  (important to have them here)  
    241             dh_i_sum  (1:npti) = 0._wp ; dh_i_bom(1:npti) = 0._wp ; dh_i_itm  (1:npti) = 0._wp  
     240            s_i_new   (1:npti) = 0._wp ; dh_s_tot(1:npti) = 0._wp   ! --- some init --- !  (important to have them here) 
     241            dh_i_sum  (1:npti) = 0._wp ; dh_i_bom(1:npti) = 0._wp ; dh_i_itm  (1:npti) = 0._wp 
    242242            dh_i_sub  (1:npti) = 0._wp ; dh_i_bog(1:npti) = 0._wp 
    243243            dh_snowice(1:npti) = 0._wp ; dh_s_mlt(1:npti) = 0._wp 
    244             !                                       
     244            ! 
    245245                              CALL ice_thd_zdf                      ! --- Ice-Snow temperature --- ! 
    246246            ! 
    247247            IF( ln_icedH ) THEN                                     ! --- Growing/Melting --- ! 
    248                               CALL ice_thd_dh                           ! Ice-Snow thickness    
     248                              CALL ice_thd_dh                           ! Ice-Snow thickness 
    249249                              CALL ice_thd_ent( e_i_1d(1:npti,:) )      ! Ice enthalpy remapping 
    250250            ENDIF 
    251                               CALL ice_thd_sal( ln_icedS )          ! --- Ice salinity --- !     
     251                              CALL ice_thd_sal( ln_icedS )          ! --- Ice salinity --- ! 
    252252            ! 
    253253                              CALL ice_thd_temp                     ! --- Temperature update --- ! 
     
    266266      IF( ln_icediachk )   CALL ice_cons_hsm(1, 'icethd', rdiag_v, rdiag_s, rdiag_t, rdiag_fv, rdiag_fs, rdiag_ft) 
    267267      IF( ln_icediachk )   CALL ice_cons2D  (1, 'icethd',  diag_v,  diag_s,  diag_t,  diag_fv,  diag_fs,  diag_ft) 
    268       !                    
     268      ! 
    269269      IF ( ln_pnd .AND. ln_icedH ) & 
    270          &                    CALL ice_thd_pnd                      ! --- Melt ponds  
     270         &                    CALL ice_thd_pnd                      ! --- Melt ponds 
    271271      ! 
    272272      IF( jpl > 1  )          CALL ice_itd_rem( kt )                ! --- Transport ice between thickness categories --- ! 
     
    276276                              CALL ice_cor( kt , 2 )                ! --- Corrections --- ! 
    277277      ! 
    278       oa_i(:,:,:) = oa_i(:,:,:) + a_i(:,:,:) * rDt_ice              ! ice natural aging incrementation      
     278      oa_i(:,:,:) = oa_i(:,:,:) + a_i(:,:,:) * rDt_ice              ! ice natural aging incrementation 
    279279      ! 
    280280      ! convergence tests 
     
    290290      IF( ln_timing )   CALL timing_stop('icethd')                                        ! timing 
    291291      ! 
    292    END SUBROUTINE ice_thd  
    293  
    294   
     292   END SUBROUTINE ice_thd 
     293 
     294 
    295295   SUBROUTINE ice_thd_temp 
    296296      !!----------------------------------------------------------------------- 
    297       !!                   ***  ROUTINE ice_thd_temp ***  
    298       !!                  
     297      !!                   ***  ROUTINE ice_thd_temp *** 
     298      !! 
    299299      !! ** Purpose :   Computes sea ice temperature (Kelvin) from enthalpy 
    300300      !! 
     
    302302      !!------------------------------------------------------------------- 
    303303      INTEGER  ::   ji, jk   ! dummy loop indices 
    304       REAL(wp) ::   ztmelts, zbbb, zccc  ! local scalar  
     304      REAL(wp) ::   ztmelts, zbbb, zccc  ! local scalar 
    305305      !!------------------------------------------------------------------- 
    306306      ! Recover ice temperature 
     
    312312            zccc          = SQRT( MAX( zbbb * zbbb - 4._wp * rcpi * rLfus * ztmelts, 0._wp ) ) 
    313313            t_i_1d(ji,jk) = rt0 - ( zbbb + zccc ) * 0.5_wp * r1_rcpi 
    314              
     314 
    315315            ! mask temperature 
    316             rswitch       = 1._wp - MAX( 0._wp , SIGN( 1._wp , - h_i_1d(ji) ) )  
     316            rswitch       = 1._wp - MAX( 0._wp , SIGN( 1._wp , - h_i_1d(ji) ) ) 
    317317            t_i_1d(ji,jk) = rswitch * t_i_1d(ji,jk) + ( 1._wp - rswitch ) * rt0 
    318          END DO  
    319       END DO  
     318         END DO 
     319      END DO 
    320320      ! 
    321321   END SUBROUTINE ice_thd_temp 
     
    324324   SUBROUTINE ice_thd_mono 
    325325      !!----------------------------------------------------------------------- 
    326       !!                   ***  ROUTINE ice_thd_mono ***  
    327       !!                  
     326      !!                   ***  ROUTINE ice_thd_mono *** 
     327      !! 
    328328      !! ** Purpose :   Lateral melting in case virtual_itd 
    329329      !!                          ( dA = A/2h dh ) 
     
    332332      REAL(wp) ::   zhi_bef            ! ice thickness before thermo 
    333333      REAL(wp) ::   zdh_mel, zda_mel   ! net melting 
    334       REAL(wp) ::   zvi, zvs           ! ice/snow volumes  
     334      REAL(wp) ::   zvi, zvs           ! ice/snow volumes 
    335335      !!----------------------------------------------------------------------- 
    336336      ! 
     
    344344            rswitch     = MAX( 0._wp , SIGN( 1._wp , zhi_bef - epsi20 ) ) 
    345345            zda_mel     = rswitch * a_i_1d(ji) * zdh_mel / ( 2._wp * MAX( zhi_bef, epsi20 ) ) 
    346             a_i_1d(ji)  = MAX( epsi20, a_i_1d(ji) + zda_mel )  
     346            a_i_1d(ji)  = MAX( epsi20, a_i_1d(ji) + zda_mel ) 
    347347            ! adjust thickness 
    348             h_i_1d(ji) = zvi / a_i_1d(ji)             
    349             h_s_1d(ji) = zvs / a_i_1d(ji)             
     348            h_i_1d(ji) = zvi / a_i_1d(ji) 
     349            h_s_1d(ji) = zvs / a_i_1d(ji) 
    350350            ! retrieve total concentration 
    351351            at_i_1d(ji) = a_i_1d(ji) 
     
    358358   SUBROUTINE ice_thd_1d2d( kl, kn ) 
    359359      !!----------------------------------------------------------------------- 
    360       !!                   ***  ROUTINE ice_thd_1d2d ***  
    361       !!                  
     360      !!                   ***  ROUTINE ice_thd_1d2d *** 
     361      !! 
    362362      !! ** Purpose :   move arrays from 1d to 2d and the reverse 
    363363      !!----------------------------------------------------------------------- 
    364       INTEGER, INTENT(in) ::   kl   ! index of the ice category  
     364      INTEGER, INTENT(in) ::   kl   ! index of the ice category 
    365365      INTEGER, INTENT(in) ::   kn   ! 1= from 2D to 1D   ;   2= from 1D to 2D 
    366366      ! 
     
    394394         CALL tab_2d_1d( npti, nptidx(1:npti), dqns_ice_1d   (1:npti), dqns_ice(:,:,kl)     ) 
    395395         CALL tab_2d_1d( npti, nptidx(1:npti), t_bo_1d       (1:npti), t_bo                 ) 
    396          CALL tab_2d_1d( npti, nptidx(1:npti), sprecip_1d    (1:npti), sprecip              )  
     396         CALL tab_2d_1d( npti, nptidx(1:npti), sprecip_1d    (1:npti), sprecip              ) 
    397397         CALL tab_2d_1d( npti, nptidx(1:npti), qsb_ice_bot_1d(1:npti), qsb_ice_bot          ) 
    398398         CALL tab_2d_1d( npti, nptidx(1:npti), fhld_1d       (1:npti), fhld                 ) 
    399           
     399 
    400400         CALL tab_2d_1d( npti, nptidx(1:npti), qml_ice_1d    (1:npti), qml_ice    (:,:,kl) ) 
    401401         CALL tab_2d_1d( npti, nptidx(1:npti), qcn_ice_1d    (1:npti), qcn_ice    (:,:,kl) ) 
     
    471471         sv_i_1d(1:npti) = s_i_1d (1:npti) * v_i_1d (1:npti) 
    472472         oa_i_1d(1:npti) = o_i_1d (1:npti) * a_i_1d (1:npti) 
    473           
     473 
    474474         CALL tab_1d_2d( npti, nptidx(1:npti), at_i_1d(1:npti), at_i             ) 
    475475         CALL tab_1d_2d( npti, nptidx(1:npti), a_i_1d (1:npti), a_i (:,:,kl)     ) 
     
    532532         CALL tab_1d_2d( npti, nptidx(1:npti), dh_i_sum  (1:npti) , dh_i_sum_2d(:,:,kl) ) 
    533533         CALL tab_1d_2d( npti, nptidx(1:npti), dh_s_mlt  (1:npti) , dh_s_mlt_2d(:,:,kl) ) 
    534          ! SIMIP diagnostics          
     534         ! SIMIP diagnostics 
    535535         CALL tab_1d_2d( npti, nptidx(1:npti), t_si_1d       (1:npti), t_si       (:,:,kl) ) 
    536536         CALL tab_1d_2d( npti, nptidx(1:npti), qcn_ice_bot_1d(1:npti), qcn_ice_bot(:,:,kl) ) 
     
    554554   SUBROUTINE ice_thd_init 
    555555      !!------------------------------------------------------------------- 
    556       !!                   ***  ROUTINE ice_thd_init ***  
    557       !!                  
     556      !!                   ***  ROUTINE ice_thd_init *** 
     557      !! 
    558558      !! ** Purpose :   Physical constants and parameters associated with 
    559559      !!                ice thermodynamics 
Note: See TracChangeset for help on using the changeset viewer.