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 @ 4990

Last change on this file since 4990 was 4990, checked in by timgraham, 9 years ago

Merged branches/2014/dev_MERGE_2014 back onto the trunk as follows:

In the working copy of branch ran:
svn merge svn+ssh://forge.ipsl.jussieu.fr/ipsl/forge/projets/nemo/svn/trunk@HEAD
1 conflict in LIM_SRC_3/limdiahsb.F90
Resolved by keeping the version from dev_MERGE_2014 branch
and commited at r4989

In working copy run:
svn switch svn+ssh://forge.ipsl.jussieu.fr/ipsl/forge/projets/nemo/svn/trunk
to switch working copy

Run:
svn merge --reintegrate svn+ssh://forge.ipsl.jussieu.fr/ipsl/forge/projets/nemo/svn/branches/2014/dev_MERGE_2014
to merge the branch into the trunk - no conflicts at this stage.

  • Property svn:keywords set to Id
File size: 22.4 KB
RevLine 
[888]1MODULE limsbc
2   !!======================================================================
3   !!                       ***  MODULE limsbc   ***
4   !!           computation of the flux at the sea ice/ocean interface
5   !!======================================================================
[2528]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
[3625]11   !!            3.4  ! 2011-02 (G. Madec) dynamical allocation
[4161]12   !!             -   ! 2012    (D. Iovino) salt flux change
13   !!             -   ! 2012-05 (C. Rousset) add penetration solar flux
[3625]14   !!            3.5  ! 2012-10 (A. Coward, G. Madec) salt fluxes ; ice+snow mass
[888]15   !!----------------------------------------------------------------------
16#if defined key_lim3
17   !!----------------------------------------------------------------------
18   !!   'key_lim3'                                    LIM 3.0 sea-ice model
19   !!----------------------------------------------------------------------
[2715]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
[888]24   !!----------------------------------------------------------------------
25   USE par_oce          ! ocean parameters
[4299]26   USE phycst           ! physical constants
[888]27   USE par_ice          ! ice parameters
28   USE dom_oce          ! ocean domain
[4688]29   USE dom_ice,    ONLY : tms, area
[4299]30   USE ice              ! LIM sea-ice variables
[888]31   USE sbc_ice          ! Surface boundary condition: sea-ice fields
32   USE sbc_oce          ! Surface boundary condition: ocean fields
[4299]33   USE sbccpl
[4990]34   USE oce       , ONLY : fraqsr_1lev, sshn, sshb, snwice_mass, snwice_mass_b, snwice_fmass
[2528]35   USE albedo           ! albedo parameters
[4299]36   USE lbclnk           ! ocean lateral boundary condition - MPP exchanges
[2715]37   USE lib_mpp          ! MPP library
[3294]38   USE wrk_nemo         ! work arrays
[4299]39   USE in_out_manager   ! I/O manager
[888]40   USE prtctl           ! Print control
[4299]41   USE lib_fortran      ! Fortran utilities (allows no signed zero when 'key_nosignedzero' defined) 
[4161]42   USE traqsr           ! clem: add penetration of solar flux into the calculation of heat budget
[4688]43   USE iom
44   USE domvvl           ! Variable volume
[888]45
46   IMPLICIT NONE
47   PRIVATE
48
[2715]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
[888]52
[2715]53   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:) ::   utau_oce, vtau_oce   ! air-ocean surface i- & j-stress     [N/m2]
54   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:) ::   tmod_io              ! modulus of the ice-ocean velocity   [m/s]
55   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:) ::   soce_0  , sice_0     ! cst SSS and ice salinity (levitating sea-ice)
[1526]56
[888]57   !! * Substitutions
58#  include "vectopt_loop_substitute.h90"
[4614]59#  include "domzgr_substitute.h90"
[888]60   !!----------------------------------------------------------------------
[4161]61   !! NEMO/LIM3 4.0 , UCL - NEMO Consortium (2011)
[1146]62   !! $Id$
[2528]63   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
[888]64   !!----------------------------------------------------------------------
65CONTAINS
66
[2715]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
[918]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      !!     
[1037]90      !! ** Outputs : - qsr     : sea heat flux:     solar
91      !!              - qns     : sea heat flux: non solar
92      !!              - emp     : freshwater budget: volume flux
[3625]93      !!              - sfx     : salt flux
[1037]94      !!              - fr_i    : ice fraction
95      !!              - tn_ice  : sea-ice surface temperature
[4990]96      !!              - alb_ice : sea-ice albedo (lk_cpl=T)
[888]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.
[4990]100      !!              These refs are now obsolete since everything has been revised
101      !!              The ref should be Rousset et al., 2015?
[888]102      !!---------------------------------------------------------------------
[4990]103      INTEGER, INTENT(in) ::   kt                                   ! number of iteration
[2715]104      !
[4990]105      INTEGER  ::   ji, jj, jl, jk                                  ! dummy loop indices
106      !
107      REAL(wp) ::   zemp                                            !  local scalars
108      REAL(wp) ::   zf_mass                                         ! Heat flux associated with mass exchange ice->ocean (W.m-2)
109      REAL(wp) ::   zfcm1                                           ! New solar flux received by the ocean
110      !
111      REAL(wp), POINTER, DIMENSION(:,:,:) ::   zalb_cs, zalb_os     ! 2D/3D workspace
[888]112      !!---------------------------------------------------------------------
[921]113
[4688]114      ! make calls for heat fluxes before it is modified
[4990]115      IF( iom_use('qsr_oce') )   CALL iom_put( "qsr_oce" , qsr(:,:) * pfrld(:,:) )   !     solar flux at ocean surface
116      IF( iom_use('qns_oce') )   CALL iom_put( "qns_oce" , qns(:,:) * pfrld(:,:) )   ! non-solar flux at ocean surface
117      IF( iom_use('qsr_ice') )   CALL iom_put( "qsr_ice" , SUM( qsr_ice(:,:,:) * a_i_b(:,:,:), dim=3 ) ) !     solar flux at ice surface
118      IF( iom_use('qns_ice') )   CALL iom_put( "qns_ice" , SUM( qns_ice(:,:,:) * a_i_b(:,:,:), dim=3 ) ) ! non-solar flux at ice surface
119      IF( iom_use('qtr_ice') )   CALL iom_put( "qtr_ice" , SUM( ftr_ice(:,:,:) * a_i_b(:,:,:), dim=3 ) ) !     solar flux transmitted thru ice
120      IF( iom_use('qt_oce' ) )   CALL iom_put( "qt_oce"  , ( qsr(:,:) + qns(:,:) ) * pfrld(:,:) ) 
121      IF( iom_use('qt_ice' ) )   CALL iom_put( "qt_ice"  , SUM( ( qns_ice(:,:,:) + qsr_ice(:,:,:) ) * a_i_b(:,:,:), dim=3 ) )
[4688]122
[888]123      ! pfrld is the lead fraction at the previous time step (actually between TRP and THD)
124      DO jj = 1, jpj
125         DO ji = 1, jpi
126
[4688]127            !------------------------------------------!
128            !      heat flux at the ocean surface      !
129            !------------------------------------------!
130            ! Solar heat flux reaching the ocean = zfcm1 (W.m-2)
131            !---------------------------------------------------
[4990]132            IF( lk_cpl ) THEN 
133               !!! LIM2 version zqsr = qsr_tot(ji,jj) + ( fstric(ji,jj) - qsr_ice(ji,jj,1) ) * ( 1.0 - pfrld(ji,jj) )
[4688]134               zfcm1 = qsr_tot(ji,jj)
[4161]135               DO jl = 1, jpl
[4990]136                  zfcm1 = zfcm1 + ( ftr_ice(ji,jj,jl) - qsr_ice(ji,jj,jl) ) * a_i_b(ji,jj,jl)
[4161]137               END DO
138            ELSE
[4990]139               !!! LIM2 version zqsr = pfrld(ji,jj) * qsr(ji,jj)  + ( 1.  - pfrld(ji,jj) ) * fstric(ji,jj)
[4688]140               zfcm1   = pfrld(ji,jj) * qsr(ji,jj)
141               DO jl = 1, jpl
[4872]142                  zfcm1   = zfcm1 + a_i_b(ji,jj,jl) * ftr_ice(ji,jj,jl)
[4688]143               END DO
[4161]144            ENDIF
[888]145
[4688]146            ! Total heat flux reaching the ocean = hfx_out (W.m-2)
147            !---------------------------------------------------
148            zf_mass        = hfx_thd(ji,jj) + hfx_dyn(ji,jj) + hfx_res(ji,jj) ! heat flux from snow is 0 (T=0 degC)
149            hfx_out(ji,jj) = hfx_out(ji,jj) + zf_mass + zfcm1
[4161]150
[4688]151            ! New qsr and qns used to compute the oceanic heat flux at the next time step
152            !---------------------------------------------------
153            qsr(ji,jj) = zfcm1                                     
154            qns(ji,jj) = hfx_out(ji,jj) - zfcm1             
[888]155
[4688]156            !------------------------------------------!
157            !      mass flux at the ocean surface      !
158            !------------------------------------------!
[888]159            !  case of realistic freshwater flux (Tartinville et al., 2001) (presently ACTIVATED)
160            !  -------------------------------------------------------------------------------------
161            !  The idea of this approach is that the system that we consider is the ICE-OCEAN system
162            !  Thus  FW  flux  =  External ( E-P+snow melt)
163            !       Salt flux  =  Exchanges in the ice-ocean system then converted into FW
164            !                     Associated to Ice formation AND Ice melting
165            !                     Even if i see Ice melting as a FW and SALT flux
166            !       
167            !  computing freshwater exchanges at the ice/ocean interface
[4688]168            IF( lk_cpl ) THEN
[4161]169               zemp = - emp_tot(ji,jj) + emp_ice(ji,jj) * ( 1. - pfrld(ji,jj) )    &   !
[4688]170                  &   + wfx_snw(ji,jj)
[4161]171            ELSE
[4688]172               zemp =   emp(ji,jj)     *           pfrld(ji,jj)            &   ! evaporation over oceanic fraction
173                  &   - tprecip(ji,jj) * ( 1._wp - pfrld(ji,jj) )          &   ! all precipitation reach the ocean
174                  &   + sprecip(ji,jj) * ( 1._wp - pfrld(ji,jj)**betas )       ! except solid precip intercepted by sea-ice
[4161]175            ENDIF
[921]176
[4688]177            ! mass flux from ice/ocean
[4765]178            wfx_ice(ji,jj) = wfx_bog(ji,jj) + wfx_bom(ji,jj) + wfx_sum(ji,jj) + wfx_sni(ji,jj)   &
179                           + wfx_opw(ji,jj) + wfx_dyn(ji,jj) + wfx_res(ji,jj)
[2528]180
[4688]181            ! mass flux at the ocean/ice interface
182            fmmflx(ji,jj) = - wfx_ice(ji,jj) * rdt_ice                   ! F/M mass flux save at least for biogeochemical model
[4787]183            emp(ji,jj)    = zemp - wfx_ice(ji,jj) - wfx_snw(ji,jj)       ! mass flux + F/M mass flux (always ice/ocean mass exchange)
[3625]184           
[888]185         END DO
186      END DO
187
[3625]188      !------------------------------------------!
189      !      salt flux at the ocean surface      !
190      !------------------------------------------!
[4765]191      sfx(:,:) = sfx_bog(:,:) + sfx_bom(:,:) + sfx_sum(:,:) + sfx_sni(:,:) + sfx_opw(:,:)   &
192         &     + sfx_res(:,:) + sfx_dyn(:,:) + sfx_bri(:,:)
[3625]193
[4688]194      !-------------------------------------------------------------!
195      !   mass of snow and ice per unit area for embedded sea-ice   !
196      !-------------------------------------------------------------!
197      IF( nn_ice_embd /= 0 ) THEN
198         ! save mass from the previous ice time step
199         snwice_mass_b(:,:) = snwice_mass(:,:)                 
200         ! new mass per unit area
[3625]201         snwice_mass  (:,:) = tms(:,:) * ( rhosn * vt_s(:,:) + rhoic * vt_i(:,:)  ) 
[4688]202         ! time evolution of snow+ice mass
[3625]203         snwice_fmass (:,:) = ( snwice_mass(:,:) - snwice_mass_b(:,:) ) * r1_rdtice
204      ENDIF
[921]205
[888]206      !-----------------------------------------------!
207      !   Storing the transmitted variables           !
208      !-----------------------------------------------!
[1037]209      fr_i  (:,:)   = at_i(:,:)             ! Sea-ice fraction           
[888]210      tn_ice(:,:,:) = t_su(:,:,:)           ! Ice surface temperature                     
211
212      !------------------------------------------------!
[4990]213      !    Snow/ice albedo (only if sent to coupler)   !
[888]214      !------------------------------------------------!
[2715]215      IF( lk_cpl ) THEN          ! coupled case
[4990]216
217            CALL wrk_alloc( jpi, jpj, jpl, zalb_cs, zalb_os )
218
219            CALL albedo_ice( t_su, ht_i, ht_s, zalb_cs, zalb_os )  ! cloud-sky and overcast-sky ice albedos
220
221            alb_ice(:,:,:) = ( 1. - cldf_ice ) * zalb_cs(:,:,:) + cldf_ice * zalb_os(:,:,:)
222
223            CALL wrk_dealloc( jpi, jpj, jpl, zalb_cs, zalb_os )
224
[2715]225      ENDIF
[888]226
[4688]227
[888]228      IF(ln_ctl) THEN
[918]229         CALL prt_ctl( tab2d_1=qsr   , clinfo1=' lim_sbc: qsr    : ', tab2d_2=qns , clinfo2=' qns     : ' )
[3625]230         CALL prt_ctl( tab2d_1=emp   , clinfo1=' lim_sbc: emp    : ', tab2d_2=sfx , clinfo2=' sfx     : ' )
[1037]231         CALL prt_ctl( tab2d_1=fr_i  , clinfo1=' lim_sbc: fr_i   : ' )
[918]232         CALL prt_ctl( tab3d_1=tn_ice, clinfo1=' lim_sbc: tn_ice : ', kdim=jpl )
[921]233      ENDIF
[4990]234
[918]235   END SUBROUTINE lim_sbc_flx
[888]236
[2528]237
238   SUBROUTINE lim_sbc_tau( kt , pu_oce, pv_oce )
239      !!-------------------------------------------------------------------
240      !!                ***  ROUTINE lim_sbc_tau ***
241      !! 
242      !! ** Purpose : Update the ocean surface stresses due to the ice
243      !!         
244      !! ** Action  : * at each ice time step (every nn_fsbc time step):
245      !!                - compute the modulus of ice-ocean relative velocity
246      !!                  (*rho*Cd) at T-point (C-grid) or I-point (B-grid)
247      !!                      tmod_io = rhoco * | U_ice-U_oce |
248      !!                - update the modulus of stress at ocean surface
249      !!                      taum = frld * taum + (1-frld) * tmod_io * | U_ice-U_oce |
250      !!              * at each ocean time step (every kt):
251      !!                  compute linearized ice-ocean stresses as
252      !!                      Utau = tmod_io * | U_ice - pU_oce |
253      !!                using instantaneous current ocean velocity (usually before)
254      !!
255      !!    NB: - ice-ocean rotation angle no more allowed
256      !!        - here we make an approximation: taum is only computed every ice time step
257      !!          This avoids mutiple average to pass from T -> U,V grids and next from U,V grids
258      !!          to T grid. taum is used in TKE and GLS, which should not be too sensitive to this approximaton...
259      !!
260      !! ** Outputs : - utau, vtau   : surface ocean i- and j-stress (u- & v-pts) updated with ice-ocean fluxes
261      !!              - taum         : modulus of the surface ocean stress (T-point) updated with ice-ocean fluxes
262      !!---------------------------------------------------------------------
263      INTEGER ,                     INTENT(in) ::   kt               ! ocean time-step index
264      REAL(wp), DIMENSION(jpi,jpj), INTENT(in) ::   pu_oce, pv_oce   ! surface ocean currents
265      !!
266      INTEGER  ::   ji, jj   ! dummy loop indices
267      REAL(wp) ::   zat_u, zutau_ice, zu_t, zmodt   ! local scalar
268      REAL(wp) ::   zat_v, zvtau_ice, zv_t          !   -      -
[2715]269      !!---------------------------------------------------------------------
270      !
[2528]271      IF( MOD( kt-1, nn_fsbc ) == 0 ) THEN     !==  Ice time-step only  ==!   (i.e. surface module time-step)
272!CDIR NOVERRCHK
273         DO jj = 2, jpjm1                             !* update the modulus of stress at ocean surface (T-point)
274!CDIR NOVERRCHK
275            DO ji = fs_2, fs_jpim1
276               !                                               ! 2*(U_ice-U_oce) at T-point
277               zu_t = u_ice(ji,jj) + u_ice(ji-1,jj) - u_oce(ji,jj) - u_oce(ji-1,jj)   
278               zv_t = v_ice(ji,jj) + v_ice(ji,jj-1) - v_oce(ji,jj) - v_oce(ji,jj-1) 
279               !                                              ! |U_ice-U_oce|^2
280               zmodt =  0.25_wp * (  zu_t * zu_t + zv_t * zv_t  )
281               !                                               ! update the ocean stress modulus
282               taum(ji,jj) = ( 1._wp - at_i(ji,jj) ) * taum(ji,jj) + at_i(ji,jj) * rhoco * zmodt
283               tmod_io(ji,jj) = rhoco * SQRT( zmodt )          ! rhoco * |U_ice-U_oce| at T-point
284            END DO
285         END DO
286         CALL lbc_lnk( taum, 'T', 1. )   ;   CALL lbc_lnk( tmod_io, 'T', 1. )
287         !
288         utau_oce(:,:) = utau(:,:)                    !* save the air-ocean stresses at ice time-step
289         vtau_oce(:,:) = vtau(:,:)
290         !
291      ENDIF
[2715]292      !
293      !                                      !==  every ocean time-step  ==!
294      !
[2528]295      DO jj = 2, jpjm1                                !* update the stress WITHOUT a ice-ocean rotation angle
296         DO ji = fs_2, fs_jpim1   ! Vect. Opt.
297            zat_u  = ( at_i(ji,jj) + at_i(ji+1,jj) ) * 0.5_wp   ! ice area at u and V-points
298            zat_v  = ( at_i(ji,jj) + at_i(ji,jj+1) ) * 0.5_wp
299            !                                                   ! linearized quadratic drag formulation
300            zutau_ice   = 0.5_wp * ( tmod_io(ji,jj) + tmod_io(ji+1,jj) ) * ( u_ice(ji,jj) - pu_oce(ji,jj) )
301            zvtau_ice   = 0.5_wp * ( tmod_io(ji,jj) + tmod_io(ji,jj+1) ) * ( v_ice(ji,jj) - pv_oce(ji,jj) )
302            !                                                   ! stresses at the ocean surface
303            utau(ji,jj) = ( 1._wp - zat_u ) * utau_oce(ji,jj) + zat_u * zutau_ice
304            vtau(ji,jj) = ( 1._wp - zat_v ) * vtau_oce(ji,jj) + zat_v * zvtau_ice
305         END DO
306      END DO
307      CALL lbc_lnk( utau, 'U', -1. )   ;   CALL lbc_lnk( vtau, 'V', -1. )   ! lateral boundary condition
308      !
309      IF(ln_ctl)   CALL prt_ctl( tab2d_1=utau, clinfo1=' lim_sbc: utau   : ', mask1=umask,   &
310         &                       tab2d_2=vtau, clinfo2=' vtau    : '        , mask2=vmask )
311     
312   END SUBROUTINE lim_sbc_tau
313
[2715]314
315   SUBROUTINE lim_sbc_init
316      !!-------------------------------------------------------------------
317      !!                  ***  ROUTINE lim_sbc_init  ***
318      !!             
319      !! ** Purpose : Preparation of the file ice_evolu for the output of
320      !!      the temporal evolution of key variables
321      !!
322      !! ** input   : Namelist namicedia
323      !!-------------------------------------------------------------------
[4161]324      REAL(wp) :: zsum, zarea
[2715]325      !
[4299]326      INTEGER  ::   ji, jj, jk                       ! dummy loop indices
[3625]327      REAL(wp) ::   zcoefu, zcoefv, zcoeff          ! local scalar
[2715]328      IF(lwp) WRITE(numout,*)
329      IF(lwp) WRITE(numout,*) 'lim_sbc_init : LIM-3 sea-ice - surface boundary condition'
330      IF(lwp) WRITE(numout,*) '~~~~~~~~~~~~~   '
331
332      !                                      ! allocate lim_sbc array
333      IF( lim_sbc_alloc() /= 0 )   CALL ctl_stop( 'STOP', 'lim_sbc_init : unable to allocate standard arrays' )
334      !
335      soce_0(:,:) = soce                     ! constant SSS and ice salinity used in levitating sea-ice case
336      sice_0(:,:) = sice
337      !
338      IF( cp_cfg == "orca" ) THEN            ! decrease ocean & ice reference salinities in the Baltic sea
339         WHERE( 14._wp <= glamt(:,:) .AND. glamt(:,:) <= 32._wp .AND.   &
340            &   54._wp <= gphit(:,:) .AND. gphit(:,:) <= 66._wp         ) 
341            soce_0(:,:) = 4._wp
342            sice_0(:,:) = 2._wp
343         END WHERE
344      ENDIF
[4161]345      ! clem modif
[4205]346      IF( .NOT. ln_rstart ) THEN
[4990]347         fraqsr_1lev(:,:) = 1._wp
[4205]348      ENDIF
[4161]349      !
[4205]350      ! clem: snwice_mass in the restart file now
351      IF( .NOT. ln_rstart ) THEN
352         !                                      ! embedded sea ice
353         IF( nn_ice_embd /= 0 ) THEN            ! mass exchanges between ice and ocean (case 1 or 2) set the snow+ice mass
354            snwice_mass  (:,:) = tms(:,:) * ( rhosn * vt_s(:,:) + rhoic * vt_i(:,:)  )
355            snwice_mass_b(:,:) = snwice_mass(:,:)
356         ELSE
357            snwice_mass  (:,:) = 0.0_wp         ! no mass exchanges
358            snwice_mass_b(:,:) = 0.0_wp         ! no mass exchanges
359         ENDIF
360         IF( nn_ice_embd == 2 ) THEN            ! full embedment (case 2) deplete the initial ssh below sea-ice area
361            sshn(:,:) = sshn(:,:) - snwice_mass(:,:) * r1_rau0
362            sshb(:,:) = sshb(:,:) - snwice_mass(:,:) * r1_rau0
[4302]363#if defined key_vvl           
364           ! key_vvl necessary? clem: yes for compilation purpose
[4301]365            DO jk = 1,jpkm1                     ! adjust initial vertical scale factors
366               fse3t_n(:,:,jk) = e3t_0(:,:,jk)*( 1._wp + sshn(:,:)*tmask(:,:,1)/(ht_0(:,:) + 1.0 - tmask(:,:,1)) )
367               fse3t_b(:,:,jk) = e3t_0(:,:,jk)*( 1._wp + sshb(:,:)*tmask(:,:,1)/(ht_0(:,:) + 1.0 - tmask(:,:,1)) )
368            ENDDO
369            fse3t_a(:,:,:) = fse3t_b(:,:,:)
370            ! Reconstruction of all vertical scale factors at now and before time
371            ! steps
372            ! =============================================================================
373            ! Horizontal scale factor interpolations
374            ! --------------------------------------
375            CALL dom_vvl_interpol( fse3t_b(:,:,:), fse3u_b(:,:,:), 'U' )
376            CALL dom_vvl_interpol( fse3t_b(:,:,:), fse3v_b(:,:,:), 'V' )
377            CALL dom_vvl_interpol( fse3t_n(:,:,:), fse3u_n(:,:,:), 'U' )
378            CALL dom_vvl_interpol( fse3t_n(:,:,:), fse3v_n(:,:,:), 'V' )
379            CALL dom_vvl_interpol( fse3u_n(:,:,:), fse3f_n(:,:,:), 'F' )
380            ! Vertical scale factor interpolations
381            ! ------------------------------------
382            CALL dom_vvl_interpol( fse3t_n(:,:,:), fse3w_n (:,:,:), 'W'  )
383            CALL dom_vvl_interpol( fse3u_n(:,:,:), fse3uw_n(:,:,:), 'UW' )
384            CALL dom_vvl_interpol( fse3v_n(:,:,:), fse3vw_n(:,:,:), 'VW' )
385            CALL dom_vvl_interpol( fse3u_b(:,:,:), fse3uw_b(:,:,:), 'UW' )
386            CALL dom_vvl_interpol( fse3v_b(:,:,:), fse3vw_b(:,:,:), 'VW' )
387            ! t- and w- points depth
388            ! ----------------------
389            fsdept_n(:,:,1) = 0.5_wp * fse3w_n(:,:,1)
390            fsdepw_n(:,:,1) = 0.0_wp
391            fsde3w_n(:,:,1) = fsdept_n(:,:,1) - sshn(:,:)
392            DO jk = 2, jpk
393               fsdept_n(:,:,jk) = fsdept_n(:,:,jk-1) + fse3w_n(:,:,jk)
394               fsdepw_n(:,:,jk) = fsdepw_n(:,:,jk-1) + fse3t_n(:,:,jk-1)
395               fsde3w_n(:,:,jk) = fsdept_n(:,:,jk  ) - sshn   (:,:)
396            END DO
397#endif
[4205]398         ENDIF
399      ENDIF ! .NOT. ln_rstart
[2715]400      !
[4161]401
[2715]402   END SUBROUTINE lim_sbc_init
403
[888]404#else
405   !!----------------------------------------------------------------------
406   !!   Default option :        Dummy module       NO LIM 3.0 sea-ice model
407   !!----------------------------------------------------------------------
408CONTAINS
409   SUBROUTINE lim_sbc           ! Dummy routine
410   END SUBROUTINE lim_sbc
411#endif 
412
413   !!======================================================================
414END MODULE limsbc
Note: See TracBrowser for help on using the repository browser.