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

source: trunk/NEMO/LIM_SRC_2/limsbc_2.F90 @ 1226

Last change on this file since 1226 was 1226, checked in by smasson, 15 years ago

bugfix of the coupling interface (commited during changeset:1218), see ticket:155

  • Property svn:keywords set to Id
File size: 14.6 KB
Line 
1MODULE limsbc_2
2   !!======================================================================
3   !!                       ***  MODULE limsbc_2   ***
4   !!           computation of the flux at the sea ice/ocean interface
5   !!======================================================================
6   !! History : 00-01 (H. Goosse) Original code
7   !!           02-07 (C. Ethe, G. Madec) re-writing F90
8   !!           06-07 (G. Madec) surface module
9   !!----------------------------------------------------------------------
10#if defined key_lim2
11   !!----------------------------------------------------------------------
12   !!   'key_lim2'                                    LIM 2.0 sea-ice model
13   !!----------------------------------------------------------------------
14   !!----------------------------------------------------------------------
15   !!   lim_sbc_2  : flux at the ice / ocean interface
16   !!----------------------------------------------------------------------
17   USE par_oce          ! ocean parameters
18   USE dom_oce          ! ocean domain
19   USE sbc_ice          ! surface boundary condition
20   USE sbc_oce          ! surface boundary condition
21   USE phycst           ! physical constants
22   USE ice_oce          ! sea-ice variable
23   USE ice_2            ! LIM sea-ice variables
24   USE iceini_2         ! ???
25   USE dynspg_oce       ! choice of the surface pressure gradient scheme
26
27   USE lbclnk           ! ocean lateral boundary condition
28   USE in_out_manager   ! I/O manager
29   USE albedo           ! albedo parameters
30   USE prtctl           ! Print control
31   USE cpl_oasis3, ONLY : lk_cpl
32
33   IMPLICIT NONE
34   PRIVATE
35
36   PUBLIC lim_sbc_2     ! called by sbc_ice_lim_2
37
38   REAL(wp)  ::   epsi16 = 1.e-16  ! constant values
39   REAL(wp)  ::   rzero  = 0.e0   
40   REAL(wp)  ::   rone   = 1.e0
41
42   !! * Substitutions
43#  include "vectopt_loop_substitute.h90"
44   !!----------------------------------------------------------------------
45   !!   LIM 2.0,  UCL-LOCEAN-IPSL (2006)
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      REAL(wp) ::   zqsr  , zqns     ! solar & non solar heat flux
82      REAL(wp) ::   zinda            ! switch for testing the values of ice concentration
83      REAL(wp) ::   zfons            ! salt exchanges at the ice/ocean interface
84      REAL(wp) ::   zemp             ! freshwater exchanges at the ice/ocean interface
85      REAL(wp) ::   zfrldu, zfrldv   ! lead fraction at U- & V-points
86      REAL(wp) ::   zutau , zvtau    ! lead fraction at U- & V-points
87      REAL(wp) ::   zu_io , zv_io    ! 2 components of the ice-ocean velocity
88! interface 2D --> 3D
89      REAL(wp), DIMENSION(jpi,jpj,1) ::   zalb     ! albedo of ice under overcast sky
90      REAL(wp), DIMENSION(jpi,jpj,1) ::   zalbp    ! albedo of ice under clear sky
91      REAL(wp), DIMENSION(jpi,jpj,1) ::   zsist    ! surface ice temperature (K)
92      REAL(wp), DIMENSION(jpi,jpj,1) ::   zhicif   ! ice thickness
93      REAL(wp), DIMENSION(jpi,jpj,1) ::   zhsnif   ! snow thickness
94      REAL(wp) ::   zsang, zmod, zfm
95      REAL(wp), DIMENSION(jpi,jpj) ::   ztio_u, ztio_v   ! ocean stress below sea-ice
96
97      !!---------------------------------------------------------------------
98     
99      IF( kt == nit000 ) THEN
100         IF(lwp) WRITE(numout,*)
101         IF(lwp) WRITE(numout,*) 'lim_sbc_2 : LIM 2.0 sea-ice - surface boundary condition'
102         IF(lwp) WRITE(numout,*) '~~~~~~~~~   '
103      ENDIF
104
105      !------------------------------------------!
106      !      heat flux at the ocean surface      !
107      !------------------------------------------!
108
109!!gm
110!!gm CAUTION   
111!!gm re-verifies the non solar expression, especially over open ocen
112!!gm
113      DO jj = 1, jpj
114         DO ji = 1, jpi
115            zinda   = 1.0   - MAX( rzero , SIGN( rone, - ( 1.0 - pfrld(ji,jj) )   ) )
116            ifvt    = zinda * MAX( rzero , SIGN( rone,  - phicif(ji,jj)           ) )
117            i1mfr   = 1.0   - MAX( rzero , SIGN( rone, - ( 1.0 - frld(ji,jj) )    ) )
118            idfr    = 1.0   - MAX( rzero , SIGN( rone, frld(ji,jj) - pfrld(ji,jj) ) )
119            iflt    = zinda  * (1 - i1mfr) * (1 - ifvt )
120            ial     = ifvt   * i1mfr + ( 1 - ifvt ) * idfr
121            iadv    = ( 1  - i1mfr ) * zinda
122            ifral   = ( 1  - i1mfr * ( 1 - ial ) )   
123            ifrdv   = ( 1  - ifral * ( 1 - ial ) ) * iadv 
124
125!!$            zinda   = 1.0 - AINT( pfrld(ji,jj) )                   !   = 0. if pure ocean else 1. (at previous time)
126!!$
127!!$            i1mfr   = 1.0 - AINT(  frld(ji,jj) )                   !   = 0. if pure ocean else 1. (at current  time)
128!!$
129!!$            IF( phicif(ji,jj) <= 0. ) THEN   ;   ifvt = zinda      !   = 1. if (snow and no ice at previous time) else 0. ???
130!!$            ELSE                             ;   ifvt = 0.
131!!$            ENDIF
132!!$
133!!$            IF( frld(ji,jj) >= pfrld(ji,jj) ) THEN   ;   idfr = 0.  !   = 0. if lead fraction increases from previous to current
134!!$            ELSE                                     ;   idfr = 1.   
135!!$            ENDIF
136!!$
137!!$            iflt    = zinda  * (1 - i1mfr) * (1 - ifvt )    !   = 1. if ice (not only snow) at previous and pure ocean at current
138!!$
139!!$            ial     = ifvt   * i1mfr    +    ( 1 - ifvt ) * idfr
140!!$!                 snow no ice   ice         ice or nothing  lead fraction increases
141!!$!                 at previous   now           at previous
142!!$!                -> ice aera increases  ???         -> ice aera decreases ???
143!!$
144!!$            iadv    = ( 1  - i1mfr ) * zinda 
145!!$!                     pure ocean      ice at
146!!$!                     at current      previous
147!!$!                        -> = 1. if ice disapear between previous and current
148!!$
149!!$            ifral   = ( 1  - i1mfr * ( 1 - ial ) ) 
150!!$!                            ice at     ???
151!!$!                            current         
152!!$!                         -> ???
153!!$
154!!$            ifrdv   = ( 1  - ifral * ( 1 - ial ) ) * iadv
155!!$!                                                    ice disapear                           
156!!$
157!!$
158
159            !   computation the solar flux at ocean surface
160#if defined key_coupled 
161            zqsr = qsr_tot(ji,jj) + ( fstric(ji,jj) - qsr_ice(ji,jj) ) * ( 1.0 - pfrld(ji,jj) )
162#else
163            zqsr = pfrld(ji,jj) * qsr(ji,jj)  + ( 1.  - pfrld(ji,jj) ) * fstric(ji,jj)
164#endif           
165            !  computation the non solar heat flux at ocean surface
166            zqns    =  - ( 1. - thcm(ji,jj) ) * zqsr   &   ! part of the solar energy used in leads
167               &       + iflt    * ( fscmbq(ji,jj) + ffltbif(ji,jj) )                            &
168               &       + ifral   * ( ial * qcmif(ji,jj) + (1 - ial) * qldif(ji,jj) ) / rdt_ice   &
169               &       + ifrdv   * ( qfvbq(ji,jj) + qdtcn(ji,jj) ) / rdt_ice
170
171            fsbbq(ji,jj) = ( 1.0 - ( ifvt + iflt ) ) * fscmbq(ji,jj)     ! ???
172           
173            qsr  (ji,jj) = zqsr                                          ! solar heat flux
174            qns  (ji,jj) = zqns - fdtcn(ji,jj)                           ! non solar heat flux
175         END DO
176      END DO
177 
178      !------------------------------------------!
179      !      mass flux at the ocean surface      !
180      !------------------------------------------!
181
182!!gm
183!!gm CAUTION   
184!!gm re-verifies the emp & emps expression, especially the absence of 1-frld on zfm
185!!gm
186      DO jj = 1, jpj
187         DO ji = 1, jpi
188           
189#if defined key_coupled
190          zemp = emp_tot(ji,jj) - emp_ice(ji,jj) * ( 1. - pfrld(ji,jj) )    &   !
191             &   + rdmsnif(ji,jj) / rdt_ice                                     !  freshwaterflux due to snow melting
192#else
193!!$            !  computing freshwater exchanges at the ice/ocean interface
194!!$            zpme = - evap(ji,jj)    *   frld(ji,jj)           &   !  evaporation over oceanic fraction
195!!$               &   + tprecip(ji,jj)                           &   !  total precipitation
196!!$               &   - sprecip(ji,jj) * ( 1. - pfrld(ji,jj) )   &   !  remov. snow precip over ice
197!!$               &   - rdmsnif(ji,jj) / rdt_ice                     !  freshwaterflux due to snow melting
198            !  computing freshwater exchanges at the ice/ocean interface
199            zemp = + emp(ji,jj)     *         frld(ji,jj)      &   !  e-p budget over open ocean fraction
200               &   - tprecip(ji,jj) * ( 1. -  frld(ji,jj) )    &   !  liquid precipitation reaches directly the ocean
201               &   + sprecip(ji,jj) * ( 1. - pfrld(ji,jj) )    &   !  taking into account change in ice cover within the time step
202               &   + rdmsnif(ji,jj) / rdt_ice                      !  freshwaterflux due to snow melting
203               !                                                   !  ice-covered fraction:
204#endif           
205
206            !  computing salt exchanges at the ice/ocean interface
207            zfons =  ( soce - sice ) * ( rdmicif(ji,jj) / rdt_ice ) 
208           
209            !  converting the salt flux from ice to a freshwater flux from ocean
210            zfm  = zfons / ( sss_m(ji,jj) + epsi16 )
211           
212            emps(ji,jj) = zemp + zfm      ! surface ocean concentration/dilution effect (use on SSS evolution)
213            emp (ji,jj) = zemp            ! surface ocean volume flux (use on sea-surface height evolution)
214
215         END DO
216      END DO
217
218      IF( lk_dynspg_rl )    emp (:,:) = emps(:,:)      ! rigid-lid formulation : emp = emps
219
220      !------------------------------------------!
221      !    momentum flux at the ocean surface    !
222      !------------------------------------------!
223
224      IF ( ln_limdyn ) THEN                        ! Update the stress over ice-over area (only in ice-dynamic case)
225         !                                         ! otherwise the atmosphere-ocean stress is used everywhere
226
227         ! ... ice stress over ocean with a ice-ocean rotation angle (at I-point)
228!CDIR NOVERRCHK
229         DO jj = 1, jpj
230!CDIR NOVERRCHK
231            DO ji = 1, jpi
232               ! ... change the cosinus angle sign in the south hemisphere
233               zsang  = SIGN(1.e0, gphif(ji,jj) ) * sangvg
234               ! ... ice velocity relative to the ocean
235               zu_io  = ui_ice(ji,jj) - ui_oce(ji,jj)
236               zv_io  = vi_ice(ji,jj) - vi_oce(ji,jj)
237               zmod   = rhoco * SQRT( zu_io * zu_io + zv_io * zv_io )
238               ! ... ice stress over ocean with a ice-ocean rotation angle (at I-point)
239               ztio_u(ji,jj) = zmod * ( cangvg * zu_io - zsang * zv_io )
240               ztio_v(ji,jj) = zmod * ( cangvg * zv_io + zsang * zu_io )
241               !
242            END DO
243         END DO
244
245         DO jj = 2, jpjm1
246            DO ji = 2, jpim1
247               ! ... ice-cover wheighted ice-ocean stress at U and V-points  (from I-point values)
248               zutau  = 0.5 * ( ztio_u(ji+1,jj) + ztio_u(ji+1,jj+1) )
249               zvtau  = 0.5 * ( ztio_v(ji,jj+1) + ztio_v(ji+1,jj+1) )
250               ! ... open-ocean (lead) fraction at U- & V-points (from T-point values)
251               zfrldu = 0.5 * ( frld (ji,jj) + frld (ji+1,jj  ) )
252               zfrldv = 0.5 * ( frld (ji,jj) + frld (ji  ,jj+1) )
253               ! update surface ocean stress
254               utau(ji,jj) = zfrldu * utau(ji,jj) + ( 1. - zfrldu ) * zutau
255               vtau(ji,jj) = zfrldv * vtau(ji,jj) + ( 1. - zfrldv ) * zvtau
256               !
257            END DO
258         END DO
259
260         ! boundary condition on the stress (utau,vtau)
261         CALL lbc_lnk( utau, 'U', -1. )
262         CALL lbc_lnk( vtau, 'V', -1. )
263
264      ENDIF
265
266      !-----------------------------------------------!
267      !   Storing the transmitted variables           !
268      !-----------------------------------------------!
269
270      fr_i  (:,:) = 1.0 - frld(:,:)       ! sea-ice fraction
271
272      IF ( lk_cpl ) THEN           
273         ! Ice surface temperature
274         tn_ice(:,:) = sist(:,:)          ! sea-ice surface temperature       
275         ! Computation of snow/ice and ocean albedo
276         ! INTERFACE 3D versus 2D
277         zsist (:,:,1) = sist (:,:)
278         zhicif(:,:,1) = hicif(:,:)   ;   zhsnif(:,:,1) = hsnif(:,:)
279         CALL albedo_ice( zsist, zhicif, zhsnif, zalbp, zalb )
280         alb_ice(:,:) =  0.5 * ( zalbp(:,:,1) + zalb (:,:,1) )   ! Ice albedo (mean clear and overcast skys)
281      ENDIF
282
283      IF(ln_ctl) THEN
284         CALL prt_ctl(tab2d_1=qsr   , clinfo1=' lim_sbc: qsr    : ', tab2d_2=qns   , clinfo2=' qns     : ')
285         CALL prt_ctl(tab2d_1=emp   , clinfo1=' lim_sbc: emp    : ', tab2d_2=emps  , clinfo2=' emps    : ')
286         CALL prt_ctl(tab2d_1=utau  , clinfo1=' lim_sbc: utau   : ', mask1=umask,   &
287            &         tab2d_2=vtau  , clinfo2=' vtau    : '        , mask2=vmask )
288         CALL prt_ctl(tab2d_1=fr_i  , clinfo1=' lim_sbc: fr_i   : ', tab2d_2=tn_ice, clinfo2=' tn_ice  : ')
289      ENDIF
290   
291    END SUBROUTINE lim_sbc_2
292
293#else
294   !!----------------------------------------------------------------------
295   !!   Default option :        Dummy module       NO LIM 2.0 sea-ice model
296   !!----------------------------------------------------------------------
297CONTAINS
298   SUBROUTINE lim_sbc_2         ! Dummy routine
299   END SUBROUTINE lim_sbc_2
300#endif 
301
302   !!======================================================================
303END MODULE limsbc_2
Note: See TracBrowser for help on using the repository browser.