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_2.F90 in branches/2012/dev_r3385_NOCS04_HAMF/NEMOGCM/NEMO/LIM_SRC_2 – NEMO

source: branches/2012/dev_r3385_NOCS04_HAMF/NEMOGCM/NEMO/LIM_SRC_2/limsbc_2.F90 @ 3402

Last change on this file since 3402 was 3402, checked in by acc, 12 years ago

Branch: dev_r3385_NOCS04_HAMF; #665. Stage 2 of 2012 development: suppression of emps array and introduction of sfx (salt flux) array with associated code to setup the options for embedding the seaice into the ocean

  • Property svn:keywords set to Id
File size: 27.5 KB
Line 
1MODULE limsbc_2
2   !!======================================================================
3   !!                       ***  MODULE limsbc_2   ***
4   !! LIM-2 :   updates the fluxes at the ocean surface with ice-ocean fluxes
5   !!======================================================================
6   !! History :  LIM  ! 2000-01 (H. Goosse) Original code
7   !!            1.0  ! 2002-07 (C. Ethe, G. Madec) re-writing F90
8   !!            3.0  ! 2006-07 (G. Madec) surface module
9   !!            3.3  ! 2009-05 (G. Garric, C. Bricaud) addition of the lim2_evp case
10   !!             -   ! 2010-11 (G. Madec) ice-ocean stress computed at each ocean time-step
11   !!           3.3.1 ! 2011-01 (A. R. Porter, STFC Daresbury) dynamical allocation
12   !!            3.5  ! 2012-11 ((G. Madec, Y. Aksenov, A. Coward) salt and heat fluxes associated with e-p
13   !!----------------------------------------------------------------------
14#if defined key_lim2
15   !!----------------------------------------------------------------------
16   !!   'key_lim2'                                    LIM 2.0 sea-ice model
17   !!----------------------------------------------------------------------
18   !!   lim_sbc_alloc_2 : allocate the limsbc arrays
19   !!   lim_sbc_init    : initialisation
20   !!   lim_sbc_flx_2   : update mass, heat and salt fluxes at the ocean surface
21   !!   lim_sbc_tau_2   : update i- and j-stresses, and its modulus at the ocean surface
22   !!----------------------------------------------------------------------
23   USE par_oce          ! ocean parameters
24   USE phycst           ! physical constants
25   USE dom_oce          ! ocean domain
26   USE dom_ice_2        ! LIM-2: ice domain
27   USE ice_2            ! LIM-2: ice variables
28   USE sbc_ice          ! surface boundary condition: ice
29   USE sbc_oce          ! surface boundary condition: ocean
30   USE sbccpl
31
32   USE albedo           ! albedo parameters
33   USE lbclnk           ! ocean lateral boundary condition - MPP exchanges
34   USE lib_mpp          ! MPP library
35   USE wrk_nemo         ! work arrays
36   USE in_out_manager   ! I/O manager
37   USE diaar5, ONLY :   lk_diaar5
38   USE iom              ! I/O library
39   USE prtctl           ! Print control
40   USE cpl_oasis3, ONLY : lk_cpl
41   USE oce, ONLY : sshn, sshb, snwice_mass, snwice_mass_b, snwice_fmass 
42
43   IMPLICIT NONE
44   PRIVATE
45
46   PUBLIC   lim_sbc_init_2     ! called by ice_init_2
47   PUBLIC   lim_sbc_flx_2      ! called by sbc_ice_lim_2
48   PUBLIC   lim_sbc_tau_2      ! called by sbc_ice_lim_2
49
50   REAL(wp)  ::   r1_rdtice            ! = 1. / rdt_ice
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(:,:) ::   soce_0, sice_0   ! constant SSS and ice salinity used in levitating sea-ice case
56   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:) ::   utau_oce, vtau_oce   ! air-ocean surface i- & j-stress              [N/m2]
57   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:) ::   tmod_io              ! modulus of the ice-ocean relative velocity   [m/s]
58
59   !! * Substitutions
60#  include "vectopt_loop_substitute.h90"
61   !!----------------------------------------------------------------------
62   !! NEMO/LIM2 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_2()
69      !!-------------------------------------------------------------------
70      !!             ***  ROUTINE lim_sbc_alloc_2 ***
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_2)
74         !
75      IF( lk_mpp               )   CALL mpp_sum( lim_sbc_alloc_2 )
76      IF( lim_sbc_alloc_2 /= 0 )   CALL ctl_warn('lim_sbc_alloc_2: failed to allocate arrays.')
77      !
78   END FUNCTION lim_sbc_alloc_2
79
80
81   SUBROUTINE lim_sbc_flx_2( kt )
82      !!-------------------------------------------------------------------
83      !!                ***  ROUTINE lim_sbc_2 ***
84      !! 
85      !! ** Purpose :   Update surface ocean boundary condition over areas
86      !!              that are at least partially covered by sea-ice
87      !!         
88      !! ** Action  : - comput. of the momentum, heat and freshwater/salt
89      !!                fluxes at the ice-ocean interface.
90      !!              - Update the fluxes provided to the ocean
91      !!     
92      !! ** Outputs : - qsr     : sea heat flux    : solar
93      !!              - qns     : sea heat flux    : non solar (including heat content of the mass flux)
94      !!              - emp     : freshwater budget: mass flux
95      !!              - sfx     : freshwater budget: salt flux due to Freezing/Melting
96      !!              - utau    : sea surface i-stress (ocean referential)
97      !!              - vtau    : sea surface j-stress (ocean referential)
98      !!              - fr_i    : ice fraction
99      !!              - tn_ice  : sea-ice surface temperature
100      !!              - alb_ice : sea-ice alberdo (lk_cpl=T)
101      !!
102      !! References : Goosse, H. et al. 1996, Bul. Soc. Roy. Sc. Liege, 65, 87-90.
103      !!              Tartinville et al. 2001 Ocean Modelling, 3, 95-108.
104      !!---------------------------------------------------------------------
105      INTEGER, INTENT(in) ::   kt    ! number of iteration
106      !!
107      INTEGER  ::   ji, jj   ! dummy loop indices
108      INTEGER  ::   ii0, ii1, ij0, ij1         ! local integers
109      INTEGER  ::   ifvt, i1mfr, idfr, iflt    !   -       -
110      INTEGER  ::   ial, iadv, ifral, ifrdv    !   -       -
111      REAL(wp) ::   zqsr,     zqns,   zfmm     ! local scalars
112      REAL(wp) ::   zinda,    zfsalt, zemp     !   -      -
113      REAL(wp) ::   zemp_snw, zqhc,   zcd      !   -      -
114      REAL(wp) ::   zswitch                    !   -      -
115      REAL(wp), POINTER, DIMENSION(:,:)   ::   zqnsoce       ! 2D workspace
116      REAL(wp), POINTER, DIMENSION(:,:,:) ::   zalb, zalbp   ! 2D/3D workspace
117      !!---------------------------------------------------------------------
118     
119      CALL wrk_alloc( jpi, jpj, zqnsoce )
120      CALL wrk_alloc( jpi, jpj, 1, zalb, zalbp )
121
122      SELECT CASE( nn_ice_embd )                 ! levitating or embedded sea-ice option
123        CASE( 0    )   ;   zswitch = 1           ! (0) standard levitating sea-ice : salt exchange only
124        CASE( 1, 2 )   ;   zswitch = 0           ! (1) levitating sea-ice: salt and volume exchange but no pressure effect
125                                                 ! (2) embedded sea-ice : salt and volume fluxes and pressure
126      END SELECT                                 !   
127
128      !------------------------------------------!
129      !      heat flux at the ocean surface      !
130      !------------------------------------------!
131
132      zqnsoce(:,:) = qns(:,:)
133      DO jj = 1, jpj
134         DO ji = 1, jpi
135            zinda   = 1.0   - MAX( rzero , SIGN( rone, - ( 1.0 - pfrld(ji,jj) )   ) )
136            ifvt    = zinda * MAX( rzero , SIGN( rone,  - phicif(ji,jj)           ) )
137            i1mfr   = 1.0   - MAX( rzero , SIGN( rone, - ( 1.0 - frld(ji,jj) )    ) )
138            idfr    = 1.0   - MAX( rzero , SIGN( rone, frld(ji,jj) - pfrld(ji,jj) ) )
139            iflt    = zinda  * (1 - i1mfr) * (1 - ifvt )
140            ial     = ifvt   * i1mfr + ( 1 - ifvt ) * idfr
141            iadv    = ( 1  - i1mfr ) * zinda
142            ifral   = ( 1  - i1mfr * ( 1 - ial ) )   
143            ifrdv   = ( 1  - ifral * ( 1 - ial ) ) * iadv 
144
145!!$            attempt to explain the tricky flags set above....
146!!$            zinda   = 1.0 - AINT( pfrld(ji,jj) )                   ! = 0. if ice-free ocean else 1. (after ice adv, but before ice thermo)
147!!$            i1mfr   = 1.0 - AINT(  frld(ji,jj) )                   ! = 0. if ice-free ocean else 1. (after ice thermo)
148!!$
149!!$            IF( phicif(ji,jj) <= 0. ) THEN   ;   ifvt = zinda      ! = zinda if previous thermodynamic step overmelted the ice???
150!!$            ELSE                             ;   ifvt = 0.         !
151!!$            ENDIF
152!!$
153!!$            IF( frld(ji,jj) >= pfrld(ji,jj) ) THEN   ;   idfr = 0.  !   = 0. if lead fraction increases due to ice thermodynamics
154!!$            ELSE                                     ;   idfr = 1.   
155!!$            ENDIF
156!!$
157!!$            iflt    = zinda  * (1 - i1mfr) * (1 - ifvt )    !   = 1. if ice (not only snow) at previous time and ice-free ocean currently
158!!$
159!!$            ial     = ifvt   * i1mfr    +    ( 1 - ifvt ) * idfr
160!!$                    = i1mfr if ifvt = 1 i.e.
161!!$                    = idfr  if ifvt = 0
162!!$!                 snow no ice   ice         ice or nothing  lead fraction increases
163!!$!                 at previous   now           at previous
164!!$!                -> ice area increases  ???         -> ice area decreases ???
165!!$
166!!$            iadv    = ( 1  - i1mfr ) * zinda
167!!$!                     pure ocean      ice at
168!!$!                     at current      previous
169!!$!                        -> = 1. if ice disapear between previous and current
170!!$
171!!$            ifral   = ( 1  - i1mfr * ( 1 - ial ) ) 
172!!$!                            ice at     ???
173!!$!                            current         
174!!$!                         -> ???
175!!$
176!!$            ifrdv   = ( 1  - ifral * ( 1 - ial ) ) * iadv
177!!$!                                                    ice disapear
178!!$
179!!$
180
181            !   computation the solar flux at ocean surface
182#if defined key_coupled 
183            zqsr = qsr_tot(ji,jj) + ( fstric(ji,jj) - qsr_ice(ji,jj,1) ) * ( 1.0 - pfrld(ji,jj) )
184#else
185            zqsr = pfrld(ji,jj) * qsr(ji,jj)  + ( 1.  - pfrld(ji,jj) ) * fstric(ji,jj)
186#endif           
187            !  computation the non solar heat flux at ocean surface
188            zqns    =  - ( 1. - thcm(ji,jj) ) * zqsr                                              &   ! part of the solar energy used in leads
189               &       + iflt    * ( fscmbq(ji,jj) + ffltbif(ji,jj) )                             &
190               &       + ifral   * ( ial * qcmif(ji,jj) + (1 - ial) * qldif(ji,jj) ) * r1_rdtice  &
191               &       + ifrdv   * (       qfvbq(ji,jj) +             qdtcn(ji,jj) ) * r1_rdtice 
192
193            fsbbq(ji,jj) = ( 1.0 - ( ifvt + iflt ) ) * fscmbq(ji,jj)     ! store residual heat flux (to put into the ocean at the next time-step)
194            zqhc = ( rdq_snw(ji,jj) + rdq_ice(ji,jj) ) * r1_rdtice       ! heat flux due to snow & ice heat content exchange
195            !
196            qsr  (ji,jj) = zqsr                                          ! solar heat flux
197            qns  (ji,jj) = zqns - fdtcn(ji,jj) + zqhc                    ! non solar heat flux
198            !                          !------------------------------------------!
199            !                          !      mass flux at the ocean surface      !
200            !                          !------------------------------------------!
201            !
202            ! mass flux at the ocean-atmosphere interface (open ocean fraction = leads area)
203#if defined key_coupled
204            !                                                  ! coupled mode:
205            zemp = + emp_tot(ji,jj)                            &     ! net mass flux over the grid cell (ice+ocean area)
206               &   - emp_ice(ji,jj) * ( 1. - pfrld(ji,jj) )          ! minus the mass flux intercepted by sea-ice
207#else
208            !                                                  ! forced  mode:
209            zemp = + emp(ji,jj)     *         frld(ji,jj)      &     ! mass flux over open ocean fraction
210               &   - tprecip(ji,jj) * ( 1. -  frld(ji,jj) )    &     ! liquid precip. over ice reaches directly the ocean
211               &   + sprecip(ji,jj) * ( 1. - pfrld(ji,jj) )          ! snow is intercepted by sea-ice (previous frld)
212#endif           
213            !
214            ! mass flux at the ocean/ice interface (sea ice fraction)
215            zemp_snw = rdm_snw(ji,jj) * r1_rdtice                    ! snow melting = pure water that enters the ocean
216            zfmm     = rdm_ice(ji,jj) * r1_rdtice                    ! Freezing minus Melting (F-M)
217
218            ! salt flux at the ice/ocean interface (sea ice fraction) [PSU*kg/m2/s]
219            zfsalt = - sice_0(ji,jj) * zfmm                          ! F-M salt exchange
220            zcd    =   soce_0(ji,jj) * zfmm                          ! concentration/dilution term due to F-M
221            !
222            ! salt flux only       : add concentration dilution term in salt flux  and no  F-M term in volume flux
223            ! salt and mass fluxes : non concentartion dilution term in salt flux  and add F-M term in volume flux
224            sfx (ji,jj) = zfsalt +                  zswitch  * zcd   ! salt flux (+ C/D if no ice/ocean mass exchange)
225            emp (ji,jj) = zemp   + zemp_snw + ( 1.- zswitch) * zfmm  ! mass flux (- F/M mass flux if no ice/ocean mass exchange)
226            !
227         END DO
228      END DO
229      !                                !------------------------------------------!
230      !                                !    mass of snow and ice per unit area    !
231      !                                !------------------------------------------!
232      IF( nn_ice_embd /= 0 ) THEN      ! embedded sea-ice (mass required)
233         snwice_mass_b(:,:) = snwice_mass(:,:)                  ! save mass from the previous ice time step
234         !                                                      ! new mass per unit area
235         snwice_mass  (:,:) = tms(:,:) * ( rhosn * hsnif(:,:) + rhoic * hicif(:,:)  ) * ( 1.0 - frld(:,:) )
236         !                                                      ! time evolution of snow+ice mass
237         snwice_fmass (:,:) = ( snwice_mass(:,:) - snwice_mass_b(:,:) ) / rdt_ice
238      ENDIF
239
240      CALL iom_put( 'hflx_ice_cea', - fdtcn(:,:) )     
241      CALL iom_put( 'qns_io_cea', qns(:,:) - zqnsoce(:,:) * pfrld(:,:) )     
242      CALL iom_put( 'qsr_io_cea', fstric(:,:) * (1.e0 - pfrld(:,:)) )
243
244      IF( lk_diaar5 ) THEN       ! AR5 diagnostics
245         CALL iom_put( 'isnwmlt_cea'  ,                 rdm_snw(:,:) * r1_rdtice )
246         CALL iom_put( 'fsal_virt_cea',   soce_0(:,:) * rdm_ice(:,:) * r1_rdtice )
247         CALL iom_put( 'fsal_real_cea', - sice_0(:,:) * rdm_ice(:,:) * r1_rdtice )
248      ENDIF
249
250      !-----------------------------------------------!
251      !   Coupling variables                          !
252      !-----------------------------------------------!
253
254#if defined key_coupled
255      tn_ice(:,:,1) = sist(:,:)          ! sea-ice surface temperature       
256      ht_i(:,:,1) = hicif(:,:)
257      ht_s(:,:,1) = hsnif(:,:)
258      a_i(:,:,1) = fr_i(:,:)
259      !                                  ! Computation of snow/ice and ocean albedo
260      CALL albedo_ice( tn_ice, ht_i, ht_s, zalbp, zalb )
261      alb_ice(:,:,1) =  0.5 * ( zalbp(:,:,1) + zalb (:,:,1) )   ! Ice albedo (mean clear and overcast skys)
262      CALL iom_put( "icealb_cea", alb_ice(:,:,1) * fr_i(:,:) )  ! ice albedo
263#endif
264
265      IF(ln_ctl) THEN            ! control print
266         CALL prt_ctl(tab2d_1=qsr   , clinfo1=' lim_sbc: qsr    : ', tab2d_2=qns   , clinfo2=' qns     : ')
267         CALL prt_ctl(tab2d_1=emp   , clinfo1=' lim_sbc: emp    : ', tab2d_2=sfx   , clinfo2=' sfx     : ')
268         CALL prt_ctl(tab2d_1=utau  , clinfo1=' lim_sbc: utau   : ', mask1=umask,   &
269            &         tab2d_2=vtau  , clinfo2=' vtau    : '        , mask2=vmask )
270         CALL prt_ctl(tab2d_1=fr_i  , clinfo1=' lim_sbc: fr_i   : ', tab2d_2=tn_ice(:,:,1), clinfo2=' tn_ice  : ')
271      ENDIF 
272      !
273      CALL wrk_dealloc( jpi, jpj, zqnsoce )
274      CALL wrk_dealloc( jpi, jpj, 1, zalb, zalbp )
275      !
276   END SUBROUTINE lim_sbc_flx_2
277
278
279   SUBROUTINE lim_sbc_tau_2( kt , pu_oce, pv_oce )
280      !!-------------------------------------------------------------------
281      !!                ***  ROUTINE lim_sbc_tau_2 ***
282      !! 
283      !! ** Purpose : Update the ocean surface stresses due to the ice
284      !!         
285      !! ** Action  : * at each ice time step (every nn_fsbc time step):
286      !!                - compute the modulus of ice-ocean relative velocity
287      !!                  at T-point (C-grid) or I-point (B-grid)
288      !!                      tmod_io = rhoco * | U_ice-U_oce |
289      !!                - update the modulus of stress at ocean surface
290      !!                      taum = frld * taum + (1-frld) * tmod_io * | U_ice-U_oce |
291      !!              * at each ocean time step (each kt):
292      !!                  compute linearized ice-ocean stresses as
293      !!                      Utau = tmod_io * | U_ice - pU_oce |
294      !!                using instantaneous current ocean velocity (usually before)
295      !!
296      !!    NB: - the averaging operator used depends on the ice dynamics grid (cp_ice_msh='I' or 'C')
297      !!        - ice-ocean rotation angle only allowed in cp_ice_msh='I' case
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 approximation...
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) ::   zfrldu, zat_u, zu_i, zutau_ice, zu_t, zmodt   ! local scalar
310      REAL(wp) ::   zfrldv, zat_v, zv_i, zvtau_ice, zv_t, zmodi   !   -      -
311      REAL(wp) ::   zsang, zumt                                   !    -         -
312      REAL(wp), POINTER, DIMENSION(:,:) ::   ztio_u, ztio_v   ! ocean stress below sea-ice
313      !!---------------------------------------------------------------------
314      !
315      CALL wrk_alloc( jpi, jpj, ztio_u, ztio_v )
316      !
317      SELECT CASE( cp_ice_msh )     
318      !                             !-----------------------!
319      CASE( 'I' )                   !  B-grid ice dynamics  !   I-point (i.e. F-point with sea-ice indexation)
320         !                          !--=--------------------!
321         !
322         IF( MOD( kt-1, nn_fsbc ) == 0 ) THEN     !==  Ice time-step only  ==! (i.e. surface module time-step)
323!CDIR NOVERRCHK
324            DO jj = 1, jpj                               !* modulus of ice-ocean relative velocity at I-point
325!CDIR NOVERRCHK
326               DO ji = 1, jpi
327                  zu_i  = u_ice(ji,jj) - u_oce(ji,jj)                   ! ice-ocean relative velocity at I-point
328                  zv_i  = v_ice(ji,jj) - v_oce(ji,jj)
329                  tmod_io(ji,jj) = SQRT( zu_i * zu_i + zv_i * zv_i )    ! modulus of this velocity (at I-point)
330               END DO
331            END DO
332!CDIR NOVERRCHK
333            DO jj = 1, jpjm1                             !* update the modulus of stress at ocean surface (T-point)
334!CDIR NOVERRCHK
335               DO ji = 1, jpim1   ! NO vector opt.
336                  !                                               ! modulus of U_ice-U_oce at T-point
337                  zumt  = 0.25_wp * (  tmod_io(ji+1,jj) + tmod_io(ji  ,jj  )    &   
338                     &               + tmod_io(ji,jj+1) + tmod_io(ji+1,jj+1)  )
339                  !                                               ! update the modulus of stress at ocean surface
340                  taum(ji,jj) = frld(ji,jj) * taum(ji,jj) + ( 1._wp - frld(ji,jj) ) * rhoco * zumt * zumt
341               END DO
342            END DO
343            CALL lbc_lnk( taum, '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         !                                        !==  at each ocean time-step  ==!
351         !
352         !                                               !* ice/ocean stress WITH a ice-ocean rotation angle at I-point
353         DO jj = 2, jpj
354            zsang  = SIGN( 1._wp, gphif(1,jj) ) * sangvg          ! change the cosine angle sign in the SH
355            DO ji = 2, jpi    ! NO vect. opt. possible
356               ! ... ice-ocean relative velocity at I-point using instantaneous surface ocean current at u- & v-pts
357               zu_i = u_ice(ji,jj) - 0.5_wp * ( pu_oce(ji-1,jj  ) + pu_oce(ji-1,jj-1) ) * tmu(ji,jj)
358               zv_i = v_ice(ji,jj) - 0.5_wp * ( pv_oce(ji  ,jj-1) + pv_oce(ji-1,jj-1) ) * tmu(ji,jj)
359               ! ... components of stress with a ice-ocean rotation angle
360               zmodi = rhoco * tmod_io(ji,jj)                     
361               ztio_u(ji,jj) = zmodi * ( cangvg * zu_i - zsang * zv_i )
362               ztio_v(ji,jj) = zmodi * ( cangvg * zv_i + zsang * zu_i )
363            END DO
364         END DO
365         !                                               !* surface ocean stresses at u- and v-points
366         DO jj = 2, jpjm1
367            DO ji = 2, jpim1   ! NO vector opt.
368               !                                   ! ice-ocean stress at U and V-points  (from I-point values)
369               zutau_ice  = 0.5_wp * ( ztio_u(ji+1,jj) + ztio_u(ji+1,jj+1) )
370               zvtau_ice  = 0.5_wp * ( ztio_v(ji,jj+1) + ztio_v(ji+1,jj+1) )
371               !                                   ! open-ocean (lead) fraction at U- & V-points (from T-point values)
372               zfrldu = 0.5_wp * ( frld(ji,jj) + frld(ji+1,jj) )
373               zfrldv = 0.5_wp * ( frld(ji,jj) + frld(ji,jj+1) )
374               !                                   ! update the surface ocean stress (ice-cover wheighted)
375               utau(ji,jj) = zfrldu * utau_oce(ji,jj) + ( 1._wp - zfrldu ) * zutau_ice
376               vtau(ji,jj) = zfrldv * vtau_oce(ji,jj) + ( 1._wp - zfrldv ) * 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         !
382         !                          !-----------------------!
383      CASE( 'C' )                   !  C-grid ice dynamics  !   U & V-points (same as in the ocean)
384         !                          !--=--------------------!
385         !
386         IF( MOD( kt-1, nn_fsbc ) == 0 ) THEN     !==  Ice time-step only  ==! (i.e. surface module time-step)
387!CDIR NOVERRCHK
388            DO jj = 2, jpjm1                          !* modulus of the ice-ocean velocity at T-point
389!CDIR NOVERRCHK
390               DO ji = fs_2, fs_jpim1
391                  zu_t  = u_ice(ji,jj) + u_ice(ji-1,jj) - u_oce(ji,jj) - u_oce(ji-1,jj)   ! 2*(U_ice-U_oce) at T-point
392                  zv_t  = v_ice(ji,jj) + v_ice(ji,jj-1) - v_oce(ji,jj) - v_oce(ji,jj-1)     
393                  zmodt =  0.25_wp * (  zu_t * zu_t + zv_t * zv_t  )                      ! |U_ice-U_oce|^2
394                  !                                               ! update the modulus of stress at ocean surface
395                  taum   (ji,jj) = frld(ji,jj) * taum(ji,jj) + ( 1._wp - frld(ji,jj) ) * rhoco * zmodt
396                  tmod_io(ji,jj) = SQRT( zmodt ) * rhoco          ! rhoco*|Uice-Uoce|
397               END DO
398            END DO
399            CALL lbc_lnk( taum, 'T', 1. )   ;   CALL lbc_lnk( tmod_io, 'T', 1. )
400            !
401            utau_oce(:,:) = utau(:,:)                 !* save the air-ocean stresses at ice time-step
402            vtau_oce(:,:) = vtau(:,:)
403            !
404         ENDIF
405         !
406         !                                        !==  at each ocean time-step  ==!
407         !
408         DO jj = 2, jpjm1                             !* ice stress over ocean WITHOUT a ice-ocean rotation angle
409            DO ji = fs_2, fs_jpim1
410               !                                            ! ocean area at u- & v-points
411               zfrldu  = 0.5_wp * ( frld(ji,jj) + frld(ji+1,jj) )
412               zfrldv  = 0.5_wp * ( frld(ji,jj) + frld(ji,jj+1) )
413               !                                            ! quadratic drag formulation without rotation
414               !                                            ! using instantaneous surface ocean current
415               zutau_ice = 0.5 * ( tmod_io(ji,jj) + tmod_io(ji+1,jj) ) * ( u_ice(ji,jj) - pu_oce(ji,jj) )
416               zvtau_ice = 0.5 * ( tmod_io(ji,jj) + tmod_io(ji,jj+1) ) * ( v_ice(ji,jj) - pv_oce(ji,jj) )
417               !                                            ! update the surface ocean stress (ice-cover wheighted)
418               utau(ji,jj) = zfrldu * utau_oce(ji,jj) + ( 1._wp - zfrldu ) * zutau_ice
419               vtau(ji,jj) = zfrldv * vtau_oce(ji,jj) + ( 1._wp - zfrldv ) * zvtau_ice
420            END DO
421         END DO
422         CALL lbc_lnk( utau, 'U', -1. )   ;   CALL lbc_lnk( vtau, 'V', -1. )   ! lateral boundary condition
423         !
424      END SELECT
425
426      IF(ln_ctl)   CALL prt_ctl( tab2d_1=utau, clinfo1=' lim_sbc: utau   : ', mask1=umask,   &
427         &                       tab2d_2=vtau, clinfo2=' vtau    : '        , mask2=vmask )
428     
429      CALL wrk_dealloc( jpi, jpj, ztio_u, ztio_v )
430      !
431   END SUBROUTINE lim_sbc_tau_2
432
433
434   SUBROUTINE lim_sbc_init_2
435      !!-------------------------------------------------------------------
436      !!                  ***  ROUTINE lim_sbc_init  ***
437      !!             
438      !! ** Purpose : Preparation of the file ice_evolu for the output of
439      !!      the temporal evolution of key variables
440      !!
441      !! ** input   : Namelist namicedia
442      !!-------------------------------------------------------------------
443      !
444      IF(lwp) WRITE(numout,*)
445      IF(lwp) WRITE(numout,*) 'lim_sbc_init_2 : LIM-2 sea-ice - surface boundary condition'
446      IF(lwp) WRITE(numout,*) '~~~~~~~~~~~~~~~   '
447
448      !                                      ! allocate lim_sbc arrays
449      IF( lim_sbc_alloc_2() /= 0 )   CALL ctl_stop( 'STOP', 'lim_sbc_flx_2 : unable to allocate arrays' )
450      !
451      r1_rdtice = 1._wp / rdt_ice
452      !
453      soce_0(:,:) = soce                     ! constant SSS and ice salinity used in levitating sea-ice case
454      sice_0(:,:) = sice
455      !
456      IF( cp_cfg == "orca" ) THEN            ! decrease ocean & ice reference salinities in the Baltic sea
457         WHERE( 14._wp <= glamt(:,:) .AND. glamt(:,:) <= 32._wp .AND.   &
458            &   54._wp <= gphit(:,:) .AND. gphit(:,:) <= 66._wp         ) 
459            soce_0(:,:) = 4._wp
460            sice_0(:,:) = 2._wp
461         END WHERE
462      ENDIF
463      !                                      ! embedded sea ice
464      IF( nn_ice_embd /= 0 ) THEN            ! mass exchanges between ice and ocean (case 1 or 2) set the snow+ice mass
465         snwice_mass  (:,:) = tms(:,:) * ( rhosn * hsnif(:,:) + rhoic * hicif(:,:)  ) * ( 1.0 - frld(:,:) )
466         snwice_mass_b(:,:) = snwice_mass(:,:)
467      ELSE
468         snwice_mass  (:,:) = 0.e0           ! no mass exchanges
469         snwice_mass_b(:,:) = 0.e0           ! no mass exchanges
470      ENDIF
471      IF( nn_ice_embd == 2 .AND.          &  ! full embedment (case 2) & no restart :
472         &   .NOT.ln_rstart ) THEN           ! deplete the initial ssh belew sea-ice area
473         sshn(:,:) = sshn(:,:) - snwice_mass(:,:) * r1_rau0
474         sshb(:,:) = sshb(:,:) - snwice_mass(:,:) * r1_rau0
475      ENDIF
476      !
477   END SUBROUTINE lim_sbc_init_2
478
479#else
480   !!----------------------------------------------------------------------
481   !!   Default option         Empty module        NO LIM 2.0 sea-ice model
482   !!----------------------------------------------------------------------
483#endif 
484
485   !!======================================================================
486END MODULE limsbc_2
Note: See TracBrowser for help on using the repository browser.