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.
Changeset 1175 for trunk/NEMO/TOP_SRC/TRP/trcldf_lap.F90 – NEMO

Ignore:
Timestamp:
2008-09-11T18:26:34+02:00 (16 years ago)
Author:
cetlod
Message:

update transport modules to take into account new trends organization, see ticket:248

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/NEMO/TOP_SRC/TRP/trcldf_lap.F90

    r1152 r1175  
    11MODULE trcldf_lap 
    2    !!============================================================================== 
     2   !!====================================================================== 
    33   !!                       ***  MODULE  trcldf_lap  *** 
    44   !! Ocean passive tracers:  horizontal component of the lateral tracer mixing trend 
    5    !!============================================================================== 
     5   !!====================================================================== 
     6   !! History :  1.0  !  87-06  (P. Andrich, D. L Hostis)  Original code 
     7   !!                 !  91-11  (G. Madec) 
     8   !!                 !  95-02  (M. Levy)    passive tracers 
     9   !!                 !  95-11  (G. Madec)  suppress volumetric scale factors 
     10   !!                 !  96-01  (G. Madec)  statement function for e3 
     11   !!            8.5  !  02-06  (G. Madec)  F90: Free form and module 
     12   !!            9.0  !  04-03  (C. Ethe)   passive tracer 
     13   !!                 !  07-02  (C. Deltel)  Diagnose ML trends for passive tracers 
     14   !!---------------------------------------------------------------------- 
    615#if defined key_top 
    7    !!---------------------------------------------------------------------- 
    8    !!   'key_top'                                                TOP models 
    916   !!---------------------------------------------------------------------- 
    1017   !!   trc_ldf_lap  : update the tracer trend with the horizontal diffusion 
     
    1421   USE trp_trc                 ! ocean passive tracers variables 
    1522   USE prtctl_trc          ! Print control for debbuging 
     23   USE trdmld_trc 
     24   USE trdmld_trc_oce      
    1625 
    1726   IMPLICIT NONE 
     
    2534   !!---------------------------------------------------------------------- 
    2635   !!   TOP 1.0 , LOCEAN-IPSL (2005)  
    27    !! $Id$  
    28    !! This software is governed by the CeCILL licence see modipsl/doc/NEMO_CeCILL.txt  
     36   !! $Header: /home/opalod/NEMOCVSROOT/NEMO/TOP_SRC/TRP/trcldf_lap.F90,v 1.10 2006/09/12 11:10:14 opalod Exp $  
     37   !! Software governed by the CeCILL licence (modipsl/doc/NEMO_CeCILL.txt) 
    2938   !!---------------------------------------------------------------------- 
    3039    
     
    5362      !! ** Action  : - Update tra arrays with the before iso-level  
    5463      !!                harmonic mixing trend. 
    55       !!              - Save the trends in trtrd ('key_trc_diatrd') 
    56       !! 
    57       !! History : 
    58       !!   1.0  !  87-06  (P. Andrich, D. L Hostis)  Original code 
    59       !!        !  91-11  (G. Madec) 
    60       !!        !  95-02  (M. Levy)    passive tracers 
    61       !!        !  95-11  (G. Madec)  suppress volumetric scale factors 
    62       !!        !  96-01  (G. Madec)  statement function for e3 
    63       !!   8.5  !  02-06  (G. Madec)  F90: Free form and module 
    64       !!   9.0  !  04-03  (C. Ethe)   passive tracer 
     64      !!              - Save the trends ('key_trdmld_trc') 
    6565      !!---------------------------------------------------------------------- 
    6666      USE oce_trc          , ztu => ua,  &  ! use ua as workspace 
    6767         &                   ztv => va      ! use va as workspace 
    6868 
    69       !! * Arguments 
    7069      INTEGER, INTENT( in ) ::   kt       ! ocean time-step index 
    71        
     70 
    7271      !! * Local save 
    7372      REAL(wp), DIMENSION(jpi,jpj), SAVE ::   & 
    7473         ze1ur, ze2vr, zbtr2              ! scale factor coefficients 
    7574       
    76       !! * Local declarations 
    77       INTEGER ::   ji, jj, jk,jn         ! dummy loop indices 
     75      INTEGER ::   ji, jj, jk, jn         ! dummy loop indices 
    7876      REAL(wp) ::   & 
    79          zabe1, zabe2, zbtr              ! temporary scalars 
     77         zabe1, zabe2, zbtr               ! temporary scalars 
    8078 
    8179      REAL(wp) ::   & 
    82          ztra, ztrax, ztray              ! workspace 
     80         ztra, ztrax, ztray               ! workspace 
    8381      CHARACTER (len=22) :: charout 
     82      REAL(wp), DIMENSION(:,:,:), ALLOCATABLE ::   ztrtrd 
    8483      !!---------------------------------------------------------------------- 
    8584       
     
    9291         zbtr2(:,:) = 1. / ( e1t(:,:) * e2t(:,:) ) 
    9392      ENDIF 
    94   
    95       DO jn = 1, jptra 
     93 
     94      IF( l_trdtrc ) THEN 
     95!         STOP 'trcldf_lap: this was never validated, please comment this line to proceed...' 
     96      ENDIF 
     97 
     98      IF( l_trdtrc ) ALLOCATE( ztrtrd(jpi,jpj,jpk) ) 
     99 
     100      !                                                          ! =========== 
     101      DO jn = 1, jptra                                           ! tracer loop 
     102         !                                                       ! =========== 
     103         IF( l_trdtrc ) ztrtrd(:,:,:) = tra(:,:,:,jn) 
    96104          
    97105         !                                                  ! ============= 
     
    99107            !                                               ! ============= 
    100108            ! 1. First derivative (gradient) 
    101             ! ------------------- 
     109            ! ------------------------------ 
    102110            DO jj = 1, jpjm1 
    103111               DO ji = 1, fs_jpim1   ! vector opt. 
     
    116124 
    117125            ! 2. Second derivative (divergence) 
    118             ! -------------------- 
     126            ! --------------------------------- 
    119127            DO jj = 2, jpjm1 
    120128               DO ji = fs_2, fs_jpim1   ! vector opt. 
     
    130138                  ! add it to the general tracer trends 
    131139                  tra(ji,jj,jk,jn) = tra(ji,jj,jk,jn) + ztrax + ztray 
    132  
    133140#if defined key_trc_diatrd 
    134141                  ! save the horizontal diffusive trends 
     
    136143                  IF (luttrd(jn)) trtrd(ji,jj,jk,ikeep(jn),5) = ztray 
    137144#endif 
     145 
    138146               END DO 
    139147            END DO 
     
    141149         END DO                                             !  End of slab   
    142150         !                                                  ! ============= 
     151         IF( l_trdtrc ) THEN 
     152            ztrtrd(:,:,:) = tra(:,:,:,jn) - ztrtrd(:,:,:) 
     153            IF (luttrd(jn)) CALL trd_mod_trc( ztrtrd, jn, jptrc_trd_ldf, kt )   ! trends diags 
     154         END IF 
     155         !                                                       ! =========== 
     156      END DO                                                     ! tracer loop 
     157      !                                                          ! =========== 
    143158 
    144       END DO 
     159      IF( l_trdtrc ) DEALLOCATE( ztrtrd ) 
    145160 
    146      IF(ln_ctl)   THEN  ! print mean trends (used for debugging) 
     161      IF( ln_ctl ) THEN    ! print mean trends (used for debugging) 
    147162         WRITE(charout, FMT="('ldf - lap')") 
    148          CALL prt_ctl_trc_info(charout) 
    149          CALL prt_ctl_trc(tab4d=tra, mask=tmask, clinfo=ctrcnm,clinfo2='trd') 
     163         CALL prt_ctl_trc_info( charout ) 
     164         CALL prt_ctl_trc( tab4d=tra, mask=tmask, clinfo=ctrcnm, clinfo2='trd' ) 
    150165      ENDIF 
    151166 
Note: See TracChangeset for help on using the changeset viewer.