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

source: branches/2013/dev_MERGE_2013/NEMOGCM/NEMO/LIM_SRC_3/limsbc.F90 @ 4302

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