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.
limsbc.F90 in trunk/NEMOGCM/NEMO/LIM_SRC_3 – NEMO

source: trunk/NEMOGCM/NEMO/LIM_SRC_3/limsbc.F90 @ 4528

Last change on this file since 4528 was 4333, checked in by clem, 10 years ago

remove remaining bugs in LIM3, so that it can run in both regional and global config

  • Property svn:keywords set to Id
File size: 24.9 KB
Line 
1MODULE limsbc
2   !!======================================================================
3   !!                       ***  MODULE limsbc   ***
4   !!           computation of the flux at the sea ice/ocean interface
5   !!======================================================================
6   !! History :   -   ! 2006-07 (M. Vancoppelle)  LIM3 original code
7   !!            3.0  ! 2008-03 (C. Tallandier)  surface module
8   !!             -   ! 2008-04 (C. Tallandier)  split in 2 + new ice-ocean coupling
9   !!            3.3  ! 2010-05 (G. Madec) decrease ocean & ice reference salinities in the Baltic sea
10   !!                 !                  + simplification of the ice-ocean stress calculation
11   !!            3.4  ! 2011-02 (G. Madec) dynamical allocation
12   !!             -   ! 2012    (D. Iovino) salt flux change
13   !!             -   ! 2012-05 (C. Rousset) add penetration solar flux
14   !!            3.5  ! 2012-10 (A. Coward, G. Madec) salt fluxes ; ice+snow mass
15   !!----------------------------------------------------------------------
16#if defined key_lim3
17   !!----------------------------------------------------------------------
18   !!   'key_lim3'                                    LIM 3.0 sea-ice model
19   !!----------------------------------------------------------------------
20   !!   lim_sbc_alloc : allocate the limsbc arrays
21   !!   lim_sbc_init  : initialisation
22   !!   lim_sbc_flx   : updates mass, heat and salt fluxes at the ocean surface
23   !!   lim_sbc_tau   : update i- and j-stresses, and its modulus at the ocean surface
24   !!----------------------------------------------------------------------
25   USE par_oce          ! ocean parameters
26   USE phycst           ! physical constants
27   USE par_ice          ! ice parameters
28   USE dom_oce          ! ocean domain
29   USE domvvl           ! ocean vertical scale factors
30   USE dom_ice,    ONLY : tms
31   USE ice              ! LIM sea-ice variables
32   USE sbc_ice          ! Surface boundary condition: sea-ice fields
33   USE sbc_oce          ! Surface boundary condition: ocean fields
34   USE sbccpl
35   USE cpl_oasis3, ONLY : lk_cpl
36   USE oce       , ONLY : iatte, oatte, sshn, sshb, snwice_mass, snwice_mass_b, snwice_fmass
37   USE albedo           ! albedo parameters
38   USE lbclnk           ! ocean lateral boundary condition - MPP exchanges
39   USE lib_mpp          ! MPP library
40   USE wrk_nemo         ! work arrays
41   USE in_out_manager   ! I/O manager
42   USE prtctl           ! Print control
43   USE lib_fortran      ! Fortran utilities (allows no signed zero when 'key_nosignedzero' defined) 
44   USE traqsr           ! clem: add penetration of solar flux into the calculation of heat budget
45
46   IMPLICIT NONE
47   PRIVATE
48
49   PUBLIC   lim_sbc_init   ! called by ice_init
50   PUBLIC   lim_sbc_flx    ! called by sbc_ice_lim
51   PUBLIC   lim_sbc_tau    ! called by sbc_ice_lim
52
53   REAL(wp)  ::   rzero  = 0._wp   
54   REAL(wp)  ::   rone   = 1._wp
55
56   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:) ::   utau_oce, vtau_oce   ! air-ocean surface i- & j-stress     [N/m2]
57   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:) ::   tmod_io              ! modulus of the ice-ocean velocity   [m/s]
58   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:) ::   soce_0  , sice_0     ! cst SSS and ice salinity (levitating sea-ice)
59
60   !! * Substitutions
61#  include "vectopt_loop_substitute.h90"
62   !!----------------------------------------------------------------------
63   !! NEMO/LIM3 4.0 , UCL - NEMO Consortium (2011)
64   !! $Id$
65   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
66   !!----------------------------------------------------------------------
67CONTAINS
68
69   INTEGER FUNCTION lim_sbc_alloc()
70      !!-------------------------------------------------------------------
71      !!             ***  ROUTINE lim_sbc_alloc ***
72      !!-------------------------------------------------------------------
73      ALLOCATE( soce_0(jpi,jpj) , utau_oce(jpi,jpj) ,                       &
74         &      sice_0(jpi,jpj) , vtau_oce(jpi,jpj) , tmod_io(jpi,jpj), STAT=lim_sbc_alloc)
75         !
76      IF( lk_mpp             )   CALL mpp_sum( lim_sbc_alloc )
77      IF( lim_sbc_alloc /= 0 )   CALL ctl_warn('lim_sbc_alloc: failed to allocate arrays')
78   END FUNCTION lim_sbc_alloc
79
80
81   SUBROUTINE lim_sbc_flx( kt )
82      !!-------------------------------------------------------------------
83      !!                ***  ROUTINE lim_sbc_flx ***
84      !! 
85      !! ** Purpose :   Update the surface ocean boundary condition for heat
86      !!              salt and mass over areas where sea-ice is non-zero
87      !!         
88      !! ** Action  : - computes the heat and freshwater/salt fluxes
89      !!              at the ice-ocean interface.
90      !!              - Update the ocean sbc
91      !!     
92      !! ** Outputs : - qsr     : sea heat flux:     solar
93      !!              - qns     : sea heat flux: non solar
94      !!              - emp     : freshwater budget: volume flux
95      !!              - sfx     : salt flux
96      !!              - fr_i    : ice fraction
97      !!              - tn_ice  : sea-ice surface temperature
98      !!              - alb_ice : sea-ice alberdo (lk_cpl=T)
99      !!
100      !! References : Goosse, H. et al. 1996, Bul. Soc. Roy. Sc. Liege, 65, 87-90.
101      !!              Tartinville et al. 2001 Ocean Modelling, 3, 95-108.
102      !!---------------------------------------------------------------------
103      INTEGER, INTENT(in) ::   kt    ! number of iteration
104      !
105      INTEGER  ::   ji, jj, jl           ! dummy loop indices
106      INTEGER  ::   ierr, ifvt, i1mfr, idfr           ! local integer
107      INTEGER  ::   iflt, ial , iadv , ifral, ifrdv   !   -      -
108      REAL(wp) ::   zinda, zemp, zemp_snow, zfmm      ! local scalars
109      REAL(wp) ::   zemp_snw                          !   -      -
110      REAL(wp) ::   zfcm1 , zfcm2                     !   -      -
111      REAL(wp), POINTER, DIMENSION(:,:,:) ::   zalb, zalbp     ! 2D/3D workspace
112      REAL(wp) ::   zzfcm1, zfscmbq ! clem: for light penetration
113      !!---------------------------------------------------------------------
114     
115      IF( lk_cpl )   CALL wrk_alloc( jpi, jpj, jpl, zalb, zalbp )
116
117      !------------------------------------------!
118      !      heat flux at the ocean surface      !
119      !------------------------------------------!
120      ! pfrld is the lead fraction at the previous time step (actually between TRP and THD)
121      ! changed to old_frld and old ht_i
122
123      DO jj = 1, jpj
124         DO ji = 1, jpi
125            zinda   = 1.0 - MAX( rzero , SIGN( rone , - ( 1.0 - pfrld(ji,jj) ) ) )
126            ifvt    = zinda  *  MAX( rzero , SIGN( rone, - phicif(ji,jj) ) )  !subscripts are bad here
127            i1mfr   = 1.0 - MAX( rzero , SIGN( rone ,  - at_i(ji,jj) ) )
128            idfr    = 1.0 - MAX( rzero , SIGN( rone , ( 1.0 - at_i(ji,jj) ) - pfrld(ji,jj) ) )
129            iflt    = zinda  * (1 - i1mfr) * (1 - ifvt )
130            ial     = ifvt   * i1mfr + ( 1 - ifvt ) * idfr
131            iadv    = ( 1  - i1mfr ) * zinda
132            ifral   = ( 1  - i1mfr * ( 1 - ial ) )   
133            ifrdv   = ( 1  - ifral * ( 1 - ial ) ) * iadv 
134
135            ! switch --- 1.0 ---------------- 0.0 --------------------
136            ! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
137            ! zinda   | if pfrld = 1       | if pfrld < 1            |
138            !  -> ifvt| if pfrld old_ht_i
139            ! i1mfr   | if frld = 1        | if frld  < 1            |
140            ! idfr    | if frld <= pfrld    | if frld > pfrld        |
141            ! iflt    |
142            ! ial     |
143            ! iadv    |
144            ! ifral
145            ! ifrdv
146
147            !   computation the solar flux at ocean surface
148            IF (lk_cpl) THEN ! be carfeful: not been tested yet
149               ! original line
150               !zfcm1 = qsr_tot(ji,jj) + fstric(ji,jj) * at_i(ji,jj)
151               ! new line to include solar penetration (not tested)
152               zfcm1 = qsr_tot(ji,jj) + fstric(ji,jj) * at_i(ji,jj) / ( 1.0 - zinda + zinda * iatte(ji,jj) )
153               DO jl = 1, jpl
154                  zfcm1 = zfcm1 - qsr_ice(ji,jj,jl) * a_i(ji,jj,jl)
155               END DO
156            ELSE
157               zfcm1   = pfrld(ji,jj) * qsr(ji,jj)  + &
158                    &    ( 1._wp - pfrld(ji,jj) ) * fstric(ji,jj) / ( 1.0 - zinda + zinda * iatte(ji,jj) )
159            ENDIF
160            ! fstric     Solar flux transmitted trough the ice
161            ! qsr        Net short wave heat flux on free ocean
162            ! new line
163            fscmbq(ji,jj) = ( 1.0 - pfrld(ji,jj) ) * fstric(ji,jj) / ( 1.0 - zinda + zinda * iatte(ji,jj) )
164
165            ! solar flux and fscmbq with light penetration (clem)
166            zzfcm1  = pfrld(ji,jj) * qsr(ji,jj) * oatte(ji,jj) + ( 1. - pfrld(ji,jj) ) * fstric(ji,jj)
167            zfscmbq = ( 1.0 - pfrld(ji,jj) ) * fstric(ji,jj)
168
169            !  computation the non solar heat flux at ocean surface
170            zfcm2 = - zzfcm1                                                                    & !
171               &    + iflt    * zfscmbq                                                         & ! total ablation: heat given to the ocean
172               &    + ifral   * ( ial * qcmif(ji,jj) + (1 - ial) * qldif(ji,jj) ) * r1_rdtice   &
173               &    + ifrdv   * (       qfvbq(ji,jj) +             qdtcn(ji,jj) ) * r1_rdtice   &
174               &    + fhmec(ji,jj)                                                              & ! snow melt when ridging
175               &    + fheat_mec(ji,jj)                                                          & ! ridge formation
176               &    + fheat_res(ji,jj)                                                            ! residual heat flux
177            ! qcmif   Energy needed to bring the ocean surface layer until its freezing (ok)
178            ! qldif   heat balance of the lead (or of the open ocean)
179            ! qfvbq   latent heat uptake/release after accretion/ablation
180            ! qdtcn   Energy from the turbulent oceanic heat flux heat flux coming in the lead
181
182            IF( num_sal == 2 )   zfcm2 = zfcm2 + fhbri(ji,jj)    ! add contribution due to brine drainage
183
184            ! bottom radiative component is sent to the computation of the oceanic heat flux
185            fsbbq(ji,jj) = ( 1._wp - ( ifvt + iflt ) ) * fscmbq(ji,jj)     
186
187            ! used to compute the oceanic heat flux at the next time step
188            qsr(ji,jj) = zfcm1                                       ! solar heat flux
189            qns(ji,jj) = zfcm2 - fdtcn(ji,jj)                        ! non solar heat flux
190            !                           ! fdtcn : turbulent oceanic heat flux
191         END DO
192      END DO
193
194      !------------------------------------------!
195      !      mass flux at the ocean surface      !
196      !------------------------------------------!
197
198!!gm   optimisation: this loop have to be merged with the previous one
199      DO jj = 1, jpj
200         DO ji = 1, jpi
201            !  case of realistic freshwater flux (Tartinville et al., 2001) (presently ACTIVATED)
202            !  -------------------------------------------------------------------------------------
203            !  The idea of this approach is that the system that we consider is the ICE-OCEAN system
204            !  Thus  FW  flux  =  External ( E-P+snow melt)
205            !       Salt flux  =  Exchanges in the ice-ocean system then converted into FW
206            !                     Associated to Ice formation AND Ice melting
207            !                     Even if i see Ice melting as a FW and SALT flux
208            !       
209
210            !  computing freshwater exchanges at the ice/ocean interface
211            IF (lk_cpl) THEN
212               zemp = - emp_tot(ji,jj) + emp_ice(ji,jj) * ( 1. - pfrld(ji,jj) )    &   !
213                  &   - rdm_snw(ji,jj) / rdt_ice
214            ELSE
215               zemp =   emp(ji,jj)     * ( 1.0 - at_i(ji,jj)          )  &   ! evaporation over oceanic fraction
216                  &   - tprecip(ji,jj) *         at_i(ji,jj)             &   ! all precipitation reach the ocean
217                  &   + sprecip(ji,jj) * ( 1. - (pfrld(ji,jj)**betas) )  &   ! except solid precip intercepted by sea-ice
218                  &   - fmmec(ji,jj)                                         ! snow falling when ridging
219            ENDIF
220
221            ! mass flux at the ocean/ice interface (sea ice fraction)
222            zemp_snw = rdm_snw(ji,jj) * r1_rdtice                         ! snow melting = pure water that enters the ocean
223            zfmm     = rdm_ice(ji,jj) * r1_rdtice                         ! Freezing minus melting 
224
225            fmmflx(ji,jj) = zfmm                                     ! F/M mass flux save at least for biogeochemical model
226
227            emp(ji,jj) = zemp + zemp_snw + zfmm  ! mass flux + F/M mass flux (always ice/ocean mass exchange)
228           
229            !  correcting brine salt fluxes   (zinda = 1  if pfrld=1 , =0 otherwise)
230            zinda        = 1.0 - MAX( rzero , SIGN( rone , - ( 1.0 - pfrld(ji,jj) ) ) )
231            sfx_bri(ji,jj) = zinda * sfx_bri(ji,jj)
232         END DO
233      END DO
234
235      !------------------------------------------!
236      !      salt flux at the ocean surface      !
237      !------------------------------------------!
238
239      IF( num_sal == 2 ) THEN      ! variable ice salinity: brine drainage included in the salt flux
240         sfx(:,:) = sfx_thd(:,:) + sfx_res(:,:) + sfx_mec(:,:) + sfx_bri(:,:)
241      ELSE                         ! constant ice salinity:
242         sfx(:,:) = sfx_thd(:,:) + sfx_res(:,:) + sfx_mec(:,:)
243      ENDIF
244      !-----------------------------------------------!
245      !   mass of snow and ice per unit area          !
246      !-----------------------------------------------!
247      IF( nn_ice_embd /= 0 ) THEN                               ! embedded sea-ice (mass required)
248         snwice_mass_b(:,:) = snwice_mass(:,:)                  ! save mass from the previous ice time step
249         !                                                      ! new mass per unit area
250         snwice_mass  (:,:) = tms(:,:) * ( rhosn * vt_s(:,:) + rhoic * vt_i(:,:)  ) 
251         !                                                      ! time evolution of snow+ice mass
252         snwice_fmass (:,:) = ( snwice_mass(:,:) - snwice_mass_b(:,:) ) * r1_rdtice
253      ENDIF
254
255      !-----------------------------------------------!
256      !   Storing the transmitted variables           !
257      !-----------------------------------------------!
258      fr_i  (:,:)   = at_i(:,:)             ! Sea-ice fraction           
259      tn_ice(:,:,:) = t_su(:,:,:)           ! Ice surface temperature                     
260
261      !------------------------------------------------!
262      !    Computation of snow/ice and ocean albedo    !
263      !------------------------------------------------!
264      IF( lk_cpl ) THEN          ! coupled case
265         CALL albedo_ice( t_su, ht_i, ht_s, zalbp, zalb )                  ! snow/ice albedo
266         !
267         alb_ice(:,:,:) =  0.5_wp * zalbp(:,:,:) + 0.5_wp * zalb (:,:,:)   ! Ice albedo (mean clear and overcast skys)
268      ENDIF
269
270      IF(ln_ctl) THEN
271         CALL prt_ctl( tab2d_1=qsr   , clinfo1=' lim_sbc: qsr    : ', tab2d_2=qns , clinfo2=' qns     : ' )
272         CALL prt_ctl( tab2d_1=emp   , clinfo1=' lim_sbc: emp    : ', tab2d_2=sfx , clinfo2=' sfx     : ' )
273         CALL prt_ctl( tab2d_1=fr_i  , clinfo1=' lim_sbc: fr_i   : ' )
274         CALL prt_ctl( tab3d_1=tn_ice, clinfo1=' lim_sbc: tn_ice : ', kdim=jpl )
275      ENDIF
276      !
277      IF( lk_cpl )   CALL wrk_dealloc( jpi, jpj, jpl, zalb, zalbp )
278      !
279   END SUBROUTINE lim_sbc_flx
280
281
282   SUBROUTINE lim_sbc_tau( kt , pu_oce, pv_oce )
283      !!-------------------------------------------------------------------
284      !!                ***  ROUTINE lim_sbc_tau ***
285      !! 
286      !! ** Purpose : Update the ocean surface stresses due to the ice
287      !!         
288      !! ** Action  : * at each ice time step (every nn_fsbc time step):
289      !!                - compute the modulus of ice-ocean relative velocity
290      !!                  (*rho*Cd) at T-point (C-grid) or I-point (B-grid)
291      !!                      tmod_io = rhoco * | U_ice-U_oce |
292      !!                - update the modulus of stress at ocean surface
293      !!                      taum = frld * taum + (1-frld) * tmod_io * | U_ice-U_oce |
294      !!              * at each ocean time step (every kt):
295      !!                  compute linearized ice-ocean stresses as
296      !!                      Utau = tmod_io * | U_ice - pU_oce |
297      !!                using instantaneous current ocean velocity (usually before)
298      !!
299      !!    NB: - ice-ocean rotation angle no more allowed
300      !!        - here we make an approximation: taum is only computed every ice time step
301      !!          This avoids mutiple average to pass from T -> U,V grids and next from U,V grids
302      !!          to T grid. taum is used in TKE and GLS, which should not be too sensitive to this approximaton...
303      !!
304      !! ** Outputs : - utau, vtau   : surface ocean i- and j-stress (u- & v-pts) updated with ice-ocean fluxes
305      !!              - taum         : modulus of the surface ocean stress (T-point) updated with ice-ocean fluxes
306      !!---------------------------------------------------------------------
307      INTEGER ,                     INTENT(in) ::   kt               ! ocean time-step index
308      REAL(wp), DIMENSION(jpi,jpj), INTENT(in) ::   pu_oce, pv_oce   ! surface ocean currents
309      !!
310      INTEGER  ::   ji, jj   ! dummy loop indices
311      REAL(wp) ::   zat_u, zutau_ice, zu_t, zmodt   ! local scalar
312      REAL(wp) ::   zat_v, zvtau_ice, zv_t          !   -      -
313      !!---------------------------------------------------------------------
314      !
315      IF( MOD( kt-1, nn_fsbc ) == 0 ) THEN     !==  Ice time-step only  ==!   (i.e. surface module time-step)
316!CDIR NOVERRCHK
317         DO jj = 2, jpjm1                             !* update the modulus of stress at ocean surface (T-point)
318!CDIR NOVERRCHK
319            DO ji = fs_2, fs_jpim1
320               !                                               ! 2*(U_ice-U_oce) at T-point
321               zu_t = u_ice(ji,jj) + u_ice(ji-1,jj) - u_oce(ji,jj) - u_oce(ji-1,jj)   
322               zv_t = v_ice(ji,jj) + v_ice(ji,jj-1) - v_oce(ji,jj) - v_oce(ji,jj-1) 
323               !                                              ! |U_ice-U_oce|^2
324               zmodt =  0.25_wp * (  zu_t * zu_t + zv_t * zv_t  )
325               !                                               ! update the ocean stress modulus
326               taum(ji,jj) = ( 1._wp - at_i(ji,jj) ) * taum(ji,jj) + at_i(ji,jj) * rhoco * zmodt
327               tmod_io(ji,jj) = rhoco * SQRT( zmodt )          ! rhoco * |U_ice-U_oce| at T-point
328            END DO
329         END DO
330         CALL lbc_lnk( taum, 'T', 1. )   ;   CALL lbc_lnk( tmod_io, 'T', 1. )
331         !
332         utau_oce(:,:) = utau(:,:)                    !* save the air-ocean stresses at ice time-step
333         vtau_oce(:,:) = vtau(:,:)
334         !
335      ENDIF
336      !
337      !                                      !==  every ocean time-step  ==!
338      !
339      DO jj = 2, jpjm1                                !* update the stress WITHOUT a ice-ocean rotation angle
340         DO ji = fs_2, fs_jpim1   ! Vect. Opt.
341            zat_u  = ( at_i(ji,jj) + at_i(ji+1,jj) ) * 0.5_wp   ! ice area at u and V-points
342            zat_v  = ( at_i(ji,jj) + at_i(ji,jj+1) ) * 0.5_wp
343            !                                                   ! linearized quadratic drag formulation
344            zutau_ice   = 0.5_wp * ( tmod_io(ji,jj) + tmod_io(ji+1,jj) ) * ( u_ice(ji,jj) - pu_oce(ji,jj) )
345            zvtau_ice   = 0.5_wp * ( tmod_io(ji,jj) + tmod_io(ji,jj+1) ) * ( v_ice(ji,jj) - pv_oce(ji,jj) )
346            !                                                   ! stresses at the ocean surface
347            utau(ji,jj) = ( 1._wp - zat_u ) * utau_oce(ji,jj) + zat_u * zutau_ice
348            vtau(ji,jj) = ( 1._wp - zat_v ) * vtau_oce(ji,jj) + zat_v * zvtau_ice
349         END DO
350      END DO
351      CALL lbc_lnk( utau, 'U', -1. )   ;   CALL lbc_lnk( vtau, 'V', -1. )   ! lateral boundary condition
352      !
353      IF(ln_ctl)   CALL prt_ctl( tab2d_1=utau, clinfo1=' lim_sbc: utau   : ', mask1=umask,   &
354         &                       tab2d_2=vtau, clinfo2=' vtau    : '        , mask2=vmask )
355     
356   END SUBROUTINE lim_sbc_tau
357
358
359   SUBROUTINE lim_sbc_init
360      !!-------------------------------------------------------------------
361      !!                  ***  ROUTINE lim_sbc_init  ***
362      !!             
363      !! ** Purpose : Preparation of the file ice_evolu for the output of
364      !!      the temporal evolution of key variables
365      !!
366      !! ** input   : Namelist namicedia
367      !!-------------------------------------------------------------------
368      REAL(wp) :: zsum, zarea
369      !
370      INTEGER  ::   ji, jj, jk                       ! dummy loop indices
371      REAL(wp) ::   zcoefu, zcoefv, zcoeff          ! local scalar
372      IF(lwp) WRITE(numout,*)
373      IF(lwp) WRITE(numout,*) 'lim_sbc_init : LIM-3 sea-ice - surface boundary condition'
374      IF(lwp) WRITE(numout,*) '~~~~~~~~~~~~~   '
375
376      !                                      ! allocate lim_sbc array
377      IF( lim_sbc_alloc() /= 0 )   CALL ctl_stop( 'STOP', 'lim_sbc_init : unable to allocate standard arrays' )
378      !
379      soce_0(:,:) = soce                     ! constant SSS and ice salinity used in levitating sea-ice case
380      sice_0(:,:) = sice
381      !
382      IF( cp_cfg == "orca" ) THEN            ! decrease ocean & ice reference salinities in the Baltic sea
383         WHERE( 14._wp <= glamt(:,:) .AND. glamt(:,:) <= 32._wp .AND.   &
384            &   54._wp <= gphit(:,:) .AND. gphit(:,:) <= 66._wp         ) 
385            soce_0(:,:) = 4._wp
386            sice_0(:,:) = 2._wp
387         END WHERE
388      ENDIF
389      ! clem modif
390      IF( .NOT. ln_rstart ) THEN
391         iatte(:,:) = 1._wp
392         oatte(:,:) = 1._wp
393      ENDIF
394      !
395      ! clem: snwice_mass in the restart file now
396      IF( .NOT. ln_rstart ) THEN
397         !                                      ! embedded sea ice
398         IF( nn_ice_embd /= 0 ) THEN            ! mass exchanges between ice and ocean (case 1 or 2) set the snow+ice mass
399            snwice_mass  (:,:) = tms(:,:) * ( rhosn * vt_s(:,:) + rhoic * vt_i(:,:)  )
400            snwice_mass_b(:,:) = snwice_mass(:,:)
401         ELSE
402            snwice_mass  (:,:) = 0.0_wp         ! no mass exchanges
403            snwice_mass_b(:,:) = 0.0_wp         ! no mass exchanges
404         ENDIF
405         IF( nn_ice_embd == 2 ) THEN            ! full embedment (case 2) deplete the initial ssh below sea-ice area
406            sshn(:,:) = sshn(:,:) - snwice_mass(:,:) * r1_rau0
407            sshb(:,:) = sshb(:,:) - snwice_mass(:,:) * r1_rau0
408#if defined key_vvl           
409           ! key_vvl necessary? clem: yes for compilation purpose
410            DO jk = 1,jpkm1                     ! adjust initial vertical scale factors
411               fse3t_n(:,:,jk) = e3t_0(:,:,jk)*( 1._wp + sshn(:,:)*tmask(:,:,1)/(ht_0(:,:) + 1.0 - tmask(:,:,1)) )
412               fse3t_b(:,:,jk) = e3t_0(:,:,jk)*( 1._wp + sshb(:,:)*tmask(:,:,1)/(ht_0(:,:) + 1.0 - tmask(:,:,1)) )
413            ENDDO
414            fse3t_a(:,:,:) = fse3t_b(:,:,:)
415            ! Reconstruction of all vertical scale factors at now and before time
416            ! steps
417            ! =============================================================================
418            ! Horizontal scale factor interpolations
419            ! --------------------------------------
420            CALL dom_vvl_interpol( fse3t_b(:,:,:), fse3u_b(:,:,:), 'U' )
421            CALL dom_vvl_interpol( fse3t_b(:,:,:), fse3v_b(:,:,:), 'V' )
422            CALL dom_vvl_interpol( fse3t_n(:,:,:), fse3u_n(:,:,:), 'U' )
423            CALL dom_vvl_interpol( fse3t_n(:,:,:), fse3v_n(:,:,:), 'V' )
424            CALL dom_vvl_interpol( fse3u_n(:,:,:), fse3f_n(:,:,:), 'F' )
425            ! Vertical scale factor interpolations
426            ! ------------------------------------
427            CALL dom_vvl_interpol( fse3t_n(:,:,:), fse3w_n (:,:,:), 'W'  )
428            CALL dom_vvl_interpol( fse3u_n(:,:,:), fse3uw_n(:,:,:), 'UW' )
429            CALL dom_vvl_interpol( fse3v_n(:,:,:), fse3vw_n(:,:,:), 'VW' )
430            CALL dom_vvl_interpol( fse3u_b(:,:,:), fse3uw_b(:,:,:), 'UW' )
431            CALL dom_vvl_interpol( fse3v_b(:,:,:), fse3vw_b(:,:,:), 'VW' )
432            ! t- and w- points depth
433            ! ----------------------
434            fsdept_n(:,:,1) = 0.5_wp * fse3w_n(:,:,1)
435            fsdepw_n(:,:,1) = 0.0_wp
436            fsde3w_n(:,:,1) = fsdept_n(:,:,1) - sshn(:,:)
437            DO jk = 2, jpk
438               fsdept_n(:,:,jk) = fsdept_n(:,:,jk-1) + fse3w_n(:,:,jk)
439               fsdepw_n(:,:,jk) = fsdepw_n(:,:,jk-1) + fse3t_n(:,:,jk-1)
440               fsde3w_n(:,:,jk) = fsdept_n(:,:,jk  ) - sshn   (:,:)
441            END DO
442#endif
443         ENDIF
444      ENDIF ! .NOT. ln_rstart
445      !
446
447   END SUBROUTINE lim_sbc_init
448
449#else
450   !!----------------------------------------------------------------------
451   !!   Default option :        Dummy module       NO LIM 3.0 sea-ice model
452   !!----------------------------------------------------------------------
453CONTAINS
454   SUBROUTINE lim_sbc           ! Dummy routine
455   END SUBROUTINE lim_sbc
456#endif 
457
458   !!======================================================================
459END MODULE limsbc
Note: See TracBrowser for help on using the repository browser.