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/trunk/src/OCE/TRA – NEMO

source: NEMO/trunk/src/OCE/TRA/traldf.F90 @ 14090

Last change on this file since 14090 was 14090, checked in by hadcv, 4 years ago

#2365: Move dom_tile into domtile.F90

  • Property svn:keywords set to Id
File size: 8.6 KB
RevLine 
[458]1MODULE traldf
2   !!======================================================================
3   !!                       ***  MODULE  traldf  ***
[14072]4   !! Ocean Active tracers : lateral diffusive trends
[458]5   !!=====================================================================
[5836]6   !! History :  9.0  ! 2005-11  (G. Madec)  Original code
[14072]7   !!  NEMO      3.0  ! 2008-01  (C. Ethe, G. Madec)  merge TRC-TRA
[5836]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
[458]11   !!----------------------------------------------------------------------
[503]12
13   !!----------------------------------------------------------------------
[6140]14   !!   tra_ldf       : update the tracer trend with the lateral diffusion trend
15   !!   tra_ldf_init  : initialization, namelist read, and parameters control
[458]16   !!----------------------------------------------------------------------
[6140]17   USE oce            ! ocean dynamics and tracers
18   USE dom_oce        ! ocean space and time domain
[13982]19   ! TEMP: [tiling] This change not necessary after extra haloes development (lbc_lnk removed from tra_ldf_blp, zps_hde*)
[14090]20   USE domtile
[6140]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
[4990]29   !
[5836]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
[458]35
36   IMPLICIT NONE
37   PRIVATE
38
[14072]39   PUBLIC   tra_ldf        ! called by step.F90
40   PUBLIC   tra_ldf_init   ! called by nemogcm.F90
[13982]41
[503]42   !!----------------------------------------------------------------------
[9570]43   !! NEMO/OCE 4.0 , NEMO Consortium (2018)
[14072]44   !! $Id$
[10068]45   !! Software governed by the CeCILL license (see ./LICENSE)
[503]46   !!----------------------------------------------------------------------
[458]47CONTAINS
48
[12377]49   SUBROUTINE tra_ldf( kt, Kbb, Kmm, pts, Krhs )
[458]50      !!----------------------------------------------------------------------
51      !!                  ***  ROUTINE tra_ldf  ***
[14072]52      !!
[458]53      !! ** Purpose :   compute the lateral ocean tracer physics.
54      !!----------------------------------------------------------------------
[12377]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
[503]58      !!
[9019]59      REAL(wp), ALLOCATABLE, DIMENSION(:,:,:) ::   ztrdt, ztrds
[13982]60      ! TEMP: [tiling] This change not necessary after extra haloes development (lbc_lnk removed from tra_ldf_blp, zps_hde*)
61      LOGICAL :: lskip
[458]62      !!----------------------------------------------------------------------
[3294]63      !
[9019]64      IF( ln_timing )   CALL timing_start('tra_ldf')
[3294]65      !
[13982]66      lskip = .FALSE.
67
[2528]68      IF( l_trdtra )   THEN                    !* Save ta and sa trends
[13982]69         ALLOCATE( ztrdt(jpi,jpj,jpk) , ztrds(jpi,jpj,jpk) )
70         ztrdt(:,:,:) = pts(:,:,:,jp_tem,Krhs)
[12377]71         ztrds(:,:,:) = pts(:,:,:,jp_sal,Krhs)
[458]72      ENDIF
[13982]73
74      ! TEMP: [tiling] These changes not necessary after extra haloes development (lbc_lnk removed from tra_ldf_blp, zps_hde*)
75      IF( 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( ntsi, ntsj, ntei, ntej, ktile = 0 )
79            ELSE
80               lskip = .TRUE.
81            ENDIF
82         ENDIF
[458]83      ENDIF
[13982]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            ! NOTE: [tiling-comms-merge] This lbc_lnk is still needed in the zco case, because zps_hde is not called in step
95            IF(nn_hls.EQ.2) CALL lbc_lnk( 'tra_ldf', pts(:,:,:,:,Kbb), 'T',1.)
96            CALL tra_ldf_blp  ( kt, Kmm, nit000,'TRA', ahtu, ahtv, gtsu, gtsv, gtui, gtvi, pts(:,:,:,:,Kbb), pts(:,:,:,:,Krhs),             jpts, nldf_tra )
97         END SELECT
98         !
99         IF( l_trdtra )   THEN                    !* save the horizontal diffusive trends for further diagnostics
100            ztrdt(:,:,:) = pts(:,:,:,jp_tem,Krhs) - ztrdt(:,:,:)
101            ztrds(:,:,:) = pts(:,:,:,jp_sal,Krhs) - ztrds(:,:,:)
102            CALL trd_tra( kt, Kmm, Krhs, 'TRA', jp_tem, jptra_ldf, ztrdt )
103            CALL trd_tra( kt, Kmm, Krhs, 'TRA', jp_sal, jptra_ldf, ztrds )
104            DEALLOCATE( ztrdt, ztrds )
105         ENDIF
106
107         ! TEMP: [tiling] This change not necessary after extra haloes development (lbc_lnk removed from tra_ldf_blp, zps_hde*)
108         IF( ln_tile .AND. ntile == 0 ) CALL dom_tile( ntsi, ntsj, ntei, ntej, ktile = 1 )
109      ENDIF
[5836]110      !                                        !* print mean trends (used for debugging)
[13982]111      IF(sn_cfctl%l_prtctl)   CALL prt_ctl( tab3d_1=pts(:,:,:,jp_tem,Krhs), clinfo1=' ldf  - Ta: ', mask1=tmask, &
[12377]112         &                                  tab3d_2=pts(:,:,:,jp_sal,Krhs), clinfo2=       ' Sa: ', mask2=tmask, clinfo3='tra' )
[503]113      !
[9019]114      IF( ln_timing )   CALL timing_stop('tra_ldf')
[3294]115      !
[458]116   END SUBROUTINE tra_ldf
117
118
[2528]119   SUBROUTINE tra_ldf_init
[458]120      !!----------------------------------------------------------------------
[2528]121      !!                  ***  ROUTINE tra_ldf_init  ***
[14072]122      !!
[458]123      !! ** Purpose :   Choice of the operator for the lateral tracer diffusion
124      !!
[9490]125      !! ** Method  :   set nldf_tra from the namtra_ldf logicals
[458]126      !!----------------------------------------------------------------------
[14072]127      INTEGER ::   ioptio, ierr   ! temporary integers
[458]128      !!----------------------------------------------------------------------
[5836]129      !
[9019]130      IF(lwp) THEN                     !==  Namelist print  ==!
[458]131         WRITE(numout,*)
[2528]132         WRITE(numout,*) 'tra_ldf_init : lateral tracer diffusive operator'
[7646]133         WRITE(numout,*) '~~~~~~~~~~~~'
[6140]134         WRITE(numout,*) '   Namelist namtra_ldf: already read in ldftra module'
135         WRITE(numout,*) '      see ldf_tra_init report for lateral mixing parameters'
[9490]136         WRITE(numout,*)
[5836]137         !
[9490]138         SELECT CASE( nldf_tra )             ! print the choice of operator
[9190]139         CASE( np_no_ldf )   ;   WRITE(numout,*) '   ==>>>   NO lateral diffusion'
140         CASE( np_lap    )   ;   WRITE(numout,*) '   ==>>>   laplacian iso-level operator'
141         CASE( np_lap_i  )   ;   WRITE(numout,*) '   ==>>>   Rotated laplacian operator (standard)'
142         CASE( np_lap_it )   ;   WRITE(numout,*) '   ==>>>   Rotated laplacian operator (triad)'
143         CASE( np_blp    )   ;   WRITE(numout,*) '   ==>>>   bilaplacian iso-level operator'
144         CASE( np_blp_i  )   ;   WRITE(numout,*) '   ==>>>   Rotated bilaplacian operator (standard)'
145         CASE( np_blp_it )   ;   WRITE(numout,*) '   ==>>>   Rotated bilaplacian operator (triad)'
[6140]146         END SELECT
[458]147      ENDIF
[503]148      !
[2528]149   END SUBROUTINE tra_ldf_init
[458]150
151   !!======================================================================
[620]152END MODULE traldf
Note: See TracBrowser for help on using the repository browser.