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.
icethd.F90 in NEMO/branches/2020/r4.0-HEAD_r12713_clem_dan_fixcpl/src/ICE – NEMO

source: NEMO/branches/2020/r4.0-HEAD_r12713_clem_dan_fixcpl/src/ICE/icethd.F90 @ 12915

Last change on this file since 12915 was 12915, checked in by clem, 4 years ago

implement a convergence check on heat diffusion scheme

  • Property svn:keywords set to Id
File size: 34.6 KB
Line 
1MODULE icethd
2   !!======================================================================
3   !!                  ***  MODULE icethd   ***
4   !!   sea-ice : master routine for thermodynamics
5   !!======================================================================
6   !! History :  1.0  !  2000-01  (M.A. Morales Maqueda, H. Goosse, T. Fichefet) original code 1D
7   !!            4.0  !  2018     (many people)       SI3 [aka Sea Ice cube]
8   !!----------------------------------------------------------------------
9#if defined key_si3
10   !!----------------------------------------------------------------------
11   !!   'key_si3'                                       SI3 sea-ice model
12   !!----------------------------------------------------------------------
13   !!   ice_thd       : thermodynamics of sea ice
14   !!   ice_thd_init  : initialisation of sea-ice thermodynamics
15   !!----------------------------------------------------------------------
16   USE phycst         ! physical constants
17   USE dom_oce        ! ocean space and time domain variables
18   USE ice            ! sea-ice: variables
19!!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
21   USE sbc_ice , ONLY : qsr_oce, qns_oce, qemp_oce, qsr_ice, qns_ice, dqns_ice, evap_ice, qprec_ice, qevap_ice, &
22      &                 qml_ice, qcn_ice, qtr_ice_top
23   USE ice1D          ! sea-ice: thermodynamics variables
24   USE icethd_zdf     ! sea-ice: vertical heat diffusion
25   USE icethd_dh      ! sea-ice: ice-snow growth and melt
26   USE icethd_da      ! sea-ice: lateral melting
27   USE icethd_sal     ! sea-ice: salinity
28   USE icethd_ent     ! sea-ice: enthalpy redistribution
29   USE icethd_do      ! sea-ice: growth in open water
30   USE icethd_pnd     ! sea-ice: melt ponds
31   USE iceitd         ! sea-ice: remapping thickness distribution
32   USE icetab         ! sea-ice: 1D <==> 2D transformation
33   USE icevar         ! sea-ice: operations
34   USE icectl         ! sea-ice: control print
35   !
36   USE in_out_manager ! I/O manager
37   USE iom            ! I/O manager library
38   USE lib_mpp        ! MPP library
39   USE lib_fortran    ! fortran utilities (glob_sum + no signed zero)
40   USE lbclnk         ! lateral boundary conditions (or mpp links)
41   USE timing         ! Timing
42
43   IMPLICIT NONE
44   PRIVATE
45
46   PUBLIC   ice_thd         ! called by limstp module
47   PUBLIC   ice_thd_init    ! called by ice_init
48
49   !!** namelist (namthd) **
50   LOGICAL ::   ln_icedH         ! activate ice thickness change from growing/melting (T) or not (F)
51   LOGICAL ::   ln_icedA         ! activate lateral melting param. (T) or not (F)
52   LOGICAL ::   ln_icedO         ! activate ice growth in open-water (T) or not (F)
53   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
55
56   !! * Substitutions
57#  include "vectopt_loop_substitute.h90"
58   !!----------------------------------------------------------------------
59   !! NEMO/ICE 4.0 , NEMO Consortium (2018)
60   !! $Id$
61   !! Software governed by the CeCILL license (see ./LICENSE)
62   !!----------------------------------------------------------------------
63CONTAINS
64
65   SUBROUTINE ice_thd( kt )
66      !!-------------------------------------------------------------------
67      !!                ***  ROUTINE ice_thd  ***       
68      !! 
69      !! ** Purpose : This routine manages ice thermodynamics
70      !!         
71      !! ** Action : - computation of oceanic sensible heat flux at the ice base
72      !!                              energy budget in the leads
73      !!                              net fluxes on top of ice and of ocean
74      !!             - selection of grid cells with ice
75      !!                - call ice_thd_zdf  for vertical heat diffusion
76      !!                - call ice_thd_dh   for vertical ice growth and melt
77      !!                - call ice_thd_pnd  for melt ponds
78      !!                - call ice_thd_ent  for enthalpy remapping
79      !!                - call ice_thd_sal  for ice desalination
80      !!                - call ice_thd_temp to  retrieve temperature from ice enthalpy
81      !!                - call ice_thd_mono for extra lateral ice melt if active virtual thickness distribution
82      !!                - call ice_thd_da   for lateral ice melt
83      !!             - back to the geographic grid
84      !!                - call ice_thd_rem  for remapping thickness distribution
85      !!                - call ice_thd_do   for ice growth in leads
86      !!-------------------------------------------------------------------
87      INTEGER, INTENT(in) :: kt    ! number of iteration
88      !
89      INTEGER  :: ji, jj, jk, jl   ! dummy loop indices
90      REAL(wp) :: zfric_u, zqld, zqfr, zqfr_neg
91      REAL(wp), PARAMETER :: zfric_umin = 0._wp           ! lower bound for the friction velocity (cice value=5.e-04)
92      REAL(wp), PARAMETER :: zch        = 0.0057_wp       ! heat transfer coefficient
93      REAL(wp), DIMENSION(jpi,jpj) ::   zu_io, zv_io, zfric   ! ice-ocean velocity (m/s) and frictional velocity (m2/s2)
94      !
95      !!-------------------------------------------------------------------
96      ! controls
97      IF( ln_timing    )   CALL timing_start('icethd')                                                             ! timing
98      IF( ln_icediachk )   CALL ice_cons_hsm(0, 'icethd', rdiag_v, rdiag_s, rdiag_t, rdiag_fv, rdiag_fs, rdiag_ft) ! conservation
99      IF( ln_icediachk )   CALL ice_cons2D  (0, 'icethd',  diag_v,  diag_s,  diag_t,  diag_fv,  diag_fs,  diag_ft) ! conservation
100
101      IF( kt == nit000 .AND. lwp ) THEN
102         WRITE(numout,*)
103         WRITE(numout,*) 'ice_thd: sea-ice thermodynamics'
104         WRITE(numout,*) '~~~~~~~'
105      ENDIF
106     
107      !---------------------------------------------!
108      ! computation of friction velocity at T points
109      !---------------------------------------------!
110      IF( ln_icedyn ) THEN
111         zu_io(:,:) = u_ice(:,:) - ssu_m(:,:)
112         zv_io(:,:) = v_ice(:,:) - ssv_m(:,:)
113         DO jj = 2, jpjm1 
114            DO ji = fs_2, fs_jpim1
115               zfric(ji,jj) = rn_cio * ( 0.5_wp *  &
116                  &                    (  zu_io(ji,jj) * zu_io(ji,jj) + zu_io(ji-1,jj) * zu_io(ji-1,jj)   &
117                  &                     + zv_io(ji,jj) * zv_io(ji,jj) + zv_io(ji,jj-1) * zv_io(ji,jj-1) ) ) * tmask(ji,jj,1)
118            END DO
119         END DO
120      ELSE      !  if no ice dynamics => transmit directly the atmospheric stress to the ocean
121         DO jj = 2, jpjm1
122            DO ji = fs_2, fs_jpim1
123               zfric(ji,jj) = r1_rau0 * SQRT( 0.5_wp *  &
124                  &                         (  utau(ji,jj) * utau(ji,jj) + utau(ji-1,jj) * utau(ji-1,jj)   &
125                  &                          + vtau(ji,jj) * vtau(ji,jj) + vtau(ji,jj-1) * vtau(ji,jj-1) ) ) * tmask(ji,jj,1)
126            END DO
127         END DO
128      ENDIF
129      CALL lbc_lnk( 'icethd', zfric, 'T',  1. )
130      !
131      !--------------------------------------------------------------------!
132      ! Partial computation of forcing for the thermodynamic sea ice model
133      !--------------------------------------------------------------------!
134      DO jj = 1, jpj
135         DO ji = 1, jpi
136            rswitch  = tmask(ji,jj,1) * MAX( 0._wp , SIGN( 1._wp , at_i(ji,jj) - epsi10 ) ) ! 0 if no ice
137            !
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)
143            !
144            ! --- Energy received in the lead from atm-oce exchanges, zqld is defined everywhere (J.m-2) --- !
145            zqld =  tmask(ji,jj,1) * rdt_ice *  &
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) )
148
149            ! --- Energy needed to bring ocean surface layer until its freezing (mostly<0 but >0 if supercooling, J.m-2) --- !
150            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)
151            zqfr_neg = MIN( zqfr , 0._wp )                                                                    ! only < 0
152
153            ! --- Sensible ocean-to-ice heat flux (mostly>0 but <0 if supercooling, W/m2)
154            zfric_u            = MAX( SQRT( zfric(ji,jj) ), zfric_umin ) 
155            qsb_ice_bot(ji,jj) = rswitch * rau0 * rcp * zch * zfric_u * ( ( sst_m(ji,jj) + rt0 ) - t_bo(ji,jj) ) ! W.m-2
156
157            qsb_ice_bot(ji,jj) = rswitch * MIN( qsb_ice_bot(ji,jj), - zqfr_neg * r1_rdtice / MAX( at_i(ji,jj), epsi10 ) )
158            ! upper bound for qsb_ice_bot: the heat retrieved from the ocean must be smaller than the heat necessary to reach
159            !                              the freezing point, so that we do not have SST < T_freeze
160            !                              This implies: - ( qsb_ice_bot(ji,jj) * at_i(ji,jj) * rtdice ) - zqfr >= 0
161
162            !-- Energy Budget of the leads (J.m-2), source of ice growth in open water. Must be < 0 to form ice
163            qlead(ji,jj) = MIN( 0._wp , zqld - ( qsb_ice_bot(ji,jj) * at_i(ji,jj) * rdt_ice ) - zqfr )
164
165            ! If there is ice and leads are warming => transfer energy from the lead budget and use it for bottom melting
166            ! If the grid cell is fully covered by ice (no leads) => transfer energy from the lead budget to the ice bottom budget
167            IF( ( zqld >= 0._wp .AND. at_i(ji,jj) > 0._wp ) .OR. at_i(ji,jj) >= (1._wp - epsi10) ) THEN
168               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
169               ELSE                    ;   fhld(ji,jj) = 0._wp
170               ENDIF
171               qlead(ji,jj) = 0._wp
172            ELSE
173               fhld (ji,jj) = 0._wp
174            ENDIF
175            !
176            ! Net heat flux on top of the ice-ocean [W.m-2]
177            ! ---------------------------------------------
178            qt_atm_oi(ji,jj) = qns_tot(ji,jj) + qsr_tot(ji,jj) 
179         END DO
180      END DO
181     
182      ! In case we bypass open-water ice formation
183      IF( .NOT. ln_icedO )  qlead(:,:) = 0._wp
184      ! In case we bypass growing/melting from top and bottom
185      IF( .NOT. ln_icedH ) THEN
186         qsb_ice_bot(:,:) = 0._wp
187         fhld       (:,:) = 0._wp
188      ENDIF
189
190      ! ---------------------------------------------------------------------
191      ! Net heat flux on top of the ocean after ice thermo (1st step) [W.m-2]
192      ! ---------------------------------------------------------------------
193      !     First  step here              :  non solar + precip - qlead - qsensible
194      !     Second step in icethd_dh      :  heat remaining if total melt (zq_rema)
195      !     Third  step in iceupdate.F90  :  heat from ice-ocean mass exchange (zf_mass) + solar
196      qt_oce_ai(:,:) = ( 1._wp - at_i_b(:,:) ) * qns_oce(:,:) + qemp_oce(:,:)  &  ! Non solar heat flux received by the ocean               
197         &             - qlead(:,:) * r1_rdtice                                &  ! heat flux taken from the ocean where there is open water ice formation
198         &             - at_i (:,:) * qsb_ice_bot(:,:)                         &  ! heat flux taken by sensible flux
199         &             - at_i (:,:) * fhld       (:,:)                            ! heat flux taken during bottom growth/melt
200      !                                                                           !    (fhld should be 0 while bott growth)
201      !-------------------------------------------------------------------------------------------!
202      ! Thermodynamic computation (only on grid points covered by ice) => loop over ice categories
203      !-------------------------------------------------------------------------------------------!
204      DO jl = 1, jpl
205
206         ! select ice covered grid points
207         npti = 0 ; nptidx(:) = 0
208         DO jj = 1, jpj
209            DO ji = 1, jpi
210               IF ( a_i(ji,jj,jl) > epsi10 ) THEN     
211                  npti         = npti  + 1
212                  nptidx(npti) = (jj - 1) * jpi + ji
213               ENDIF
214            END DO
215         END DO
216
217         IF( npti > 0 ) THEN  ! If there is no ice, do nothing.
218            !                                                               
219                              CALL ice_thd_1d2d( jl, 1 )            ! --- Move to 1D arrays --- !
220            !                                                       ! --- & Change units of e_i, e_s from J/m2 to J/m3 --- !
221            !
222            s_i_new   (1:npti) = 0._wp ; dh_s_tot(1:npti) = 0._wp  ! --- some init --- !  (important to have them here)
223            dh_i_sum  (1:npti) = 0._wp ; dh_i_bom(1:npti) = 0._wp ; dh_i_itm  (1:npti) = 0._wp 
224            dh_i_sub  (1:npti) = 0._wp ; dh_i_bog(1:npti) = 0._wp
225            dh_snowice(1:npti) = 0._wp ; dh_s_mlt(1:npti) = 0._wp
226            !                                     
227                              CALL ice_thd_zdf                      ! --- Ice-Snow temperature --- !
228            !
229            IF( ln_icedH ) THEN                                     ! --- Growing/Melting --- !
230                              CALL ice_thd_dh                           ! Ice-Snow thickness   
231                              CALL ice_thd_pnd                          ! Melt ponds formation
232                              CALL ice_thd_ent( e_i_1d(1:npti,:) )      ! Ice enthalpy remapping
233            ENDIF
234                              CALL ice_thd_sal( ln_icedS )          ! --- Ice salinity --- !   
235            !
236                              CALL ice_thd_temp                     ! --- Temperature update --- !
237            !
238            IF( ln_icedH .AND. ln_virtual_itd ) &
239               &              CALL ice_thd_mono                     ! --- Extra lateral melting if virtual_itd --- !
240            !
241            IF( ln_icedA )    CALL ice_thd_da                       ! --- Lateral melting --- !
242            !
243                              CALL ice_thd_1d2d( jl, 2 )            ! --- Change units of e_i, e_s from J/m3 to J/m2 --- !
244            !                                                       ! --- & Move to 2D arrays --- !
245         ENDIF
246         !
247      END DO
248      !
249      IF( ln_icediachk )   CALL ice_cons_hsm(1, 'icethd', rdiag_v, rdiag_s, rdiag_t, rdiag_fv, rdiag_fs, rdiag_ft)
250      IF( ln_icediachk )   CALL ice_cons2D  (1, 'icethd',  diag_v,  diag_s,  diag_t,  diag_fv,  diag_fs,  diag_ft)
251      !                   
252      IF( jpl > 1  )          CALL ice_itd_rem( kt )                ! --- Transport ice between thickness categories --- !
253      !
254      IF( ln_icedO )          CALL ice_thd_do                       ! --- Frazil ice growth in leads --- !
255      !
256      ! controls
257      IF( ln_zdf_chkcvg .AND. iom_use('tice_cvg') )  CALL iom_put( 'tice_cvg', tice_cvg ) ! convergence of zdf scheme
258      IF( ln_icectl )   CALL ice_prt    (kt, iiceprt, jiceprt, 1, ' - ice thermodyn. - ') ! prints
259      IF( ln_ctl    )   CALL ice_prt3D  ('icethd')                                        ! prints
260      IF( ln_timing )   CALL timing_stop('icethd')                                        ! timing
261      !
262   END SUBROUTINE ice_thd 
263
264 
265   SUBROUTINE ice_thd_temp
266      !!-----------------------------------------------------------------------
267      !!                   ***  ROUTINE ice_thd_temp ***
268      !!                 
269      !! ** Purpose :   Computes sea ice temperature (Kelvin) from enthalpy
270      !!
271      !! ** Method  :   Formula (Bitz and Lipscomb, 1999)
272      !!-------------------------------------------------------------------
273      INTEGER  ::   ji, jk   ! dummy loop indices
274      REAL(wp) ::   ztmelts, zbbb, zccc  ! local scalar
275      !!-------------------------------------------------------------------
276      ! Recover ice temperature
277      DO jk = 1, nlay_i
278         DO ji = 1, npti
279            ztmelts       = -rTmlt * sz_i_1d(ji,jk)
280            ! Conversion q(S,T) -> T (second order equation)
281            zbbb          = ( rcp - rcpi ) * ztmelts + e_i_1d(ji,jk) * r1_rhoi - rLfus
282            zccc          = SQRT( MAX( zbbb * zbbb - 4._wp * rcpi * rLfus * ztmelts, 0._wp ) )
283            t_i_1d(ji,jk) = rt0 - ( zbbb + zccc ) * 0.5_wp * r1_rcpi
284           
285            ! mask temperature
286            rswitch       = 1._wp - MAX( 0._wp , SIGN( 1._wp , - h_i_1d(ji) ) ) 
287            t_i_1d(ji,jk) = rswitch * t_i_1d(ji,jk) + ( 1._wp - rswitch ) * rt0
288         END DO
289      END DO 
290      !
291   END SUBROUTINE ice_thd_temp
292
293
294   SUBROUTINE ice_thd_mono
295      !!-----------------------------------------------------------------------
296      !!                   ***  ROUTINE ice_thd_mono ***
297      !!                 
298      !! ** Purpose :   Lateral melting in case virtual_itd
299      !!                          ( dA = A/2h dh )
300      !!-----------------------------------------------------------------------
301      INTEGER  ::   ji                 ! dummy loop indices
302      REAL(wp) ::   zhi_bef            ! ice thickness before thermo
303      REAL(wp) ::   zdh_mel, zda_mel   ! net melting
304      REAL(wp) ::   zvi, zvs           ! ice/snow volumes
305      !!-----------------------------------------------------------------------
306      !
307      DO ji = 1, npti
308         zdh_mel = MIN( 0._wp, dh_i_itm(ji) + dh_i_sum(ji) + dh_i_bom(ji) + dh_snowice(ji) + dh_i_sub(ji) )
309         IF( zdh_mel < 0._wp .AND. a_i_1d(ji) > 0._wp )  THEN
310            zvi          = a_i_1d(ji) * h_i_1d(ji)
311            zvs          = a_i_1d(ji) * h_s_1d(ji)
312            ! lateral melting = concentration change
313            zhi_bef     = h_i_1d(ji) - zdh_mel
314            rswitch     = MAX( 0._wp , SIGN( 1._wp , zhi_bef - epsi20 ) )
315            zda_mel     = rswitch * a_i_1d(ji) * zdh_mel / ( 2._wp * MAX( zhi_bef, epsi20 ) )
316            a_i_1d(ji)  = MAX( epsi20, a_i_1d(ji) + zda_mel ) 
317            ! adjust thickness
318            h_i_1d(ji) = zvi / a_i_1d(ji)           
319            h_s_1d(ji) = zvs / a_i_1d(ji)           
320            ! retrieve total concentration
321            at_i_1d(ji) = a_i_1d(ji)
322         END IF
323      END DO
324      !
325   END SUBROUTINE ice_thd_mono
326
327
328   SUBROUTINE ice_thd_1d2d( kl, kn )
329      !!-----------------------------------------------------------------------
330      !!                   ***  ROUTINE ice_thd_1d2d ***
331      !!                 
332      !! ** Purpose :   move arrays from 1d to 2d and the reverse
333      !!-----------------------------------------------------------------------
334      INTEGER, INTENT(in) ::   kl   ! index of the ice category
335      INTEGER, INTENT(in) ::   kn   ! 1= from 2D to 1D   ;   2= from 1D to 2D
336      !
337      INTEGER ::   jk   ! dummy loop indices
338      !!-----------------------------------------------------------------------
339      !
340      SELECT CASE( kn )
341      !                    !---------------------!
342      CASE( 1 )            !==  from 2D to 1D  ==!
343         !                 !---------------------!
344         CALL tab_2d_1d( npti, nptidx(1:npti), at_i_1d(1:npti), at_i             )
345         CALL tab_2d_1d( npti, nptidx(1:npti), a_i_1d (1:npti), a_i (:,:,kl)     )
346         CALL tab_2d_1d( npti, nptidx(1:npti), h_i_1d (1:npti), h_i (:,:,kl)     )
347         CALL tab_2d_1d( npti, nptidx(1:npti), h_s_1d (1:npti), h_s (:,:,kl)     )
348         CALL tab_2d_1d( npti, nptidx(1:npti), t_su_1d(1:npti), t_su(:,:,kl)     )
349         CALL tab_2d_1d( npti, nptidx(1:npti), s_i_1d (1:npti), s_i (:,:,kl)     )
350         DO jk = 1, nlay_s
351            CALL tab_2d_1d( npti, nptidx(1:npti), t_s_1d(1:npti,jk), t_s(:,:,jk,kl)    )
352            CALL tab_2d_1d( npti, nptidx(1:npti), e_s_1d(1:npti,jk), e_s(:,:,jk,kl)    )
353         END DO
354         DO jk = 1, nlay_i
355            CALL tab_2d_1d( npti, nptidx(1:npti), t_i_1d (1:npti,jk), t_i (:,:,jk,kl)  )
356            CALL tab_2d_1d( npti, nptidx(1:npti), e_i_1d (1:npti,jk), e_i (:,:,jk,kl)  )
357            CALL tab_2d_1d( npti, nptidx(1:npti), sz_i_1d(1:npti,jk), sz_i(:,:,jk,kl)  )
358         END DO
359         CALL tab_2d_1d( npti, nptidx(1:npti), a_ip_1d     (1:npti), a_ip     (:,:,kl) )
360         CALL tab_2d_1d( npti, nptidx(1:npti), h_ip_1d     (1:npti), h_ip     (:,:,kl) )
361         CALL tab_2d_1d( npti, nptidx(1:npti), h_il_1d     (1:npti), h_il     (:,:,kl) )
362         !
363         CALL tab_2d_1d( npti, nptidx(1:npti), qprec_ice_1d  (1:npti), qprec_ice            )
364         CALL tab_2d_1d( npti, nptidx(1:npti), qsr_ice_1d    (1:npti), qsr_ice (:,:,kl)     )
365         CALL tab_2d_1d( npti, nptidx(1:npti), qns_ice_1d    (1:npti), qns_ice (:,:,kl)     )
366         CALL tab_2d_1d( npti, nptidx(1:npti), evap_ice_1d   (1:npti), evap_ice(:,:,kl)     )
367         CALL tab_2d_1d( npti, nptidx(1:npti), dqns_ice_1d   (1:npti), dqns_ice(:,:,kl)     )
368         CALL tab_2d_1d( npti, nptidx(1:npti), t_bo_1d       (1:npti), t_bo                 )
369         CALL tab_2d_1d( npti, nptidx(1:npti), sprecip_1d    (1:npti), sprecip              ) 
370         CALL tab_2d_1d( npti, nptidx(1:npti), qsb_ice_bot_1d(1:npti), qsb_ice_bot          )
371         CALL tab_2d_1d( npti, nptidx(1:npti), fhld_1d       (1:npti), fhld                 )
372         
373         CALL tab_2d_1d( npti, nptidx(1:npti), qml_ice_1d    (1:npti), qml_ice    (:,:,kl) )
374         CALL tab_2d_1d( npti, nptidx(1:npti), qcn_ice_1d    (1:npti), qcn_ice    (:,:,kl) )
375         CALL tab_2d_1d( npti, nptidx(1:npti), qtr_ice_top_1d(1:npti), qtr_ice_top(:,:,kl) )
376         !
377         CALL tab_2d_1d( npti, nptidx(1:npti), wfx_snw_sni_1d(1:npti), wfx_snw_sni   )
378         CALL tab_2d_1d( npti, nptidx(1:npti), wfx_snw_sum_1d(1:npti), wfx_snw_sum   )
379         CALL tab_2d_1d( npti, nptidx(1:npti), wfx_sub_1d    (1:npti), wfx_sub       )
380         CALL tab_2d_1d( npti, nptidx(1:npti), wfx_snw_sub_1d(1:npti), wfx_snw_sub   )
381         CALL tab_2d_1d( npti, nptidx(1:npti), wfx_ice_sub_1d(1:npti), wfx_ice_sub   )
382         CALL tab_2d_1d( npti, nptidx(1:npti), wfx_err_sub_1d(1:npti), wfx_err_sub   )
383         !
384         CALL tab_2d_1d( npti, nptidx(1:npti), wfx_bog_1d (1:npti), wfx_bog          )
385         CALL tab_2d_1d( npti, nptidx(1:npti), wfx_bom_1d (1:npti), wfx_bom          )
386         CALL tab_2d_1d( npti, nptidx(1:npti), wfx_sum_1d (1:npti), wfx_sum          )
387         CALL tab_2d_1d( npti, nptidx(1:npti), wfx_sni_1d (1:npti), wfx_sni          )
388         CALL tab_2d_1d( npti, nptidx(1:npti), wfx_res_1d (1:npti), wfx_res          )
389         CALL tab_2d_1d( npti, nptidx(1:npti), wfx_spr_1d (1:npti), wfx_spr          )
390         CALL tab_2d_1d( npti, nptidx(1:npti), wfx_lam_1d (1:npti), wfx_lam          )
391         CALL tab_2d_1d( npti, nptidx(1:npti), wfx_pnd_1d (1:npti), wfx_pnd          )
392         !
393         CALL tab_2d_1d( npti, nptidx(1:npti), sfx_bog_1d (1:npti), sfx_bog          )
394         CALL tab_2d_1d( npti, nptidx(1:npti), sfx_bom_1d (1:npti), sfx_bom          )
395         CALL tab_2d_1d( npti, nptidx(1:npti), sfx_sum_1d (1:npti), sfx_sum          )
396         CALL tab_2d_1d( npti, nptidx(1:npti), sfx_sni_1d (1:npti), sfx_sni          )
397         CALL tab_2d_1d( npti, nptidx(1:npti), sfx_bri_1d (1:npti), sfx_bri          )
398         CALL tab_2d_1d( npti, nptidx(1:npti), sfx_res_1d (1:npti), sfx_res          )
399         CALL tab_2d_1d( npti, nptidx(1:npti), sfx_sub_1d (1:npti), sfx_sub          )
400         CALL tab_2d_1d( npti, nptidx(1:npti), sfx_lam_1d (1:npti), sfx_lam          )
401         !
402         CALL tab_2d_1d( npti, nptidx(1:npti), hfx_thd_1d    (1:npti), hfx_thd       )
403         CALL tab_2d_1d( npti, nptidx(1:npti), hfx_spr_1d    (1:npti), hfx_spr       )
404         CALL tab_2d_1d( npti, nptidx(1:npti), hfx_sum_1d    (1:npti), hfx_sum       )
405         CALL tab_2d_1d( npti, nptidx(1:npti), hfx_bom_1d    (1:npti), hfx_bom       )
406         CALL tab_2d_1d( npti, nptidx(1:npti), hfx_bog_1d    (1:npti), hfx_bog       )
407         CALL tab_2d_1d( npti, nptidx(1:npti), hfx_dif_1d    (1:npti), hfx_dif       )
408         CALL tab_2d_1d( npti, nptidx(1:npti), hfx_opw_1d    (1:npti), hfx_opw       )
409         CALL tab_2d_1d( npti, nptidx(1:npti), hfx_snw_1d    (1:npti), hfx_snw       )
410         CALL tab_2d_1d( npti, nptidx(1:npti), hfx_sub_1d    (1:npti), hfx_sub       )
411         CALL tab_2d_1d( npti, nptidx(1:npti), hfx_res_1d    (1:npti), hfx_res       )
412         CALL tab_2d_1d( npti, nptidx(1:npti), hfx_err_dif_1d(1:npti), hfx_err_dif   )
413         CALL tab_2d_1d( npti, nptidx(1:npti), qt_oce_ai_1d  (1:npti), qt_oce_ai     )
414         !
415         ! ocean surface fields
416         CALL tab_2d_1d( npti, nptidx(1:npti), sst_1d(1:npti), sst_m )
417         CALL tab_2d_1d( npti, nptidx(1:npti), sss_1d(1:npti), sss_m )
418         !
419         ! to update ice age
420         CALL tab_2d_1d( npti, nptidx(1:npti), o_i_1d (1:npti), o_i (:,:,kl) )
421         CALL tab_2d_1d( npti, nptidx(1:npti), oa_i_1d(1:npti), oa_i(:,:,kl) )
422         !
423         ! --- Change units of e_i, e_s from J/m2 to J/m3 --- !
424         DO jk = 1, nlay_i
425            WHERE( h_i_1d(1:npti)>0._wp ) e_i_1d(1:npti,jk) = e_i_1d(1:npti,jk) / (h_i_1d(1:npti) * a_i_1d(1:npti)) * nlay_i
426         END DO
427         DO jk = 1, nlay_s
428            WHERE( h_s_1d(1:npti)>0._wp ) e_s_1d(1:npti,jk) = e_s_1d(1:npti,jk) / (h_s_1d(1:npti) * a_i_1d(1:npti)) * nlay_s
429         END DO
430         !
431         !                 !---------------------!
432      CASE( 2 )            !==  from 1D to 2D  ==!
433         !                 !---------------------!
434         ! --- Change units of e_i, e_s from J/m3 to J/m2 --- !
435         DO jk = 1, nlay_i
436            e_i_1d(1:npti,jk) = e_i_1d(1:npti,jk) * h_i_1d(1:npti) * a_i_1d(1:npti) * r1_nlay_i
437         END DO
438         DO jk = 1, nlay_s
439            e_s_1d(1:npti,jk) = e_s_1d(1:npti,jk) * h_s_1d(1:npti) * a_i_1d(1:npti) * r1_nlay_s
440         END DO
441         !
442         ! Change thickness to volume (replaces routine ice_var_eqv2glo)
443         v_i_1d (1:npti) = h_i_1d (1:npti) * a_i_1d (1:npti)
444         v_s_1d (1:npti) = h_s_1d (1:npti) * a_i_1d (1:npti)
445         sv_i_1d(1:npti) = s_i_1d (1:npti) * v_i_1d (1:npti)
446         v_ip_1d(1:npti) = h_ip_1d(1:npti) * a_ip_1d(1:npti)
447         v_il_1d(1:npti) = h_il_1d(1:npti) * a_ip_1d(1:npti)
448         oa_i_1d(1:npti) = o_i_1d (1:npti) * a_i_1d (1:npti)
449         
450         CALL tab_1d_2d( npti, nptidx(1:npti), at_i_1d(1:npti), at_i             )
451         CALL tab_1d_2d( npti, nptidx(1:npti), a_i_1d (1:npti), a_i (:,:,kl)     )
452         CALL tab_1d_2d( npti, nptidx(1:npti), h_i_1d (1:npti), h_i (:,:,kl)     )
453         CALL tab_1d_2d( npti, nptidx(1:npti), h_s_1d (1:npti), h_s (:,:,kl)     )
454         CALL tab_1d_2d( npti, nptidx(1:npti), t_su_1d(1:npti), t_su(:,:,kl)     )
455         CALL tab_1d_2d( npti, nptidx(1:npti), s_i_1d (1:npti), s_i (:,:,kl)     )
456         DO jk = 1, nlay_s
457            CALL tab_1d_2d( npti, nptidx(1:npti), t_s_1d(1:npti,jk), t_s(:,:,jk,kl)    )
458            CALL tab_1d_2d( npti, nptidx(1:npti), e_s_1d(1:npti,jk), e_s(:,:,jk,kl)    )
459         END DO
460         DO jk = 1, nlay_i
461            CALL tab_1d_2d( npti, nptidx(1:npti), t_i_1d (1:npti,jk), t_i (:,:,jk,kl)  )
462            CALL tab_1d_2d( npti, nptidx(1:npti), e_i_1d (1:npti,jk), e_i (:,:,jk,kl)  )
463            CALL tab_1d_2d( npti, nptidx(1:npti), sz_i_1d(1:npti,jk), sz_i(:,:,jk,kl)  )
464         END DO
465         CALL tab_1d_2d( npti, nptidx(1:npti), a_ip_1d     (1:npti), a_ip     (:,:,kl) )
466         CALL tab_1d_2d( npti, nptidx(1:npti), h_ip_1d     (1:npti), h_ip     (:,:,kl) )
467         CALL tab_1d_2d( npti, nptidx(1:npti), h_il_1d     (1:npti), h_il     (:,:,kl) )
468         !
469         CALL tab_1d_2d( npti, nptidx(1:npti), wfx_snw_sni_1d(1:npti), wfx_snw_sni )
470         CALL tab_1d_2d( npti, nptidx(1:npti), wfx_snw_sum_1d(1:npti), wfx_snw_sum )
471         CALL tab_1d_2d( npti, nptidx(1:npti), wfx_sub_1d    (1:npti), wfx_sub     )
472         CALL tab_1d_2d( npti, nptidx(1:npti), wfx_snw_sub_1d(1:npti), wfx_snw_sub )
473         CALL tab_1d_2d( npti, nptidx(1:npti), wfx_ice_sub_1d(1:npti), wfx_ice_sub )
474         CALL tab_1d_2d( npti, nptidx(1:npti), wfx_err_sub_1d(1:npti), wfx_err_sub )
475         !
476         CALL tab_1d_2d( npti, nptidx(1:npti), wfx_bog_1d (1:npti), wfx_bog        )
477         CALL tab_1d_2d( npti, nptidx(1:npti), wfx_bom_1d (1:npti), wfx_bom        )
478         CALL tab_1d_2d( npti, nptidx(1:npti), wfx_sum_1d (1:npti), wfx_sum        )
479         CALL tab_1d_2d( npti, nptidx(1:npti), wfx_sni_1d (1:npti), wfx_sni        )
480         CALL tab_1d_2d( npti, nptidx(1:npti), wfx_res_1d (1:npti), wfx_res        )
481         CALL tab_1d_2d( npti, nptidx(1:npti), wfx_spr_1d (1:npti), wfx_spr        )
482         CALL tab_1d_2d( npti, nptidx(1:npti), wfx_lam_1d (1:npti), wfx_lam        )
483         CALL tab_1d_2d( npti, nptidx(1:npti), wfx_pnd_1d (1:npti), wfx_pnd        )
484         !
485         CALL tab_1d_2d( npti, nptidx(1:npti), sfx_bog_1d (1:npti), sfx_bog        )
486         CALL tab_1d_2d( npti, nptidx(1:npti), sfx_bom_1d (1:npti), sfx_bom        )
487         CALL tab_1d_2d( npti, nptidx(1:npti), sfx_sum_1d (1:npti), sfx_sum        )
488         CALL tab_1d_2d( npti, nptidx(1:npti), sfx_sni_1d (1:npti), sfx_sni        )
489         CALL tab_1d_2d( npti, nptidx(1:npti), sfx_bri_1d (1:npti), sfx_bri        )
490         CALL tab_1d_2d( npti, nptidx(1:npti), sfx_res_1d (1:npti), sfx_res        )
491         CALL tab_1d_2d( npti, nptidx(1:npti), sfx_sub_1d (1:npti), sfx_sub        )
492         CALL tab_1d_2d( npti, nptidx(1:npti), sfx_lam_1d (1:npti), sfx_lam        )
493         !
494         CALL tab_1d_2d( npti, nptidx(1:npti), hfx_thd_1d    (1:npti), hfx_thd     )
495         CALL tab_1d_2d( npti, nptidx(1:npti), hfx_spr_1d    (1:npti), hfx_spr     )
496         CALL tab_1d_2d( npti, nptidx(1:npti), hfx_sum_1d    (1:npti), hfx_sum     )
497         CALL tab_1d_2d( npti, nptidx(1:npti), hfx_bom_1d    (1:npti), hfx_bom     )
498         CALL tab_1d_2d( npti, nptidx(1:npti), hfx_bog_1d    (1:npti), hfx_bog     )
499         CALL tab_1d_2d( npti, nptidx(1:npti), hfx_dif_1d    (1:npti), hfx_dif     )
500         CALL tab_1d_2d( npti, nptidx(1:npti), hfx_opw_1d    (1:npti), hfx_opw     )
501         CALL tab_1d_2d( npti, nptidx(1:npti), hfx_snw_1d    (1:npti), hfx_snw     )
502         CALL tab_1d_2d( npti, nptidx(1:npti), hfx_sub_1d    (1:npti), hfx_sub     )
503         CALL tab_1d_2d( npti, nptidx(1:npti), hfx_res_1d    (1:npti), hfx_res     )
504         CALL tab_1d_2d( npti, nptidx(1:npti), hfx_err_dif_1d(1:npti), hfx_err_dif )
505         CALL tab_1d_2d( npti, nptidx(1:npti), qt_oce_ai_1d  (1:npti), qt_oce_ai   )
506         !
507         CALL tab_1d_2d( npti, nptidx(1:npti), qns_ice_1d    (1:npti), qns_ice    (:,:,kl) )
508         CALL tab_1d_2d( npti, nptidx(1:npti), qtr_ice_bot_1d(1:npti), qtr_ice_bot(:,:,kl) )
509         ! effective conductivity and 1st layer temperature (ln_cndflx=T)
510         CALL tab_1d_2d( npti, nptidx(1:npti), cnd_ice_1d(1:npti), cnd_ice(:,:,kl) )
511         CALL tab_1d_2d( npti, nptidx(1:npti), t1_ice_1d (1:npti), t1_ice (:,:,kl) )
512         ! SIMIP diagnostics         
513         CALL tab_1d_2d( npti, nptidx(1:npti), t_si_1d       (1:npti), t_si       (:,:,kl) )
514         CALL tab_1d_2d( npti, nptidx(1:npti), qcn_ice_bot_1d(1:npti), qcn_ice_bot(:,:,kl) )
515         CALL tab_1d_2d( npti, nptidx(1:npti), qcn_ice_top_1d(1:npti), qcn_ice_top(:,:,kl) )
516         ! extensive variables
517         CALL tab_1d_2d( npti, nptidx(1:npti), v_i_1d (1:npti), v_i (:,:,kl) )
518         CALL tab_1d_2d( npti, nptidx(1:npti), v_s_1d (1:npti), v_s (:,:,kl) )
519         CALL tab_1d_2d( npti, nptidx(1:npti), sv_i_1d(1:npti), sv_i(:,:,kl) )
520         CALL tab_1d_2d( npti, nptidx(1:npti), v_ip_1d(1:npti), v_ip(:,:,kl) )
521         CALL tab_1d_2d( npti, nptidx(1:npti), v_il_1d(1:npti), v_il(:,:,kl) )
522         CALL tab_1d_2d( npti, nptidx(1:npti), oa_i_1d(1:npti), oa_i(:,:,kl) )
523         ! check convergence of heat diffusion scheme
524         IF( ln_zdf_chkcvg ) THEN
525            CALL tab_1d_2d( npti, nptidx(1:npti), tice_cvg_1d(1:npti), tice_cvg(:,:,kl) )
526         ENDIF
527         !
528      END SELECT
529      !
530   END SUBROUTINE ice_thd_1d2d
531
532
533   SUBROUTINE ice_thd_init
534      !!-------------------------------------------------------------------
535      !!                   ***  ROUTINE ice_thd_init ***
536      !!                 
537      !! ** Purpose :   Physical constants and parameters associated with
538      !!                ice thermodynamics
539      !!
540      !! ** Method  :   Read the namthd namelist and check the parameters
541      !!                called at the first timestep (nit000)
542      !!
543      !! ** input   :   Namelist namthd
544      !!-------------------------------------------------------------------
545      INTEGER  ::   ios   ! Local integer output status for namelist read
546      !!
547      NAMELIST/namthd/ ln_icedH, ln_icedA, ln_icedO, ln_icedS, ln_leadhfx
548      !!-------------------------------------------------------------------
549      !
550      REWIND( numnam_ice_ref )              ! Namelist namthd in reference namelist : Ice thermodynamics
551      READ  ( numnam_ice_ref, namthd, IOSTAT = ios, ERR = 901)
552901   IF( ios /= 0 )   CALL ctl_nam ( ios , 'namthd in reference namelist' )
553      REWIND( numnam_ice_cfg )              ! Namelist namthd in configuration namelist : Ice thermodynamics
554      READ  ( numnam_ice_cfg, namthd, IOSTAT = ios, ERR = 902 )
555902   IF( ios >  0 )   CALL ctl_nam ( ios , 'namthd in configuration namelist' )
556      IF(lwm) WRITE( numoni, namthd )
557      !
558      IF(lwp) THEN                          ! control print
559         WRITE(numout,*)
560         WRITE(numout,*) 'ice_thd_init: Ice Thermodynamics'
561         WRITE(numout,*) '~~~~~~~~~~~~'
562         WRITE(numout,*) '   Namelist namthd:'
563         WRITE(numout,*) '      activate ice thick change from top/bot (T) or not (F)                ln_icedH   = ', ln_icedH
564         WRITE(numout,*) '      activate lateral melting (T) or not (F)                              ln_icedA   = ', ln_icedA
565         WRITE(numout,*) '      activate ice growth in open-water (T) or not (F)                     ln_icedO   = ', ln_icedO
566         WRITE(numout,*) '      activate gravity drainage and flushing (T) or not (F)                ln_icedS   = ', ln_icedS
567         WRITE(numout,*) '      heat in the leads is used to melt sea-ice before warming the ocean   ln_leadhfx = ', ln_leadhfx
568     ENDIF
569      !
570                       CALL ice_thd_zdf_init   ! set ice heat diffusion parameters
571      IF( ln_icedA )   CALL ice_thd_da_init    ! set ice lateral melting parameters
572      IF( ln_icedO )   CALL ice_thd_do_init    ! set ice growth in open water parameters
573                       CALL ice_thd_sal_init   ! set ice salinity parameters
574                       CALL ice_thd_pnd_init   ! set melt ponds parameters
575      !
576   END SUBROUTINE ice_thd_init
577
578#else
579   !!----------------------------------------------------------------------
580   !!   Default option         Dummy module          NO  SI3 sea-ice model
581   !!----------------------------------------------------------------------
582#endif
583
584   !!======================================================================
585END MODULE icethd
Note: See TracBrowser for help on using the repository browser.