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/2012/dev_r3385_NOCS04_HAMF/NEMOGCM/NEMO/LIM_SRC_3 – NEMO

source: branches/2012/dev_r3385_NOCS04_HAMF/NEMOGCM/NEMO/LIM_SRC_3/limsbc.F90 @ 3488

Last change on this file since 3488 was 3488, checked in by acc, 11 years ago

Branch: dev_r3385_NOCS04_HAMF; #665. Stage 3 of 2012 development: Rationalisation of code. Added LIM3 changes, corrected coupled changes and highlighted areas of concern in CICE interface

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