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

source: trunk/NEMO/LIM_SRC_3/limsbc.F90 @ 1322

Last change on this file since 1322 was 1322, checked in by ctlod, 15 years ago

correction of the wind module computation + few bugs, see ticket: #346

  • Property svn:keywords set to Id
File size: 26.5 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   !!----------------------------------------------------------------------
10#if defined key_lim3
11   !!----------------------------------------------------------------------
12   !!   'key_lim3'                                    LIM 3.0 sea-ice model
13   !!----------------------------------------------------------------------
14   !!   lim_sbc  : flux at the ice / ocean interface
15   !!----------------------------------------------------------------------
16   USE oce
17   USE par_oce          ! ocean parameters
18   USE par_ice          ! ice parameters
19   USE dom_oce          ! ocean domain
20   USE sbc_ice          ! Surface boundary condition: sea-ice fields
21   USE sbc_oce          ! Surface boundary condition: ocean fields
22   USE phycst           ! physical constants
23   USE ice_oce          ! sea-ice variable
24   USE ice              ! LIM sea-ice variables
25   USE iceini           ! ???
26   USE dynspg_oce       ! choice of the surface pressure gradient scheme
27
28   USE lbclnk           ! ocean lateral boundary condition
29   USE in_out_manager   ! I/O manager
30   USE albedo           ! albedo parameters
31   USE prtctl           ! Print control
32
33   IMPLICIT NONE
34   PRIVATE
35
36   PUBLIC   lim_sbc_flx   ! called by sbc_ice_lim
37   PUBLIC   lim_sbc_tau   ! called by sbc_ice_lim
38
39   REAL(wp)  ::   epsi16 = 1.e-16  ! constant values
40   REAL(wp)  ::   rzero  = 0.e0   
41   REAL(wp)  ::   rone   = 1.e0
42
43   REAL(wp), DIMENSION(jpi,jpj) ::   utau_oce, vtau_oce   !: air-ocean surface i- & j-stress            [N/m2]
44   REAL(wp), DIMENSION(jpi,jpj) ::   tmod_io              !: modulus of the ice-ocean relative velocity   [m/s]
45   REAL(wp), DIMENSION(jpi,jpj) ::   ssu_mb  , ssv_mb     !: before mean ocean surface currents          [m/s]
46   !! * Substitutions
47#  include "vectopt_loop_substitute.h90"
48   !!----------------------------------------------------------------------
49   !! NEMO/LIM  3.0 ,  UCL-LOCEAN-IPSL (2008)
50   !! $Id$
51   !! Software governed by the CeCILL licence (modipsl/doc/NEMO_CeCILL.txt)
52   !!----------------------------------------------------------------------
53
54CONTAINS
55
56   SUBROUTINE lim_sbc_tau( kt, kcpl )
57      !!-------------------------------------------------------------------
58      !!                ***  ROUTINE lim_sbc_tau ***
59      !! 
60      !! ** Purpose : Update the ocean surface stresses due to the ice
61      !!         
62      !! ** Action  : - compute the ice-ocean stress depending on kcpl:
63      !!              fluxes at the ice-ocean interface.
64      !!     Case 0  :  old LIM-3 way, computed at ice time-step only
65      !!     Case 1  :  at each ocean time step the stresses are computed
66      !!                using the current ocean velocity (now)
67      !!     Case 2  :  combination of half case 0 + half case 1
68      !!     
69      !! ** Outputs : - utau   : sea surface i-stress (ocean referential)
70      !!              - vtau   : sea surface j-stress (ocean referential)
71      !!
72      !! References : Goosse, H. et al. 1996, Bul. Soc. Roy. Sc. Liege, 65, 87-90.
73      !!              Tartinville et al. 2001 Ocean Modelling, 3, 95-108.
74      !!---------------------------------------------------------------------
75      INTEGER ::   kt     ! number of ocean iteration
76      INTEGER ::   kcpl   ! ice-ocean coupling indicator: =0  LIM-3 old case
77      !                   !                               =1  stresses computed using now ocean velocity
78      !                   !                               =2  combination of 0 and 1 cases
79      !!
80      INTEGER  ::   ji, jj           ! dummy loop indices
81      REAL(wp) ::   zfrldu, zfrldv   ! lead fraction at U- & V-points
82      REAL(wp) ::   zat_u, zu_ico, zutaui, zu_u
83      REAL(wp) ::   zat_v, zv_ico, zvtaui, zv_v, zsang
84      REAL(wp) ::   zu_ij, zu_im1j, zv_ij, zv_ijm1
85
86#if defined key_coupled   
87      REAL(wp), DIMENSION(jpi,jpj,jpl) ::   zalb     ! albedo of ice under overcast sky
88      REAL(wp), DIMENSION(jpi,jpj,jpl) ::   zalbp    ! albedo of ice under clear sky
89#endif
90      REAL(wp), DIMENSION(jpi,jpj) ::   ztio_u, ztio_v   ! ocean stress below sea-ice
91      !!---------------------------------------------------------------------
92
93      IF( kt == nit000 ) THEN
94         IF(lwp) WRITE(numout,*)
95         IF(lwp) WRITE(numout,*) 'lim_sbc_tau : LIM 3.0 sea-ice - surface ocean momentum fluxes'
96         IF(lwp) WRITE(numout,*) '~~~~~~~~~~~ '
97      ENDIF
98
99      SELECT CASE( kcpl )
100         !                                        !--------------------------------!
101      CASE( 0 )                                   !  LIM 3 old stress computation  !  (at ice timestep only)
102         !                                        !--------------------------------!
103         DO jj = 2, jpjm1                      ! ... modulus of the ice-ocean velocity
104            DO ji = fs_2, fs_jpim1
105               zu_ij   = u_ice(ji  ,jj) - ssu_m(ji  ,jj)               ! (i  ,j)
106               zu_im1j = u_ice(ji-1,jj) - ssu_m(ji-1,jj)               ! (i-1,j)
107               zv_ij   = v_ice(ji,jj  ) - ssv_m(ji,jj  )               ! (i,j  )
108               zv_ijm1 = v_ice(ji,jj-1) - ssv_m(ji,jj-1)               ! (i,j-1)
109               tmod_io(ji,jj) = SQRT(  0.5 * ( zu_ij * zu_ij + zu_im1j * zu_im1j   &
110                  &                          + zv_ij * zv_ij + zv_ijm1 * zv_ijm1  ) )
111            END DO
112         END DO
113         CALL lbc_lnk( tmod_io, 'T', 1. )
114         ! ... ice stress over ocean with a ice-ocean rotation angle
115         DO jj = 1, jpj
116            ! ... change the sinus angle sign in the south hemisphere
117            zsang  = SIGN(1.e0, gphif(1,jj) ) * sangvg
118            DO ji = 1, jpi
119               ! ... ice velocity relative to the ocean
120               zu_u = u_ice(ji,jj) - u_oce(ji,jj)
121               zv_v = v_ice(ji,jj) - v_oce(ji,jj)
122               ! quadratic drag formulation
123!!gm still an error in the rotation, but usually the angle is zero (zsang=0, cangvg=1)
124               zutaui   = 0.5 * ( tmod_io(ji,jj) + tmod_io(ji+1,jj) ) * rhoco * ( cangvg * zu_u - zsang * zv_v ) 
125               zvtaui   = 0.5 * ( tmod_io(ji,jj) + tmod_io(ji,jj+1) ) * rhoco * ( cangvg * zv_v + zsang * zu_u ) 
126               ! IMPORTANT
127               ! these lines are bound to prevent numerical oscillations
128               ! in the ice-ocean stress
129               ! They are physically ill-based. There is a cleaner solution
130               ! to try (remember discussion in Paris Gurvan)
131               ztio_u(ji,jj) = zutaui * exp( - ( tmod_io(ji,jj) + tmod_io(ji+1,jj) )  )
132               ztio_v(ji,jj) = zvtaui * exp( - ( tmod_io(ji,jj) + tmod_io(ji,jj+1) )  ) 
133               !
134            END DO
135         END DO
136
137         DO jj = 2, jpjm1
138            DO ji = fs_2, fs_jpim1   ! vertor opt.
139               ! ... open-ocean (lead) fraction at U- & V-points (from T-point values)
140               zfrldu = 0.5 * ( ato_i(ji,jj) + ato_i(ji+1,jj  ) )
141               zfrldv = 0.5 * ( ato_i(ji,jj) + ato_i(ji  ,jj+1) )
142               ! update surface ocean stress
143               utau(ji,jj) = zfrldu * utau(ji,jj) + ( 1. - zfrldu ) * ztio_u(ji,jj)
144               vtau(ji,jj) = zfrldv * vtau(ji,jj) + ( 1. - zfrldv ) * ztio_v(ji,jj)
145               !
146            END DO
147         END DO
148
149         ! boundary condition on the stress (utau,vtau)
150         CALL lbc_lnk( utau, 'U', -1. )   ;   CALL lbc_lnk( vtau, 'V', -1. )
151         !
152         !                                        !--------------------------------!
153      CASE( 1 )                                   !  Use the now velocity          !  (at each ocean timestep)
154         !                                        !--------------------------------!
155         IF( MOD( kt-1, nn_fsbc ) == 0 ) THEN
156            utau_oce(:,:) = utau(:,:)             ! ... save the air-ocean stresses at ice time-step
157            vtau_oce(:,:) = vtau(:,:)
158            DO jj = 2, jpjm1                      ! ... modulus of the ice-ocean velocity
159               DO ji = fs_2, fs_jpim1
160                  zu_ij   = u_ice(ji  ,jj) - ssu_m(ji  ,jj)               ! (i  ,j)
161                  zu_im1j = u_ice(ji-1,jj) - ssu_m(ji-1,jj)               ! (i-1,j)
162                  zv_ij   = v_ice(ji,jj  ) - ssv_m(ji,jj  )               ! (i,j  )
163                  zv_ijm1 = v_ice(ji,jj-1) - ssv_m(ji,jj-1)               ! (i,j-1)
164                  tmod_io(ji,jj) = SQRT( 0.5 * (  zu_ij * zu_ij + zu_im1j * zu_im1j   &
165                     &                          + zv_ij * zv_ij + zv_ijm1 * zv_ijm1 ) )
166               END DO
167            END DO
168         CALL lbc_lnk( tmod_io, 'T', 1. )
169         ENDIF
170         ! ... ice stress over ocean with a ice-ocean rotation angle
171         DO jj = 2, jpjm1
172            zsang  = SIGN(1.e0, gphif(1,jj-1) ) * sangvg
173            DO ji = fs_2, fs_jpim1
174               ! computation of wind stress over ocean in X and Y direction
175               zat_u  = ( at_i(ji,jj) + at_i(ji+1,jj) ) * 0.5      ! ice area at u and V-points
176               zat_v  = ( at_i(ji,jj) + at_i(ji,jj+1) ) * 0.5
177
178               zu_u   = u_ice(ji,jj) - ub(ji,jj,1)                  ! u ice-ocean velocity at U-point
179               zv_v   = v_ice(ji,jj) - vb(ji,jj,1)                  ! v ice-ocean velocity at V-point
180               !
181!!gm still an error in the rotation, but usually the angle is zero (zsang=0, cangvg=1)
182               zutaui   = 0.5 * ( tmod_io(ji,jj) + tmod_io(ji+1,jj) ) * rhoco * ( cangvg * zu_u - zsang * zv_v ) 
183               zvtaui   = 0.5 * ( tmod_io(ji,jj) + tmod_io(ji,jj+1) ) * rhoco * ( cangvg * zv_v + zsang * zu_u ) 
184
185               utau(ji,jj) = ( 1.- zat_u ) * utau_oce(ji,jj) + zat_u * zutaui    ! stress at the ocean surface
186               vtau(ji,jj) = ( 1.- zat_v ) * vtau_oce(ji,jj) + zat_v * zvtaui
187               !                                                    ! u ice-ocean velocity at V-point
188            END DO
189         END DO
190         ! boundary condition on the stress (utau,vtau)
191         CALL lbc_lnk( utau, 'U', -1. )   ;   CALL lbc_lnk( vtau, 'V', -1. )
192         !
193         !                                        !--------------------------------!
194      CASE( 2 )                                   !  mixed 0 and 2 cases           !  (at each ocean timestep)
195         !                                        !--------------------------------!
196         IF( MOD( kt-1, nn_fsbc ) == 0 ) THEN
197            utau_oce(:,:) = utau (:,:)            ! ... save the air-ocean stresses at ice time-step
198            vtau_oce(:,:) = vtau (:,:)
199            ssu_mb  (:,:) = ssu_m(:,:)            ! ... save the ice-ocean velocity at ice time-step
200            ssv_mb  (:,:) = ssv_m(:,:)
201            DO jj = 2, jpjm1                      ! ... modulus of the ice-ocean velocity
202               DO ji = fs_2, fs_jpim1
203                  zu_ij   = u_ice(ji  ,jj) - ssu_m(ji  ,jj)               ! (i  ,j)
204                  zu_im1j = u_ice(ji-1,jj) - ssu_m(ji-1,jj)               ! (i-1,j)
205                  zv_ij   = v_ice(ji,jj  ) - ssv_m(ji,jj  )               ! (i,j  )
206                  zv_ijm1 = v_ice(ji,jj-1) - ssv_m(ji,jj-1)               ! (i,j-1)
207                  tmod_io(ji,jj) = SQRT( 0.5 * ( zu_ij * zu_ij + zu_im1j * zu_im1j   &
208                     &                         + zv_ij * zv_ij + zv_ijm1 * zv_ijm1 ) )
209               END DO
210            END DO
211         CALL lbc_lnk( tmod_io, 'T', 1. )
212         ENDIF
213         ! ... ice stress over ocean with a ice-ocean rotation angle
214         DO jj = 2, jpjm1
215            zsang  = SIGN(1.e0, gphif(1,jj-1) ) * sangvg
216            DO ji = fs_2, fs_jpim1
217               ! computation of wind stress over ocean in X and Y direction
218               zat_u = ( at_i(ji,jj) + at_i(ji+1,jj) ) * 0.5     ! ice area at u and V-points
219               zat_v = ( at_i(ji,jj) + at_i(ji,jj+1) ) * 0.5 
220
221               !!gm bug mixing U and V points value below     ====>>> to be corrected
222               zu_ico = u_ice(ji,jj) - 0.5 * ( ub(ji,jj,1) - ssu_mb(ji,jj) )   ! ice-oce velocity using un and ssu_mb
223               zv_ico = v_ice(ji,jj) - 0.5 * ( vb(ji,jj,1) - ssv_mb(ji,jj) )
224               !                                        ! quadratic drag formulation with rotation
225!!gm still an error in the rotation, but usually the angle is zero (zsang=0, cangvg=1)
226               zutaui = 0.5 * ( tmod_io(ji,jj) + tmod_io(ji+1,jj) ) * rhoco * ( cangvg * zu_ico - zsang * zv_ico )
227               zvtaui = 0.5 * ( tmod_io(ji,jj) + tmod_io(ji,jj+1) ) * rhoco * ( cangvg * zv_ico + zsang * zu_ico )
228               !
229               utau(ji,jj) = ( 1.-zat_u ) * utau_oce(ji,jj) + zat_u * zutaui    ! stress at the ocean surface
230               vtau(ji,jj) = ( 1.-zat_v ) * vtau_oce(ji,jj) + zat_v * zvtaui
231            END DO
232         END DO
233         ! boundary condition on the stress (utau,vtau)
234         CALL lbc_lnk( utau, 'U', -1. )   ;   CALL lbc_lnk( vtau, 'V', -1. )
235         !
236      END SELECT
237      IF(ln_ctl)   CALL prt_ctl( tab2d_1=utau, clinfo1=' lim_sbc: utau   : ', mask1=umask,   &
238         &                       tab2d_2=vtau, clinfo2=' vtau    : '        , mask2=vmask )
239     
240   END SUBROUTINE lim_sbc_tau
241
242
243   SUBROUTINE lim_sbc_flx( kt )
244      !!-------------------------------------------------------------------
245      !!                ***  ROUTINE lim_sbc_flx ***
246      !! 
247      !! ** Purpose :   Update the surface ocean boundary condition for heat
248      !!              salt and mass over areas where sea-ice is non-zero
249      !!         
250      !! ** Action  : - computes the heat and freshwater/salt fluxes
251      !!              at the ice-ocean interface.
252      !!              - Update the ocean sbc
253      !!     
254      !! ** Outputs : - qsr     : sea heat flux:     solar
255      !!              - qns     : sea heat flux: non solar
256      !!              - emp     : freshwater budget: volume flux
257      !!              - emps    : freshwater budget: concentration/dillution
258      !!              - fr_i    : ice fraction
259      !!              - tn_ice  : sea-ice surface temperature
260      !!              - alb_ice : sea-ice alberdo (lk_cpl=T)
261      !!
262      !! References : Goosse, H. et al. 1996, Bul. Soc. Roy. Sc. Liege, 65, 87-90.
263      !!              Tartinville et al. 2001 Ocean Modelling, 3, 95-108.
264      !!---------------------------------------------------------------------
265      INTEGER ::   kt    ! number of iteration
266      !!
267      INTEGER  ::   ji, jj           ! dummy loop indices
268      INTEGER  ::   ifvt, i1mfr, idfr               ! some switches
269      INTEGER  ::   iflt, ial, iadv, ifral, ifrdv
270      REAL(wp) ::   zinda            ! switch for testing the values of ice concentration
271      REAL(wp) ::   zfons            ! salt exchanges at the ice/ocean interface
272      REAL(wp) ::   zpme             ! freshwater exchanges at the ice/ocean interface
273      REAL(wp), DIMENSION(jpi,jpj) ::   zfcm1 , zfcm2    ! solar/non solar heat fluxes
274#if defined key_coupled   
275      REAL(wp), DIMENSION(jpi,jpj,jpl) ::   zalb     ! albedo of ice under overcast sky
276      REAL(wp), DIMENSION(jpi,jpj,jpl) ::   zalbp    ! albedo of ice under clear sky
277#endif
278      !!---------------------------------------------------------------------
279
280      IF( kt == nit000 ) THEN
281         IF(lwp) WRITE(numout,*)
282         IF(lwp) WRITE(numout,*) 'lim_sbc_flx : LIM 3.0 sea-ice - heat salt and mass ocean surface fluxes'
283         IF(lwp) WRITE(numout,*) '~~~~~~~~~~~ '
284      ENDIF
285
286      !------------------------------------------!
287      !      heat flux at the ocean surface      !
288      !------------------------------------------!
289      ! pfrld is the lead fraction at the previous time step (actually between TRP and THD)
290      ! changed to old_frld and old ht_i
291
292      DO jj = 1, jpj
293         DO ji = 1, jpi
294            zinda   = 1.0 - MAX( rzero , SIGN( rone , - ( 1.0 - pfrld(ji,jj) ) ) )
295            ifvt    = zinda  *  MAX( rzero , SIGN( rone, -phicif  (ji,jj) ) )  !subscripts are bad here
296            i1mfr   = 1.0 - MAX( rzero , SIGN( rone ,  - ( at_i(ji,jj)       ) ) )
297            idfr    = 1.0 - MAX( rzero , SIGN( rone , ( 1.0 - at_i(ji,jj) ) - pfrld(ji,jj) ) )
298            iflt    = zinda  * (1 - i1mfr) * (1 - ifvt )
299            ial     = ifvt   * i1mfr + ( 1 - ifvt ) * idfr
300            iadv    = ( 1  - i1mfr ) * zinda
301            ifral   = ( 1  - i1mfr * ( 1 - ial ) )   
302            ifrdv   = ( 1  - ifral * ( 1 - ial ) ) * iadv 
303
304            ! switch --- 1.0 ---------------- 0.0 --------------------
305            ! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
306            ! zinda   | if pfrld = 1       | if pfrld < 1            |
307            !  -> ifvt| if pfrld old_ht_i
308            ! i1mfr   | if frld = 1        | if frld  < 1            |
309            ! idfr    | if frld <= pfrld    | if frld > pfrld        |
310            ! iflt    |
311            ! ial     |
312            ! iadv    |
313            ! ifral
314            ! ifrdv
315
316            !   computation the solar flux at ocean surface
317            zfcm1(ji,jj)   = pfrld(ji,jj) * qsr(ji,jj)  + ( 1. - pfrld(ji,jj) ) * fstric(ji,jj)
318            ! fstric     Solar flux transmitted trough the ice
319            ! qsr        Net short wave heat flux on free ocean
320            ! new line
321            fscmbq(ji,jj) = ( 1.0 - pfrld(ji,jj) ) * fstric(ji,jj)
322
323            !  computation the non solar heat flux at ocean surface
324            zfcm2(ji,jj) = - zfcm1(ji,jj)                  &
325               &           + iflt    * ( fscmbq(ji,jj) )   & ! total abl -> fscmbq is given to the ocean
326               ! fscmbq and ffltbif are obsolete
327               !              &           + iflt * ffltbif(ji,jj) !!! only if one category is used
328               &           + ifral   * ( ial * qcmif(ji,jj) + (1 - ial) * qldif(ji,jj) ) / rdt_ice   &
329               &           + ifrdv   * ( qfvbq(ji,jj) + qdtcn(ji,jj) ) / rdt_ice                     &
330               &           + fhmec(ji,jj)     & ! new contribution due to snow melt in ridging!!
331               &           + fheat_rpo(ji,jj) & ! contribution from ridge formation
332               &           + fheat_res(ji,jj)
333            ! fscmbq  Part of the solar radiation transmitted through the ice and going to the ocean
334            !         computed in limthd_zdf.F90
335            ! ffltbif Total heat content of the ice (brine pockets+ice) / delta_t
336            ! qcmif   Energy needed to bring the ocean surface layer until its freezing (ok)
337            ! qldif   heat balance of the lead (or of the open ocean)
338            ! qfvbq   i think this is wrong!
339            ! ---> Array used to store energy in case of total lateral ablation
340            ! qfvbq latent heat uptake/release after accretion/ablation
341            ! qdtcn Energy from the turbulent oceanic heat flux heat flux coming in the lead
342
343            IF ( num_sal .EQ. 2 ) zfcm2(ji,jj) = zfcm2(ji,jj) + &
344               fhbri(ji,jj) ! new contribution due to brine drainage
345
346            ! bottom radiative component is sent to the computation of the
347            ! oceanic heat flux
348            fsbbq(ji,jj) = ( 1.0 - ( ifvt + iflt ) ) * fscmbq(ji,jj)     
349
350            ! used to compute the oceanic heat flux at the next time step
351            qsr(ji,jj) = zfcm1(ji,jj)                                       ! solar heat flux
352            qns(ji,jj) = zfcm2(ji,jj) - fdtcn(ji,jj)                        ! non solar heat flux
353            !                           ! fdtcn : turbulent oceanic heat flux
354
355            !!gm   this IF prevents the vertorisation of the whole loop
356            IF ( ( ji .EQ. jiindx ) .AND. ( jj .EQ. jjindx) ) THEN
357               WRITE(numout,*) ' lim_sbc : heat fluxes '
358               WRITE(numout,*) ' qsr       : ', qsr(jiindx,jjindx)
359               WRITE(numout,*) ' zfcm1     : ', zfcm1(jiindx,jjindx)
360               WRITE(numout,*) ' pfrld     : ', pfrld(jiindx,jjindx)
361               WRITE(numout,*) ' fstric    : ', fstric (jiindx,jjindx)
362               WRITE(numout,*)
363               WRITE(numout,*) ' qns       : ', qns(jiindx,jjindx)
364               WRITE(numout,*) ' zfcm2     : ', zfcm2(jiindx,jjindx)
365               WRITE(numout,*) ' zfcm1     : ', zfcm1(jiindx,jjindx)
366               WRITE(numout,*) ' ifral     : ', ifral
367               WRITE(numout,*) ' ial       : ', ial 
368               WRITE(numout,*) ' qcmif     : ', qcmif(jiindx,jjindx)
369               WRITE(numout,*) ' qldif     : ', qldif(jiindx,jjindx)
370               WRITE(numout,*) ' qcmif / dt: ', qcmif(jiindx,jjindx) / rdt_ice
371               WRITE(numout,*) ' qldif / dt: ', qldif(jiindx,jjindx) / rdt_ice
372               WRITE(numout,*) ' ifrdv     : ', ifrdv
373               WRITE(numout,*) ' qfvbq     : ', qfvbq(jiindx,jjindx)
374               WRITE(numout,*) ' qdtcn     : ', qdtcn(jiindx,jjindx)
375               WRITE(numout,*) ' qfvbq / dt: ', qfvbq(jiindx,jjindx) / rdt_ice
376               WRITE(numout,*) ' qdtcn / dt: ', qdtcn(jiindx,jjindx) / rdt_ice
377               WRITE(numout,*) ' '
378               WRITE(numout,*) ' fdtcn     : ', fdtcn(jiindx,jjindx)
379               WRITE(numout,*) ' fhmec     : ', fhmec(jiindx,jjindx)
380               WRITE(numout,*) ' fheat_rpo : ', fheat_rpo(jiindx,jjindx)
381               WRITE(numout,*) ' fhbri     : ', fhbri(jiindx,jjindx)
382               WRITE(numout,*) ' fheat_res : ', fheat_res(jiindx,jjindx)
383            ENDIF
384            !!gm   end
385         END DO
386      END DO
387
388      !------------------------------------------!
389      !      mass flux at the ocean surface      !
390      !------------------------------------------!
391
392      !!gm   optimisation: this loop have to be merged with the previous one
393      DO jj = 1, jpj
394         DO ji = 1, jpi
395            !  case of realistic freshwater flux (Tartinville et al., 2001) (presently ACTIVATED)
396            !  -------------------------------------------------------------------------------------
397            !  The idea of this approach is that the system that we consider is the ICE-OCEAN system
398            !  Thus  FW  flux  =  External ( E-P+snow melt)
399            !       Salt flux  =  Exchanges in the ice-ocean system then converted into FW
400            !                     Associated to Ice formation AND Ice melting
401            !                     Even if i see Ice melting as a FW and SALT flux
402            !       
403
404            !  computing freshwater exchanges at the ice/ocean interface
405            zpme = - emp(ji,jj)     * ( 1.0 - at_i(ji,jj) )  &   !  evaporation over oceanic fraction
406               &   + tprecip(ji,jj) *         at_i(ji,jj)    &   !  total precipitation
407               ! old fashioned way               
408               !              &   - sprecip(ji,jj) * ( 1. - pfrld(ji,jj) )  &   !  remov. snow precip over ice
409               &   - sprecip(ji,jj) * ( 1. - (pfrld(ji,jj)**betas) )  &   !  remov. snow precip over ice
410               &   - rdmsnif(ji,jj) / rdt_ice                &   !  freshwaterflux due to snow melting
411               ! new contribution from snow falling when ridging
412               &   + fmmec(ji,jj)
413
414            !  computing salt exchanges at the ice/ocean interface
415            !  sice should be the same as computed with the ice model
416            zfons =  ( soce - sice ) * ( rdmicif(ji,jj) / rdt_ice ) 
417            ! SOCE
418            zfons =  ( sss_m(ji,jj) - sice ) * ( rdmicif(ji,jj) / rdt_ice ) 
419
420            !CT useless            !  salt flux for constant salinity
421            !CT useless            fsalt(ji,jj)      =  zfons / ( sss_m(ji,jj) + epsi16 ) + fsalt_res(ji,jj)
422            !  salt flux for variable salinity
423            zinda             = 1.0 - MAX( rzero , SIGN( rone , - ( 1.0 - pfrld(ji,jj) ) ) )
424            !  correcting brine and salt fluxes
425            fsbri(ji,jj)      =  zinda*fsbri(ji,jj)
426            !  converting the salt fluxes from ice to a freshwater flux from ocean
427            fsalt_res(ji,jj)  =  fsalt_res(ji,jj) / ( sss_m(ji,jj) + epsi16 )
428            fseqv(ji,jj)      =  fseqv(ji,jj)     / ( sss_m(ji,jj) + epsi16 )
429            fsbri(ji,jj)      =  fsbri(ji,jj)     / ( sss_m(ji,jj) + epsi16 )
430            fsalt_rpo(ji,jj)  =  fsalt_rpo(ji,jj) / ( sss_m(ji,jj) + epsi16 )
431
432            !  freshwater mass exchange (positive to the ice, negative for the ocean ?)
433            !  actually it's a salt flux (so it's minus freshwater flux)
434            !  if sea ice grows, zfons is positive, fsalt also
435            !  POSITIVE SALT FLUX FROM THE ICE TO THE OCEAN
436            !  POSITIVE FRESHWATER FLUX FROM THE OCEAN TO THE ICE [kg.m-2.s-1]
437
438            emp(ji,jj) = - zpme 
439         END DO
440      END DO
441
442      IF( num_sal == 2 ) THEN      ! variable ice salinity: brine drainage included in the salt flux
443         emps(:,:) = fsbri(:,:) + fseqv(:,:) + fsalt_res(:,:) + fsalt_rpo(:,:) + emp(:,:)
444      ELSE                         ! constant ice salinity:
445         emps(:,:) =              fseqv(:,:) + fsalt_res(:,:) + fsalt_rpo(:,:) + emp(:,:)
446      ENDIF
447
448      IF( lk_dynspg_rl )    emp (:,:) = emps(:,:)      ! rigid-lid formulation : emp = emps
449
450      !-----------------------------------------------!
451      !   Storing the transmitted variables           !
452      !-----------------------------------------------!
453
454      fr_i  (:,:)   = at_i(:,:)             ! Sea-ice fraction           
455      tn_ice(:,:,:) = t_su(:,:,:)           ! Ice surface temperature                     
456
457#if defined key_coupled           
458      !------------------------------------------------!
459      !    Computation of snow/ice and ocean albedo    !
460      !------------------------------------------------!
461      zalb  (:,:,:) = 0.e0
462      zalbp (:,:,:) = 0.e0
463
464      CALL albedo_ice( t_su, ht_i, ht_s, zalbp, zalb )
465
466      alb_ice(:,:,:) =  0.5 * zalbp(:,:,:) + 0.5 * zalb (:,:,:)   ! Ice albedo (mean clear and overcast skys)
467#endif
468
469      IF(ln_ctl) THEN
470         CALL prt_ctl( tab2d_1=qsr   , clinfo1=' lim_sbc: qsr    : ', tab2d_2=qns , clinfo2=' qns     : ' )
471         CALL prt_ctl( tab2d_1=emp   , clinfo1=' lim_sbc: emp    : ', tab2d_2=emps, clinfo2=' emps    : ' )
472         CALL prt_ctl( tab2d_1=fr_i  , clinfo1=' lim_sbc: fr_i   : ' )
473         CALL prt_ctl( tab3d_1=tn_ice, clinfo1=' lim_sbc: tn_ice : ', kdim=jpl )
474      ENDIF
475      !
476   END SUBROUTINE lim_sbc_flx
477
478
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.