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 13589 for NEMO/releases/r4.0/r4.0-HEAD/src/ICE/icethd.F90 – NEMO

Ignore:
Timestamp:
2020-10-14T15:35:49+02:00 (4 years ago)
Author:
clem
Message:

4.0-HEAD: rewrite heat budget of sea ice to make it perfectly conservative by construction. Also, activating ln_icediachk now gives an ascii file (icedrift_diagnostics.ascii) containing mass, salt and heat global conservation issues (if any). In addition, 2D drift files can be outputed (icedrift_mass...) but since I did not want to change the xml files, one has to uncomment some lines in icectl.F90 and add the corresponding fields in field_def_oce.xml

File:
1 edited

Legend:

Unmodified
Added
Removed
  • NEMO/releases/r4.0/r4.0-HEAD/src/ICE/icethd.F90

    r13284 r13589  
    1818   USE ice            ! sea-ice: variables 
    1919!!gm list trop longue ==>>> why not passage en argument d'appel ? 
    20    USE sbc_oce , ONLY : sss_m, sst_m, e3t_m, utau, vtau, ssu_m, ssv_m, frq_m, qns_tot, qsr_tot, sprecip, ln_cpl 
     20   USE sbc_oce , ONLY : sss_m, sst_m, e3t_m, utau, vtau, ssu_m, ssv_m, frq_m, sprecip, ln_cpl 
    2121   USE sbc_ice , ONLY : qsr_oce, qns_oce, qemp_oce, qsr_ice, qns_ice, dqns_ice, evap_ice, qprec_ice, qevap_ice, & 
    2222      &                 qml_ice, qcn_ice, qtr_ice_top 
     
    5252   LOGICAL ::   ln_icedO         ! activate ice growth in open-water (T) or not (F) 
    5353   LOGICAL ::   ln_icedS         ! activate gravity drainage and flushing (T) or not (F) 
    54    LOGICAL ::   ln_leadhfx       !  heat in the leads is used to melt sea-ice before warming the ocean 
     54   LOGICAL ::   ln_leadhfx       ! heat in the leads is used to melt sea-ice before warming the ocean 
    5555 
    5656   !! for convergence tests 
     
    9191      ! 
    9292      INTEGER  :: ji, jj, jk, jl   ! dummy loop indices 
    93       REAL(wp) :: zfric_u, zqld, zqfr, zqfr_neg 
    94       REAL(wp), PARAMETER :: zfric_umin = 0._wp           ! lower bound for the friction velocity (cice value=5.e-04) 
    95       REAL(wp), PARAMETER :: zch        = 0.0057_wp       ! heat transfer coefficient 
    96       REAL(wp), DIMENSION(jpi,jpj) ::   zu_io, zv_io, zfric   ! ice-ocean velocity (m/s) and frictional velocity (m2/s2) 
     93      REAL(wp) :: zfric_u, zqld, zqfr, zqfr_neg, zqfr_pos 
     94      REAL(wp), PARAMETER :: zfric_umin = 0._wp       ! lower bound for the friction velocity (cice value=5.e-04) 
     95      REAL(wp), PARAMETER :: zch        = 0.0057_wp   ! heat transfer coefficient 
     96      REAL(wp), DIMENSION(jpi,jpj) ::   zu_io, zv_io, zfric, zvel   ! ice-ocean velocity (m/s) and frictional velocity (m2/s2) 
    9797      ! 
    9898      !!------------------------------------------------------------------- 
     
    125125                  &                    (  zu_io(ji,jj) * zu_io(ji,jj) + zu_io(ji-1,jj) * zu_io(ji-1,jj)   & 
    126126                  &                     + zv_io(ji,jj) * zv_io(ji,jj) + zv_io(ji,jj-1) * zv_io(ji,jj-1) ) ) * tmask(ji,jj,1) 
     127               zvel(ji,jj) = 0.5_wp * SQRT( ( u_ice(ji-1,jj) + u_ice(ji,jj) ) * ( u_ice(ji-1,jj) + u_ice(ji,jj) ) + & 
     128                  &                         ( v_ice(ji,jj-1) + v_ice(ji,jj) ) * ( v_ice(ji,jj-1) + v_ice(ji,jj) ) ) 
    127129            END DO 
    128130         END DO 
    129       ELSE      !  if no ice dynamics => transmit directly the atmospheric stress to the ocean 
     131      ELSE      !  if no ice dynamics => transfer directly the atmospheric stress to the ocean 
    130132         DO jj = 2, jpjm1 
    131133            DO ji = fs_2, fs_jpim1 
     
    133135                  &                         (  utau(ji,jj) * utau(ji,jj) + utau(ji-1,jj) * utau(ji-1,jj)   & 
    134136                  &                          + vtau(ji,jj) * vtau(ji,jj) + vtau(ji,jj-1) * vtau(ji,jj-1) ) ) * tmask(ji,jj,1) 
     137               zvel(ji,jj) = 0._wp 
    135138            END DO 
    136139         END DO 
    137140      ENDIF 
    138       CALL lbc_lnk( 'icethd', zfric, 'T',  1. ) 
     141      CALL lbc_lnk_multi( 'icethd', zfric, 'T',  1._wp, zvel, 'T', 1._wp ) 
    139142      ! 
    140143      !--------------------------------------------------------------------! 
     
    145148            rswitch  = tmask(ji,jj,1) * MAX( 0._wp , SIGN( 1._wp , at_i(ji,jj) - epsi10 ) ) ! 0 if no ice 
    146149            ! 
    147             !           !  solar irradiance transmission at the mixed layer bottom and used in the lead heat budget 
    148             !           !  practically no "direct lateral ablation" 
    149             !            
    150             !           !  net downward heat flux from the ice to the ocean, expressed as a function of ocean  
    151             !           !  temperature and turbulent mixing (McPhee, 1992) 
    152             ! 
    153150            ! --- Energy received in the lead from atm-oce exchanges, zqld is defined everywhere (J.m-2) --- ! 
    154151            zqld =  tmask(ji,jj,1) * rdt_ice *  & 
     
    156153               &      ( 1._wp - at_i_b(ji,jj) ) * qns_oce(ji,jj) + qemp_oce(ji,jj) ) 
    157154 
    158             ! --- Energy needed to bring ocean surface layer until its freezing (mostly<0 but >0 if supercooling, J.m-2) --- ! 
     155            ! --- Energy needed to bring ocean surface layer until its freezing, zqfr is defined everywhere (J.m-2) --- ! 
     156            !     (mostly<0 but >0 if supercooling) 
    159157            zqfr     = rau0 * rcp * e3t_m(ji,jj) * ( t_bo(ji,jj) - ( sst_m(ji,jj) + rt0 ) ) * tmask(ji,jj,1)  ! both < 0 (t_bo < sst) and > 0 (t_bo > sst) 
    160158            zqfr_neg = MIN( zqfr , 0._wp )                                                                    ! only < 0 
    161  
    162             ! --- Sensible ocean-to-ice heat flux (mostly>0 but <0 if supercooling, W/m2) 
     159            zqfr_pos = MAX( zqfr , 0._wp )                                                                    ! only > 0 
     160 
     161            ! --- Sensible ocean-to-ice heat flux (W/m2) --- ! 
     162            !     (mostly>0 but <0 if supercooling) 
    163163            zfric_u            = MAX( SQRT( zfric(ji,jj) ), zfric_umin )  
    164             qsb_ice_bot(ji,jj) = rswitch * rau0 * rcp * zch * zfric_u * ( ( sst_m(ji,jj) + rt0 ) - t_bo(ji,jj) ) ! W.m-2 
    165  
    166             qsb_ice_bot(ji,jj) = rswitch * MIN( qsb_ice_bot(ji,jj), - zqfr_neg * r1_rdtice / MAX( at_i(ji,jj), epsi10 ) ) 
     164            qsb_ice_bot(ji,jj) = rswitch * rau0 * rcp * zch * zfric_u * ( ( sst_m(ji,jj) + rt0 ) - t_bo(ji,jj) ) 
     165 
    167166            ! upper bound for qsb_ice_bot: the heat retrieved from the ocean must be smaller than the heat necessary to reach  
    168167            !                              the freezing point, so that we do not have SST < T_freeze 
    169             !                              This implies: - ( qsb_ice_bot(ji,jj) * at_i(ji,jj) * rtdice ) - zqfr >= 0 
    170  
    171             !-- Energy Budget of the leads (J.m-2), source of ice growth in open water. Must be < 0 to form ice 
    172             qlead(ji,jj) = MIN( 0._wp , zqld - ( qsb_ice_bot(ji,jj) * at_i(ji,jj) * rdt_ice ) - zqfr ) 
    173  
    174             ! If there is ice and leads are warming => transfer energy from the lead budget and use it for bottom melting  
    175             ! If the grid cell is fully covered by ice (no leads) => transfer energy from the lead budget to the ice bottom budget 
    176             IF( ( zqld >= 0._wp .AND. at_i(ji,jj) > 0._wp ) .OR. at_i(ji,jj) >= (1._wp - epsi10) ) THEN 
    177                IF( ln_leadhfx ) THEN   ;   fhld(ji,jj) = rswitch * zqld * r1_rdtice / MAX( at_i(ji,jj), epsi10 ) ! divided by at_i since this is (re)multiplied by a_i in icethd_dh.F90 
    178                ELSE                    ;   fhld(ji,jj) = 0._wp 
    179                ENDIF 
     168            !                              This implies: qsb_ice_bot(ji,jj) * at_i(ji,jj) * rtdice <= - zqfr_neg 
     169            !                              The following formulation is ok for both normal conditions and supercooling 
     170            qsb_ice_bot(ji,jj) = rswitch * MIN( qsb_ice_bot(ji,jj), - zqfr_neg * r1_rdtice / MAX( at_i(ji,jj), epsi10 ) ) 
     171 
     172            ! --- Energy Budget of the leads (qlead, J.m-2) --- ! 
     173            !     qlead is the energy received from the atm. in the leads. 
     174            !     If warming (zqld >= 0), then the energy in the leads is used to melt ice (bottom melting) => fhld  (W/m2) 
     175            !     If cooling (zqld <  0), then the energy in the leads is used to grow ice in open water    => qlead (J.m-2) 
     176            IF( zqld >= 0._wp .AND. at_i(ji,jj) > 0._wp ) THEN 
     177               ! upper bound for fhld: fhld should be equal to zqld 
     178               !                        but we have to make sure that this heat will not make the sst drop below the freezing point 
     179               !                        so the max heat that can be pulled out of the ocean is zqld - qsb - zqfr_pos 
     180               !                        The following formulation is ok for both normal conditions and supercooling 
     181               fhld (ji,jj) = rswitch * MAX( 0._wp, ( zqld - zqfr_pos ) * r1_rdtice / MAX( at_i(ji,jj), epsi10 ) &  ! divided by at_i since this is (re)multiplied by a_i in icethd_dh.F90 
     182                  &                                 - qsb_ice_bot(ji,jj) ) 
    180183               qlead(ji,jj) = 0._wp 
    181184            ELSE 
    182185               fhld (ji,jj) = 0._wp 
     186               ! upper bound for qlead: qlead should be equal to zqld 
     187               !                        but before using this heat for ice formation, we suppose that the ocean cools down till the freezing point. 
     188               !                        The energy for this cooling down is zqfr. Also some heat will be removed from the ocean from turbulent fluxes (qsb) 
     189               !                        and freezing point is reached if zqfr = zqld - qsb*a/dt 
     190               !                        so the max heat that can be pulled out of the ocean is zqld - qsb - zqfr 
     191               !                        The following formulation is ok for both normal conditions and supercooling 
     192               qlead(ji,jj) = MIN( 0._wp , zqld - ( qsb_ice_bot(ji,jj) * at_i(ji,jj) * rdt_ice ) - zqfr ) 
    183193            ENDIF 
    184194            ! 
    185             ! Net heat flux on top of the ice-ocean [W.m-2] 
    186             ! --------------------------------------------- 
    187             qt_atm_oi(ji,jj) = qns_tot(ji,jj) + qsr_tot(ji,jj)  
     195            ! If ice is landfast and ice concentration reaches its max 
     196            ! => stop ice formation in open water 
     197            IF(  zvel(ji,jj) <= 5.e-04_wp .AND. at_i(ji,jj) >= rn_amax_2d(ji,jj)-epsi06 )   qlead(ji,jj) = 0._wp 
     198            ! 
     199            ! If the grid cell is almost fully covered by ice (no leads) 
     200            ! => stop ice formation in open water 
     201            IF( at_i(ji,jj) >= (1._wp - epsi10) )   qlead(ji,jj) = 0._wp 
     202            ! 
     203            ! If ln_leadhfx is false 
     204            ! => do not use energy of the leads to melt sea-ice 
     205            IF( .NOT.ln_leadhfx )   fhld(ji,jj) = 0._wp 
     206            ! 
    188207         END DO 
    189208      END DO 
     
    197216      ENDIF 
    198217 
    199       ! --------------------------------------------------------------------- 
    200       ! Net heat flux on top of the ocean after ice thermo (1st step) [W.m-2] 
    201       ! --------------------------------------------------------------------- 
    202       !     First  step here              :  non solar + precip - qlead - qsensible 
    203       !     Second step in icethd_dh      :  heat remaining if total melt (zq_rema)  
    204       !     Third  step in iceupdate.F90  :  heat from ice-ocean mass exchange (zf_mass) + solar 
    205       qt_oce_ai(:,:) = ( 1._wp - at_i_b(:,:) ) * qns_oce(:,:) + qemp_oce(:,:)  &  ! Non solar heat flux received by the ocean                
    206          &             - qlead(:,:) * r1_rdtice                                &  ! heat flux taken from the ocean where there is open water ice formation 
    207          &             - at_i (:,:) * qsb_ice_bot(:,:)                         &  ! heat flux taken by sensible flux 
    208          &             - at_i (:,:) * fhld       (:,:)                            ! heat flux taken during bottom growth/melt  
    209       !                                                                           !    (fhld should be 0 while bott growth) 
    210218      !-------------------------------------------------------------------------------------------! 
    211219      ! Thermodynamic computation (only on grid points covered by ice) => loop over ice categories 
     
    425433         CALL tab_2d_1d( npti, nptidx(1:npti), hfx_res_1d    (1:npti), hfx_res       ) 
    426434         CALL tab_2d_1d( npti, nptidx(1:npti), hfx_err_dif_1d(1:npti), hfx_err_dif   ) 
    427          CALL tab_2d_1d( npti, nptidx(1:npti), qt_oce_ai_1d  (1:npti), qt_oce_ai     ) 
    428435         ! 
    429436         ! ocean surface fields 
     
    517524         CALL tab_1d_2d( npti, nptidx(1:npti), hfx_res_1d    (1:npti), hfx_res     ) 
    518525         CALL tab_1d_2d( npti, nptidx(1:npti), hfx_err_dif_1d(1:npti), hfx_err_dif ) 
    519          CALL tab_1d_2d( npti, nptidx(1:npti), qt_oce_ai_1d  (1:npti), qt_oce_ai   ) 
    520526         ! 
    521527         CALL tab_1d_2d( npti, nptidx(1:npti), qns_ice_1d    (1:npti), qns_ice    (:,:,kl) ) 
Note: See TracChangeset for help on using the changeset viewer.