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_zdf_2.F90 in branches/dev_001_SBC/NEMO/LIM_SRC – NEMO

source: branches/dev_001_SBC/NEMO/LIM_SRC/limthd_zdf_2.F90 @ 882

Last change on this file since 882 was 882, checked in by ctlod, 16 years ago

dev_001_SBC: Step II: change effectively the modules names in addining _2 extension, see ticket: #110

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 42.9 KB
Line 
1MODULE limthd_zdf_2
2   !!======================================================================
3   !!                       ***  MODULE limthd_zdf_2 ***
4   !!                thermodynamic growth and decay of the ice
5   !!======================================================================
6   !! History :  1.0  !  01-04 (LIM) Original code
7   !!            2.0  !  02-08 (C. Ethe, G. Madec) F90
8   !!----------------------------------------------------------------------
9#if defined key_lim2
10   !!----------------------------------------------------------------------
11   !!   'key_lim2'                                    LIM 2.0 sea-ice model
12   !!----------------------------------------------------------------------
13   !!----------------------------------------------------------------------
14   !!   lim_thd_zdf_2 : vertical accr./abl. and lateral ablation of sea ice
15   !!----------------------------------------------------------------------
16   USE par_oce          ! ocean parameters
17   USE phycst           ! ???
18   USE ice_oce          ! ice variables
19   USE thd_ice_2
20   USE iceini_2
21   USE limistate_2
22   USE in_out_manager
23     
24   IMPLICIT NONE
25   PRIVATE
26
27   PUBLIC   lim_thd_zdf_2        ! called by lim_thd_2
28
29   REAL(wp) ::   epsi20 = 1.e-20  ,  &  ! constant values
30      &          epsi13 = 1.e-13  ,  &
31      &          zzero  = 0.e0    ,  &
32      &          zone   = 1.e0
33   !!----------------------------------------------------------------------
34   !!   LIM 2.0,  UCL-LOCEAN-IPSL (2005)
35   !! $Id$
36   !! Software governed by the CeCILL licence (modipsl/doc/NEMO_CeCILL.txt)
37   !!----------------------------------------------------------------------
38
39CONTAINS
40
41   SUBROUTINE lim_thd_zdf_2( kideb , kiut )
42      !!------------------------------------------------------------------
43      !!                ***  ROUTINE lim_thd_zdf_2  ***
44      !!             
45      !! ** Purpose : This routine determines the time evolution of snow
46      !!      and sea-ice thicknesses, concentration and heat content
47      !!      due to the vertical and lateral thermodynamic accretion-
48      !!      ablation processes. One only treats the case of lat. abl.
49      !!      For lateral accretion, see routine lim_lat_accr
50      !!
51      !! ** Method  : The representation of vertical growth and decay of
52      !!      the sea-ice model is based upon the diffusion of heat
53      !!      through the external and internal boundaries of a
54      !!      three-layer system (two layers of ice and one layer and
55      !!      one layer of snow, if present, on top of the ice).
56      !!
57      !! ** Action  : - Calculation of some intermediates variables
58      !!              - Calculation of surface temperature
59      !!              - Calculation of available heat for surface ablation
60      !!              - Calculation of the changes in internal temperature
61      !!                of the three-layer system, due to vertical diffusion
62      !!                processes
63      !!              - Performs surface ablation and bottom accretion-ablation
64      !!              - Performs snow-ice formation
65      !!              - Performs lateral ablation
66      !!
67      !! References : Fichefet T. and M. Maqueda 1997, J. Geophys. Res., 102(C6), 12609-12646   
68      !!              Fichefet T. and M. Maqueda 1999, Clim. Dyn, 15(4), 251-268 
69      !!------------------------------------------------------------------
70      INTEGER, INTENT(in) ::   kideb    ! Start point on which the  the computation is applied
71      INTEGER, INTENT(in) ::   kiut     ! End point on which the  the computation is applied
72      !!
73      INTEGER ::   ji       ! dummy loop indices
74      REAL(wp), DIMENSION(jpij,2) ::   zqcmlt        ! energy due to surface( /1 ) and bottom melting( /2 )
75      REAL(wp), DIMENSION(jpij) ::  &
76         ztsmlt      &    ! snow/ice surface melting temperature
77         ,ztbif      &    ! int. temp. at the mid-point of the 1st layer of the snow/ice sys.
78         ,zksn       &    ! effective conductivity of snow
79         ,zkic       &    ! effective conductivity of ice
80         ,zksndh     &    ! thermal cond. at the mid-point of the 1st layer of the snow/ice sys.
81         , zfcsu     &    ! conductive heat flux at the surface of the snow/ice system
82         , zfcsudt   &    ! = zfcsu * dt
83         , zi0       &    ! frac. of the net SW rad. which is not absorbed at the surface
84         , z1mi0     &    ! fraction of the net SW radiation absorbed at the surface
85         , zqmax     &    ! maximum energy stored in brine pockets
86         , zrcpdt    &    ! h_su*rho_su*cp_su/dt(h_su being the thick. of surf. layer)
87         , zts_old   &    ! previous surface temperature
88         , zidsn , z1midsn , zidsnic ! tempory variables
89      REAL(wp), DIMENSION(jpij) ::   &
90          zfnet       &  ! net heat flux at the top surface( incl. conductive heat flux)
91          , zsprecip  &    ! snow accumulation
92          , zhsnw_old &    ! previous snow thickness
93          , zdhictop  &    ! change in ice thickness due to top surf ablation/accretion
94          , zdhicbot  &    ! change in ice thickness due to bottom surf abl/acc
95          , zqsup     &    ! energy transmitted to ocean (coming from top surf abl/acc)
96          , zqocea    &    ! energy transmitted to ocean (coming from bottom sur abl/acc)
97          , zfrl_old  &    ! previous sea/ice fraction
98          , zfrld_1d    &    ! new sea/ice fraction
99          , zep            ! internal temperature of the 2nd layer of the snow/ice system
100       REAL(wp), DIMENSION(3) :: & 
101          zplediag  &    ! principle diagonal, subdiag. and supdiag. of the
102          , zsubdiag  &    ! tri-diagonal matrix coming from the computation
103          , zsupdiag  &    ! of the temperatures inside the snow-ice system
104          , zsmbr          ! second member
105       REAL(wp) :: & 
106          zhsu     &     ! thickness of surface layer
107          , zhe      &     ! effective thickness for compu. of equ. thermal conductivity
108          , zheshth  &     ! = zhe / thth
109          , zghe     &     ! correction factor of the thermal conductivity
110          , zumsb    &     ! parameter for numerical method to solve heat-diffusion eq.
111          , zkhsn    &     ! conductivity at the snow layer
112          , zkhic    &     ! conductivity at the ice layers
113          , zkint    &     ! equivalent conductivity at the snow-ice interface
114          , zkhsnint &     ! = zkint*dt / (hsn*rhosn*cpsn) 
115          , zkhicint &     ! = 2*zkint*dt / (hic*rhoic*cpic)
116          , zpiv1 , zpiv2  &       ! tempory scalars used to solve the tri-diagonal system
117          , zb2 , zd2 , zb3 , zd3 &
118          , ztint          ! equivalent temperature at the snow-ice interface
119       REAL(wp) :: & 
120          zexp      &     ! exponential function of the ice thickness
121          , zfsab     &     ! part of solar radiation stored in brine pockets
122          , zfts      &     ! value of energy balance function when the temp. equal surf. temp.
123          , zdfts     &     ! value of derivative of ztfs when the temp. equal surf. temp.
124          , zdts      &     ! surface temperature increment
125          , zqsnw_mlt &     ! energy needed to melt snow
126          , zdhsmlt   &     ! change in snow thickness due to melt
127          , zhsn      &     ! snow thickness (previous+accumulation-melt)
128          , zqsn_mlt_rem &  ! remaining heat coming from snow melting
129          , zqice_top_mlt & ! energy used to melt ice at top surface
130          , zdhssub      &  ! change in snow thick. due to sublimation or evaporation
131          , zdhisub      &  ! change in ice thick. due to sublimation or evaporation   
132          , zdhsn        &  ! snow ice thickness increment
133          , zdtsn        &  ! snow internal temp. increment
134          , zdtic        &  ! ice internal temp. increment
135          , zqnes          ! conductive energy due to ice melting in the first ice layer
136       REAL(wp) :: & 
137          ztbot     &      ! temperature at the bottom surface
138          , zfcbot    &      ! conductive heat flux at bottom surface
139          , zqice_bot &      ! energy used for bottom melting/growing
140          , zqice_bot_mlt &  ! energy used for bottom melting
141          , zqstbif_bot  &  ! part of energy stored in brine pockets used for bottom melting
142          , zqstbif_old  &  ! tempory var. for zqstbif_bot
143          , zdhicmlt      &  ! change in ice thickness due to bottom melting
144          , zdhicm        &  ! change in ice thickness var.
145          , zdhsnm        &  ! change in snow thickness var.
146          , zhsnfi        &  ! snow thickness var.
147          , zc1, zpc1, zc2, zpc2, zp1, zp2 & ! tempory variables
148          , ztb2, ztb3
149       REAL(wp) :: & 
150          zdrmh         &   ! change in snow/ice thick. after snow-ice formation
151          , zhicnew       &   ! new ice thickness
152          , zhsnnew       &   ! new snow thickness
153          , zquot , ztneq &   ! tempory temp. variables
154          , zqice, zqicetot & ! total heat inside the snow/ice system
155          , zdfrl         &   ! change in ice concentration
156          , zdvsnvol      &   ! change in snow volume
157          , zdrfrl1, zdrfrl2 &  ! tempory scalars
158          , zihsn, zidhb, zihic, zihe, zihq, ziexp, ziqf, zihnf, zibmlt, ziqr, zihgnew, zind
159       !!----------------------------------------------------------------------
160
161       !-----------------------------------------------------------------------
162       !  1. Boundaries conditions for snow/ice system internal temperature
163       !       - If tbif_1d(ji,1) > rt0_snow, tbif_1d(ji,1) = rt0_snow
164       !       - If tbif_1d(ji,2/3) > rt0_ice, tbif_1d(ji,2/3) = rt0_ice
165       !     Computation of energies due to surface and bottom melting
166       !-----------------------------------------------------------------------
167       
168       DO ji = kideb , kiut
169          zihsn = MAX( zzero , SIGN( zone , hsndif - h_snow_1d(ji) ) )
170          zihic = MAX( zzero , SIGN( zone , hicdif - h_ice_1d(ji) ) )
171          !--computation of energy due to surface melting
172          zqcmlt(ji,1) = ( MAX ( zzero ,  &
173             &                   rcpsn * h_snow_1d(ji) * ( tbif_1d(ji,1) - rt0_snow ) ) ) * ( 1.0 - zihsn )
174          !--computation of energy due to bottom melting
175          zqcmlt(ji,2) = ( MAX( zzero , &
176             &                  rcpic * ( tbif_1d(ji,2) - rt0_ice ) * ( h_ice_1d(ji) / 2. ) ) &
177             &           + MAX( zzero , &
178             &                  rcpic * ( tbif_1d(ji,3) - rt0_ice ) * ( h_ice_1d(ji) / 2. ) ) &
179             &           ) * ( 1.0 - zihic  )
180          !--limitation of  snow/ice system internal temperature
181          tbif_1d(ji,1)   = MIN( rt0_snow, tbif_1d(ji,1) )
182          tbif_1d(ji,2)   = MIN( rt0_ice , tbif_1d(ji,2) )
183          tbif_1d(ji,3)   = MIN( rt0_ice , tbif_1d(ji,3) )
184       END DO
185
186       !-------------------------------------------
187       !  2. Calculate some intermediate variables. 
188       !-------------------------------------------
189       
190       ! initialisation of the thickness of surface layer
191       zhsu = hnzst 
192
193       DO ji = kideb , kiut
194          zind   = MAX( zzero , SIGN( zone , zhsu - h_snow_1d(ji) ) )
195          zihsn  = MAX( zzero , SIGN( zone , hsndif - h_snow_1d(ji) ) )
196          zihsn  = MAX( zihsn , zind )
197          zihic  = MAX( zzero , sign( zone , hicdif - h_ice_1d(ji) ) )
198          !     2.1. Computation of surface melting temperature
199          !----------------------------------------------------
200          zind  = MAX( zzero , SIGN( zone , -h_snow_1d(ji) ) )
201          ztsmlt(ji) = ( 1.0 - zind ) * rt0_snow + zind * rt0_ice
202          !
203          !     2.2. Effective conductivity of snow and ice
204          !-----------------------------------------------
205
206          !---computation of the correction factor on the thermal conductivity
207          !-- (Morales Maqueda, 1995 ; Fichefet and Morales Maqueda, 1997)
208          zhe      =  ( rcdsn / ( rcdsn + rcdic ) ) * h_ice_1d(ji)   &
209             &     + ( rcdic / ( rcdsn + rcdic ) ) * h_snow_1d(ji) 
210          zihe     = MAX( zzero , SIGN( zone , 2.0 * zhe - thth ) )
211          zheshth  = zhe / thth
212          zghe     = ( 1.0 - zihe ) * zheshth * ( 2.0 - zheshth )   &
213             &     +         zihe   * 0.5 * ( 1.5 + LOG( 2.0 * zheshth ) )
214#if defined key_lim_cp3
215          zghe = 1.0
216#endif 
217
218          !---effective conductivities
219          zksn(ji)  = zghe * rcdsn 
220          zkic(ji)  = zghe * rcdic
221
222          !
223          !     2.3. Computation of the conductive heat flux from the snow/ice
224          !          system interior toward the top surface
225          !------------------------------------------------------------------
226
227          !---Thermal conductivity at the mid-point of the first snow/ice system layer
228          zksndh(ji) =   ( ( 1.0 - zihsn ) * 2.0 * zksn(ji) + zihsn * 4.0 * zkic(ji) )   &
229             &         / ( ( 1.0 - zihsn ) *  h_snow_1d(ji)                              &
230             &           +        zihsn   *  ( ( 1.0 + 3.0 * zihic ) * h_ice_1d(ji)      &
231             &           + 4.0 * zkic(ji)/zksn(ji) * h_snow_1d(ji) ) )
232
233          !---internal temperature at the mid-point of the first snow/ice system layer
234          ztbif(ji)  = ( 1.0 - zihsn ) * tbif_1d(ji,1)                       &
235             &       +         zihsn   * ( ( 1.0 - zihic ) * tbif_1d(ji,2)   &
236             &       +         zihic   * tfu_1d(ji)   )
237          !---conductive heat flux
238          zfcsu(ji) = zksndh(ji) * ( ztbif(ji) - sist_1d(ji) )
239
240       END DO
241
242       !--------------------------------------------------------------------
243       !  3. Calculate :
244       !     - fstbif_1d, part of solar radiation absorbing inside the ice
245       !       assuming an exponential absorption (Grenfell and Maykut, 1977)
246       !     - zqmax,  maximum energy stored in brine pockets
247       !     - qstbif_1d, total energy stored in brine pockets (updating)
248       !-------------------------------------------------------------------
249
250       DO ji = kideb , kiut
251          zihsn  = MAX( zzero , SIGN (zone , -h_snow_1d(ji) ) )
252          zihic  = MAX( zzero , 1.0 - ( h_ice_1d(ji) / zhsu ) )     
253          zind   = MAX( zzero , SIGN (zone , hicdif - h_ice_1d(ji) ) )
254          !--Computation of the fraction of the net shortwave radiation which
255          !--penetrates inside the ice cover ( See Forcat)
256          zi0(ji)  = zihsn * ( fr1_i0_1d(ji) + zihic * fr2_i0_1d(ji) )
257          zexp     = MIN( zone , EXP( -1.5 * ( h_ice_1d(ji) - zhsu ) ) )
258          fstbif_1d(ji) = zi0(ji) * qsr_ice_1d(ji) * zexp
259          !--Computation of maximum energy stored in brine pockets zqmax and update
260          !--the total energy stored in brine pockets, if less than zqmax
261          zqmax(ji) = MAX( zzero , 0.5 * xlic * ( h_ice_1d(ji) - hicmin ) )
262          zfsab   = zi0(ji) * qsr_ice_1d(ji) * ( 1.0 - zexp )
263          zihq    = ( 1.0 - zind ) * MAX(zzero, SIGN( zone , qstbif_1d(ji) - zqmax(ji) ) ) &
264             &    +         zind   * zone
265          qstbif_1d(ji) = ( qstbif_1d(ji) + ( 1.0 - zihq ) * zfsab * rdt_ice ) * swiqst
266          !--fraction of shortwave radiation absorbed at surface
267          ziexp = zihq * zexp + ( 1.0 - zihq ) * ( swiqst + ( 1.0 - swiqst ) * zexp )
268          z1mi0(ji) = 1.0 - zi0(ji) * ziexp
269       END DO
270
271       !--------------------------------------------------------------------------------
272       !  4. Computation of the surface temperature : determined by considering the
273       !     budget of a thin layer of thick. zhsu at the top surface (H. Grenier, 1995)
274       !     and based on a surface energy balance :
275       !     hsu * rcp * dT/dt = Fsr + Fnsr(T) + Fcs(T),
276       !     where - Fsr is the net absorbed solar radiation,
277       !           - Fnsr is the total non solar radiation (incoming and outgoing long-wave,
278       !             sensible and latent heat fluxes)
279       !           - Fcs the conductive heat flux at the top of surface
280       !------------------------------------------------------------------------------
281
282       !     4.1. Computation of intermediate values
283       !---------------------------------------------
284       DO ji = kideb, kiut
285          zrcpdt(ji) = ( rcpsn * MIN( h_snow_1d(ji) , zhsu )    &
286             &       + rcpic * MAX( zhsu - h_snow_1d(ji) , zzero ) ) / rdt_ice
287          zts_old(ji) =  sist_1d(ji)
288       END DO
289
290       !     4.2. Computation of surface temperature by expanding the eq. of energy balance
291       !          with Ts = Tp + DT. One obtain , F(Tp) + DT * DF(Tp) = 0
292       !          where  - F(Tp) = Fsr + Fnsr(Tp) + Fcs(Tp)
293       !                 - DF(Tp)= (dFnsr(Tp)/dT) + (dFcs(Tp)/dT) - hsu*rcp/dt
294       !---------------------------------------------------------------------------------
295
296       DO ji = kideb, kiut
297          !---computation of the derivative of energy balance function
298#if defined key_coupled
299#   if defined key_lim_cp2
300          zdfts   =   zksndh(ji)   & ! contribution of the conductive heat flux
301             &      + zrcpdt(ji)   & ! contribution of hsu * rcp / dt
302             &      - dqns_ice_1d(ji)      ! contribution of the total non solar radiation
303#   else
304          zdfts   =   zksndh(ji)   & ! contribution of the conductive heat flux
305             &      + zrcpdt(ji)    ! contribution of hsu * rcp / dt
306#   endif
307
308#else
309          zdfts    =  zksndh(ji)   & ! contribution of the conductive heat flux
310             &      + zrcpdt(ji)   & ! contribution of hsu * rcp / dt
311             &      - dqns_ice_1d (ji)     ! contribution of the total non solar radiation
312#endif
313          !---computation of the energy balance function
314          zfts    = - z1mi0 (ji) * qsr_ice_1d(ji)   & ! net absorbed solar radiation
315             &      - qns_ice_1d(ji)                & ! total non solar radiation
316             &      - zfcsu (ji)                      ! conductive heat flux from the surface
317          !---computation of surface temperature increment 
318          zdts    = -zfts / zdfts
319#if defined key_lim_cp3
320          zdts = zdts / 3.0
321#endif
322          !---computation of the new surface temperature
323          sist_1d(ji) = sist_1d(ji) + zdts
324
325       END DO
326
327       !----------------------------------------------------------------------------
328       !  5. Boundary condition at the top surface
329       !--    IF Tsb < Tmelt, Fnet = Fcs (the net heat flux equal the conductive heat flux)
330       !      Otherwise Tsb = Tmelt and Qnet(Tmelt) > 0
331       !      Fnet(Tmelt) is therefore the net surface flux needed for melting
332       !----------------------------------------------------------------------------
333       
334       
335       !     5.1.  Limitation of surface temperature and update total non solar fluxes,
336       !          latent heat flux and conductive flux at the top surface
337       !---------------------------------------------------------------------- 
338                     
339       DO ji = kideb, kiut
340          sist_1d(ji) = MIN( ztsmlt(ji) , sist_1d(ji) )
341#if ! defined key_coupled
342          qns_ice_1d(ji) = qns_ice_1d(ji) + dqns_ice_1d(ji) * ( sist_1d(ji) - zts_old(ji) )
343          qla_ice_1d (ji) = qla_ice_1d (ji) + dqla_ice_1d(ji) * ( sist_1d(ji) - zts_old(ji) )
344#endif
345          zfcsu(ji)  = zksndh(ji) * ( ztbif(ji) - sist_1d(ji) )
346       END DO
347
348       !     5.2. Calculate available heat for surface ablation.
349       !---------------------------------------------------------------------
350
351       DO ji = kideb, kiut
352          zfnet(ji) = qns_ice_1d(ji) + z1mi0(ji) * qsr_ice_1d(ji) + zfcsu(ji)         
353          zfnet(ji) = MAX( zzero , zfnet(ji) )
354          zfnet(ji) = zfnet(ji) * MAX( zzero , SIGN( zone , sist_1d(ji) - ztsmlt(ji) ) )
355       END DO
356
357       !-------------------------------------------------------------------------
358       !  6. Calculate changes in internal temperature due to vertical diffusion   
359       !     processes. The evolution of this temperature is governed by the one-
360       !     dimensionnal heat-diffusion equation.
361       !     Given the temperature tbif(1/2/3), at time m we solve a set
362       !     of finite difference equations to obtain new tempe. Each tempe is coupled
363       !     to the temp. immediatly above and below by heat conduction terms. Thus
364       !     we have a set of equations of the form A * T = B, where A is a tridiagonal
365       !     matrix, T a vector whose components are the unknown new temp.
366       !-------------------------------------------------------------------------
367       
368       !--parameter for the numerical methode use to solve the heat-diffusion equation
369       !- implicit, explicit or Crank-Nicholson
370       zumsb = 1.0 - sbeta 
371       DO ji = kideb, kiut
372          zidsn(ji)   = MAX ( zzero, SIGN( zone, hsndif - h_snow_1d(ji) ) ) 
373          z1midsn(ji) = 1.0 - zidsn(ji)
374          zihic       = MAX ( zzero, SIGN( zone, hicdif - h_ice_1d(ji) ) ) 
375          zidsnic(ji) = zidsn(ji) *  zihic 
376          zfcsudt(ji) = zfcsu(ji) * rdt_ice 
377       END DO
378   
379       DO ji = kideb, kiut
380
381          !     6.1 Calculate intermediate variables.
382          !----------------------------------------
383
384          !--conductivity at the snow surface
385          zkhsn = 2.0 * zksn(ji) * rdt_ice / rcpsn
386          !--conductivity at the ice surface
387          zkhic = 4.0 * zkic(ji) * rdt_ice / MAX( h_ice_1d(ji) * h_ice_1d(ji) * rcpic , epsi20 )
388          !--conductivity at the snow/ice interface
389          zkint = 4.0 * zksn(ji) * zkic(ji)  &
390             &        / ( zksn(ji) * h_ice_1d(ji) + 2.0 * zkic(ji) * h_snow_1d(ji) * z1midsn(ji)) 
391          zkhsnint = zkint * rdt_ice / rcpsn
392          zkhicint = zkint * 2.0 * rdt_ice / MAX( h_ice_1d(ji) * rcpic , epsi20 )
393         
394          !     6.2. Fulfill the linear system matrix.
395          !-----------------------------------------
396!$$$          zplediag(1) = 1 + sbeta * z1midsn(ji) * ( zkhsn + zkhsnint )       
397          zplediag(1) =   zidsn(ji) + z1midsn(ji) * h_snow_1d(ji)   &
398             &          + sbeta * z1midsn(ji) * zkhsnint 
399          zplediag(2) = 1 + sbeta * ( z1midsn(ji) * zkhicint + zkhic ) 
400          zplediag(3) = 1 + 3.0 * sbeta * zkhic   
401
402          zsubdiag(1) =  0.e0             
403          zsubdiag(2) = -1.e0 * z1midsn(ji) * sbeta * zkhicint
404          zsubdiag(3) = -1.e0 * sbeta * zkhic 
405
406          zsupdiag(1) = -1.e0 * z1midsn(ji) * sbeta * zkhsnint 
407          zsupdiag(2) = zsubdiag(3)
408          zsupdiag(3) =  0.e0
409         
410          !     6.3. Fulfill the idependent term vector.
411          !-------------------------------------------
412         
413!$$$          zsmbr(1) = zidsn(ji) * sist_1d(ji) + z1midsn(ji) *   &
414!$$$             &         ( tbif_1d(ji,1) + zkhsn * sist_1d(ji)
415!$$$             &         - zumsb * ( zkhsn * tbif_1d(ji,1)
416!$$$             &                   + zkhsnint * ( tbif_1d(ji,1) - tbif_1d(ji,2) ) ) )
417          zsmbr(1) = zidsn(ji) * sist_1d(ji) + z1midsn(ji) *    &
418             &       ( h_snow_1d(ji) * tbif_1d(ji,1) - ( zfcsudt(ji) / rcpsn )  &
419             &       - zumsb * zkhsnint * ( tbif_1d(ji,1) - tbif_1d(ji,2) ) )
420
421          zsmbr(2) =  tbif_1d(ji,2)  &
422             &      - zidsn(ji) * ( 1.0 - zidsnic(ji) ) &
423             &        * ( zfcsudt(ji) / MAX( h_ice_1d(ji) * rcpic , epsi20 ) ) &
424             &      + zumsb * ( zkhicint * ( tbif_1d(ji,1) - tbif_1d(ji,2) ) &
425             &                   - zkhic * ( tbif_1d(ji,2) - tbif_1d(ji,3) )  )
426
427          zsmbr(3) =  tbif_1d(ji,3)  &
428             &      + zkhic * ( 2.0 * tfu_1d(ji) &
429             &                + zumsb * ( tbif_1d(ji,2) - 3.0 * tbif_1d(ji,3) ) )
430         
431          !     6.4. Solve the system (Gauss elimination method).
432          !----------------------------------------------------
433         
434          zpiv1 = zsubdiag(2) / zplediag(1) 
435          zb2   = zplediag(2) - zpiv1 * zsupdiag(1)
436          zd2   = zsmbr(2) - zpiv1 * zsmbr(1)
437
438          zpiv2 = zsubdiag(3) / zb2
439          zb3   = zplediag(3) - zpiv2 * zsupdiag(2)
440          zd3   = zsmbr(3) - zpiv2 * zd2
441
442          tbif_1d(ji,3) = zd3 / zb3
443          tbif_1d(ji,2) = ( zd2 - zsupdiag(2) * tbif_1d(ji,3) ) / zb2
444          tbif_1d(ji,1) = ( zsmbr(1) - zsupdiag(1) * tbif_1d(ji,2) ) / zplediag(1)           
445
446          !--- taking into account the particular case of  zidsnic(ji) = 1
447          ztint =  (  zkic(ji) * h_snow_1d(ji) * tfu_1d (ji)    &
448             &      + zksn(ji) * h_ice_1d(ji) * sist_1d(ji) )   &
449             &   / ( zkic(ji) * h_snow_1d(ji) + zksn(ji) * h_ice_1d(ji) ) 
450
451          tbif_1d(ji,1) = ( 1.0 - zidsnic(ji) ) * tbif_1d(ji,1)   &
452             &                + zidsnic(ji)   * ( ztint + sist_1d(ji) ) / 2.0
453          tbif_1d(ji,2) = ( 1.0 - zidsnic(ji) ) * tbif_1d(ji,2)   &
454             &                + zidsnic(ji)   * ( 3.0 * ztint + tfu_1d(ji) ) / 4.0
455          tbif_1d(ji,3) = ( 1.0 - zidsnic(ji) ) * tbif_1d(ji,3)   &
456             &                + zidsnic(ji)   * ( ztint + 3.0 * tfu_1d(ji) ) / 4.0     
457       END DO
458 
459       !----------------------------------------------------------------------
460       !  9. Take into account surface ablation and bottom accretion-ablation.|
461       !----------------------------------------------------------------------
462       
463       !---Snow accumulation in one thermodynamic time step
464       zsprecip(kideb:kiut) = sprecip_1d(kideb:kiut) * rdt_ice / rhosn
465
466
467       DO ji = kideb, kiut
468         
469          !      9.1. Surface ablation and update of snow thickness and qstbif_1d
470          !--------------------------------------------------------------------
471         
472          !--------------------------------------------------------------------------
473          !--      Melting snow processes :
474          !--      Melt at the upper surface is computed from the difference between
475          !--      the net heat flux (including the conductive heat flux) at the upper
476          !--      surface and the pre-existing energy due to surface melting
477          !------------------------------------------------------------------------------
478         
479          !-- store the snow thickness
480          zhsnw_old(ji) =  h_snow_1d(ji)
481          !--computation of the energy needed to melt snow
482          zqsnw_mlt  = zfnet(ji) * rdt_ice - zqcmlt(ji,1)
483          !--change in snow thickness due to melt
484          zdhsmlt = - zqsnw_mlt / xlsn
485         
486          !-- compute new snow thickness, taking into account the part of snow accumulation
487          !   (as snow precipitation) and the part of snow lost due to melt
488          zhsn =  h_snow_1d(ji) + zsprecip(ji) + zdhsmlt
489          h_snow_1d(ji) = MAX( zzero , zhsn )
490          !-- compute the volume of snow lost after surface melting and the associated mass
491          dvsbq_1d(ji) =  ( 1.0 - frld_1d(ji) ) * ( h_snow_1d(ji) - zhsnw_old(ji) - zsprecip(ji) )
492          dvsbq_1d(ji) =  MIN( zzero , dvsbq_1d(ji) )
493          rdmsnif_1d(ji) =  rhosn * dvsbq_1d(ji)
494          !-- If the snow is completely melted the remaining heat is used to melt ice
495          zqsn_mlt_rem  = MAX( zzero , -zhsn ) * xlsn
496          zqice_top_mlt = zqsn_mlt_rem 
497          zqstbif_old   = qstbif_1d(ji)
498
499          !--------------------------------------------------------------------------
500          !--      Melting ice processes at the top surface :
501          !--      The energy used to melt ice, zqice_top_mlt, is taken from the energy
502          !--      stored in brine pockets qstbif_1d and the remaining energy coming
503          !--      from the melting snow process zqsn_mlt_rem.
504          !--      If qstbif_1d > zqsn_mlt_rem then, one uses only a zqsn_mlt_rem part
505          !--      of qstbif_1d to melt ice,
506          !--         zqice_top_mlt = zqice_top_mlt + zqsn_mlt_rem
507          !--         qstbif_1d = qstbif_1d - zqsn_mlt_rem
508          !--      Otherwise one uses all qstbif_1d to melt ice
509          !--         zqice_top_mlt = zqice_top_mlt + qstbif_1d
510          !--         qstbif_1d = 0
511          !------------------------------------------------------
512         
513          ziqf =  MAX ( zzero , SIGN( zone , qstbif_1d(ji) - zqsn_mlt_rem  ) )
514          zqice_top_mlt =         ziqf   * ( zqice_top_mlt + zqsn_mlt_rem )   &
515             &          + ( 1.0 - ziqf ) * ( zqice_top_mlt + qstbif_1d(ji)  )
516
517          qstbif_1d(ji) =         ziqf   * ( qstbif_1d(ji) - zqsn_mlt_rem )   &
518             &        + ( 1.0 - ziqf ) * ( qstbif_1d(ji) - qstbif_1d(ji)  )
519
520          !--    The contribution of the energy stored in brine pockets qstbif_1d to melt
521          !--    ice is taking into account only when qstbif_1d is less than zqmax.
522          !--    Otherwise, only the remaining energy coming from the melting snow
523          !--    process is used
524          zihq =  MAX ( zzero , SIGN( zone , qstbif_1d(ji) - zqmax(ji) ) )
525
526          zqice_top_mlt =         zihq   * zqice_top_mlt   &
527             &          + ( 1.0 - zihq ) * zqsn_mlt_rem
528
529          qstbif_1d(ji) =         zihq   * qstbif_1d(ji)   &
530             &        + ( 1.0 - zihq ) * zqstbif_old
531
532          !--change in ice thickness due to melt at the top surface
533          zdhictop(ji) = -zqice_top_mlt / xlic
534          !--compute the volume formed after surface melting
535          dvsbq_1d(ji) =  zdhictop(ji) * ( 1.0 - frld_1d(ji) )
536
537          !-------------------------------------------------------------------------
538          !--      A small variation at the surface also occurs because of sublimation
539          !--      associated with the latent flux. If qla_ice_1d is negative, snow condensates at
540          !        the surface. Otherwise, snow evaporates
541          !-----------------------------------------------------------------------
542          !----change in snow and ice thicknesses due to sublimation or evaporation
543          zdhssub  = parsub * ( qla_ice_1d(ji) / ( rhosn * xsn ) ) * rdt_ice 
544          zhsn     = h_snow_1d(ji) - zdhssub
545          zdhisub  = MAX( zzero , -zhsn ) * rhosn/rhoic
546          zdhictop(ji) =  zdhictop(ji) - zdhisub
547          h_snow_1d(ji)  =  MAX( zzero , zhsn )
548          !-------------------------------------------------
549          !--  Update Internal temperature and qstbif_1d.
550          !-------------------------------------------
551          zihsn  =  MAX( zzero , SIGN( zone, -h_snow_1d(ji) ) )
552          tbif_1d(ji,1) = ( 1.0 - zihsn ) * tbif_1d(ji,1) + zihsn   * tfu_1d(ji)
553          !--change in snow internal temperature if snow has increased
554          zihnf = MAX( zzero , SIGN( zone , h_snow_1d(ji) - zhsnw_old(ji) ) )
555          zdhsn = 1.0 - zhsnw_old(ji) / MAX( h_snow_1d(ji) , epsi20 )
556          zdtsn = zdhsn * ( sist_1d(ji) - tbif_1d(ji,1) )
557          tbif_1d(ji,1) = tbif_1d(ji,1) + z1midsn(ji) * zihnf * zdtsn
558          !--energy created due to ice melting in the first ice layer
559          zqnes  = ( rt0_ice - tbif_1d(ji,2) ) * rcpic * ( h_ice_1d(ji) / 2. )
560          !--change in first ice layer internal temperature
561          ziqr  = MAX( zzero , SIGN( zone , qstbif_1d(ji) - zqnes ) )
562          zdtic = qstbif_1d(ji) / ( rcpic * ( h_ice_1d(ji) / 2. ) )
563          tbif_1d(ji,2) =  ziqr * rt0_ice + ( 1 - ziqr ) * ( tbif_1d(ji,2) + zdtic )
564          !--update qstbif_1d
565          qstbif_1d(ji) = ziqr * ( qstbif_1d(ji) - zqnes ) * swiqst
566
567
568          !--      9.2. Calculate bottom accretion-ablation and update qstbif_1d.
569          !             Growth and melting at bottom ice surface are governed by 
570          !                 -xlic * Dh = (Fcb - Fbot ) * Dt
571          !             where Fbot is the net downward heat flux from ice to the ocean
572          !            and Fcb is the conductive heat flux at the bottom surface
573          !---------------------------------------------------------------------------
574          ztbot = ( 1.0 - zidsnic(ji) ) * tbif_1d(ji,3) + zidsnic(ji) * sist_1d(ji)
575          !---computes conductive heat flux at bottom surface
576          zfcbot =  4.0 * zkic(ji) * ( tfu_1d(ji) - ztbot )   &
577             &   / ( h_ice_1d(ji) + zidsnic(ji) * ( 3. * h_ice_1d(ji) &
578             &   + 4.0 * zkic(ji)/zksn(ji) * h_snow_1d(ji) ) )
579          !---computation of net energy needed for bottom melting/growing
580          zqice_bot = ( zfcbot - ( fbif_1d(ji) + qlbbq_1d(ji) ) ) * rdt_ice
581          zqstbif_bot = qstbif_1d(ji)
582          !---switch to know if bottom surface melts ( = 1 ) or grows ( = 0 )occurs
583          zibmlt = MAX( zzero , SIGN( zone , -zqice_bot ) )
584          !--particular case of melting (in the same way as the top surface)
585          zqice_bot_mlt = zqice_bot 
586          zqstbif_old = zqstbif_bot
587
588          ziqf =  MAX ( zzero , SIGN( zone , qstbif_1d(ji) + zqice_bot_mlt  ) )
589          zqice_bot_mlt =         ziqf   * ( zqice_bot_mlt + zqice_bot_mlt ) &
590             &          + ( 1.0 - ziqf ) * ( zqice_bot_mlt + qstbif_1d(ji)  )         
591          qstbif_1d(ji)   =         ziqf   * ( qstbif_1d(ji) + zqice_bot_mlt ) &
592             &          + ( 1.0 - ziqf ) * ( qstbif_1d(ji) - qstbif_1d(ji)  )
593          !--    The contribution of the energy stored in brine pockets qstbif_1d to melt
594          !--    ice is taking into account only when qstbif_1d is less than zqmax.
595          zihq =  MAX ( zzero , SIGN( zone , qstbif_1d(ji) - zqmax(ji) ) )
596          zqice_bot_mlt =         zihq   * zqice_bot_mlt   &
597             &          + ( 1.0 - zihq ) * zqice_bot
598          qstbif_1d(ji)   =         zihq   * qstbif_1d(ji)   &
599             &             + ( 1.0 - zihq ) * zqstbif_old
600
601          !---treatment of the case of melting/growing
602          zqice_bot   =         zibmlt   * ( zqice_bot_mlt - zqcmlt(ji,2) )   &
603             &        + ( 1.0 - zibmlt ) * ( zqice_bot - zqcmlt(ji,2)  )
604          qstbif_1d(ji) =         zibmlt   * qstbif_1d(ji)   &
605             &           + ( 1.0 - zibmlt ) * zqstbif_bot
606
607          !--computes change in ice thickness due to melt or growth
608          zdhicbot(ji) = zqice_bot / xlic
609          !--limitation of bottom melting if so : hmelt maximum melting at bottom
610          zdhicmlt  = MAX( hmelt , zdhicbot(ji) ) 
611          !--energy after bottom melting/growing
612          zqsup(ji) = ( 1.0 - frld_1d(ji) ) * xlic * ( zdhicmlt - zdhicbot(ji) )
613          !-- compute the new thickness and the newly formed volume after bottom melting/growing
614          zdhicbot(ji)  = zdhicmlt
615          dvbbq_1d(ji) = ( 1.0 - frld_1d(ji) ) * zdhicbot(ji)
616
617
618          !        9.3.  Updating ice thickness after top surface ablation
619          !              and bottom surface accretion/ablation
620          !---------------------------------------------------------------
621          zhicnew  = h_ice_1d(ji) + zdhictop(ji) + zdhicbot(ji)
622
623          !
624          !        9.4. Case of total ablation (ice is gone but snow may be left)
625          !-------------------------------------------------------------------
626          zhsn  = h_snow_1d(ji)
627          zihgnew = 1.0 - MAX( zzero , SIGN( zone , -zhicnew ) )
628          zihsn   = MAX( zzero , SIGN( zone , -zhsn ) )
629          !---convert
630          zdhicm  = ( 1.0 - zihgnew ) * ( zhicnew - qstbif_1d(ji) / xlic )
631          zdhsnm  = ( 1.0 - zihsn ) * zdhicm * rhoic / rhosn
632          !---updating new ice thickness and computing the newly formed ice mass
633          zhicnew   =  zihgnew * zhicnew
634          rdmicif_1d(ji) =  rdmicif_1d(ji) + ( 1.0 - frld_1d(ji) ) * ( zhicnew - h_ice_1d(ji) ) * rhoic
635          !---updating new snow thickness and computing the newly formed snow mass
636          zhsnfi   = zhsn + zdhsnm
637          h_snow_1d(ji) = MAX( zzero , zhsnfi )
638          rdmsnif_1d(ji) =  rdmsnif_1d(ji) + ( 1.0 - frld_1d(ji) ) * ( h_snow_1d(ji) - zhsn ) * rhosn
639          !--remaining energy in case of total ablation
640          zqocea(ji) = - ( zihsn * xlic * zdhicm + xlsn * ( zhsnfi - h_snow_1d(ji) ) ) * ( 1.0 - frld_1d(ji) )
641          qstbif_1d(ji) = zihgnew * qstbif_1d(ji)
642
643          !
644          !        9.5. Update internal temperature and ice thickness.
645          !-------------------------------------------------------
646          !
647          sist_1d(ji) = zihgnew * sist_1d(ji) + ( 1.0 - zihgnew ) * tfu_1d(ji)
648          zidhb  = MAX( zzero , SIGN( zone , - zdhicbot(ji) ) )
649          zc1    = - zhicnew * 0.5
650          zpc1   = MIN( 0.5 * zone , - h_ice_1d(ji) * 0.5 - zdhictop(ji) )
651          zc2    = - zhicnew
652          zpc2   =  zidhb * zc2 + ( 1.0 - zidhb ) * ( - h_ice_1d(ji) - zdhictop(ji) )
653          zp1    =  MAX( zpc1 , zc1 )
654          zp2    =  MAX( zpc2 , zc1 )
655          zep(ji) =  tbif_1d(ji,2)
656          ztb2  = 2.0 * (         - zp1   * tbif_1d(ji,2)  &
657             &  + ( zp1 - zp2 ) * tbif_1d(ji,3)  &
658             &  + ( zp2 - zc1 ) * tfu_1d(ji) ) / MAX( zhicnew , epsi20 ) 
659          tbif_1d(ji,2) = zihgnew * ztb2 + ( 1.0 - zihgnew ) * tfu_1d(ji)
660          !---
661          zp1  =  MIN( zpc1 , zc1 )
662          zp2  =  MIN( zpc2 , zc1 )
663          zp1  =  MAX( zc2  , zp1 )
664          ztb3 =  2.0 * (   ( 1.0 - zidhb ) * (  ( zc1 - zp2 ) * tbif_1d(ji,3)  &
665             &                                 + ( zp2 - zc2 ) * tfu_1d(ji) )   &
666             &               +      zidhb   * (  ( zc1 - zp1 ) * zep(ji)      &
667             &                                 + ( zp1 - zc2 ) * tbif_1d(ji,3))  ) / MAX( zhicnew , epsi20 )
668          tbif_1d(ji,3) =  zihgnew * ztb3 + ( 1.0 - zihgnew ) * tfu_1d(ji)
669          h_ice_1d(ji)  =  zhicnew
670       END DO
671
672
673       !----------------------------------------------------------------------------
674       !  10. Surface accretion.
675       !      The change of ice thickness after snow/ice formation is such that
676       !      the interface between snow and ice is located at the same height
677       !      as the ocean surface. It is given by (Fichefet and Morales Maqueda 1999)
678       !          D(h_ice) = (- D(hsn)/alph) =  [rhosn*hsn - (rau0 - rhoic)*hic]
679       !                                     / [alph*rhosn+rau0 - rhoic]
680       !----------------------------------------------------------------------------
681       !
682       DO ji = kideb , kiut
683
684          !--  Computation of the change of ice thickness after snow-ice formation
685          zdrmh =  ( rhosn * h_snow_1d(ji) + ( rhoic - rau0 ) * h_ice_1d(ji) )  &
686             &  / ( alphs * rhosn + rau0 - rhoic )
687          zdrmh = MAX( zzero , zdrmh )
688
689          !--New ice and snow thicknesses Fichefet and Morales Maqueda (1999)
690          zhicnew  = MAX( h_ice_1d(ji) , h_ice_1d(ji) + zdrmh )
691          zhsnnew  = MIN( h_snow_1d(ji) , h_snow_1d(ji) - alphs * zdrmh )
692          !---Compute new ice temperatures. snow temperature remains unchanged
693          !   Lepparanta (1983):
694          zihic = 1.0 - MAX( zzero , SIGN( zone , -zhicnew ) )
695          zquot  = ( 1.0 - zihic ) &
696             &   +         zihic * MIN( zone , h_ice_1d(ji) / MAX( zhicnew , epsi20 ) ) 
697          ztneq  =         alphs * cnscg * tbif_1d(ji,1)    &
698             &   + ( 1.0 - alphs * ( rhosn/rhoic ) ) * tfu_1d(ji)
699          zep(ji) = tbif_1d(ji,2)
700          tbif_1d(ji,2) = ztneq - zquot * zquot * ( ztneq - tbif_1d(ji,2) )
701          tbif_1d(ji,3) = 2.0 * ztneq &
702             &        + zquot * ( tbif_1d(ji,3) + zep(ji) - 2.0 * ztneq ) - tbif_1d(ji,2)
703
704          !---  Lepparanta (1983) (latent heat released during white ice formation
705          !     goes to the ocean -for lateral ablation-)
706          qldif_1d(ji)  = qldif_1d(ji) + zdrmh * ( 1.0 - alphs * ( rhosn/rhoic ) ) * xlic * ( 1.0 - frld_1d(ji) )
707          !--   Changes in ice volume and ice mass Lepparanta (1983):
708          dvnbq_1d(ji) = ( 1.0 - frld_1d(ji) ) * ( zhicnew - h_ice_1d(ji) )
709          dmgwi_1d(ji) = dmgwi_1d(ji) + ( 1.0 -frld_1d(ji) ) * ( h_snow_1d(ji) - zhsnnew ) * rhosn
710          !---  volume change of ice and snow (used for ocean-ice freshwater flux computation)
711          rdmicif_1d(ji) = rdmicif_1d(ji) + ( 1.0 - frld_1d(ji) )   * ( zhicnew - h_ice_1d (ji) ) * rhoic
712          rdmsnif_1d(ji) = rdmsnif_1d(ji) + ( 1.0 - frld_1d(ji) )   * ( zhsnnew - h_snow_1d(ji) ) * rhosn
713
714          !---  Actualize new snow and ice thickness.
715          h_snow_1d(ji)  = zhsnnew
716          h_ice_1d (ji)  = zhicnew
717
718       END DO
719
720       !----------------------------------------------------
721       !  11. Lateral ablation (Changes in sea/ice fraction)
722       !----------------------------------------------------
723       DO ji = kideb , kiut
724          zfrl_old(ji)  = frld_1d(ji)
725          zihic   = 1.0 - MAX( zzero , SIGN( zone , -h_ice_1d(ji) ) )
726          zihsn   = 1.0 - MAX( zzero , SIGN( zone , -h_snow_1d(ji) ) )
727          !--In the case of total ablation (all the ice ice has melted) frld = 1
728          frld_1d(ji)  = ( 1.0 - zihic ) + zihic * zfrl_old(ji)
729          !--Part of solar radiation absorbing inside the ice and going
730          !--through the ocean
731          fscbq_1d(ji) = ( 1.0 - zfrl_old(ji) ) * ( 1.0 - thcm_1d(ji) ) * fstbif_1d(ji)
732          !--Total remaining energy after bottom melting/growing
733          qfvbq_1d(ji) = zqsup(ji) + ( 1.0 - zihic ) * zqocea(ji)
734          !--Updating of total heat from the ocean
735          qldif_1d(ji)  = qldif_1d(ji) + qfvbq_1d(ji) + ( 1.0 - zihic ) * fscbq_1d(ji) * rdt_ice
736          !--Computation of total heat inside the snow/ice system
737          zqice  = h_snow_1d(ji) * xlsn + h_ice_1d(ji) * xlic
738          zqicetot  = ( 1.0 - frld_1d(ji) ) * zqice
739          !--The concentration of ice is reduced (frld increases) if the heat
740          !--exchange between ice and ocean is positive
741          ziqf = MAX( zzero , SIGN( zone ,  zqicetot - qldif_1d(ji) ) )
742          zdfrl = qldif_1d(ji) / MAX( epsi20 , zqice ) 
743          frld_1d(ji)  = ( 1.0 - ziqf )    &
744             &       +         ziqf * ( frld_1d(ji) + MAX( zzero , zdfrl ) ) 
745          fltbif_1d(ji) = ( ( 1.0 - zfrl_old(ji) ) * qstbif_1d(ji) - zqicetot  ) / rdt_ice
746          !--  Opening of leads: Hakkinen & Mellor, 1992.
747          zdfrl = - ( zdhictop(ji) + zdhicbot(ji) ) * hakspl * ( 1.0 - zfrl_old(ji) ) &
748             &  / MAX( epsi13 , h_ice_1d(ji) + h_snow_1d(ji) * rhosn/rhoic ) 
749          zfrld_1d(ji) =  frld_1d(ji) + MAX( zzero , zdfrl )
750          !--Limitation of sea-ice fraction <= 1
751          zfrld_1d(ji) = ziqf * MIN( 0.99 * zone , zfrld_1d(ji) ) + ( 1 - ziqf )
752          !---Update surface and internal temperature and snow/ice thicknesses.
753          sist_1d(ji)   = sist_1d(ji)   + ( 1.0 - ziqf ) * ( tfu_1d(ji) - sist_1d(ji)   )
754          tbif_1d(ji,1) = tbif_1d(ji,1) + ( 1.0 - ziqf ) * ( tfu_1d(ji) - tbif_1d(ji,1) )
755          tbif_1d(ji,2) = tbif_1d(ji,2) + ( 1.0 - ziqf ) * ( tfu_1d(ji) - tbif_1d(ji,2) )
756          tbif_1d(ji,3) = tbif_1d(ji,3) + ( 1.0 - ziqf ) * ( tfu_1d(ji) - tbif_1d(ji,3) )
757          !--variation of ice volume and ice mass
758          dvlbq_1d(ji)   = zihic * ( zfrl_old(ji) - frld_1d(ji) ) * h_ice_1d(ji)
759          rdmicif_1d(ji) = rdmicif_1d(ji) + dvlbq_1d(ji) * rhoic
760          !--variation of snow volume and snow mass
761          zdvsnvol    = zihsn * ( zfrl_old(ji) - frld_1d(ji) ) * h_snow_1d(ji)
762          rdmsnif_1d(ji) = rdmsnif_1d(ji) + zdvsnvol * rhosn
763          h_snow_1d(ji)  = ziqf * h_snow_1d(ji)
764
765          zdrfrl1 = ziqf * ( 1.0 -  frld_1d(ji) ) / MAX( epsi20 , 1.0 - zfrld_1d(ji) )
766          zdrfrl2 = ziqf * ( 1.0 - zfrl_old(ji) ) / MAX( epsi20 , 1.0 - zfrld_1d(ji) )
767
768          h_snow_1d (ji) = zdrfrl1 * h_snow_1d(ji)
769          h_ice_1d  (ji) = zdrfrl1 * h_ice_1d(ji)
770          qstbif_1d(ji) = zdrfrl2 * qstbif_1d(ji)
771          frld_1d(ji)    = zfrld_1d(ji)
772          !
773       END DO
774       !
775    END SUBROUTINE lim_thd_zdf_2
776
777#else
778   !!----------------------------------------------------------------------
779   !!   Default Option                                     NO sea-ice model
780   !!----------------------------------------------------------------------
781CONTAINS
782   SUBROUTINE lim_thd_zdf_2          ! Empty routine
783   END SUBROUTINE lim_thd_zdf_2
784#endif
785
786   !!======================================================================
787END MODULE limthd_zdf_2
Note: See TracBrowser for help on using the repository browser.