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_lac.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_lac.F90 @ 8373

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

remove most of wrk_alloc

  • Property svn:keywords set to Id
File size: 23.1 KB
Line 
1MODULE limthd_lac
2   !!======================================================================
3   !!                       ***  MODULE limthd_lac   ***
4   !!                lateral thermodynamic growth of the ice
5   !!======================================================================
6   !! History :  LIM  ! 2005-12 (M. Vancoppenolle)  Original code
7   !!             -   ! 2006-01 (M. Vancoppenolle)  add ITD
8   !!            3.0  ! 2007-07 (M. Vancoppenolle)  Mass and energy conservation tested
9   !!            4.0  ! 2011-02 (G. Madec) dynamical allocation
10   !!----------------------------------------------------------------------
11#if defined key_lim3
12   !!----------------------------------------------------------------------
13   !!   'key_lim3'                                      LIM3 sea-ice model
14   !!----------------------------------------------------------------------
15   !!   lim_lat_acr   : lateral accretion of ice
16   !!----------------------------------------------------------------------
17   USE par_oce        ! ocean parameters
18   USE dom_oce        ! domain variables
19   USE phycst         ! physical constants
20   USE sbc_oce , ONLY : sss_m
21   USE sbc_ice , ONLY : utau_ice, vtau_ice
22   USE thd_ice        ! LIM thermodynamics
23   USE ice            ! LIM variables
24   USE limtab         ! LIM 2D <==> 1D
25   USE limcons        ! LIM conservation
26   USE in_out_manager ! I/O manager
27   USE lib_mpp        ! MPP library
28   USE wrk_nemo       ! work arrays
29   USE lbclnk         ! ocean lateral boundary conditions (or mpp link)
30   USE lib_fortran    ! Fortran utilities (allows no signed zero when 'key_nosignedzero' defined) 
31   USE limthd_ent
32   USE limvar
33
34   IMPLICIT NONE
35   PRIVATE
36
37   PUBLIC lim_thd_lac     ! called by lim_thd
38
39   !!----------------------------------------------------------------------
40   !! NEMO/LIM3 4.0 , UCL - NEMO Consortium (2011)
41   !! $Id$
42   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
43   !!----------------------------------------------------------------------
44CONTAINS
45
46   SUBROUTINE lim_thd_lac
47      !!-------------------------------------------------------------------
48      !!               ***   ROUTINE lim_thd_lac  ***
49      !! 
50      !! ** Purpose : Computation of the evolution of the ice thickness and
51      !!      concentration as a function of the heat balance in the leads.
52      !!      It is only used for lateral accretion
53      !!       
54      !! ** Method  : Ice is formed in the open water when ocean lose heat
55      !!      (heat budget of open water Bl is negative) .
56      !!      Computation of the increase of 1-A (ice concentration) fol-
57      !!      lowing the law :
58      !!      (dA/dt)acc = F[ (1-A)/(1-a) ] * [ Bl / (Li*h0) ]
59      !!       where - h0 is the thickness of ice created in the lead
60      !!             - a is a minimum fraction for leads
61      !!             - F is a monotonic non-increasing function defined as:
62      !!                  F(X)=( 1 - X**exld )**(1.0/exld)
63      !!             - exld is the exponent closure rate (=2 default val.)
64      !!
65      !! ** Action : - Adjustment of snow and ice thicknesses and heat
66      !!                content in brine pockets
67      !!             - Updating ice internal temperature
68      !!             - Computation of variation of ice volume and mass
69      !!             - Computation of a_i after lateral accretion and
70      !!               update ht_s_1d, ht_i_1d and tbif_1d(:,:)     
71      !!------------------------------------------------------------------------
72      INTEGER  ::   ji,jj,jk,jl      ! dummy loop indices
73      INTEGER  ::   iter     !   -       -
74      REAL(wp) ::   ztmelts, zdv, zfrazb, zweight, zde                          ! local scalars
75      REAL(wp) ::   zgamafr, zvfrx, zvgx, ztaux, ztwogp, zf                     !   -      -
76      REAL(wp) ::   ztenagm, zvfry, zvgy, ztauy, zvrel2, zfp, zsqcd , zhicrit   !   -      -
77
78      REAL(wp) ::   zQm          ! enthalpy exchanged with the ocean (J/m2, >0 towards ocean)
79      REAL(wp) ::   zEi          ! sea ice specific enthalpy (J/kg)
80      REAL(wp) ::   zEw          ! seawater specific enthalpy (J/kg)
81      REAL(wp) ::   zfmdt        ! mass flux x time step (kg/m2, >0 towards ocean)
82     
83      REAL(wp) ::   zv_newfra
84 
85      INTEGER , DIMENSION(jpij) ::   jcat        ! indexes of categories where new ice grows
86      REAL(wp), DIMENSION(jpij) ::   zswinew     ! switch for new ice or not
87
88      REAL(wp), DIMENSION(jpij) ::   zv_newice   ! volume of accreted ice
89      REAL(wp), DIMENSION(jpij) ::   za_newice   ! fractional area of accreted ice
90      REAL(wp), DIMENSION(jpij) ::   zh_newice   ! thickness of accreted ice
91      REAL(wp), DIMENSION(jpij) ::   ze_newice   ! heat content of accreted ice
92      REAL(wp), DIMENSION(jpij) ::   zs_newice   ! salinity of accreted ice
93      REAL(wp), DIMENSION(jpij) ::   zo_newice   ! age of accreted ice
94      REAL(wp), DIMENSION(jpij) ::   zdv_res     ! residual volume in case of excessive heat budget
95      REAL(wp), DIMENSION(jpij) ::   zda_res     ! residual area in case of excessive heat budget
96      REAL(wp), DIMENSION(jpij) ::   zat_i_1d    ! total ice fraction   
97      REAL(wp), DIMENSION(jpij) ::   zv_frazb    ! accretion of frazil ice at the ice bottom
98      REAL(wp), DIMENSION(jpij) ::   zvrel_1d    ! relative ice / frazil velocity (1D vector)
99
100      REAL(wp), DIMENSION(jpij,jpl) ::   zv_b      ! old volume of ice in category jl
101      REAL(wp), DIMENSION(jpij,jpl) ::   za_b      ! old area of ice in category jl
102      REAL(wp), DIMENSION(jpij,jpl) ::   za_i_1d   ! 1-D version of a_i
103      REAL(wp), DIMENSION(jpij,jpl) ::   zv_i_1d   ! 1-D version of v_i
104      REAL(wp), DIMENSION(jpij,jpl) ::   zsmv_i_1d ! 1-D version of smv_i
105
106      REAL(wp), DIMENSION(jpij,nlay_i,jpl) ::   ze_i_1d !: 1-D version of e_i
107
108      REAL(wp), DIMENSION(jpi,jpj) ::   zvrel     ! relative ice / frazil velocity
109
110      REAL(wp) :: zcai = 1.4e-3_wp                     ! ice-air drag (clem: should be dependent on coupling/forcing used)
111      !!-----------------------------------------------------------------------!
112
113      CALL lim_var_agg(1)
114      CALL lim_var_glo2eqv
115
116      !------------------------------------------------------------------------------!
117      ! 3) Collection thickness of ice formed in leads and polynyas
118      !------------------------------------------------------------------------------!   
119      ! hicol is the thickness of new ice formed in open water
120      ! hicol can be either prescribed (frazswi = 0) or computed (frazswi = 1)
121      ! Frazil ice forms in open water, is transported by wind
122      ! accumulates at the edge of the consolidated ice edge
123      ! where it forms aggregates of a specific thickness called
124      ! collection thickness.
125
126      ! Note : the following algorithm currently breaks vectorization
127      !
128
129      zvrel(:,:) = 0._wp
130
131      ! Default new ice thickness
132      WHERE( qlead(:,:) < 0._wp ) ; hicol(:,:) = rn_hnewice
133      ELSEWHERE                   ; hicol(:,:) = 0._wp
134      END WHERE
135
136      IF( ln_frazil ) THEN
137
138         !--------------------
139         ! Physical constants
140         !--------------------
141         hicol(:,:) = 0._wp
142
143         zhicrit = 0.04 ! frazil ice thickness
144         ztwogp  = 2. * rau0 / ( grav * 0.3 * ( rau0 - rhoic ) ) ! reduced grav
145         zsqcd   = 1.0 / SQRT( 1.3 * zcai ) ! 1/SQRT(airdensity*drag)
146         zgamafr = 0.03
147
148         DO jj = 2, jpjm1
149            DO ji = 2, jpim1
150               IF ( qlead(ji,jj) < 0._wp .AND. tau_icebfr(ji,jj) == 0._wp ) THEN ! activated if cooling and no landfast
151                  !-------------
152                  ! Wind stress
153                  !-------------
154                  ! C-grid wind stress components
155                  ztaux         = ( utau_ice(ji-1,jj  ) * umask(ji-1,jj  ,1)   &
156                     &          +   utau_ice(ji  ,jj  ) * umask(ji  ,jj  ,1) ) * 0.5_wp
157                  ztauy         = ( vtau_ice(ji  ,jj-1) * vmask(ji  ,jj-1,1)   &
158                     &          +   vtau_ice(ji  ,jj  ) * vmask(ji  ,jj  ,1) ) * 0.5_wp
159                  ! Square root of wind stress
160                  ztenagm       =  SQRT( SQRT( ztaux * ztaux + ztauy * ztauy ) )
161
162                  !---------------------
163                  ! Frazil ice velocity
164                  !---------------------
165                  rswitch = MAX( 0._wp, SIGN( 1._wp , ztenagm - epsi10 ) )
166                  zvfrx   = rswitch * zgamafr * zsqcd * ztaux / MAX( ztenagm, epsi10 )
167                  zvfry   = rswitch * zgamafr * zsqcd * ztauy / MAX( ztenagm, epsi10 )
168
169                  !-------------------
170                  ! Pack ice velocity
171                  !-------------------
172                  ! C-grid ice velocity
173                  zvgx    = ( u_ice(ji-1,jj  ) * umask(ji-1,jj  ,1)  + u_ice(ji,jj) * umask(ji,jj,1) ) * 0.5_wp
174                  zvgy    = ( v_ice(ji  ,jj-1) * vmask(ji  ,jj-1,1)  + v_ice(ji,jj) * vmask(ji,jj,1) ) * 0.5_wp
175
176                  !-----------------------------------
177                  ! Relative frazil/pack ice velocity
178                  !-----------------------------------
179                  ! absolute relative velocity
180                  rswitch      = MAX( 0._wp, SIGN( 1._wp , at_i(ji,jj) - epsi10 ) )
181                  zvrel2       = MAX(  ( zvfrx - zvgx ) * ( zvfrx - zvgx )   &
182                     &               + ( zvfry - zvgy ) * ( zvfry - zvgy ) , 0.15 * 0.15 ) * rswitch
183                  zvrel(ji,jj) = SQRT( zvrel2 )
184
185                  !---------------------
186                  ! Iterative procedure
187                  !---------------------
188                  hicol(ji,jj) = zhicrit +   ( zhicrit + 0.1 )    &
189                     &                   / ( ( zhicrit + 0.1 ) * ( zhicrit + 0.1 ) -  zhicrit * zhicrit ) * ztwogp * zvrel2
190
191                  iter = 1
192                  DO WHILE ( iter < 20 ) 
193                     zf  = ( hicol(ji,jj) - zhicrit ) * ( hicol(ji,jj) * hicol(ji,jj) - zhicrit * zhicrit ) -   &
194                        &    hicol(ji,jj) * zhicrit * ztwogp * zvrel2
195                     zfp = ( hicol(ji,jj) - zhicrit ) * ( 3.0 * hicol(ji,jj) + zhicrit ) - zhicrit * ztwogp * zvrel2
196
197                     hicol(ji,jj) = hicol(ji,jj) - zf / MAX( zfp, epsi20 )
198                     iter = iter + 1
199                  END DO
200
201               ENDIF ! end of selection of pixels where ice forms
202
203            END DO
204         END DO 
205         !
206         CALL lbc_lnk_multi( zvrel, 'T', 1., hicol, 'T', 1.  )
207
208      ENDIF ! End of computation of frazil ice collection thickness
209
210      !------------------------------------------------------------------------------!
211      ! 4) Identify grid points where new ice forms
212      !------------------------------------------------------------------------------!
213
214      !-------------------------------------
215      ! Select points for new ice formation
216      !-------------------------------------
217      ! This occurs if open water energy budget is negative (cooling) and there is no landfast ice
218      nidx = 0 ; idxice(:) = 0
219      DO jj = 1, jpj
220         DO ji = 1, jpi
221            IF ( qlead(ji,jj)  <  0._wp .AND. tau_icebfr(ji,jj) == 0._wp ) THEN
222               nidx = nidx + 1
223               idxice( nidx ) = (jj - 1) * jpi + ji
224            ENDIF
225         END DO
226      END DO
227
228      !------------------------------
229      ! Move from 2-D to 1-D vectors
230      !------------------------------
231      ! If ocean gains heat do nothing. Otherwise compute new ice formation
232
233      IF ( nidx > 0 ) THEN
234
235         CALL tab_2d_1d( nidx, idxice(1:nidx), zat_i_1d  (1:nidx)     , at_i           )
236         DO jl = 1, jpl
237            CALL tab_2d_1d( nidx, idxice(1:nidx), za_i_1d  (1:nidx,jl), a_i  (:,:,jl)  )
238            CALL tab_2d_1d( nidx, idxice(1:nidx), zv_i_1d  (1:nidx,jl), v_i  (:,:,jl)  )
239            CALL tab_2d_1d( nidx, idxice(1:nidx), zsmv_i_1d(1:nidx,jl), smv_i(:,:,jl)  )
240            DO jk = 1, nlay_i
241               CALL tab_2d_1d( nidx, idxice(1:nidx), ze_i_1d(1:nidx,jk,jl), e_i(:,:,jk,jl)   )
242            END DO
243         END DO
244
245         CALL tab_2d_1d( nidx, idxice(1:nidx), qlead_1d  (1:nidx)     , qlead       )
246         CALL tab_2d_1d( nidx, idxice(1:nidx), t_bo_1d   (1:nidx)     , t_bo        )
247         CALL tab_2d_1d( nidx, idxice(1:nidx), sfx_opw_1d(1:nidx)     , sfx_opw     )
248         CALL tab_2d_1d( nidx, idxice(1:nidx), wfx_opw_1d(1:nidx)     , wfx_opw     )
249         CALL tab_2d_1d( nidx, idxice(1:nidx), hicol_1d  (1:nidx)     , hicol       )
250         CALL tab_2d_1d( nidx, idxice(1:nidx), zvrel_1d  (1:nidx)     , zvrel       )
251
252         CALL tab_2d_1d( nidx, idxice(1:nidx), hfx_thd_1d(1:nidx)     , hfx_thd     )
253         CALL tab_2d_1d( nidx, idxice(1:nidx), hfx_opw_1d(1:nidx)     , hfx_opw     )
254         CALL tab_2d_1d( nidx, idxice(1:nidx), rn_amax_1d(1:nidx)     , rn_amax_2d  )
255         CALL tab_2d_1d( nidx, idxice(1:nidx), sss_1d    (1:nidx)     , sss_m       )
256
257         !------------------------------------------------------------------------------|
258         ! 2) Convert units for ice internal energy
259         !------------------------------------------------------------------------------|
260         DO jl = 1, jpl
261            DO jk = 1, nlay_i
262               DO ji = 1, nidx
263                  IF( zv_i_1d(ji,jl) > 0._wp )   ze_i_1d(ji,jk,jl) = ze_i_1d(ji,jk,jl) / zv_i_1d(ji,jl) * REAL( nlay_i )
264               END DO
265            END DO
266         END DO
267         !------------------------------------------------------------------------------!
268         ! 5) Compute thickness, salinity, enthalpy, age, area and volume of new ice
269         !------------------------------------------------------------------------------!
270
271         !-----------------------------------------
272         ! Keep old ice areas and volume in memory
273         !-----------------------------------------
274         zv_b(1:nidx,:) = zv_i_1d(1:nidx,:) 
275         za_b(1:nidx,:) = za_i_1d(1:nidx,:)
276
277         !----------------------
278         ! Thickness of new ice
279         !----------------------
280         zh_newice(1:nidx) = hicol_1d(1:nidx)
281
282         !----------------------
283         ! Salinity of new ice
284         !----------------------
285         SELECT CASE ( nn_icesal )
286         CASE ( 1 )                    ! Sice = constant
287            zs_newice(1:nidx) = rn_icesal
288         CASE ( 2 )                    ! Sice = F(z,t) [Vancoppenolle et al (2005)]
289            DO ji = 1, nidx
290               zs_newice(ji) = MIN(  4.606 + 0.91 / zh_newice(ji) , rn_simax , 0.5 * sss_1d(ji) )
291            END DO
292         CASE ( 3 )                    ! Sice = F(z) [multiyear ice]
293            zs_newice(1:nidx) =   2.3
294         END SELECT
295
296         !-------------------------
297         ! Heat content of new ice
298         !-------------------------
299         ! We assume that new ice is formed at the seawater freezing point
300         DO ji = 1, nidx
301            ztmelts       = - tmut * zs_newice(ji) + rt0                  ! Melting point (K)
302            ze_newice(ji) =   rhoic * (  cpic * ( ztmelts - t_bo_1d(ji) )                                         &
303               &                       + lfus * ( 1.0 - ( ztmelts - rt0 ) / MIN( t_bo_1d(ji) - rt0, -epsi10 ) )   &
304               &                       - rcp  *         ( ztmelts - rt0 )  )
305         END DO
306
307         !----------------
308         ! Age of new ice
309         !----------------
310         DO ji = 1, nidx
311            zo_newice(ji) = 0._wp
312         END DO
313
314         !-------------------
315         ! Volume of new ice
316         !-------------------
317         DO ji = 1, nidx
318
319            zEi           = - ze_newice(ji) * r1_rhoic             ! specific enthalpy of forming ice [J/kg]
320
321            zEw           = rcp * ( t_bo_1d(ji) - rt0 )            ! specific enthalpy of seawater at t_bo_1d [J/kg]
322                                                                   ! clem: we suppose we are already at the freezing point (condition qlead<0 is satisfyied)
323                                                                   
324            zdE           = zEi - zEw                              ! specific enthalpy difference [J/kg]
325                                             
326            zfmdt         = - qlead_1d(ji) / zdE                   ! Fm.dt [kg/m2] (<0)
327                                                                   ! clem: we use qlead instead of zqld (limthd) because we suppose we are at the freezing point   
328            zv_newice(ji) = - zfmdt * r1_rhoic
329
330            zQm           = zfmdt * zEw                            ! heat to the ocean >0 associated with mass flux 
331
332            ! Contribution to heat flux to the ocean [W.m-2], >0 
333            hfx_thd_1d(ji) = hfx_thd_1d(ji) + zfmdt * zEw * r1_rdtice
334            ! Total heat flux used in this process [W.m-2] 
335            hfx_opw_1d(ji) = hfx_opw_1d(ji) - zfmdt * zdE * r1_rdtice
336            ! mass flux
337            wfx_opw_1d(ji) = wfx_opw_1d(ji) - zv_newice(ji) * rhoic * r1_rdtice
338            ! salt flux
339            sfx_opw_1d(ji) = sfx_opw_1d(ji) - zv_newice(ji) * rhoic * zs_newice(ji) * r1_rdtice
340         END DO
341         
342         zv_frazb(:) = 0._wp
343         IF( ln_frazil ) THEN
344            ! A fraction zfrazb of frazil ice is accreted at the ice bottom
345            DO ji = 1, nidx
346               rswitch       = 1._wp - MAX( 0._wp, SIGN( 1._wp , - zat_i_1d(ji) ) )
347               zfrazb        = rswitch * ( TANH( rn_Cfrazb * ( zvrel_1d(ji) - rn_vfrazb ) ) + 1.0 ) * 0.5 * rn_maxfrazb
348               zv_frazb(ji)  =         zfrazb   * zv_newice(ji)
349               zv_newice(ji) = ( 1.0 - zfrazb ) * zv_newice(ji)
350            END DO
351         END IF
352         
353         !-----------------
354         ! Area of new ice
355         !-----------------
356         DO ji = 1, nidx
357            za_newice(ji) = zv_newice(ji) / zh_newice(ji)
358         END DO
359
360         !------------------------------------------------------------------------------!
361         ! 6) Redistribute new ice area and volume into ice categories                  !
362         !------------------------------------------------------------------------------!
363
364         !------------------------
365         ! 6.1) lateral ice growth
366         !------------------------
367         ! If lateral ice growth gives an ice concentration gt 1, then
368         ! we keep the excessive volume in memory and attribute it later to bottom accretion
369         DO ji = 1, nidx
370            IF ( za_newice(ji) >  ( rn_amax_1d(ji) - zat_i_1d(ji) ) ) THEN
371               zda_res(ji)   = za_newice(ji) - ( rn_amax_1d(ji) - zat_i_1d(ji) )
372               zdv_res(ji)   = zda_res  (ji) * zh_newice(ji) 
373               za_newice(ji) = za_newice(ji) - zda_res  (ji)
374               zv_newice(ji) = zv_newice(ji) - zdv_res  (ji)
375            ELSE
376               zda_res(ji) = 0._wp
377               zdv_res(ji) = 0._wp
378            ENDIF
379         END DO
380
381         ! find which category to fill
382         zat_i_1d(:) = 0._wp
383         DO jl = 1, jpl
384            DO ji = 1, nidx
385               IF( zh_newice(ji) > hi_max(jl-1) .AND. zh_newice(ji) <= hi_max(jl) ) THEN
386                  za_i_1d (ji,jl) = za_i_1d (ji,jl) + za_newice(ji)
387                  zv_i_1d (ji,jl) = zv_i_1d (ji,jl) + zv_newice(ji)
388                  jcat    (ji)    = jl
389               ENDIF
390               zat_i_1d(ji) = zat_i_1d(ji) + za_i_1d  (ji,jl)
391            END DO
392         END DO
393
394         ! Heat content
395         DO ji = 1, nidx
396            jl = jcat(ji)                                                    ! categroy in which new ice is put
397            zswinew  (ji) = MAX( 0._wp , SIGN( 1._wp , - za_b(ji,jl) ) )   ! 0 if old ice
398         END DO
399
400         DO jk = 1, nlay_i
401            DO ji = 1, nidx
402               jl = jcat(ji)
403               rswitch = MAX( 0._wp, SIGN( 1._wp , zv_i_1d(ji,jl) - epsi20 ) )
404               ze_i_1d(ji,jk,jl) = zswinew(ji)   *   ze_newice(ji) +                                                    &
405                  &        ( 1.0 - zswinew(ji) ) * ( ze_newice(ji) * zv_newice(ji) + ze_i_1d(ji,jk,jl) * zv_b(ji,jl) )  &
406                  &        * rswitch / MAX( zv_i_1d(ji,jl), epsi20 )
407            END DO
408         END DO
409
410         !------------------------------------------------
411         ! 6.2) bottom ice growth + ice enthalpy remapping
412         !------------------------------------------------
413         DO jl = 1, jpl
414
415            ! for remapping
416            h_i_old (1:nidx,0:nlay_i+1) = 0._wp
417            eh_i_old(1:nidx,0:nlay_i+1) = 0._wp
418            DO jk = 1, nlay_i
419               DO ji = 1, nidx
420                  h_i_old (ji,jk) = zv_i_1d(ji,jl) * r1_nlay_i
421                  eh_i_old(ji,jk) = ze_i_1d(ji,jk,jl) * h_i_old(ji,jk)
422               END DO
423            END DO
424
425            ! new volumes including lateral/bottom accretion + residual
426            DO ji = 1, nidx
427               rswitch        = MAX( 0._wp, SIGN( 1._wp , zat_i_1d(ji) - epsi20 ) )
428               zv_newfra      = rswitch * ( zdv_res(ji) + zv_frazb(ji) ) * za_i_1d(ji,jl) / MAX( zat_i_1d(ji) , epsi20 )
429               za_i_1d(ji,jl) = rswitch * za_i_1d(ji,jl)               
430               zv_i_1d(ji,jl) = zv_i_1d(ji,jl) + zv_newfra
431               ! for remapping
432               h_i_old (ji,nlay_i+1) = zv_newfra
433               eh_i_old(ji,nlay_i+1) = ze_newice(ji) * zv_newfra
434            ENDDO
435            ! --- Ice enthalpy remapping --- !
436            CALL lim_thd_ent( ze_i_1d(1:nidx,:,jl) ) 
437         ENDDO
438
439         !-----------------
440         ! Update salinity
441         !-----------------
442         DO jl = 1, jpl
443            DO ji = 1, nidx
444               zdv   = zv_i_1d(ji,jl) - zv_b(ji,jl)
445               zsmv_i_1d(ji,jl) = zsmv_i_1d(ji,jl) + zdv * zs_newice(ji)
446            END DO
447         END DO
448
449         !------------------------------------------------------------------------------!
450         ! 8) Change units for e_i
451         !------------------------------------------------------------------------------!   
452         DO jl = 1, jpl
453            DO jk = 1, nlay_i
454               DO ji = 1, nidx
455                  ze_i_1d(ji,jk,jl) = ze_i_1d(ji,jk,jl) * zv_i_1d(ji,jl) * r1_nlay_i 
456               END DO
457            END DO
458         END DO
459         !------------------------------------------------------------------------------!
460         ! 7) Change 2D vectors to 1D vectors
461         !------------------------------------------------------------------------------!
462         DO jl = 1, jpl
463            CALL tab_1d_2d( nidx, idxice(1:nidx), za_i_1d (1:nidx,jl), a_i (:,:,jl)  )
464            CALL tab_1d_2d( nidx, idxice(1:nidx), zv_i_1d (1:nidx,jl), v_i (:,:,jl)  )
465            CALL tab_1d_2d( nidx, idxice(1:nidx), zsmv_i_1d(1:nidx,jl), smv_i (:,:,jl)   )
466            DO jk = 1, nlay_i
467               CALL tab_1d_2d( nidx, idxice(1:nidx), ze_i_1d(1:nidx,jk,jl), e_i(:,:,jk,jl)  )
468            END DO
469         END DO
470         CALL tab_1d_2d( nidx, idxice(1:nidx), sfx_opw_1d(1:nidx), sfx_opw  )
471         CALL tab_1d_2d( nidx, idxice(1:nidx), wfx_opw_1d(1:nidx), wfx_opw  )
472         CALL tab_1d_2d( nidx, idxice(1:nidx), hfx_thd_1d(1:nidx), hfx_thd  )
473         CALL tab_1d_2d( nidx, idxice(1:nidx), hfx_opw_1d(1:nidx), hfx_opw  )
474         !
475      ENDIF ! nidx > 0
476      !
477   END SUBROUTINE lim_thd_lac
478
479#else
480   !!----------------------------------------------------------------------
481   !!   Default option                               NO  LIM3 sea-ice model
482   !!----------------------------------------------------------------------
483CONTAINS
484   SUBROUTINE lim_thd_lac           ! Empty routine
485   END SUBROUTINE lim_thd_lac
486#endif
487
488   !!======================================================================
489END MODULE limthd_lac
Note: See TracBrowser for help on using the repository browser.