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.F90 in NEMO/branches/2021/dev_r14273_HPC-02_Daley_Tiling/src/OCE/TRA – NEMO

source: NEMO/branches/2021/dev_r14273_HPC-02_Daley_Tiling/src/OCE/TRA/traldf.F90 @ 14680

Last change on this file since 14680 was 14680, checked in by hadcv, 3 years ago

#2600: Merge in dev_r14393_HPC-03_Mele_Comm_Cleanup [14667]

  • Property svn:keywords set to Id
File size: 8.3 KB
Line 
1MODULE traldf
2   !!======================================================================
3   !!                       ***  MODULE  traldf  ***
4   !! Ocean Active tracers : lateral diffusive trends
5   !!=====================================================================
6   !! History :  9.0  ! 2005-11  (G. Madec)  Original code
7   !!  NEMO      3.0  ! 2008-01  (C. Ethe, G. Madec)  merge TRC-TRA
8   !!            3.7  ! 2013-12  (G. Madec) remove the optional computation from T & S anomaly profiles and traldf_bilapg
9   !!             -   ! 2013-12  (F. Lemarie, G. Madec)  triad operator (Griffies) + Method of Stabilizing Correction
10   !!             -   ! 2014-01  (G. Madec, S. Masson)  restructuration/simplification of lateral diffusive operators
11   !!----------------------------------------------------------------------
12
13   !!----------------------------------------------------------------------
14   !!   tra_ldf       : update the tracer trend with the lateral diffusion trend
15   !!   tra_ldf_init  : initialization, namelist read, and parameters control
16   !!----------------------------------------------------------------------
17   USE oce            ! ocean dynamics and tracers
18   USE dom_oce        ! ocean space and time domain
19   ! TEMP: [tiling] This change not necessary after lbc_lnks removed from tra_ldf_blp and zps_hde*
20   USE domtile
21   USE phycst         ! physical constants
22   USE ldftra         ! lateral diffusion: eddy diffusivity & EIV coeff.
23   USE ldfslp         ! lateral diffusion: iso-neutral slope
24   USE traldf_lap_blp ! lateral diffusion: laplacian iso-level            operator  (tra_ldf_lap/_blp   routines)
25   USE traldf_iso     ! lateral diffusion: laplacian iso-neutral standard operator  (tra_ldf_iso        routine )
26   USE traldf_triad   ! lateral diffusion: laplacian iso-neutral triad    operator  (tra_ldf_triad      routine )
27   USE trd_oce        ! trends: ocean variables
28   USE trdtra         ! ocean active tracers trends
29   !
30   USE prtctl         ! Print control
31   USE in_out_manager ! I/O manager
32   USE lib_mpp        ! distribued memory computing library
33   USE lbclnk         ! ocean lateral boundary conditions (or mpp link)
34   USE timing         ! Timing
35
36   IMPLICIT NONE
37   PRIVATE
38
39   PUBLIC   tra_ldf        ! called by step.F90
40   PUBLIC   tra_ldf_init   ! called by nemogcm.F90
41
42   !!----------------------------------------------------------------------
43   !! NEMO/OCE 4.0 , NEMO Consortium (2018)
44   !! $Id$
45   !! Software governed by the CeCILL license (see ./LICENSE)
46   !!----------------------------------------------------------------------
47CONTAINS
48
49   SUBROUTINE tra_ldf( kt, Kbb, Kmm, pts, Krhs )
50      !!----------------------------------------------------------------------
51      !!                  ***  ROUTINE tra_ldf  ***
52      !!
53      !! ** Purpose :   compute the lateral ocean tracer physics.
54      !!----------------------------------------------------------------------
55      INTEGER,                                   INTENT(in   ) :: kt              ! ocean time-step index
56      INTEGER,                                   INTENT(in   ) :: Kbb, Kmm, Krhs  ! ocean time level indices
57      REAL(wp), DIMENSION(jpi,jpj,jpk,jpts,jpt), INTENT(inout) :: pts             ! active tracers and RHS of tracer equation
58      !!
59      REAL(wp), ALLOCATABLE, DIMENSION(:,:,:) ::   ztrdt, ztrds
60      ! TEMP: [tiling] This change not necessary after lbc_lnks removed from tra_ldf_blp and zps_hde*
61      LOGICAL :: lskip
62      !!----------------------------------------------------------------------
63      !
64      IF( ln_timing )   CALL timing_start('tra_ldf')
65      !
66      lskip = .FALSE.
67
68      IF( l_trdtra )   THEN                    !* Save ta and sa trends
69         ALLOCATE( ztrdt(jpi,jpj,jpk) , ztrds(jpi,jpj,jpk) )
70         ztrdt(:,:,:) = pts(:,:,:,jp_tem,Krhs)
71         ztrds(:,:,:) = pts(:,:,:,jp_sal,Krhs)
72      ENDIF
73
74      ! TEMP: [tiling] These changes not necessary after lbc_lnks removed from tra_ldf_blp and zps_hde*
75      IF( nn_hls == 1 .AND. (nldf_tra == np_blp .OR. nldf_tra == np_blp_i .OR. nldf_tra == np_blp_it) )  THEN
76         IF( ln_tile ) THEN
77            IF( ntile == 1 ) THEN
78               CALL dom_tile_stop( ldhold=.TRUE., cstr='traldf' )
79            ELSE
80               lskip = .TRUE.
81            ENDIF
82         ENDIF
83      ENDIF
84      IF( .NOT. lskip ) THEN
85         !
86         SELECT CASE ( nldf_tra )                 !* compute lateral mixing trend and add it to the general trend
87         CASE ( np_lap   )                                  ! laplacian: iso-level operator
88            CALL tra_ldf_lap  ( kt, Kmm, nit000,'TRA', ahtu, ahtv, gtsu, gtsv, gtui, gtvi, pts(:,:,:,:,Kbb), pts(:,:,:,:,Krhs),                   jpts,  1 )
89         CASE ( np_lap_i )                                  ! laplacian: standard iso-neutral operator (Madec)
90            CALL tra_ldf_iso  ( kt, Kmm, nit000,'TRA', ahtu, ahtv, gtsu, gtsv, gtui, gtvi, pts(:,:,:,:,Kbb), pts(:,:,:,:,Kbb), pts(:,:,:,:,Krhs), jpts,  1 )
91         CASE ( np_lap_it )                                 ! laplacian: triad iso-neutral operator (griffies)
92            CALL tra_ldf_triad( kt, Kmm, nit000,'TRA', ahtu, ahtv, gtsu, gtsv, gtui, gtvi, pts(:,:,:,:,Kbb), pts(:,:,:,:,Kbb), pts(:,:,:,:,Krhs), jpts,  1 )
93         CASE ( np_blp , np_blp_i , np_blp_it )             ! bilaplacian: iso-level & iso-neutral operators
94            CALL tra_ldf_blp  ( kt, Kmm, nit000,'TRA', ahtu, ahtv, gtsu, gtsv, gtui, gtvi, pts(:,:,:,:,Kbb), pts(:,:,:,:,Krhs),             jpts, nldf_tra )
95         END SELECT
96         !
97         IF( l_trdtra )   THEN                    !* save the horizontal diffusive trends for further diagnostics
98            ztrdt(:,:,:) = pts(:,:,:,jp_tem,Krhs) - ztrdt(:,:,:)
99            ztrds(:,:,:) = pts(:,:,:,jp_sal,Krhs) - ztrds(:,:,:)
100            CALL trd_tra( kt, Kmm, Krhs, 'TRA', jp_tem, jptra_ldf, ztrdt )
101            CALL trd_tra( kt, Kmm, Krhs, 'TRA', jp_sal, jptra_ldf, ztrds )
102            DEALLOCATE( ztrdt, ztrds )
103         ENDIF
104
105         ! TEMP: [tiling] This change not necessary after lbc_lnks removed from tra_ldf_blp and zps_hde*
106         IF( ln_tile .AND. .NOT. l_istiled ) CALL dom_tile_start( ldhold=.TRUE., cstr='traldf' )
107      ENDIF
108      !                                        !* print mean trends (used for debugging)
109      IF(sn_cfctl%l_prtctl)   CALL prt_ctl( tab3d_1=pts(:,:,:,jp_tem,Krhs), clinfo1=' ldf  - Ta: ', mask1=tmask, &
110         &                                  tab3d_2=pts(:,:,:,jp_sal,Krhs), clinfo2=       ' Sa: ', mask2=tmask, clinfo3='tra' )
111      !
112      IF( ln_timing )   CALL timing_stop('tra_ldf')
113      !
114   END SUBROUTINE tra_ldf
115
116
117   SUBROUTINE tra_ldf_init
118      !!----------------------------------------------------------------------
119      !!                  ***  ROUTINE tra_ldf_init  ***
120      !!
121      !! ** Purpose :   Choice of the operator for the lateral tracer diffusion
122      !!
123      !! ** Method  :   set nldf_tra from the namtra_ldf logicals
124      !!----------------------------------------------------------------------
125      INTEGER ::   ioptio, ierr   ! temporary integers
126      !!----------------------------------------------------------------------
127      !
128      IF(lwp) THEN                     !==  Namelist print  ==!
129         WRITE(numout,*)
130         WRITE(numout,*) 'tra_ldf_init : lateral tracer diffusive operator'
131         WRITE(numout,*) '~~~~~~~~~~~~'
132         WRITE(numout,*) '   Namelist namtra_ldf: already read in ldftra module'
133         WRITE(numout,*) '      see ldf_tra_init report for lateral mixing parameters'
134         WRITE(numout,*)
135         !
136         SELECT CASE( nldf_tra )             ! print the choice of operator
137         CASE( np_no_ldf )   ;   WRITE(numout,*) '   ==>>>   NO lateral diffusion'
138         CASE( np_lap    )   ;   WRITE(numout,*) '   ==>>>   laplacian iso-level operator'
139         CASE( np_lap_i  )   ;   WRITE(numout,*) '   ==>>>   Rotated laplacian operator (standard)'
140         CASE( np_lap_it )   ;   WRITE(numout,*) '   ==>>>   Rotated laplacian operator (triad)'
141         CASE( np_blp    )   ;   WRITE(numout,*) '   ==>>>   bilaplacian iso-level operator'
142         CASE( np_blp_i  )   ;   WRITE(numout,*) '   ==>>>   Rotated bilaplacian operator (standard)'
143         CASE( np_blp_it )   ;   WRITE(numout,*) '   ==>>>   Rotated bilaplacian operator (triad)'
144         END SELECT
145      ENDIF
146      !
147   END SUBROUTINE tra_ldf_init
148
149   !!======================================================================
150END MODULE traldf
Note: See TracBrowser for help on using the repository browser.