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

Last change on this file since 4045 was 4045, checked in by clem, 11 years ago

new LIM3

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