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.
limthd.F90 in branches/2017/dev_r8183_ICEMODEL/NEMOGCM/NEMO/LIM_SRC_3 – NEMO

source: branches/2017/dev_r8183_ICEMODEL/NEMOGCM/NEMO/LIM_SRC_3/limthd.F90 @ 8411

Last change on this file since 8411 was 8411, checked in by clem, 7 years ago

continue changing names

  • Property svn:keywords set to Id
File size: 35.5 KB
RevLine 
[825]1MODULE limthd
2   !!======================================================================
3   !!                  ***  MODULE limthd   ***
[1572]4   !!  LIM-3 :   ice thermodynamic
[825]5   !!======================================================================
[1572]6   !! History :  LIM  ! 2000-01 (M.A. Morales Maqueda, H. Goosse, T. Fichefet) LIM-1
7   !!            2.0  ! 2002-07 (C. Ethe, G. Madec)  LIM-2 (F90 rewriting)
8   !!            3.0  ! 2005-11 (M. Vancoppenolle)  LIM-3 : Multi-layer thermodynamics + salinity variations
[2528]9   !!             -   ! 2007-04 (M. Vancoppenolle) add lim_thd_glohec, lim_thd_con_dh and lim_thd_con_dif
[4688]10   !!            3.2  ! 2009-07 (M. Vancoppenolle, Y. Aksenov, G. Madec) bug correction in wfx_snw
[2528]11   !!            3.3  ! 2010-11 (G. Madec) corrected snow melting heat (due to factor betas)
[2715]12   !!            4.0  ! 2011-02 (G. Madec) dynamical allocation
[4161]13   !!             -   ! 2012-05 (C. Rousset) add penetration solar flux
[1572]14   !!----------------------------------------------------------------------
[825]15#if defined key_lim3
16   !!----------------------------------------------------------------------
[834]17   !!   'key_lim3'                                      LIM3 sea-ice model
[825]18   !!----------------------------------------------------------------------
[3625]19   !!   lim_thd       : thermodynamic of sea ice
20   !!   lim_thd_init  : initialisation of sea-ice thermodynamic
[825]21   !!----------------------------------------------------------------------
[3625]22   USE phycst         ! physical constants
23   USE dom_oce        ! ocean space and time domain variables
[7646]24   USE ice            ! sea-ice variables
[8326]25   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
[8321]26   USE sbc_ice , ONLY : qsr_oce, qns_oce, qemp_oce, qsr_ice, qns_ice, dqns_ice, evap_ice, qprec_ice, qevap_ice, &
27      &                 fr1_i0, fr2_i0, nn_limflx
[7646]28   USE thd_ice        ! thermodynamic sea-ice variables
29   USE limthd_dif     ! vertical diffusion
30   USE limthd_dh      ! ice-snow growth and melt
31   USE limthd_da      ! lateral melting
32   USE limthd_sal     ! ice salinity
33   USE limthd_ent     ! ice enthalpy redistribution
34   USE limthd_lac     ! lateral accretion
35   USE limitd_th      ! remapping thickness distribution
36   USE limtab         ! 1D <==> 2D transformation
37   USE limvar         !
[8411]38   USE icecons        ! conservation tests
39   USE icectl         ! control print
[6140]40   !
41   USE in_out_manager ! I/O manager
[3625]42   USE lbclnk         ! lateral boundary condition - MPP links
43   USE lib_mpp        ! MPP library
44   USE lib_fortran    ! Fortran utilities (allows no signed zero when 'key_nosignedzero' defined) 
[4161]45   USE timing         ! Timing
[825]46
47   IMPLICIT NONE
48   PRIVATE
49
[5407]50   PUBLIC   lim_thd         ! called by limstp module
[8321]51   PUBLIC   lim_thd_init    ! called by ice_init
[825]52
53   !! * Substitutions
54#  include "vectopt_loop_substitute.h90"
55   !!----------------------------------------------------------------------
[8326]56   !! NEMO/LIM3 4.0 , UCL - NEMO Consortium (2010)
[1156]57   !! $Id$
[2528]58   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
[825]59   !!----------------------------------------------------------------------
60CONTAINS
61
[921]62   SUBROUTINE lim_thd( kt )
[825]63      !!-------------------------------------------------------------------
64      !!                ***  ROUTINE lim_thd  ***       
65      !! 
[4990]66      !! ** Purpose : This routine manages ice thermodynamics
[825]67      !!         
68      !! ** Action : - Initialisation of some variables
69      !!             - Some preliminary computation (oceanic heat flux
70      !!               at the ice base, snow acc.,heat budget of the leads)
71      !!             - selection of the icy points and put them in an array
[4990]72      !!             - call lim_thd_dif  for vertical heat diffusion
73      !!             - call lim_thd_dh   for vertical ice growth and melt
74      !!             - call lim_thd_ent  for enthalpy remapping
75      !!             - call lim_thd_sal  for ice desalination
76      !!             - call lim_thd_temp to  retrieve temperature from ice enthalpy
[825]77      !!             - back to the geographic grid
78      !!     
[4990]79      !! ** References :
[1572]80      !!---------------------------------------------------------------------
[5123]81      INTEGER, INTENT(in) :: kt    ! number of iteration
[6140]82      !
[4688]83      INTEGER  :: ji, jj, jk, jl   ! dummy loop indices
[8239]84      REAL(wp) :: zfric_u, zqld, zqfr, zqfr_neg
[8379]85      REAL(wp) :: zvi_b, zsmv_b, zei_b, zfs_b, zfw_b, zft_b ! conservation check
[5202]86      REAL(wp), PARAMETER :: zfric_umin = 0._wp           ! lower bound for the friction velocity (cice value=5.e-04)
87      REAL(wp), PARAMETER :: zch        = 0.0057_wp       ! heat transfer coefficient
[8373]88      REAL(wp), DIMENSION(jpi,jpj) ::   zu_io, zv_io, zfric   ! ice-ocean velocity (m/s) and frictional velocity (m2/s2)
[7646]89      !
[825]90      !!-------------------------------------------------------------------
[4990]91
[6140]92      IF( nn_timing == 1 )   CALL timing_start('limthd')
[2715]93
[7646]94      IF( kt == nit000 .AND. lwp ) THEN
95         WRITE(numout,*)'' 
96         WRITE(numout,*)' lim_thd '
97         WRITE(numout,*)' ~~~~~~~~'
98      ENDIF
99     
[4688]100      ! conservation test
[8411]101      IF( ln_limdiachk ) CALL ice_cons_hsm(0, 'limthd', zvi_b, zsmv_b, zei_b, zfw_b, zfs_b, zft_b)
[4161]102
[5167]103      CALL lim_var_glo2eqv
[7646]104
105      !---------------------------------------------!
106      ! computation of friction velocity at T points
107      !---------------------------------------------!
108      IF( ln_limdyn ) THEN
[7753]109         zu_io(:,:) = u_ice(:,:) - ssu_m(:,:)
110         zv_io(:,:) = v_ice(:,:) - ssv_m(:,:)
[7646]111         DO jj = 2, jpjm1 
112            DO ji = fs_2, fs_jpim1
113               zfric(ji,jj) = rn_cio * ( 0.5_wp *  &
114                  &                    (  zu_io(ji,jj) * zu_io(ji,jj) + zu_io(ji-1,jj) * zu_io(ji-1,jj)   &
115                  &                     + zv_io(ji,jj) * zv_io(ji,jj) + zv_io(ji,jj-1) * zv_io(ji,jj-1) ) ) * tmask(ji,jj,1)
116            END DO
117         END DO
118      ELSE      !  if no ice dynamics => transmit directly the atmospheric stress to the ocean
119         DO jj = 2, jpjm1
120            DO ji = fs_2, fs_jpim1
121               zfric(ji,jj) = r1_rau0 * SQRT( 0.5_wp *  &
122                  &                         (  utau(ji,jj) * utau(ji,jj) + utau(ji-1,jj) * utau(ji-1,jj)   &
123                  &                          + vtau(ji,jj) * vtau(ji,jj) + vtau(ji,jj-1) * vtau(ji,jj-1) ) ) * tmask(ji,jj,1)
124            END DO
125         END DO
126      ENDIF
127      CALL lbc_lnk( zfric, 'T',  1. )
128      !
[8325]129      ftr_ice(:,:,:) = 0._wp  ! initialization (part of solar radiation transmitted through the ice)
[825]130
[7646]131      !--------------------------------------------------------------------!
132      ! Partial computation of forcing for the thermodynamic sea ice model
133      !--------------------------------------------------------------------!
[921]134      DO jj = 1, jpj
135         DO ji = 1, jpi
[5134]136            rswitch  = tmask(ji,jj,1) * MAX( 0._wp , SIGN( 1._wp , at_i(ji,jj) - epsi10 ) ) ! 0 if no ice
[2528]137            !
[921]138            !           !  solar irradiance transmission at the mixed layer bottom and used in the lead heat budget
139            !           !  practically no "direct lateral ablation"
140            !           
141            !           !  net downward heat flux from the ice to the ocean, expressed as a function of ocean
142            !           !  temperature and turbulent mixing (McPhee, 1992)
[4688]143            !
144            ! --- Energy received in the lead, zqld is defined everywhere (J.m-2) --- !
[5407]145            zqld =  tmask(ji,jj,1) * rdt_ice *  &
[8313]146               &    ( ( 1._wp - at_i_b(ji,jj) ) * qsr_oce(ji,jj) * frq_m(ji,jj) +  &
147               &      ( 1._wp - at_i_b(ji,jj) ) * qns_oce(ji,jj) + qemp_oce(ji,jj) )
[825]148
[5123]149            ! --- Energy needed to bring ocean surface layer until its freezing (<0, J.m-2) --- !
[8239]150            ! includes supercooling potential energy (>0) or "above-freezing" energy (<0)
[6140]151            zqfr = tmask(ji,jj,1) * rau0 * rcp * e3t_m(ji,jj) * ( t_bo(ji,jj) - ( sst_m(ji,jj) + rt0 ) )
[4688]152
[8239]153            ! --- Above-freezing sensible heat content (J/m2 grid)
154            zqfr_neg = tmask(ji,jj,1) * rau0 * rcp * e3t_m(ji,jj) * MIN( ( t_bo(ji,jj) - ( sst_m(ji,jj) + rt0 ) ), 0._wp )
155
156            ! --- Sensible ocean-to-ice heat flux (W/m2)
[7646]157            zfric_u      = MAX( SQRT( zfric(ji,jj) ), zfric_umin ) 
[8239]158            fhtur(ji,jj) = rswitch * rau0 * rcp * zch  * zfric_u * ( ( sst_m(ji,jj) + rt0 ) - t_bo(ji,jj) ) ! W.m-2
159
160            fhtur(ji,jj) = rswitch * MIN( fhtur(ji,jj), - zqfr_neg * r1_rdtice / MAX( at_i(ji,jj), epsi10 ) )
[5123]161            ! upper bound for fhtur: the heat retrieved from the ocean must be smaller than the heat necessary to reach
162            !                        the freezing point, so that we do not have SST < T_freeze
163            !                        This implies: - ( fhtur(ji,jj) * at_i(ji,jj) * rtdice ) - zqfr >= 0
164
[8239]165            !-- Energy Budget of the leads (J.m-2), source of lateral accretion. Must be < 0 to form ice
[5123]166            qlead(ji,jj) = MIN( 0._wp , zqld - ( fhtur(ji,jj) * at_i(ji,jj) * rdt_ice ) - zqfr )
[4688]167
168            ! If there is ice and leads are warming, then transfer energy from the lead budget and use it for bottom melting
[5123]169            IF( zqld > 0._wp ) THEN
170               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 limthd_dh.F90
[4688]171               qlead(ji,jj) = 0._wp
[4990]172            ELSE
173               fhld (ji,jj) = 0._wp
[4688]174            ENDIF
[2528]175            !
[7646]176            ! Net heat flux on top of the ice-ocean [W.m-2]
177            ! ---------------------------------------------
[5407]178            hfx_in(ji,jj) = qns_tot(ji,jj) + qsr_tot(ji,jj) 
[7646]179         END DO
180      END DO
181     
182      ! In case we bypass open-water ice formation
[7753]183      IF( .NOT. ln_limdO )  qlead(:,:) = 0._wp
[7646]184      ! In case we bypass growing/melting from top and bottom: we suppose ice is impermeable => ocean is isolated from atmosphere
[8313]185      IF( .NOT. ln_limdH )  hfx_in(:,:) = ( 1._wp - at_i_b(:,:) ) * ( qns_oce(:,:) + qsr_oce(:,:) ) + qemp_oce(:,:)
[7753]186      IF( .NOT. ln_limdH )  fhtur (:,:) = 0._wp  ;  fhld  (:,:) = 0._wp
[4688]187
[7646]188      ! ---------------------------------------------------------------------
189      ! Net heat flux on top of the ocean after ice thermo (1st step) [W.m-2]
190      ! ---------------------------------------------------------------------
191      !     First  step here              :  non solar + precip - qlead - qturb
192      !     Second step in limthd_dh      :  heat remaining if total melt (zq_rema)
193      !     Third  step in limsbc         :  heat from ice-ocean mass exchange (zf_mass) + solar
194      DO jj = 1, jpj
195         DO ji = 1, jpi
[8313]196            hfx_out(ji,jj) = ( 1._wp - at_i_b(ji,jj) ) * qns_oce(ji,jj) + qemp_oce(ji,jj)  &  ! Non solar heat flux received by the ocean               
197               &             - qlead(ji,jj) * r1_rdtice                                    &  ! heat flux taken from the ocean where there is open water ice formation
198               &             - at_i(ji,jj) * fhtur(ji,jj)                                  &  ! heat flux taken by turbulence
199               &             - at_i(ji,jj) *  fhld(ji,jj)                                     ! heat flux taken during bottom growth/melt
200                                                                                              !    (fhld should be 0 while bott growth)
[825]201         END DO
202      END DO
203
[8371]204      !-------------------------------------------------------------------------------------------!
205      ! Thermodynamic computation (only on grid points covered by ice) => loop over ice categories
206      !-------------------------------------------------------------------------------------------!
207      DO jl = 1, jpl
[825]208
[7646]209         ! select ice covered grid points
[8327]210         nidx = 0 ; idxice(:) = 0
[8332]211         DO jj = 1, jpj
212            DO ji = 1, jpi
[5123]213               IF ( a_i(ji,jj,jl) > epsi10 ) THEN     
[8327]214                  nidx         = nidx  + 1
215                  idxice(nidx) = (jj - 1) * jpi + ji
[825]216               ENDIF
217            END DO
218         END DO
219
[8327]220         IF( lk_mpp )         CALL mpp_ini_ice( nidx , numout )
[825]221
[8327]222         IF( nidx > 0 ) THEN  ! If there is no ice, do nothing.
[7646]223            !                                                               
[8369]224                              CALL lim_thd_1d2d( jl, 1 )            ! --- Move to 1D arrays --- !
[8379]225            !                                                       ! --- & Change units of e_i, e_s from J/m2 to J/m3 --- !
[6140]226            !
[8378]227            s_i_new   (1:nidx) = 0._wp ; dh_s_tot (1:nidx) = 0._wp  ! --- some init --- !  (important to have them here)
228            dh_i_surf (1:nidx) = 0._wp ; dh_i_bott(1:nidx) = 0._wp
229            dh_snowice(1:nidx) = 0._wp ; dh_i_sub (1:nidx) = 0._wp
230            !
[8369]231            IF( ln_limdH )    CALL lim_thd_dif                      ! --- Ice/Snow Temperature profile --- !
[6140]232            !
[8369]233            IF( ln_limdH )    CALL lim_thd_dh                       ! --- Ice/Snow thickness --- !   
[6140]234            !
[8342]235            IF( ln_limdH )    CALL lim_thd_ent( e_i_1d(1:nidx,:) )  ! --- Ice enthalpy remapping --- !
[6140]236            !
[8369]237                              CALL lim_thd_sal                      ! --- Ice salinity --- !   
[6140]238            !
[8369]239                              CALL lim_thd_temp                     ! --- temperature update --- !
[6140]240            !
[7646]241            IF( ln_limdH ) THEN
242               IF ( ( nn_monocat == 1 .OR. nn_monocat == 4 ) .AND. jpl == 1 ) THEN
[8369]243                              CALL lim_thd_lam                      ! --- extra lateral melting if monocat --- !
[7646]244               END IF
[5123]245            END IF
[2528]246            !
[8370]247            IF( ln_limdA )    CALL lim_thd_da                       ! --- lateral melting --- !
248            !
[8379]249                              CALL lim_thd_1d2d( jl, 2 )            ! --- Change units of e_i, e_s from J/m3 to J/m2 --- !
250            !                                                       ! --- & Move to 2D arrays --- !
[8325]251            !
[7646]252            IF( lk_mpp )      CALL mpp_comm_free( ncomm_ice ) !RB necessary ??
[1572]253         ENDIF
254         !
[8341]255      END DO
[8371]256      ! update ice age (in case a_i changed, i.e. becomes 0 or lateral melting)
[8379]257      oa_i(:,:,:) = o_i(:,:,:) * a_i(:,:,:)
[5202]258
[8411]259      IF( ln_limdiachk ) CALL ice_cons_hsm(1, 'limthd', zvi_b, zsmv_b, zei_b, zfw_b, zfs_b, zft_b)
[8379]260      !
261                         CALL lim_var_zapsmall           ! --- remove very small ice concentration (<1e-10) --- !
262      !                                                  !     & make sure at_i=SUM(a_i) & ato_i=1 where at_i=0
263      !                   
264      IF( jpl > 1 )      CALL lim_itd_th_rem( kt )       ! --- Transport ice between thickness categories --- !
265      !
266      IF( ln_limdO )     CALL lim_thd_lac                ! --- frazil ice growing in leads --- !
267      !
[8411]268      IF( ln_limctl )    CALL ice_prt( kt, iiceprt, jiceprt, 1, ' - ice thermodyn. - ' )   ! control print
269      IF( ln_ctl )       CALL ice_prt3D( 'limthd' )      ! Control print
[2528]270      !
[7646]271      IF( nn_timing == 1 )  CALL timing_stop('limthd')
272
[4688]273   END SUBROUTINE lim_thd 
[825]274
[5407]275 
[8342]276   SUBROUTINE lim_thd_temp
[825]277      !!-----------------------------------------------------------------------
[4688]278      !!                   ***  ROUTINE lim_thd_temp ***
[825]279      !!                 
[4688]280      !! ** Purpose :   Computes sea ice temperature (Kelvin) from enthalpy
[825]281      !!
282      !! ** Method  :   Formula (Bitz and Lipscomb, 1999)
283      !!-------------------------------------------------------------------
[2715]284      INTEGER  ::   ji, jk   ! dummy loop indices
[4990]285      REAL(wp) ::   ztmelts, zaaa, zbbb, zccc, zdiscrim  ! local scalar
[825]286      !!-------------------------------------------------------------------
[4688]287      ! Recover ice temperature
288      DO jk = 1, nlay_i
[8342]289         DO ji = 1, nidx
[5123]290            ztmelts       =  -tmut * s_i_1d(ji,jk) + rt0
[4688]291            ! Conversion q(S,T) -> T (second order equation)
292            zaaa          =  cpic
[8325]293            zbbb          =  ( rcp - cpic ) * ( ztmelts - rt0 ) + e_i_1d(ji,jk) * r1_rhoic - lfus
[5123]294            zccc          =  lfus * ( ztmelts - rt0 )
[4688]295            zdiscrim      =  SQRT( MAX( zbbb * zbbb - 4._wp * zaaa * zccc, 0._wp ) )
[5123]296            t_i_1d(ji,jk) =  rt0 - ( zbbb + zdiscrim ) / ( 2._wp * zaaa )
[4688]297           
298            ! mask temperature
[4990]299            rswitch       =  1._wp - MAX( 0._wp , SIGN( 1._wp , - ht_i_1d(ji) ) ) 
[5123]300            t_i_1d(ji,jk) =  rswitch * t_i_1d(ji,jk) + ( 1._wp - rswitch ) * rt0
[4688]301         END DO
302      END DO 
[6140]303      !
[4688]304   END SUBROUTINE lim_thd_temp
[825]305
[6140]306
[8342]307   SUBROUTINE lim_thd_lam
[5123]308      !!-----------------------------------------------------------------------
309      !!                   ***  ROUTINE lim_thd_lam ***
310      !!                 
311      !! ** Purpose :   Lateral melting in case monocategory
312      !!                          ( dA = A/2h dh )
313      !!-----------------------------------------------------------------------
[6140]314      INTEGER  ::   ji                 ! dummy loop indices
315      REAL(wp) ::   zhi_bef            ! ice thickness before thermo
316      REAL(wp) ::   zdh_mel, zda_mel   ! net melting
317      REAL(wp) ::   zvi, zvs           ! ice/snow volumes
318      !!-----------------------------------------------------------------------
319      !
[8342]320      DO ji = 1, nidx
[6416]321         zdh_mel = MIN( 0._wp, dh_i_surf(ji) + dh_i_bott(ji) + dh_snowice(ji) + dh_i_sub(ji) )
[5167]322         IF( zdh_mel < 0._wp .AND. a_i_1d(ji) > 0._wp )  THEN
323            zvi          = a_i_1d(ji) * ht_i_1d(ji)
324            zvs          = a_i_1d(ji) * ht_s_1d(ji)
[5123]325            ! lateral melting = concentration change
326            zhi_bef     = ht_i_1d(ji) - zdh_mel
[5167]327            rswitch     = MAX( 0._wp , SIGN( 1._wp , zhi_bef - epsi20 ) )
328            zda_mel     = rswitch * a_i_1d(ji) * zdh_mel / ( 2._wp * MAX( zhi_bef, epsi20 ) )
329            a_i_1d(ji)  = MAX( epsi20, a_i_1d(ji) + zda_mel ) 
[7646]330            ! adjust thickness
[5167]331            ht_i_1d(ji) = zvi / a_i_1d(ji)           
332            ht_s_1d(ji) = zvs / a_i_1d(ji)           
[5123]333            ! retrieve total concentration
334            at_i_1d(ji) = a_i_1d(ji)
335         END IF
336      END DO
[6140]337      !
[5123]338   END SUBROUTINE lim_thd_lam
339
[6140]340
[8342]341   SUBROUTINE lim_thd_1d2d( jl, kn )
[5123]342      !!-----------------------------------------------------------------------
343      !!                   ***  ROUTINE lim_thd_1d2d ***
344      !!                 
345      !! ** Purpose :   move arrays from 1d to 2d and the reverse
346      !!-----------------------------------------------------------------------
[8342]347      INTEGER, INTENT(in) ::   jl       ! ice cat
[6140]348      INTEGER, INTENT(in) ::   kn       ! 1= from 2D to 1D   ;   2= from 1D to 2D
349      !
[5123]350      INTEGER             ::   jk       ! dummy loop indices
[6140]351      !!-----------------------------------------------------------------------
352      !
[5123]353      SELECT CASE( kn )
[6140]354      !
355      CASE( 1 )            ! from 2D to 1D
356         !
[8342]357         CALL tab_2d_1d( nidx, idxice(1:nidx), at_i_1d(1:nidx), at_i             )
358         CALL tab_2d_1d( nidx, idxice(1:nidx), a_i_1d (1:nidx), a_i(:,:,jl)      )
359         CALL tab_2d_1d( nidx, idxice(1:nidx), ht_i_1d(1:nidx), ht_i(:,:,jl)     )
360         CALL tab_2d_1d( nidx, idxice(1:nidx), ht_s_1d(1:nidx), ht_s(:,:,jl)     )
361         CALL tab_2d_1d( nidx, idxice(1:nidx), t_su_1d(1:nidx), t_su(:,:,jl)     )
362         CALL tab_2d_1d( nidx, idxice(1:nidx), sm_i_1d(1:nidx), sm_i(:,:,jl)     )
[5123]363         DO jk = 1, nlay_s
[8342]364            CALL tab_2d_1d( nidx, idxice(1:nidx), t_s_1d(1:nidx,jk), t_s(:,:,jk,jl)   )
365            CALL tab_2d_1d( nidx, idxice(1:nidx), e_s_1d(1:nidx,jk), e_s(:,:,jk,jl)   )
[5123]366         END DO
367         DO jk = 1, nlay_i
[8342]368            CALL tab_2d_1d( nidx, idxice(1:nidx), t_i_1d(1:nidx,jk), t_i(:,:,jk,jl)   )
369            CALL tab_2d_1d( nidx, idxice(1:nidx), e_i_1d(1:nidx,jk), e_i(:,:,jk,jl)   )
370            CALL tab_2d_1d( nidx, idxice(1:nidx), s_i_1d(1:nidx,jk), s_i(:,:,jk,jl)   )
[5123]371         END DO
[6140]372         !
[8342]373         CALL tab_2d_1d( nidx, idxice(1:nidx), qprec_ice_1d(1:nidx), qprec_ice        )
374         CALL tab_2d_1d( nidx, idxice(1:nidx), qsr_ice_1d  (1:nidx), qsr_ice(:,:,jl)  )
375         CALL tab_2d_1d( nidx, idxice(1:nidx), fr1_i0_1d   (1:nidx), fr1_i0           )
376         CALL tab_2d_1d( nidx, idxice(1:nidx), fr2_i0_1d   (1:nidx), fr2_i0           )
377         CALL tab_2d_1d( nidx, idxice(1:nidx), qns_ice_1d  (1:nidx), qns_ice(:,:,jl)  )
378         CALL tab_2d_1d( nidx, idxice(1:nidx), ftr_ice_1d  (1:nidx), ftr_ice(:,:,jl)  )
379         CALL tab_2d_1d( nidx, idxice(1:nidx), evap_ice_1d (1:nidx), evap_ice(:,:,jl) )
380         CALL tab_2d_1d( nidx, idxice(1:nidx), dqns_ice_1d (1:nidx), dqns_ice(:,:,jl) )
381         CALL tab_2d_1d( nidx, idxice(1:nidx), t_bo_1d     (1:nidx), t_bo             )
382         CALL tab_2d_1d( nidx, idxice(1:nidx), sprecip_1d  (1:nidx), sprecip          ) 
383         CALL tab_2d_1d( nidx, idxice(1:nidx), fhtur_1d    (1:nidx), fhtur            )
384         CALL tab_2d_1d( nidx, idxice(1:nidx), fhld_1d     (1:nidx), fhld             )
[6140]385         !
[8342]386         CALL tab_2d_1d( nidx, idxice(1:nidx), wfx_snw_sni_1d(1:nidx), wfx_snw_sni   )
387         CALL tab_2d_1d( nidx, idxice(1:nidx), wfx_snw_sum_1d(1:nidx), wfx_snw_sum   )
388         CALL tab_2d_1d( nidx, idxice(1:nidx), wfx_sub_1d    (1:nidx), wfx_sub       )
389         CALL tab_2d_1d( nidx, idxice(1:nidx), wfx_snw_sub_1d(1:nidx), wfx_snw_sub   )
390         CALL tab_2d_1d( nidx, idxice(1:nidx), wfx_ice_sub_1d(1:nidx), wfx_ice_sub   )
391         CALL tab_2d_1d( nidx, idxice(1:nidx), wfx_err_sub_1d(1:nidx), wfx_err_sub   )
[6140]392         !
[8342]393         CALL tab_2d_1d( nidx, idxice(1:nidx), wfx_bog_1d (1:nidx), wfx_bog          )
394         CALL tab_2d_1d( nidx, idxice(1:nidx), wfx_bom_1d (1:nidx), wfx_bom          )
395         CALL tab_2d_1d( nidx, idxice(1:nidx), wfx_sum_1d (1:nidx), wfx_sum          )
396         CALL tab_2d_1d( nidx, idxice(1:nidx), wfx_sni_1d (1:nidx), wfx_sni          )
397         CALL tab_2d_1d( nidx, idxice(1:nidx), wfx_res_1d (1:nidx), wfx_res          )
398         CALL tab_2d_1d( nidx, idxice(1:nidx), wfx_spr_1d (1:nidx), wfx_spr          )
[8370]399         CALL tab_2d_1d( nidx, idxice(1:nidx), wfx_lam_1d (1:nidx), wfx_lam          )
[6140]400         !
[8342]401         CALL tab_2d_1d( nidx, idxice(1:nidx), sfx_bog_1d (1:nidx), sfx_bog          )
402         CALL tab_2d_1d( nidx, idxice(1:nidx), sfx_bom_1d (1:nidx), sfx_bom          )
403         CALL tab_2d_1d( nidx, idxice(1:nidx), sfx_sum_1d (1:nidx), sfx_sum          )
404         CALL tab_2d_1d( nidx, idxice(1:nidx), sfx_sni_1d (1:nidx), sfx_sni          )
405         CALL tab_2d_1d( nidx, idxice(1:nidx), sfx_bri_1d (1:nidx), sfx_bri          )
406         CALL tab_2d_1d( nidx, idxice(1:nidx), sfx_res_1d (1:nidx), sfx_res          )
407         CALL tab_2d_1d( nidx, idxice(1:nidx), sfx_sub_1d (1:nidx), sfx_sub          )
[8370]408         CALL tab_2d_1d( nidx, idxice(1:nidx), sfx_lam_1d (1:nidx), sfx_lam          )
[6140]409         !
[8342]410         CALL tab_2d_1d( nidx, idxice(1:nidx), hfx_thd_1d (1:nidx), hfx_thd          )
411         CALL tab_2d_1d( nidx, idxice(1:nidx), hfx_spr_1d (1:nidx), hfx_spr          )
412         CALL tab_2d_1d( nidx, idxice(1:nidx), hfx_sum_1d (1:nidx), hfx_sum          )
413         CALL tab_2d_1d( nidx, idxice(1:nidx), hfx_bom_1d (1:nidx), hfx_bom          )
414         CALL tab_2d_1d( nidx, idxice(1:nidx), hfx_bog_1d (1:nidx), hfx_bog          )
415         CALL tab_2d_1d( nidx, idxice(1:nidx), hfx_dif_1d (1:nidx), hfx_dif          )
416         CALL tab_2d_1d( nidx, idxice(1:nidx), hfx_opw_1d (1:nidx), hfx_opw          )
417         CALL tab_2d_1d( nidx, idxice(1:nidx), hfx_snw_1d (1:nidx), hfx_snw          )
418         CALL tab_2d_1d( nidx, idxice(1:nidx), hfx_sub_1d (1:nidx), hfx_sub          )
419         CALL tab_2d_1d( nidx, idxice(1:nidx), hfx_err_1d (1:nidx), hfx_err          )
420         CALL tab_2d_1d( nidx, idxice(1:nidx), hfx_res_1d (1:nidx), hfx_res          )
421         CALL tab_2d_1d( nidx, idxice(1:nidx), hfx_err_dif_1d(1:nidx), hfx_err_dif   )
422         CALL tab_2d_1d( nidx, idxice(1:nidx), hfx_err_rem_1d(1:nidx), hfx_err_rem   )
423         CALL tab_2d_1d( nidx, idxice(1:nidx), hfx_out_1d (1:nidx), hfx_out          )
[6140]424         !
[8239]425         ! SIMIP diagnostics
[8342]426         CALL tab_2d_1d( nidx, idxice(1:nidx), diag_fc_bo_1d(1:nidx), diag_fc_bo   )
427         CALL tab_2d_1d( nidx, idxice(1:nidx), diag_fc_su_1d(1:nidx), diag_fc_su   )
[8326]428         ! ocean surface fields
[8342]429         CALL tab_2d_1d( nidx, idxice(1:nidx), sst_1d(1:nidx), sst_m )
430         CALL tab_2d_1d( nidx, idxice(1:nidx), sss_1d(1:nidx), sss_m )
[8379]431
432         ! --- Change units of e_i, e_s from J/m2 to J/m3 --- !
433         DO jk = 1, nlay_i
434            WHERE( ht_i_1d(1:nidx)>0._wp ) e_i_1d(1:nidx,jk) = e_i_1d(1:nidx,jk) / (ht_i_1d(1:nidx) * a_i_1d(1:nidx)) * nlay_i
435         ENDDO
436         DO jk = 1, nlay_s
437            WHERE( ht_s_1d(1:nidx)>0._wp ) e_s_1d(1:nidx,jk) = e_s_1d(1:nidx,jk) / (ht_s_1d(1:nidx) * a_i_1d(1:nidx)) * nlay_s
438         ENDDO
[8239]439         !
[6140]440      CASE( 2 )            ! from 1D to 2D
441         !
[8379]442         ! --- Change units of e_i, e_s from J/m3 to J/m2 --- !
443         DO jk = 1, nlay_i
444            e_i_1d(1:nidx,jk) = e_i_1d(1:nidx,jk) * ht_i_1d(1:nidx) * a_i_1d(1:nidx) * r1_nlay_i
445         ENDDO
446         DO jk = 1, nlay_s
447            e_s_1d(1:nidx,jk) = e_s_1d(1:nidx,jk) * ht_s_1d(1:nidx) * a_i_1d(1:nidx) * r1_nlay_s
448         ENDDO
449         !
450         ! Change thickness to volume
451         v_i_1d(1:nidx)   = ht_i_1d(1:nidx) * a_i_1d(1:nidx)
452         v_s_1d(1:nidx)   = ht_s_1d(1:nidx) * a_i_1d(1:nidx)
453         smv_i_1d(1:nidx) = sm_i_1d(1:nidx) * v_i_1d(1:nidx)
454         
[8342]455         CALL tab_1d_2d( nidx, idxice(1:nidx), at_i_1d(1:nidx), at_i             )
456         CALL tab_1d_2d( nidx, idxice(1:nidx), a_i_1d (1:nidx), a_i(:,:,jl)      )
457         CALL tab_1d_2d( nidx, idxice(1:nidx), ht_i_1d(1:nidx), ht_i(:,:,jl)     )
458         CALL tab_1d_2d( nidx, idxice(1:nidx), ht_s_1d(1:nidx), ht_s(:,:,jl)     )
459         CALL tab_1d_2d( nidx, idxice(1:nidx), t_su_1d(1:nidx), t_su(:,:,jl)     )
460         CALL tab_1d_2d( nidx, idxice(1:nidx), sm_i_1d(1:nidx), sm_i(:,:,jl)     )
[5123]461         DO jk = 1, nlay_s
[8342]462            CALL tab_1d_2d( nidx, idxice(1:nidx), t_s_1d(1:nidx,jk), t_s(:,:,jk,jl)   )
463            CALL tab_1d_2d( nidx, idxice(1:nidx), e_s_1d(1:nidx,jk), e_s(:,:,jk,jl)   )
[5123]464         END DO
465         DO jk = 1, nlay_i
[8342]466            CALL tab_1d_2d( nidx, idxice(1:nidx), t_i_1d(1:nidx,jk), t_i(:,:,jk,jl)   )
467            CALL tab_1d_2d( nidx, idxice(1:nidx), e_i_1d(1:nidx,jk), e_i(:,:,jk,jl)   )
468            CALL tab_1d_2d( nidx, idxice(1:nidx), s_i_1d(1:nidx,jk), s_i(:,:,jk,jl)   )
[5123]469         END DO
[6140]470         !
[8342]471         CALL tab_1d_2d( nidx, idxice(1:nidx), wfx_snw_sni_1d(1:nidx), wfx_snw_sni   )
472         CALL tab_1d_2d( nidx, idxice(1:nidx), wfx_snw_sum_1d(1:nidx), wfx_snw_sum   )
473         CALL tab_1d_2d( nidx, idxice(1:nidx), wfx_sub_1d    (1:nidx), wfx_sub       )
474         CALL tab_1d_2d( nidx, idxice(1:nidx), wfx_snw_sub_1d(1:nidx), wfx_snw_sub   )
475         CALL tab_1d_2d( nidx, idxice(1:nidx), wfx_ice_sub_1d(1:nidx), wfx_ice_sub   )
476         CALL tab_1d_2d( nidx, idxice(1:nidx), wfx_err_sub_1d(1:nidx), wfx_err_sub   )
[6140]477         !
[8342]478         CALL tab_1d_2d( nidx, idxice(1:nidx), wfx_bog_1d (1:nidx), wfx_bog          )
479         CALL tab_1d_2d( nidx, idxice(1:nidx), wfx_bom_1d (1:nidx), wfx_bom          )
480         CALL tab_1d_2d( nidx, idxice(1:nidx), wfx_sum_1d (1:nidx), wfx_sum          )
481         CALL tab_1d_2d( nidx, idxice(1:nidx), wfx_sni_1d (1:nidx), wfx_sni          )
482         CALL tab_1d_2d( nidx, idxice(1:nidx), wfx_res_1d (1:nidx), wfx_res          )
483         CALL tab_1d_2d( nidx, idxice(1:nidx), wfx_spr_1d (1:nidx), wfx_spr          )
[8370]484         CALL tab_1d_2d( nidx, idxice(1:nidx), wfx_lam_1d (1:nidx), wfx_lam          )
[6140]485         !
[8342]486         CALL tab_1d_2d( nidx, idxice(1:nidx), sfx_bog_1d (1:nidx), sfx_bog          )
487         CALL tab_1d_2d( nidx, idxice(1:nidx), sfx_bom_1d (1:nidx), sfx_bom          )
488         CALL tab_1d_2d( nidx, idxice(1:nidx), sfx_sum_1d (1:nidx), sfx_sum          )
489         CALL tab_1d_2d( nidx, idxice(1:nidx), sfx_sni_1d (1:nidx), sfx_sni          )
490         CALL tab_1d_2d( nidx, idxice(1:nidx), sfx_bri_1d (1:nidx), sfx_bri          )
491         CALL tab_1d_2d( nidx, idxice(1:nidx), sfx_res_1d (1:nidx), sfx_res          )
492         CALL tab_1d_2d( nidx, idxice(1:nidx), sfx_sub_1d (1:nidx), sfx_sub          )
[8370]493         CALL tab_1d_2d( nidx, idxice(1:nidx), sfx_lam_1d (1:nidx), sfx_lam          )
494         !
[8342]495         CALL tab_1d_2d( nidx, idxice(1:nidx), hfx_thd_1d (1:nidx), hfx_thd          )
496         CALL tab_1d_2d( nidx, idxice(1:nidx), hfx_spr_1d (1:nidx), hfx_spr          )
497         CALL tab_1d_2d( nidx, idxice(1:nidx), hfx_sum_1d (1:nidx), hfx_sum          )
498         CALL tab_1d_2d( nidx, idxice(1:nidx), hfx_bom_1d (1:nidx), hfx_bom          )
499         CALL tab_1d_2d( nidx, idxice(1:nidx), hfx_bog_1d (1:nidx), hfx_bog          )
500         CALL tab_1d_2d( nidx, idxice(1:nidx), hfx_dif_1d (1:nidx), hfx_dif          )
501         CALL tab_1d_2d( nidx, idxice(1:nidx), hfx_opw_1d (1:nidx), hfx_opw          )
502         CALL tab_1d_2d( nidx, idxice(1:nidx), hfx_snw_1d (1:nidx), hfx_snw          )
503         CALL tab_1d_2d( nidx, idxice(1:nidx), hfx_sub_1d (1:nidx), hfx_sub          )
504         CALL tab_1d_2d( nidx, idxice(1:nidx), hfx_err_1d (1:nidx), hfx_err          )
505         CALL tab_1d_2d( nidx, idxice(1:nidx), hfx_res_1d (1:nidx), hfx_res          )
506         CALL tab_1d_2d( nidx, idxice(1:nidx), hfx_err_dif_1d(1:nidx), hfx_err_dif   )
507         CALL tab_1d_2d( nidx, idxice(1:nidx), hfx_err_rem_1d(1:nidx), hfx_err_rem   )
508         CALL tab_1d_2d( nidx, idxice(1:nidx), hfx_out_1d (1:nidx), hfx_out          )
[8370]509         !
[8342]510         CALL tab_1d_2d( nidx, idxice(1:nidx), qns_ice_1d  (1:nidx), qns_ice(:,:,jl)  )
511         CALL tab_1d_2d( nidx, idxice(1:nidx), ftr_ice_1d  (1:nidx), ftr_ice(:,:,jl)  )
[6140]512         !
[8239]513         ! SIMIP diagnostics         
[8342]514         CALL tab_1d_2d( nidx, idxice(1:nidx), t_si_1d      (1:nidx), t_si(:,:,jl)      )
515         CALL tab_1d_2d( nidx, idxice(1:nidx), diag_fc_bo_1d(1:nidx), diag_fc_bo        )
516         CALL tab_1d_2d( nidx, idxice(1:nidx), diag_fc_su_1d(1:nidx), diag_fc_su        )
[8371]517         ! extensive variables
518         CALL tab_1d_2d( nidx, idxice(1:nidx), v_i_1d  (1:nidx), v_i  (:,:,jl) )
519         CALL tab_1d_2d( nidx, idxice(1:nidx), v_s_1d  (1:nidx), v_s  (:,:,jl) )
520         CALL tab_1d_2d( nidx, idxice(1:nidx), smv_i_1d(1:nidx), smv_i(:,:,jl) )
[5123]521      END SELECT
[6140]522      !
[5123]523   END SUBROUTINE lim_thd_1d2d
524
525
[825]526   SUBROUTINE lim_thd_init
527      !!-----------------------------------------------------------------------
528      !!                   ***  ROUTINE lim_thd_init ***
529      !!                 
530      !! ** Purpose :   Physical constants and parameters linked to the ice
[1572]531      !!              thermodynamics
[825]532      !!
533      !! ** Method  :   Read the namicethd namelist and check the ice-thermo
[1572]534      !!              parameter values called at the first timestep (nit000)
[825]535      !!
536      !! ** input   :   Namelist namicether
[2528]537      !!-------------------------------------------------------------------
[4147]538      INTEGER  ::   ios                 ! Local integer output status for namelist read
[8313]539      NAMELIST/namicethd/ rn_kappa_i, nn_ice_thcon, ln_dqnsice, rn_cdsn,                                  &
540         &                ln_limdH, rn_betas,                                                             &
541         &                ln_limdA, rn_beta, rn_dmin,                                                     &
[8321]542         &                ln_limdO, rn_hnewice, ln_frazil, rn_maxfrazb, rn_vfrazb, rn_Cfrazb, rn_himin,   &
543         &                nn_limflx
[825]544      !!-------------------------------------------------------------------
[2528]545      !
[4147]546      REWIND( numnam_ice_ref )              ! Namelist namicethd in reference namelist : Ice thermodynamics
547      READ  ( numnam_ice_ref, namicethd, IOSTAT = ios, ERR = 901)
548901   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namicethd in reference namelist', lwp )
549
550      REWIND( numnam_ice_cfg )              ! Namelist namicethd in configuration namelist : Ice thermodynamics
551      READ  ( numnam_ice_cfg, namicethd, IOSTAT = ios, ERR = 902 )
552902   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namicethd in configuration namelist', lwp )
[4624]553      IF(lwm) WRITE ( numoni, namicethd )
[5123]554      !
[7813]555      !
[1572]556      IF(lwp) THEN                          ! control print
[7646]557         WRITE(numout,*) 'lim_thd_init : Ice Thermodynamics'
558         WRITE(numout,*) '~~~~~~~~~~~~~'
559         WRITE(numout,*)'   -- limthd_dif --'
560         WRITE(numout,*)'      extinction radiation parameter in sea ice               rn_kappa_i   = ', rn_kappa_i
561         WRITE(numout,*)'      switch for comp. of thermal conductivity in the ice     nn_ice_thcon = ', nn_ice_thcon
[8313]562         WRITE(numout,*)'      change the surface non-solar flux with Tsu or not       ln_dqnsice   = ', ln_dqnsice
[7813]563         WRITE(numout,*)'      thermal conductivity of the snow                        rn_cdsn      = ', rn_cdsn
[7646]564         WRITE(numout,*)'   -- limthd_dh --'
565         WRITE(numout,*)'      activate ice thick change from top/bot (T) or not (F)   ln_limdH     = ', ln_limdH
566         WRITE(numout,*)'      coefficient for ice-lead partition of snowfall          rn_betas     = ', rn_betas
567         WRITE(numout,*)'   -- limthd_da --'
568         WRITE(numout,*)'      activate lateral melting (T) or not (F)                 ln_limdA     = ', ln_limdA
569         WRITE(numout,*)'      Coef. beta for lateral melting param.                   rn_beta      = ', rn_beta
570         WRITE(numout,*)'      Minimum floe diameter for lateral melting param.        rn_dmin      = ', rn_dmin
571         WRITE(numout,*)'   -- limthd_lac --'
572         WRITE(numout,*)'      activate ice growth in open-water (T) or not (F)        ln_limdO     = ', ln_limdO
[5123]573         WRITE(numout,*)'      ice thick. for lateral accretion                        rn_hnewice   = ', rn_hnewice
574         WRITE(numout,*)'      Frazil ice thickness as a function of wind or not       ln_frazil    = ', ln_frazil
575         WRITE(numout,*)'      Maximum proportion of frazil ice collecting at bottom   rn_maxfrazb  = ', rn_maxfrazb
576         WRITE(numout,*)'      Thresold relative drift speed for collection of frazil  rn_vfrazb    = ', rn_vfrazb
577         WRITE(numout,*)'      Squeezing coefficient for collection of frazil          rn_Cfrazb    = ', rn_Cfrazb
[7646]578         WRITE(numout,*)'   -- limitd_th --'
[5123]579         WRITE(numout,*)'      minimum ice thickness                                   rn_himin     = ', rn_himin 
[4688]580         WRITE(numout,*)'      check heat conservation in the ice/snow                 con_i        = ', con_i
[8321]581         WRITE(numout,*)'   -- icestp --'
582         WRITE(numout,*)'      Multicategory heat flux formulation                     nn_limflx    = ', nn_limflx
[825]583      ENDIF
[1572]584      !
[8313]585      IF ( rn_hnewice < rn_himin )   CALL ctl_stop( 'STOP', 'lim_thd_init : rn_hnewice should be >= rn_himin' )
586      !
[8321]587      IF(lwp) WRITE(numout,*)
588      SELECT CASE( nn_limflx )         ! LIM3 Multi-category heat flux formulation
589      CASE ( -1 )
590         IF(lwp) WRITE(numout,*) '   LIM3: use per-category fluxes (nn_limflx = -1) '
591         IF( ln_cpl )   CALL ctl_stop( 'sbc_init : the chosen nn_limflx for LIM3 in coupled mode must be 0 or 2' )
592      CASE ( 0  )
593         IF(lwp) WRITE(numout,*) '   LIM3: use average per-category fluxes (nn_limflx = 0) '
594      CASE ( 1  )
595         IF(lwp) WRITE(numout,*) '   LIM3: use average then redistribute per-category fluxes (nn_limflx = 1) '
596         IF( ln_cpl )   CALL ctl_stop( 'sbc_init : the chosen nn_limflx for LIM3 in coupled mode must be 0 or 2' )
597      CASE ( 2  )
598         IF(lwp) WRITE(numout,*) '   LIM3: Redistribute a single flux over categories (nn_limflx = 2) '
599         IF( .NOT. ln_cpl )   CALL ctl_stop( 'sbc_init : the chosen nn_limflx for LIM3 in forced mode cannot be 2' )
600      CASE DEFAULT
601         CALL ctl_stop( 'sbcmod: LIM3 option, nn_limflx, should be between -1 and 2' )
602      END SELECT
603      !
[825]604   END SUBROUTINE lim_thd_init
605
606#else
[1572]607   !!----------------------------------------------------------------------
[2528]608   !!   Default option         Dummy module          NO  LIM3 sea-ice model
[1572]609   !!----------------------------------------------------------------------
[825]610#endif
611
612   !!======================================================================
613END MODULE limthd
Note: See TracBrowser for help on using the repository browser.