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 trunk/NEMO/LIM_SRC_2 – NEMO

source: trunk/NEMO/LIM_SRC_2/limthd_zdf_2.F90 @ 888

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

merge dev_001_SBC branche with the trunk to include the New Surface Module package, see ticket: #113

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