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 branches/2013/dev_r4028_CNRS_LIM3/NEMOGCM/NEMO/LIM_SRC_3 – NEMO

source: branches/2013/dev_r4028_CNRS_LIM3/NEMOGCM/NEMO/LIM_SRC_3/limsbc.F90 @ 4332

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

update LIM3 to fix remaining bugs. Now working in global and regional config.

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