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.
tramle.F90 in NEMO/branches/UKMO/NEMO_4.0.2_FKOSM/src/OCE/TRA – NEMO

source: NEMO/branches/UKMO/NEMO_4.0.2_FKOSM/src/OCE/TRA/tramle.F90 @ 12912

Last change on this file since 12912 was 12912, checked in by cguiavarch, 4 years ago

OSMOSIS and Fox-Kemper changes (merged from NEMO_4.0.1_FKOSM)

File size: 21.3 KB
Line 
1MODULE tramle
2   !!======================================================================
3   !!                    ***  MODULE  tramle  ***
4   !! Ocean tracers: Mixed Layer Eddy induced transport
5   !!======================================================================
6   !! History :  3.3  !  2010-08  (G. Madec)  Original code
7   !!----------------------------------------------------------------------
8
9   !!----------------------------------------------------------------------
10   !!   tra_mle_trp   : update the effective transport with the Mixed Layer Eddy induced transport
11   !!   tra_mle_init  : initialisation of the Mixed Layer Eddy induced transport computation
12   !!----------------------------------------------------------------------
13   USE oce            ! ocean dynamics and tracers variables
14   USE dom_oce        ! ocean space and time domain variables
15   USE phycst         ! physical constant
16   USE zdfmxl         ! mixed layer depth
17   !
18   USE in_out_manager ! I/O manager
19   USE iom            ! IOM library
20   USE lib_mpp        ! MPP library
21   USE lbclnk         ! lateral boundary condition / mpp link
22
23   ! where OSMOSIS_OBL is used with integrated FK
24   USE zdf_oce, ONLY : ln_zdfosm
25   USE zdfosm, ONLY  : ln_osm_mle, hmle, dbdx_mle, dbdy_mle, mld_prof
26
27   IMPLICIT NONE
28   PRIVATE
29
30   PUBLIC   tra_mle_trp        ! routine called in traadv.F90
31   PUBLIC   tra_mle_init   ! routine called in traadv.F90
32
33   !                                    !!* namelist namtra_mle *
34   LOGICAL, PUBLIC ::   ln_mle           !: flag to activate the Mixed Layer Eddy (MLE) parameterisation
35   INTEGER         ::      nn_mle           ! MLE type: =0 standard Fox-Kemper ; =1 new formulation
36   INTEGER         ::      nn_mld_uv        ! space interpolation of MLD at u- & v-pts (0=min,1=averaged,2=max)
37   INTEGER         ::      nn_conv          ! =1 no MLE in case of convection ; =0 always MLE
38   REAL(wp)        ::      rn_ce            ! MLE coefficient
39   !                                        ! parameters used in nn_mle = 0 case
40   REAL(wp)        ::      rn_lf               ! typical scale of mixed layer front
41   REAL(wp)        ::      rn_time             ! time scale for mixing momentum across the mixed layer
42   !                                        ! parameters used in nn_mle = 1 case
43   REAL(wp)        ::      rn_lat              ! reference latitude for a 5 km scale of ML front
44   REAL(wp)        ::      rn_rho_c_mle        ! Density criterion for definition of MLD used by FK
45
46   REAL(wp) ::   r5_21 = 5.e0 / 21.e0   ! factor used in mle streamfunction computation
47   REAL(wp) ::   rb_c                   ! ML buoyancy criteria = g rho_c /rau0 where rho_c is defined in zdfmld
48   REAL(wp) ::   rc_f                   ! MLE coefficient (= rn_ce / (5 km * fo) ) in nn_mle=1 case
49
50   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:) ::   rfu, rfv   ! modified Coriolis parameter (f+tau) at u- & v-pts
51   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:) ::   r1_ft      ! inverse of the modified Coriolis parameter at t-pts
52
53   !! * Substitutions
54#  include "vectopt_loop_substitute.h90"
55   !!----------------------------------------------------------------------
56   !! NEMO/OCE 4.0 , NEMO Consortium (2018)
57   !! $Id$
58   !! Software governed by the CeCILL license (see ./LICENSE)
59   !!----------------------------------------------------------------------
60CONTAINS
61
62  SUBROUTINE tra_mle_trp( kt, kit000, pu, pv, pw, cdtype )
63    !!----------------------------------------------------------------------
64    !!                  ***  ROUTINE tra_mle_trp  ***
65    !!
66    !! ** Purpose :   Add to the transport the Mixed Layer Eddy induced transport
67    !!
68    !! ** Method  :   The 3 components of the Mixed Layer Eddy (MLE) induced
69    !!              transport are computed as follows :
70    !!                zu_mle = dk[ zpsi_uw ]
71    !!                zv_mle = dk[ zpsi_vw ]
72    !!                zw_mle = - di[ zpsi_uw ] - dj[ zpsi_vw ]
73    !!                where zpsi is the MLE streamfunction at uw and vw points (see the doc)
74    !!              and added to the input velocity :
75    !!                p.n = p.n + z._mle
76    !!
77    !! ** Action  : - (pun,pvn,pwn) increased by the mle transport
78    !!                CAUTION, the transport is not updated at the last line/raw
79    !!                         this may be a problem for some advection schemes
80    !!
81    !! References: Fox-Kemper et al., JPO, 38, 1145-1165, 2008
82    !!             Fox-Kemper and Ferrari, JPO, 38, 1166-1179, 2008
83    !!----------------------------------------------------------------------
84    INTEGER                         , INTENT(in   ) ::   kt         ! ocean time-step index
85    INTEGER                         , INTENT(in   ) ::   kit000     ! first time step index
86    CHARACTER(len=3)                , INTENT(in   ) ::   cdtype     ! =TRA or TRC (tracer indicator)
87    REAL(wp), DIMENSION(jpi,jpj,jpk), INTENT(inout) ::   pu         ! in : 3 ocean transport components
88    REAL(wp), DIMENSION(jpi,jpj,jpk), INTENT(inout) ::   pv         ! out: same 3  transport components
89    REAL(wp), DIMENSION(jpi,jpj,jpk), INTENT(inout) ::   pw         !   increased by the MLE induced transport
90    !
91    INTEGER  ::   ji, jj, jk          ! dummy loop indices
92    INTEGER  ::   ii, ij, ik, ikmax   ! local integers
93    REAL(wp) ::   zcuw, zmuw, zc      ! local scalar
94    REAL(wp) ::   zcvw, zmvw          !   -      -
95    INTEGER , DIMENSION(jpi,jpj)     :: inml_mle
96    REAL(wp), DIMENSION(jpi,jpj)     :: zpsim_u, zpsim_v, zmld, zbm, zhu, zhv, zn2, zLf_NH, zLf_MH
97    REAL(wp), DIMENSION(jpi,jpj,jpk) :: zpsi_uw, zpsi_vw
98    !!----------------------------------------------------------------------
99    !
100    !
101    IF(ln_osm_mle.and.ln_zdfosm) THEN
102       ikmax = MIN( MAXVAL( mld_prof(:,:) ), jpkm1 )                  ! max level of the computation
103       !
104       !
105       SELECT CASE( nn_mld_uv )                         ! MLD at u- & v-pts
106       CASE ( 0 )                                               != min of the 2 neighbour MLDs
107          DO jj = 1, jpjm1
108             DO ji = 1, fs_jpim1   ! vector opt.
109                zhu(ji,jj) = MIN( hmle(ji+1,jj), hmle(ji,jj) )
110                zhv(ji,jj) = MIN( hmle(ji,jj+1), hmle(ji,jj) )
111             END DO
112          END DO
113       CASE ( 1 )                                               != average of the 2 neighbour MLDs
114          DO jj = 1, jpjm1
115             DO ji = 1, fs_jpim1   ! vector opt.
116                zhu(ji,jj) = MAX( hmle(ji+1,jj), hmle(ji,jj) )
117                zhv(ji,jj) = MAX( hmle(ji,jj+1), hmle(ji,jj) )
118             END DO
119          END DO
120       CASE ( 2 )                                               != max of the 2 neighbour MLDs
121          DO jj = 1, jpjm1
122             DO ji = 1, fs_jpim1   ! vector opt.
123                zhu(ji,jj) = MAX( hmle(ji+1,jj), hmle(ji,jj) )
124                zhv(ji,jj) = MAX( hmle(ji,jj+1), hmle(ji,jj) )
125             END DO
126          END DO
127       END SELECT
128       IF( nn_mle == 0 ) THEN           ! Fox-Kemper et al. 2010 formulation
129          DO jj = 1, jpjm1
130             DO ji = 1, fs_jpim1   ! vector opt.
131                zpsim_u(ji,jj) = rn_ce * zhu(ji,jj) * zhu(ji,jj)  * e2u(ji,jj)                                            &
132                     &           * dbdx_mle(ji,jj) * MIN( 111.e3_wp , e1u(ji,jj) )   &
133                     &           / (  MAX( rn_lf * rfu(ji,jj) , SQRT( rb_c * zhu(ji,jj) ) )   )
134                !
135                zpsim_v(ji,jj) = rn_ce * zhv(ji,jj) * zhv(ji,jj)  * e1v(ji,jj)                                            &
136                     &           * dbdy_mle(ji,jj)  * MIN( 111.e3_wp , e2v(ji,jj) )   &
137                     &           / (  MAX( rn_lf * rfv(ji,jj) , SQRT( rb_c * zhv(ji,jj) ) )   )
138             END DO
139          END DO
140          !
141       ELSEIF( nn_mle == 1 ) THEN       ! New formulation (Lf = 5km fo/ff with fo=Coriolis parameter at latitude rn_lat)
142          DO jj = 1, jpjm1
143             DO ji = 1, fs_jpim1   ! vector opt.
144                zpsim_u(ji,jj) = rc_f *   zhu(ji,jj)   * zhu(ji,jj)   * e2u(ji,jj)               &
145                     &                  * dbdx_mle(ji,jj) * MIN( 111.e3_wp , e1u(ji,jj) )
146                !
147                zpsim_v(ji,jj) = rc_f *   zhv(ji,jj)   * zhv(ji,jj)   * e1v(ji,jj)               &
148                     &                  * dbdy_mle(ji,jj) * MIN( 111.e3_wp , e2v(ji,jj) )
149             END DO
150          END DO
151       ENDIF
152
153    ELSE !do not use osn_mle
154       !                                      !==  MLD used for MLE  ==!
155       !                                                ! compute from the 10m density to deal with the diurnal cycle
156       inml_mle(:,:) = mbkt(:,:) + 1                    ! init. to number of ocean w-level (T-level + 1)
157       IF ( nla10 > 0 ) THEN                            ! avoid case where first level is thicker than 10m
158          DO jk = jpkm1, nlb10, -1                      ! from the bottom to nlb10 (10m)
159             DO jj = 1, jpj
160                DO ji = 1, jpi                          ! index of the w-level at the ML based
161                   IF( rhop(ji,jj,jk) > rhop(ji,jj,nla10) + rn_rho_c_mle )   inml_mle(ji,jj) = jk      ! Mixed layer
162                END DO
163             END DO
164          END DO
165       ENDIF
166       ikmax = MIN( MAXVAL( inml_mle(:,:) ), jpkm1 )                  ! max level of the computation
167
168       !
169       !
170       zmld(:,:) = 0._wp                      !==   Horizontal shape of the MLE  ==!
171       zbm (:,:) = 0._wp
172       zn2 (:,:) = 0._wp
173       DO jk = 1, ikmax                                 ! MLD and mean buoyancy and N2 over the mixed layer
174          DO jj = 1, jpj
175             DO ji = 1, jpi
176                zc = e3t_n(ji,jj,jk) * REAL( MIN( MAX( 0, inml_mle(ji,jj)-jk ) , 1  )  )    ! zc being 0 outside the ML t-points
177                zmld(ji,jj) = zmld(ji,jj) + zc
178                zbm (ji,jj) = zbm (ji,jj) + zc * (rau0 - rhop(ji,jj,jk) ) * r1_rau0
179                zn2 (ji,jj) = zn2 (ji,jj) + zc * (rn2(ji,jj,jk)+rn2(ji,jj,jk+1))*0.5_wp
180             END DO
181          END DO
182       END DO
183
184       SELECT CASE( nn_mld_uv )                         ! MLD at u- & v-pts
185       CASE ( 0 )                                               != min of the 2 neighbour MLDs
186          DO jj = 1, jpjm1
187             DO ji = 1, fs_jpim1   ! vector opt.
188                zhu(ji,jj) = MIN( zmld(ji+1,jj), zmld(ji,jj) )
189                zhv(ji,jj) = MIN( zmld(ji,jj+1), zmld(ji,jj) )
190             END DO
191          END DO
192       CASE ( 1 )                                               != average of the 2 neighbour MLDs
193          DO jj = 1, jpjm1
194             DO ji = 1, fs_jpim1   ! vector opt.
195                zhu(ji,jj) = ( zmld(ji+1,jj) + zmld(ji,jj) ) * 0.5_wp
196                zhv(ji,jj) = ( zmld(ji,jj+1) + zmld(ji,jj) ) * 0.5_wp
197             END DO
198          END DO
199       CASE ( 2 )                                               != max of the 2 neighbour MLDs
200          DO jj = 1, jpjm1
201             DO ji = 1, fs_jpim1   ! vector opt.
202                zhu(ji,jj) = MAX( zmld(ji+1,jj), zmld(ji,jj) )
203                zhv(ji,jj) = MAX( zmld(ji,jj+1), zmld(ji,jj) )
204             END DO
205          END DO
206       END SELECT
207       !                                                ! convert density into buoyancy
208       zbm(:,:) = + grav * zbm(:,:) / MAX( e3t_n(:,:,1), zmld(:,:) )
209       !
210       !
211       !                                      !==  Magnitude of the MLE stream function  ==!
212       !
213       !                 di[bm]  Ds
214       ! Psi = Ce  H^2 ---------------- e2u  mu(z)   where fu Lf = MAX( fu*rn_fl , (Db H)^1/2 )
215       !                  e1u   Lf fu                      and the e2u for the "transport"
216       !                                                      (not *e3u as divided by e3u at the end)
217       !
218       IF( nn_mle == 0 ) THEN           ! Fox-Kemper et al. 2010 formulation
219          DO jj = 1, jpjm1
220             DO ji = 1, fs_jpim1   ! vector opt.
221                zpsim_u(ji,jj) = rn_ce * zhu(ji,jj) * zhu(ji,jj)  * e2_e1u(ji,jj)                                            &
222                     &           * ( zbm(ji+1,jj) - zbm(ji,jj) ) * MIN( 111.e3_wp , e1u(ji,jj) )   &
223                     &           / (  MAX( rn_lf * rfu(ji,jj) , SQRT( rb_c * zhu(ji,jj) ) )   )
224                !
225                zpsim_v(ji,jj) = rn_ce * zhv(ji,jj) * zhv(ji,jj)  * e1_e2v(ji,jj)                                            &
226                     &           * ( zbm(ji,jj+1) - zbm(ji,jj) ) * MIN( 111.e3_wp , e2v(ji,jj) )   &
227                     &           / (  MAX( rn_lf * rfv(ji,jj) , SQRT( rb_c * zhv(ji,jj) ) )   )
228             END DO
229          END DO
230          !
231       ELSEIF( nn_mle == 1 ) THEN       ! New formulation (Lf = 5km fo/ff with fo=Coriolis parameter at latitude rn_lat)
232          DO jj = 1, jpjm1
233             DO ji = 1, fs_jpim1   ! vector opt.
234                zpsim_u(ji,jj) = rc_f *   zhu(ji,jj)   * zhu(ji,jj)   * e2_e1u(ji,jj)               &
235                     &                  * ( zbm(ji+1,jj) - zbm(ji,jj) ) * MIN( 111.e3_wp , e1u(ji,jj) )
236                !
237                zpsim_v(ji,jj) = rc_f *   zhv(ji,jj)   * zhv(ji,jj)   * e1_e2v(ji,jj)               &
238                     &                  * ( zbm(ji,jj+1) - zbm(ji,jj) ) * MIN( 111.e3_wp , e2v(ji,jj) )
239             END DO
240          END DO
241       ENDIF
242       !
243       IF( nn_conv == 1 ) THEN              ! No MLE in case of convection
244          DO jj = 1, jpjm1
245             DO ji = 1, fs_jpim1   ! vector opt.
246                IF( MIN( zn2(ji,jj) , zn2(ji+1,jj) ) < 0._wp )   zpsim_u(ji,jj) = 0._wp
247                IF( MIN( zn2(ji,jj) , zn2(ji,jj+1) ) < 0._wp )   zpsim_v(ji,jj) = 0._wp
248             END DO
249          END DO
250       ENDIF
251       !
252    ENDIF  ! end of lm_osm_mle loop
253    !                                      !==  structure function value at uw- and vw-points  ==!
254    DO jj = 1, jpjm1
255       DO ji = 1, fs_jpim1   ! vector opt.
256          zhu(ji,jj) = 1._wp / MAX(zhu(ji,jj), rsmall)                   ! hu --> 1/hu
257          zhv(ji,jj) = 1._wp / MAX(zhv(ji,jj), rsmall) 
258       END DO
259    END DO
260    !
261    zpsi_uw(:,:,:) = 0._wp
262    zpsi_vw(:,:,:) = 0._wp
263    !
264    DO jk = 2, ikmax                                ! start from 2 : surface value = 0
265       DO jj = 1, jpjm1
266          DO ji = 1, fs_jpim1   ! vector opt.
267             zcuw = 1._wp - ( gdepw_n(ji+1,jj,jk) + gdepw_n(ji,jj,jk) ) * zhu(ji,jj)
268             zcvw = 1._wp - ( gdepw_n(ji,jj+1,jk) + gdepw_n(ji,jj,jk) ) * zhv(ji,jj)
269             zcuw = zcuw * zcuw
270             zcvw = zcvw * zcvw
271             zmuw = MAX(  0._wp , ( 1._wp - zcuw ) * ( 1._wp + r5_21 * zcuw )  )
272             zmvw = MAX(  0._wp , ( 1._wp - zcvw ) * ( 1._wp + r5_21 * zcvw )  )
273             !
274             zpsi_uw(ji,jj,jk) = zpsim_u(ji,jj) * zmuw * umask(ji,jj,jk)
275             zpsi_vw(ji,jj,jk) = zpsim_v(ji,jj) * zmvw * vmask(ji,jj,jk)
276          END DO
277       END DO
278    END DO
279    !
280    !                                      !==  transport increased by the MLE induced transport ==!
281    DO jk = 1, ikmax
282       DO jj = 1, jpjm1                          ! CAUTION pu,pv must be defined at row/column i=1 / j=1
283          DO ji = 1, fs_jpim1   ! vector opt.
284             pu(ji,jj,jk) = pu(ji,jj,jk) + ( zpsi_uw(ji,jj,jk) - zpsi_uw(ji,jj,jk+1) )
285             pv(ji,jj,jk) = pv(ji,jj,jk) + ( zpsi_vw(ji,jj,jk) - zpsi_vw(ji,jj,jk+1) )
286          END DO
287       END DO
288       DO jj = 2, jpjm1
289          DO ji = fs_2, fs_jpim1   ! vector opt.
290             pw(ji,jj,jk) = pw(ji,jj,jk) - ( zpsi_uw(ji,jj,jk) - zpsi_uw(ji-1,jj,jk)   &
291                  &                          + zpsi_vw(ji,jj,jk) - zpsi_vw(ji,jj-1,jk) )
292          END DO
293       END DO
294    END DO
295
296    IF( cdtype == 'TRA') THEN              !==  outputs  ==!
297       !
298       IF (ln_osm_mle.and.ln_zdfosm) THEN
299          zLf_NH(:,:) = SQRT( rb_c * hmle(:,:) ) * r1_ft(:,:)      ! Lf = N H / f
300       ELSE
301          zLf_NH(:,:) = SQRT( rb_c * zmld(:,:) ) * r1_ft(:,:)      ! Lf = N H / f
302       END IF
303       CALL iom_put( "Lf_NHpf" , zLf_NH  )    ! Lf = N H / f
304       !
305       ! divide by cross distance to give streamfunction with dimensions m^2/s
306       DO jk = 1, ikmax+1
307          zpsi_uw(:,:,jk) = zpsi_uw(:,:,jk) * r1_e2u(:,:)
308          zpsi_vw(:,:,jk) = zpsi_vw(:,:,jk) * r1_e1v(:,:)
309       END DO
310       CALL iom_put( "psiu_mle", zpsi_uw )    ! i-mle streamfunction
311       CALL iom_put( "psiv_mle", zpsi_vw )    ! j-mle streamfunction
312    ENDIF
313    !
314  END SUBROUTINE tra_mle_trp
315
316
317   SUBROUTINE tra_mle_init
318      !!---------------------------------------------------------------------
319      !!                  ***  ROUTINE tra_mle_init  ***
320      !!
321      !! ** Purpose :   Control the consistency between namelist options for
322      !!              tracer advection schemes and set nadv
323      !!----------------------------------------------------------------------
324      INTEGER  ::   ji, jj, jk   ! dummy loop indices
325      INTEGER  ::   ierr
326      INTEGER ::    ios                 ! Local integer output status for namelist read
327      REAL(wp) ::   z1_t2, zfu, zfv                                !    -         -
328      !
329      NAMELIST/namtra_mle/ ln_mle , nn_mle, rn_ce, rn_lf, rn_time, rn_lat, nn_mld_uv, nn_conv, rn_rho_c_mle
330      !!----------------------------------------------------------------------
331
332      REWIND( numnam_ref )              ! Namelist namtra_mle in reference namelist : Tracer advection scheme
333      READ  ( numnam_ref, namtra_mle, IOSTAT = ios, ERR = 901)
334901   IF( ios /= 0 )   CALL ctl_nam ( ios , 'namtra_mle in reference namelist' )
335
336      REWIND( numnam_cfg )              ! Namelist namtra_mle in configuration namelist : Tracer advection scheme
337      READ  ( numnam_cfg, namtra_mle, IOSTAT = ios, ERR = 902 )
338902   IF( ios >  0 )   CALL ctl_nam ( ios , 'namtra_mle in configuration namelist' )
339      IF(lwm) WRITE ( numond, namtra_mle )
340
341      IF(lwp) THEN                     ! Namelist print
342         WRITE(numout,*)
343         WRITE(numout,*) 'tra_mle_init : mixed layer eddy (MLE) advection acting on tracers'
344         WRITE(numout,*) '~~~~~~~~~~~~~'
345         WRITE(numout,*) '   Namelist namtra_mle : mixed layer eddy advection applied on tracers'
346         WRITE(numout,*) '      use mixed layer eddy (MLE, i.e. Fox-Kemper param) (T/F)      ln_mle       = ', ln_mle
347         WRITE(numout,*) '         MLE type: =0 standard Fox-Kemper ; =1 new formulation        nn_mle    = ', nn_mle
348         WRITE(numout,*) '         magnitude of the MLE (typical value: 0.06 to 0.08)           rn_ce     = ', rn_ce
349         WRITE(numout,*) '         scale of ML front (ML radius of deformation) (rn_mle=0)      rn_lf     = ', rn_lf, 'm'
350         WRITE(numout,*) '         maximum time scale of MLE                    (rn_mle=0)      rn_time   = ', rn_time, 's'
351         WRITE(numout,*) '         reference latitude (degrees) of MLE coef.    (rn_mle=1)      rn_lat    = ', rn_lat, 'deg'
352         WRITE(numout,*) '         space interp. of MLD at u-(v-)pts (0=min,1=averaged,2=max)   nn_mld_uv = ', nn_mld_uv
353         WRITE(numout,*) '         =1 no MLE in case of convection ; =0 always MLE              nn_conv   = ', nn_conv
354         WRITE(numout,*) '         Density difference used to define ML for FK              rn_rho_c_mle  = ', rn_rho_c_mle
355      ENDIF
356      !
357      IF(lwp) THEN
358         WRITE(numout,*)
359         IF( ln_mle ) THEN
360            WRITE(numout,*) '   ==>>>   Mixed Layer Eddy induced transport added to tracer advection'
361            IF( nn_mle == 0 )   WRITE(numout,*) '              Fox-Kemper et al 2010 formulation'
362            IF( nn_mle == 1 )   WRITE(numout,*) '              New formulation'
363         ELSE
364            WRITE(numout,*) '   ==>>>   Mixed Layer Eddy parametrisation NOT used'
365         ENDIF
366      ENDIF
367      !
368      IF( ln_mle ) THEN                ! MLE initialisation
369         !
370         rb_c = grav * rn_rho_c_mle /rau0        ! Mixed Layer buoyancy criteria
371         IF(lwp) WRITE(numout,*)
372         IF(lwp) WRITE(numout,*) '      ML buoyancy criteria = ', rb_c, ' m/s2 '
373         IF(lwp) WRITE(numout,*) '      associated ML density criteria defined in zdfmxl = ', rho_c, 'kg/m3'
374         !
375         IF( nn_mle == 0 ) THEN           ! MLE array allocation & initialisation
376            ALLOCATE( rfu(jpi,jpj) , rfv(jpi,jpj) , STAT= ierr )
377            IF( ierr /= 0 )   CALL ctl_stop( 'tra_adv_mle_init: failed to allocate arrays' )
378            z1_t2 = 1._wp / ( rn_time * rn_time )
379            DO jj = 2, jpj                           ! "coriolis+ time^-1" at u- & v-points
380               DO ji = fs_2, jpi   ! vector opt.
381                  zfu = ( ff_f(ji,jj) + ff_f(ji,jj-1) ) * 0.5_wp
382                  zfv = ( ff_f(ji,jj) + ff_f(ji-1,jj) ) * 0.5_wp
383                  rfu(ji,jj) = SQRT(  zfu * zfu + z1_t2 )
384                  rfv(ji,jj) = SQRT(  zfv * zfv + z1_t2 )
385               END DO
386            END DO
387            CALL lbc_lnk_multi( 'tramle', rfu, 'U', 1. , rfv, 'V', 1. )
388            !
389         ELSEIF( nn_mle == 1 ) THEN           ! MLE array allocation & initialisation
390            rc_f = rn_ce / (  5.e3_wp * 2._wp * omega * SIN( rad * rn_lat )  )
391            !
392         ENDIF
393         !
394         !                                ! 1/(f^2+tau^2)^1/2 at t-point (needed in both nn_mle case)
395         ALLOCATE( r1_ft(jpi,jpj) , STAT= ierr )
396         IF( ierr /= 0 )   CALL ctl_stop( 'tra_adv_mle_init: failed to allocate r1_ft array' )
397         !
398         z1_t2 = 1._wp / ( rn_time * rn_time )
399         r1_ft(:,:) = 1._wp / SQRT(  ff_t(:,:) * ff_t(:,:) + z1_t2  )
400         !
401      ENDIF
402      !
403   END SUBROUTINE tra_mle_init
404
405   !!==============================================================================
406END MODULE tramle
Note: See TracBrowser for help on using the repository browser.