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.
traldf_blp.F90 in branches/2015/dev_r5721_CNRS9_NOC3_LDF/NEMOGCM/NEMO/OPA_SRC/TRA – NEMO

source: branches/2015/dev_r5721_CNRS9_NOC3_LDF/NEMOGCM/NEMO/OPA_SRC/TRA/traldf_blp.F90 @ 5770

Last change on this file since 5770 was 5770, checked in by gm, 9 years ago

#1593: LDF-ADV, step II.2: phasing the improvements/simplifications of advective tracer trend (see wiki page)

File size: 8.2 KB
Line 
1MODULE traldf_blp
2   !!======================================================================
3   !!                   ***  MODULE  traldf_blp  ***
4   !! Ocean  tracers:  bilaplacian lateral mixing trend on tracers
5   !!======================================================================
6   !! History :  3.7  ! 2015-09  (G. Madec)  original code
7   !!----------------------------------------------------------------------
8
9   !!----------------------------------------------------------------------
10   !!   traldf_blp    : update the tracer trend with the bilaplacian lateral mixing trend
11   !!----------------------------------------------------------------------
12   USE oce            ! ocean dynamics and active tracers
13   USE dom_oce        ! ocean space and time domain
14   USE phycst         ! physical constants
15   USE trc_oce        ! share passive tracers/Ocean variables
16   USE zdf_oce        ! ocean vertical physics
17   USE ldftra         ! lateral physics: eddy diffusivity
18   USE ldfslp         ! lateral physics: iso-neutral slopes
19   USE traldf_lap     ! lateral diffusion (Standard operator)         (tra_ldf_lap   routine)
20   USE traldf_iso     ! lateral diffusion (Standard operator)         (tra_ldf_iso   routine)
21   USE traldf_triad   ! lateral diffusion (Standard operator)         (tra_ldf_triad routine)
22   USE diaptr         ! poleward transport diagnostics
23   USE zpshde         ! partial step: hor. derivative     (zps_hde routine)
24   !
25   USE in_out_manager ! I/O manager
26   USE iom            ! I/O library
27   USE lbclnk         ! ocean lateral boundary conditions (or mpp link)
28   USE lib_mpp        ! MPP library
29   USE wrk_nemo       ! Memory Allocation
30   USE timing         ! Timing
31
32   IMPLICIT NONE
33   PRIVATE
34
35   PUBLIC   tra_ldf_blp   ! routine called by traldf.F90
36
37   !                      ! Flag to control the type of lateral diffusive operator
38   INTEGER, PARAMETER, PUBLIC ::   np_no_ldf = 00   ! without operator (i.e. no lateral diffusive trend)
39   !                          !!      laplacian     !    bilaplacian    !
40   INTEGER, PARAMETER, PUBLIC ::   np_lap    = 10   ,   np_blp    = 20  ! iso-level operator
41   INTEGER, PARAMETER, PUBLIC ::   np_lap_i  = 11   ,   np_blp_i  = 21  ! standard iso-neutral or geopotential operator
42   INTEGER, PARAMETER, PUBLIC ::   np_lap_it = 12   ,   np_blp_it = 22  ! triad    iso-neutral or geopotential operator
43
44   REAL(wp), DIMENSION(:,:,:), ALLOCATABLE, SAVE ::   zdkt3d   !: vertical tracer gradient at 2 levels
45
46   !! * Substitutions
47#  include "domzgr_substitute.h90"
48#  include "vectopt_loop_substitute.h90"
49   !!----------------------------------------------------------------------
50   !! NEMO/OPA 3.7 , NEMO Consortium (2015)
51   !! $Id: traldf_iso_grif.F90 5147 2015-03-13 10:01:32Z cetlod $
52   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
53   !!----------------------------------------------------------------------
54CONTAINS
55
56   SUBROUTINE tra_ldf_blp( kt, kit000, cdtype, pahu, pahv, pgu , pgv ,   &
57      &                                                    pgui, pgvi,   &
58      &                                                    ptb , pta , kjpt, kldf )
59      !!----------------------------------------------------------------------
60      !!                 ***  ROUTINE tra_ldf_blp  ***
61      !!                   
62      !! ** Purpose :   Compute the before lateral tracer diffusive
63      !!      trend and add it to the general trend of tracer equation.
64      !!
65      !! ** Method  :   The lateral diffusive trends is provided by a bilaplacian
66      !!      operator applied to before field (forward in time).
67      !!      It is computed by two successive calls to laplacian routine
68      !!
69      !! ** Action :   pta   updated with the before rotated bilaplacian diffusion
70      !!----------------------------------------------------------------------
71      INTEGER                              , INTENT(in   ) ::   kt         ! ocean time-step index
72      INTEGER                              , INTENT(in   ) ::   kit000     ! first time step index
73      CHARACTER(len=3)                     , INTENT(in   ) ::   cdtype     ! =TRA or TRC (tracer indicator)
74      INTEGER                              , INTENT(in   ) ::   kjpt       ! number of tracers
75      INTEGER                              , INTENT(in   ) ::   kldf       ! type of operator used
76      REAL(wp), DIMENSION(jpi,jpj,jpk)     , INTENT(in   ) ::   pahu, pahv ! eddy diffusivity at u- and v-points  [m2/s]
77      REAL(wp), DIMENSION(jpi,jpj    ,kjpt), INTENT(in   ) ::   pgu, pgv   ! tracer gradient at pstep levels
78      REAL(wp), DIMENSION(jpi,jpj,    kjpt), INTENT(in   ) ::   pgui, pgvi ! tracer gradient at top levels
79      REAL(wp), DIMENSION(jpi,jpj,jpk,kjpt), INTENT(in   ) ::   ptb        ! before and now tracer fields
80      REAL(wp), DIMENSION(jpi,jpj,jpk,kjpt), INTENT(inout) ::   pta        ! tracer trend
81      !
82      INTEGER ::   ji, jj, jk, jn   ! dummy loop indices
83      REAL(wp), POINTER, DIMENSION(:,:,:,:) :: zlap         ! laplacian at t-point
84      REAL(wp), POINTER, DIMENSION(:,:,:)   :: zglu, zglv   ! bottom GRADh of the laplacian (u- and v-points)
85      REAL(wp), POINTER, DIMENSION(:,:,:)   :: zgui, zgvi   ! top    GRADh of the laplacian (u- and v-points)
86      !!---------------------------------------------------------------------
87      !
88      IF( nn_timing == 1 )  CALL timing_start('tra_ldf_blp')
89      !
90      CALL wrk_alloc( jpi,jpj,jpk,kjpt,   zlap ) 
91      CALL wrk_alloc( jpi,jpj,    kjpt,   zglu, zglv, zgui, zgvi ) 
92      !
93      IF( kt == kit000 .AND. lwp )  THEN
94         WRITE(numout,*)
95         SELECT CASE ( kldf )
96         CASE ( np_blp    )   ;   WRITE(numout,*) 'tra_ldf_blp : iso-level   bilaplacian operator on ', cdtype
97         CASE ( np_blp_i  )   ;   WRITE(numout,*) 'tra_ldf_blp : iso-neutral bilaplacian operator on ', cdtype, ' (Standard)'
98         CASE ( np_blp_it )   ;   WRITE(numout,*) 'tra_ldf_blp : iso-neutral bilaplacian operator on ', cdtype, ' (triad)'
99         END SELECT
100         WRITE(numout,*) '~~~~~~~~~~~'
101      ENDIF
102
103      zlap(:,:,:,:) = 0._wp
104      !
105      SELECT CASE ( kldf )       !==  1st laplacian applied to ptb (output in zlap)  ==!
106      !
107      CASE ( np_blp    )               ! iso-level bilaplacian
108         CALL tra_ldf_lap  ( kt, kit000, cdtype, pahu, pahv, pgu, pgv, pgui, pgvi, ptb,      zlap, kjpt, 1 )
109         !
110      CASE ( np_blp_i  )               ! rotated   bilaplacian : standard operator (Madec)
111         CALL tra_ldf_iso  ( kt, kit000, cdtype, pahu, pahv, pgu, pgv, pgui, pgvi, ptb, ptb, zlap, kjpt, 1 )
112         !
113      CASE ( np_blp_it )               ! rotated  bilaplacian : triad operator (griffies)
114         CALL tra_ldf_triad( kt, kit000, cdtype, pahu, pahv, pgu, pgv, pgui, pgvi, ptb, ptb, zlap, kjpt, 1 )
115         !
116      END SELECT
117      !
118      DO jn = 1, kjpt
119         CALL lbc_lnk( zlap(:,:,:,jn) , 'T', 1. )     ! Lateral boundary conditions (unchanged sign)
120      END DO
121      !                                               ! Partial top/bottom cell: GRADh( zlap ) 
122      IF( ln_isfcav .AND. ln_zps ) THEN   ;   CALL zps_hde_isf( kt, kjpt, zlap, zglu, zglv, zgui, zgvi )  ! both top & bottom
123      ELSEIF(             ln_zps ) THEN   ;   CALL zps_hde    ( kt, kjpt, zlap, zglu, zglv )              ! only bottom
124      ENDIF
125      !
126      SELECT CASE ( kldf )       !==  2nd laplacian applied to zlap (output in pta)  ==!
127      !
128      CASE ( np_blp    )               ! iso-level bilaplacian
129         CALL tra_ldf_lap  ( kt, kit000, cdtype, pahu, pahv, zglu, zglv, zgui, zgvi, zlap, pta,      kjpt, 2 )
130         !
131      CASE ( np_blp_i  )               ! rotated   bilaplacian : standard operator (Madec)
132         CALL tra_ldf_iso  ( kt, kit000, cdtype, pahu, pahv, zglu, zglv, zgui, zgvi, zlap, ptb, pta, kjpt, 2 )
133         !
134      CASE ( np_blp_it )               ! rotated  bilaplacian : triad operator (griffies)
135         CALL tra_ldf_triad( kt, kit000, cdtype, pahu, pahv, zglu, zglv, zgui, zgvi, zlap, ptb, pta, kjpt, 2 )
136         !
137      END SELECT
138      !
139      CALL wrk_dealloc( jpi,jpj,jpk,kjpt,   zlap ) 
140      CALL wrk_dealloc( jpi,jpj    ,kjpt,   zglu, zglv, zgui, zgvi ) 
141      !
142      IF( nn_timing == 1 )  CALL timing_stop('tra_ldf_blp')
143      !
144   END SUBROUTINE tra_ldf_blp
145
146   !!==============================================================================
147END MODULE traldf_blp
Note: See TracBrowser for help on using the repository browser.