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/DEV_r1837_mass_heat_salt_fluxes/NEMO/LIM_SRC_2 – NEMO

source: branches/DEV_r1837_mass_heat_salt_fluxes/NEMO/LIM_SRC_2/limsbc_2.F90 @ 1855

Last change on this file since 1855 was 1855, checked in by gm, 14 years ago

ticket:#665 style change only, with the suppression of thd_ice_2 (merged in ice_2)

  • Property svn:keywords set to Id
File size: 16.1 KB
Line 
1MODULE limsbc_2
2   !!======================================================================
3   !!                       ***  MODULE limsbc_2   ***
4   !!   LIM 2 ice model :   heat, salt, mass and momentum fluxes at the sea ice/ocean interface
5   !!======================================================================
6   !! History :  LIM  ! 2000-01 (H. Goosse) Original code
7   !!            2.0  ! 2002-07 (C. Ethe, G. Madec) re-writing F90
8   !!             -   ! 2006-07 (G. Madec) surface module
9   !!----------------------------------------------------------------------
10#if defined key_lim2
11   !!----------------------------------------------------------------------
12   !!   'key_lim2'                                    LIM 2.0 sea-ice model
13   !!----------------------------------------------------------------------
14   !!   lim_sbc_2  : flux at the ice / ocean interface
15   !!----------------------------------------------------------------------
16   USE par_oce          ! ocean parameters
17   USE dom_oce          ! ocean domain
18   USE sbc_ice          ! surface boundary condition
19   USE sbc_oce          ! surface boundary condition
20   USE phycst           ! physical constants
21   USE ice_2            ! LIM 2 sea-ice variables
22
23   USE lbclnk           ! ocean lateral boundary condition
24   USE in_out_manager   ! I/O manager
25   USE diaar5, ONLY :   lk_diaar5
26   USE iom              !
27   USE albedo           ! albedo parameters
28   USE prtctl           ! Print control
29   USE cpl_oasis3, ONLY : lk_cpl
30
31   IMPLICIT NONE
32   PRIVATE
33
34   PUBLIC   lim_sbc_2   ! called by sbc_ice_lim_2
35
36   REAL(wp)  ::   epsi16 = 1.e-16  ! constant values
37   REAL(wp)  ::   rzero  = 0.e0   
38   REAL(wp)  ::   rone   = 1.e0
39   REAL(wp), DIMENSION(jpi,jpj)  ::   soce_r
40   REAL(wp), DIMENSION(jpi,jpj)  ::   sice_r
41
42   !! * Substitutions
43#  include "vectopt_loop_substitute.h90"
44   !!----------------------------------------------------------------------
45   !! NEMO/LIM 3.3,  UCL-LOCEAN-IPSL (2010)
46   !! $Id$
47   !! Software governed by the CeCILL licence (modipsl/doc/NEMO_CeCILL.txt)
48   !!----------------------------------------------------------------------
49
50CONTAINS
51
52   SUBROUTINE lim_sbc_2( kt )
53      !!-------------------------------------------------------------------
54      !!                ***  ROUTINE lim_sbc_2 ***
55      !! 
56      !! ** Purpose : Update surface ocean boundary condition over areas
57      !!      that are at least partially covered by sea-ice
58      !!         
59      !! ** Action  : - comput. of the momentum, heat and freshwater/salt
60      !!      fluxes at the ice-ocean interface.
61      !!              - Update
62      !!     
63      !! ** Outputs : - qsr     : sea heat flux:     solar
64      !!              - qns     : sea heat flux: non solar
65      !!              - emp     : freshwater budget: volume flux
66      !!              - emps    : freshwater budget: concentration/dillution
67      !!              - utau    : sea surface i-stress (ocean referential)
68      !!              - vtau    : sea surface j-stress (ocean referential)
69      !!              - fr_i    : ice fraction
70      !!              - tn_ice  : sea-ice surface temperature
71      !!              - alb_ice : sea-ice alberdo (lk_cpl=T)
72      !!
73      !! References : Goosse, H. et al. 1996, Bul. Soc. Roy. Sc. Liege, 65, 87-90.
74      !!              Tartinville et al. 2001 Ocean Modelling, 3, 95-108.
75      !!---------------------------------------------------------------------
76      INTEGER ::   kt    ! number of iteration
77      !!
78      INTEGER  ::   ji, jj           ! dummy loop indices
79      INTEGER  ::   ifvt, i1mfr, idfr               ! some switches
80      INTEGER  ::   iflt, ial, iadv, ifral, ifrdv
81      INTEGER  ::   ii0, ii1, ij0, ij1  ! temporary integers
82      REAL(wp) ::   zrdtir           ! 1. / rdt_ice
83      REAL(wp) ::   zqsr  , zqns     ! solar & non solar heat flux
84      REAL(wp) ::   zinda            ! switch for testing the values of ice concentration
85      REAL(wp) ::   zfons            ! salt exchanges at the ice/ocean interface
86      REAL(wp) ::   zemp             ! freshwater exchanges at the ice/ocean interface
87      REAL(wp) ::   zfrldu, zfrldv   ! lead fraction at U- & V-points
88      REAL(wp) ::   zutau , zvtau    ! lead fraction at U- & V-points
89      REAL(wp) ::   zu_io , zv_io    ! 2 components of the ice-ocean velocity
90! interface 2D --> 3D
91      REAL(wp), DIMENSION(jpi,jpj,1) ::   zalb     ! albedo of ice under overcast sky
92      REAL(wp), DIMENSION(jpi,jpj,1) ::   zalbp    ! albedo of ice under clear sky
93      REAL(wp) ::   zsang, zmod, zztmp, zfm
94      REAL(wp), DIMENSION(jpi,jpj) ::   ztio_u, ztio_v   ! component of ocean stress below sea-ice at I-point
95      REAL(wp), DIMENSION(jpi,jpj) ::   ztiomi           ! module    of ocean stress below sea-ice at I-point
96      REAL(wp), DIMENSION(jpi,jpj) ::   zqnsoce          ! save qns before its modification by ice model
97
98      !!---------------------------------------------------------------------
99     
100      zrdtir = 1. / rdt_ice
101     
102      IF( kt == nit000 ) THEN
103         IF(lwp) WRITE(numout,*)
104         IF(lwp) WRITE(numout,*) 'lim_sbc_2 : LIM 2.0 sea-ice - surface boundary condition'
105         IF(lwp) WRITE(numout,*) '~~~~~~~~~   '
106
107         soce_r(:,:) = soce
108         sice_r(:,:) = sice
109         !
110         IF( cp_cfg == "orca"  .AND. jp_cfg == 2 ) THEN             !  ORCA_R2 configuration
111            ii0 = 145   ;   ii1 = 180        ! Baltic Sea
112            ij0 = 113   ;   ij1 = 130   ;   soce_r(mi0(ii0):mi1(ii1) , mj0(ij0):mj1(ij1) ) = 4.e0
113                                            sice_r(mi0(ii0):mi1(ii1) , mj0(ij0):mj1(ij1) ) = 2.e0
114         ENDIF
115         !
116      ENDIF
117
118      !------------------------------------------!
119      !      heat flux at the ocean surface      !
120      !------------------------------------------!
121
122!!gm
123!!gm CAUTION   
124!!gm re-verifies the non solar expression, especially over open ocen
125!!gm
126      zqnsoce(:,:) = qns(:,:)
127      DO jj = 1, jpj
128         DO ji = 1, jpi
129            zinda   = 1.0   - MAX( rzero , SIGN( rone, - ( 1.0 - pfrld(ji,jj) )   ) )
130            ifvt    = zinda * MAX( rzero , SIGN( rone,  - phicif(ji,jj)           ) )
131            i1mfr   = 1.0   - MAX( rzero , SIGN( rone, - ( 1.0 - frld(ji,jj) )    ) )
132            idfr    = 1.0   - MAX( rzero , SIGN( rone, frld(ji,jj) - pfrld(ji,jj) ) )
133            iflt    = zinda  * (1 - i1mfr) * (1 - ifvt )
134            ial     = ifvt   * i1mfr + ( 1 - ifvt ) * idfr
135            iadv    = ( 1  - i1mfr ) * zinda
136            ifral   = ( 1  - i1mfr * ( 1 - ial ) )   
137            ifrdv   = ( 1  - ifral * ( 1 - ial ) ) * iadv 
138
139!!$            zinda   = 1.0 - AINT( pfrld(ji,jj) )                   !   = 0. if pure ocean else 1. (at previous time)
140!!$
141!!$            i1mfr   = 1.0 - AINT(  frld(ji,jj) )                   !   = 0. if pure ocean else 1. (at current  time)
142!!$
143!!$            IF( phicif(ji,jj) <= 0. ) THEN   ;   ifvt = zinda      !   = 1. if (snow and no ice at previous time) else 0. ???
144!!$            ELSE                             ;   ifvt = 0.
145!!$            ENDIF
146!!$
147!!$            IF( frld(ji,jj) >= pfrld(ji,jj) ) THEN   ;   idfr = 0.  !   = 0. if lead fraction increases from previous to current
148!!$            ELSE                                     ;   idfr = 1.   
149!!$            ENDIF
150!!$
151!!$            iflt    = zinda  * (1 - i1mfr) * (1 - ifvt )    !   = 1. if ice (not only snow) at previous and pure ocean at current
152!!$
153!!$            ial     = ifvt   * i1mfr    +    ( 1 - ifvt ) * idfr
154!!$!                 snow no ice   ice         ice or nothing  lead fraction increases
155!!$!                 at previous   now           at previous
156!!$!                -> ice aera increases  ???         -> ice aera decreases ???
157!!$
158!!$            iadv    = ( 1  - i1mfr ) * zinda 
159!!$!                     pure ocean      ice at
160!!$!                     at current      previous
161!!$!                        -> = 1. if ice disapear between previous and current
162!!$
163!!$            ifral   = ( 1  - i1mfr * ( 1 - ial ) ) 
164!!$!                            ice at     ???
165!!$!                            current         
166!!$!                         -> ???
167!!$
168!!$            ifrdv   = ( 1  - ifral * ( 1 - ial ) ) * iadv
169!!$!                                                    ice disapear                           
170!!$
171!!$
172
173            !   computation the solar flux at ocean surface
174#if defined key_coupled 
175            zqsr = qsr_tot(ji,jj) + ( fstric(ji,jj) - qsr_ice(ji,jj,1) ) * ( 1.0 - pfrld(ji,jj) )
176#else
177            zqsr = pfrld(ji,jj) * qsr(ji,jj)  + ( 1.  - pfrld(ji,jj) ) * fstric(ji,jj)
178#endif           
179            !  computation the non solar heat flux at ocean surface
180            zqns    =  - ( 1. - thcm(ji,jj) ) * zqsr   &   ! part of the solar energy used in leads
181               &       + iflt    * ( fscmbq(ji,jj) + ffltbif(ji,jj) )                            &
182               &       + ifral   * ( ial * qcmif(ji,jj) + (1 - ial) * qldif(ji,jj) ) * zrdtir    &
183               &       + ifrdv   * ( qfvbq(ji,jj) + qdtcn(ji,jj) ) * zrdtir
184
185            fsbbq(ji,jj) = ( 1.0 - ( ifvt + iflt ) ) * fscmbq(ji,jj)     ! ???
186           
187            qsr  (ji,jj) = zqsr                                          ! solar heat flux
188            qns  (ji,jj) = zqns - fdtcn(ji,jj)                           ! non solar heat flux
189         END DO
190      END DO
191
192      CALL iom_put( 'hflx_ice_cea', - fdtcn(:,:)                         )     
193      CALL iom_put( 'qns_io_cea'  , qns(:,:) - zqnsoce(:,:) * pfrld(:,:) )     
194      CALL iom_put( 'qsr_io_cea'  , fstric(:,:) * (1. - pfrld(:,:))      )
195
196      !------------------------------------------!
197      !      mass flux at the ocean surface      !
198      !------------------------------------------!
199
200!!gm
201!!gm CAUTION   
202!!gm re-verifies the emp & emps expression, especially the absence of 1-frld on zfm
203!!gm
204      DO jj = 1, jpj
205         DO ji = 1, jpi
206           
207#if defined key_coupled
208          zemp = emp_tot(ji,jj) - emp_ice(ji,jj) * ( 1. - pfrld(ji,jj) )    &   !
209             &   + rdmsnif(ji,jj) * zrdtir                                      !  freshwaterflux due to snow melting
210#else
211!!$            !  computing freshwater exchanges at the ice/ocean interface
212!!$            zpme = - evap(ji,jj)    *   frld(ji,jj)           &   !  evaporation over oceanic fraction
213!!$               &   + tprecip(ji,jj)                           &   !  total precipitation
214!!$               &   - sprecip(ji,jj) * ( 1. - pfrld(ji,jj) )   &   !  remov. snow precip over ice
215!!$               &   - rdmsnif(ji,jj) / rdt_ice                     !  freshwaterflux due to snow melting
216            !  computing freshwater exchanges at the ice/ocean interface
217            zemp = + emp(ji,jj)     *         frld(ji,jj)      &   !  e-p budget over open ocean fraction
218               &   - tprecip(ji,jj) * ( 1. -  frld(ji,jj) )    &   !  liquid precipitation reaches directly the ocean
219               &   + sprecip(ji,jj) * ( 1. - pfrld(ji,jj) )    &   !  taking into account change in ice cover within the time step
220               &   + rdmsnif(ji,jj) * zrdtir                       !  freshwaterflux due to snow melting
221               !                                                   !  ice-covered fraction:
222#endif           
223
224            !  computing salt exchanges at the ice/ocean interface
225            zfons =  ( soce_r(ji,jj) - sice_r(ji,jj) ) * ( rdmicif(ji,jj) * zrdtir ) 
226           
227            !  converting the salt flux from ice to a freshwater flux from ocean
228            zfm  = zfons / ( sss_m(ji,jj) + epsi16 )
229           
230            emps(ji,jj) = zemp + zfm      ! surface ocean concentration/dilution effect (use on SSS evolution)
231            emp (ji,jj) = zemp            ! surface ocean volume flux (use on sea-surface height evolution)
232
233         END DO
234      END DO
235
236      IF( lk_diaar5 ) THEN
237         CALL iom_put( 'isnwmlt_cea'  ,                 rdmsnif(:,:) * zrdtir )
238         CALL iom_put( 'fsal_virt_cea',   soce_r(:,:) * rdmicif(:,:) * zrdtir )
239         CALL iom_put( 'fsal_real_cea', - sice_r(:,:) * rdmicif(:,:) * zrdtir )
240      ENDIF
241
242      !------------------------------------------!
243      !    momentum flux at the ocean surface    !
244      !------------------------------------------!
245
246      IF ( ln_limdyn ) THEN                        ! Update the stress over ice-over area (only in ice-dynamic case)
247         !                                         ! otherwise the atmosphere-ocean stress is used everywhere
248
249         ! ... ice stress over ocean with a ice-ocean rotation angle (at I-point)
250!CDIR NOVERRCHK
251         DO jj = 1, jpj
252!CDIR NOVERRCHK
253            DO ji = 1, jpi
254               ! ... change the cosinus angle sign in the south hemisphere
255               zsang  = SIGN(1.e0, gphif(ji,jj) ) * sangvg
256               ! ... ice velocity relative to the ocean at I-point
257               zu_io  = u_ice(ji,jj) - u_oce(ji,jj)
258               zv_io  = v_ice(ji,jj) - v_oce(ji,jj)
259               zmod   = SQRT( zu_io * zu_io + zv_io * zv_io )
260               zztmp  = rhoco * zmod
261               ! ... components of ice stress over ocean with a ice-ocean rotation angle (at I-point)
262               ztio_u(ji,jj) = zztmp * ( cangvg * zu_io - zsang * zv_io )
263               ztio_v(ji,jj) = zztmp * ( cangvg * zv_io + zsang * zu_io )
264               ! ... module of ice stress over ocean (at I-point)
265               ztiomi(ji,jj) = zztmp * zmod
266               !
267            END DO
268         END DO
269
270         DO jj = 2, jpjm1
271            DO ji = 2, jpim1   ! NO vector opt.
272               ! ... components of ice-ocean stress at U and V-points  (from I-point values)
273               zutau  = 0.5 * ( ztio_u(ji+1,jj) + ztio_u(ji+1,jj+1) )
274               zvtau  = 0.5 * ( ztio_v(ji,jj+1) + ztio_v(ji+1,jj+1) )
275               ! ... open-ocean (lead) fraction at U- & V-points (from T-point values)
276               zfrldu = 0.5 * ( frld(ji,jj) + frld(ji+1,jj  ) )
277               zfrldv = 0.5 * ( frld(ji,jj) + frld(ji  ,jj+1) )
278               ! ... update components of surface ocean stress (ice-cover wheighted)
279               utau(ji,jj) = zfrldu * utau(ji,jj) + ( 1. - zfrldu ) * zutau
280               vtau(ji,jj) = zfrldv * vtau(ji,jj) + ( 1. - zfrldv ) * zvtau
281               ! ... module of ice-ocean stress at T-points (from I-point values)
282               zztmp = 0.25 * ( ztiomi(ji,jj) + ztiomi(ji+1,jj) + ztiomi(ji,jj+1) + ztiomi(ji+1,jj+1) )
283               ! ... update module of surface ocean stress (ice-cover wheighted)
284               taum(ji,jj) = frld(ji,jj) * taum(ji,jj) + ( 1. - frld(ji,jj) ) * zztmp
285               !
286            END DO
287         END DO
288
289         ! boundary condition on the stress (utau,vtau,taum)
290         CALL lbc_lnk( utau, 'U', -1. )
291         CALL lbc_lnk( vtau, 'V', -1. )
292         CALL lbc_lnk( taum, 'T',  1. )
293
294      ENDIF
295
296      !-----------------------------------------------!
297      !   Coupling variables                          !
298      !-----------------------------------------------!
299
300      IF( lk_cpl ) THEN           
301         tn_ice(:,:,1) = sist(:,:)          ! sea-ice surface temperature       
302         !                                  ! snow/ice and ocean albedos
303         CALL albedo_ice( tn_ice, reshape( hicif, (/jpi,jpj,1/) ), reshape( hsnif, (/jpi,jpj,1/) ), zalbp, zalb )
304         alb_ice(:,:,1) =  0.5 * ( zalbp(:,:,1) + zalb (:,:,1) )   ! Ice albedo (mean clear and overcast skys)
305         CALL iom_put( "icealb_cea", alb_ice(:,:,1) * fr_i(:,:) )  ! ice albedo
306      ENDIF
307
308      IF(ln_ctl) THEN
309         CALL prt_ctl( tab2d_1=qsr , clinfo1=' lim_sbc: qsr    : ', tab2d_2=qns  , clinfo2=' qns     : ' )
310         CALL prt_ctl( tab2d_1=emp , clinfo1=' lim_sbc: emp    : ', tab2d_2=emps , clinfo2=' emps    : ' )
311         CALL prt_ctl( tab2d_1=utau, clinfo1=' lim_sbc: utau   : ', mask1=umask,   &
312            &          tab2d_2=vtau, clinfo2=' vtau    : '        , mask2=vmask )
313         CALL prt_ctl( tab2d_1=fr_i, clinfo1=' lim_sbc: fr_i   : ', tab2d_2=tn_ice(:,:,1), clinfo2=' tn_ice  : ' )
314      ENDIF 
315      !
316   END SUBROUTINE lim_sbc_2
317
318#else
319   !!----------------------------------------------------------------------
320   !!   Default option :        Dummy module       NO LIM 2.0 sea-ice model
321   !!----------------------------------------------------------------------
322#endif 
323
324   !!======================================================================
325END MODULE limsbc_2
Note: See TracBrowser for help on using the repository browser.