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/trcdmp.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/trcdmp.F90

    r1152 r1175  
    44   !! Ocean physics: internal restoring trend on passive tracers 
    55   !!====================================================================== 
    6 #if  defined key_top  &&  defined key_trcdmp  
     6   !! History :  7.0  !         (G. Madec)  Original code 
     7   !!                 !  96-01  (G. Madec)  
     8   !!                 !  97-05  (H. Loukos)  adapted for passive tracers 
     9   !!            8.5  !  02-08  (G. Madec )  free form + modules 
     10   !!            9.0  !  04-03  (C. Ethe)    free form + modules 
     11   !!                 !  07-02  (C. Deltel)  Diagnose ML trends for passive tracers 
    712   !!---------------------------------------------------------------------- 
    8    !!   'key_top'                                                TOP models 
    9    !!   'key_trcdmp'                                       internal damping 
     13#if  defined key_top && defined key_trcdmp  
     14   !!---------------------------------------------------------------------- 
     15   !!   key_trcdmp                                         internal damping 
    1016   !!---------------------------------------------------------------------- 
    1117   !!   trc_dmp      : update the tracer trend with the internal damping 
     
    1622   !!---------------------------------------------------------------------- 
    1723   USE oce_trc         ! ocean dynamics and tracers variables 
    18    USE trp_trc             ! ocean passive tracers variables 
     24   USE trc             ! ocean passive tracers variables 
    1925   USE trctrp_lec      ! passive tracers transport 
    2026   USE trcdta 
    2127   USE prtctl_trc      ! Print control for debbuging 
     28   USE trdmld_trc 
     29   USE trdmld_trc_oce      
    2230 
    2331   IMPLICIT NONE 
    2432   PRIVATE 
    2533 
    26    !! * Routine accessibility 
    27    PUBLIC trc_dmp   ! routine called by step.F90 
    28  
    29    !! * Shared module variables 
    30    LOGICAL , PUBLIC, PARAMETER ::   lk_trcdmp = .TRUE.    !: internal damping flag 
    31  
    32    REAL(wp), DIMENSION(jpi,jpj,jpk,jptra) ::   & 
    33       restotr         ! restoring coeff. on tracers (s-1) 
     34   PUBLIC trc_dmp      ! routine called by step.F90 
     35 
     36   LOGICAL , PUBLIC, PARAMETER ::   lk_trcdmp = .TRUE.   !: internal damping flag 
     37   REAL(wp), DIMENSION(jpi,jpj,jpk,jptra) ::   restotr   ! restoring coeff. on tracers (s-1) 
    3438 
    3539   !! * Substitutions 
     
    3741   !!---------------------------------------------------------------------- 
    3842   !!   TOP 1.0 , LOCEAN-IPSL (2005)  
    39    !! $Id$  
    40    !! This software is governed by the CeCILL licence see modipsl/doc/NEMO_CeCILL.txt  
     43   !! $Header: /home/opalod/NEMOCVSROOT/NEMO/TOP_SRC/TRP/trcdmp.F90,v 1.11 2006/09/01 14:03:49 opalod Exp $  
     44   !! Software governed by the CeCILL licence (modipsl/doc/NEMO_CeCILL.txt) 
    4145   !!---------------------------------------------------------------------- 
    4246 
     
    6064      !! ** Action  : - update the tracer trends tra with the newtonian  
    6165      !!                damping trends. 
    62       !!              - save the trends in trtrd ('key_trc_diatrd') 
    63       !! 
    64       !! History : 
    65       !!   7.0  !         (G. Madec)  Original code 
    66       !!        !  96-01  (G. Madec)  
    67       !!        !  97-05  (H. Loukos)  adapted for passive tracers 
    68       !!   8.5  !  02-08  (G. Madec )  free form + modules 
    69       !!   9.0  !  04-03  (C. Ethe)    free form + modules 
    70       !!---------------------------------------------------------------------- 
    71       !! * Arguments 
     66      !!              - save the trends ('key_trdmld_trc') 
     67      !!---------------------------------------------------------------------- 
     68      USE oce, ONLY :   ztrtrd => ua  ! use ua as 3D workspace    
     69      !! 
    7270      INTEGER, INTENT( in ) ::   kt      ! ocean time-step index 
    73  
    74       !! * Local declarations 
    75       INTEGER  ::   ji, jj, jk, jn     ! dummy loop indices 
    76       REAL(wp) ::   ztest, ztra, zdt   ! temporary scalars 
     71      INTEGER  ::   ji, jj, jk, jn       ! dummy loop indices 
     72      REAL(wp) ::   ztest, ztra !!!, zdt    ! temporary scalars 
    7773      CHARACTER (len=22) :: charout 
    7874      !!---------------------------------------------------------------------- 
     
    8278      IF( kt == nittrc000 ) CALL trc_dmp_init 
    8379 
     80 
    8481      ! 1. Newtonian damping trends on tracer fields 
    8582      ! -------------------------------------------- 
     
    8986 
    9087      ! Initialize the input fields for newtonian damping 
    91       CALL trc_dta( kt ) 
    92  
    93       DO jn = 1, jptra 
     88      CALL dta_trc( kt ) 
     89 
     90      !                                                          ! =========== 
     91      DO jn = 1, jptra                                           ! tracer loop 
     92         !                                                       ! =========== 
     93         IF( l_trdtrc ) ztrtrd(:,:,:) = tra(:,:,:,jn)    ! save trends  
    9494 
    9595         IF( lutini(jn) ) THEN 
     
    106106!!                        trn(ji,jj,jk,jn) = trn(ji,jj,jk,jn) + ztra * zdt 
    107107                        tra(ji,jj,jk,jn) = tra(ji,jj,jk,jn) + ztra 
    108 #    if defined key_trc_diatrd 
    109                         ! save the trends for diagnostics 
    110                         IF (luttrd(jn)) trtrd(ji,jj,jk,ikeep(jn),jpdiatrc-1) = ztra 
    111 #    endif 
    112108                     END DO 
    113109                  END DO 
     
    129125#    if defined key_trc_diatrd 
    130126                        ! save the trends for diagnostics 
    131                         IF (luttrd(jn)) trtrd(ji,jj,jk,ikeep(jn),jpdiatrc-1) = ztra 
     127                        IF (luttrd(jn)) trtrd(ji,jj,jk,ikeep(jn),jpdiatrc) = ztra 
    132128#    endif 
     129 
    133130                     END DO 
    134131                  END DO 
     
    149146#    if defined key_trc_diatrd 
    150147                        ! save the trends for diagnostics 
    151                         IF (luttrd(jn)) trtrd(ji,jj,jk,ikeep(jn),jpdiatrc-1) = ztra 
     148                        IF (luttrd(jn)) trtrd(ji,jj,jk,ikeep(jn),jpdiatrc) = ztra 
    152149#    endif 
     150 
    153151                     END DO 
    154152                  END DO 
     
    159157         ENDIF 
    160158 
    161       END DO 
    162  
    163      IF(ln_ctl)   THEN  ! print mean trends (used for debugging) 
     159         IF( l_trdtrc ) THEN 
     160            ztrtrd(:,:,:) = tra(:,:,:,jn) -  ztrtrd(:,:,:) 
     161            IF (luttrd(jn)) CALL trd_mod_trc( ztrtrd, jn, jptrc_trd_dmp, kt )        ! trends diags. 
     162         END IF 
     163         !                                                       ! =========== 
     164      END DO                                                     ! tracer loop 
     165      !                                                          ! =========== 
     166 
     167      IF( ln_ctl ) THEN    ! print mean trends (used for debugging) 
    164168         WRITE(charout, FMT="('dmp')") 
    165          CALL prt_ctl_trc_info(charout) 
    166          CALL prt_ctl_trc(tab4d=tra, mask=tmask, clinfo=ctrcnm,clinfo2='trd') 
     169         CALL prt_ctl_trc_info( charout ) 
     170         CALL prt_ctl_trc( tab4d=tra, mask=tmask, clinfo=ctrcnm,clinfo2='trd' ) 
    167171      ENDIF 
    168172   
     
    180184      !! ** Method  :   read the nammbf namelist and check the parameters 
    181185      !!      called by trc_dmp at the first timestep (nit000) 
    182       !! 
    183       !! History : 
    184       !!   8.5  !  02-08  (G. Madec)  Original code 
    185186      !!---------------------------------------------------------------------- 
    186187 
     
    194195 
    195196      CASE DEFAULT 
    196          WRITE(ctmp1,*) '          bad flag value for ndmp = ', ndmp 
     197         WRITE(ctmp1,*) '          bad flag value for ndmptr = ', ndmptr 
    197198         CALL ctl_stop(ctmp1) 
    198199 
     
    212213 
    213214      CASE DEFAULT 
    214          WRITE(ctmp1,*) '          bad flag value for nmldmp = ', nmldmp 
     215         WRITE(ctmp1,*) '          bad flag value for nmldmptr = ', nmldmptr 
    215216         CALL ctl_stop(ctmp1) 
    216217 
    217  
    218218      END SELECT 
    219219 
    220  
    221       ! 3. Damping coefficients initialization 
    222      ! -------------------------------------- 
    223  
    224          IF( lzoom ) THEN 
    225             CALL trccof_zoom 
    226          ELSE 
    227             CALL trccof 
    228          ENDIF 
     220      ! Damping coefficients initialization 
     221      ! ----------------------------------- 
     222      IF( lzoom ) THEN 
     223         CALL trccof_zoom 
     224      ELSE 
     225         CALL trccof 
     226      ENDIF 
    229227  
    230228   END SUBROUTINE trc_dmp_init 
     
    357355         icot         ! logical unit for file distance to the coast 
    358356 
    359       CHARACTER (len=32) ::  clname, clname2, clname3 
     357      CHARACTER (len=32) ::  clname3 
    360358      REAL(wp) ::   & 
    361359         zdate0, zinfl, zlon,         & ! temporary scalars 
Note: See TracChangeset for help on using the changeset viewer.