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/2015/dev_r5204_CNRS_PISCES_dcy/NEMOGCM/NEMO/LIM_SRC_3 – NEMO

source: branches/2015/dev_r5204_CNRS_PISCES_dcy/NEMOGCM/NEMO/LIM_SRC_3/limsbc.F90 @ 5222

Last change on this file since 5222 was 5222, checked in by cetlod, 9 years ago

dev_r5204_CNRS_PISCES_dcy: some improvments

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