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 1836 for trunk/NEMO/TOP_SRC/trcwri.F90 – NEMO

Ignore:
Timestamp:
2010-04-14T14:26:33+02:00 (14 years ago)
Author:
cetlod
Message:

improvment of PISCES model, see ticket:661

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/NEMO/TOP_SRC/trcwri.F90

    r1656 r1836  
    11MODULE trcwri 
    2    !!====================================================================== 
     2   !!=================================================================================== 
    33   !!                       *** MODULE trcwri *** 
    4    !!    TOP :   Output of passive tracers  
    5    !!====================================================================== 
    6    !!             1.0  !   
    7    !!                  !  2009-05 (C. Ethe ) 
     4   !!    TOP :   Output of passive tracers 
     5   !!==================================================================================== 
     6   !! History :   1.0  !  2009-05 (C. Ethe)  Original code 
     7   !!                  !  2010-03 (C. Ethe, R. Seferian ) Add the tracer transport trends 
    88   !!---------------------------------------------------------------------- 
    99#if defined key_top &&  defined key_iomput 
     
    1111   !!   'key_top' && 'key_iomput'                              TOP models 
    1212   !!---------------------------------------------------------------------- 
    13    !! trc_wri     :  outputs of concentration fields 
     13   !! trc_wri_trc   :  outputs of concentration fields 
     14   !! trc_wri_trd   :  outputs of transport trends 
    1415   !!---------------------------------------------------------------------- 
     16   USE dom_oce         ! ocean space and time domain variables 
     17   USE oce_trc 
     18   USE trp_trc 
    1519   USE trc 
     20   USE trdmld_trc_oce, ONLY : luttrd 
    1621   USE iom 
    1722#if defined key_off_tra 
     
    3540CONTAINS 
    3641 
    37    SUBROUTINE trc_wri( kt )   
     42   SUBROUTINE trc_wri( kt ) 
    3843      !!--------------------------------------------------------------------- 
    3944      !!                     ***  ROUTINE trc_wri  *** 
     45      !!  
     46      !! ** Purpose :   output passive tracers fields and dynamical trends 
     47      !!--------------------------------------------------------------------- 
     48      INTEGER, INTENT( in ) :: kt 
     49      !!--------------------------------------------------------------------- 
     50 
     51      ! 
     52      CALL iom_setkt  ( kt + ndttrc - 1 )       ! set the passive tracer time step 
     53      CALL trc_wri_trc( kt              )       ! outputs for tracer concentration 
     54      CALL trc_wri_trd( kt              )       ! outputs for dynamical trends 
     55      CALL iom_setkt  ( kt              )       ! set the model time step 
     56      ! 
     57   END SUBROUTINE trc_wri 
     58 
     59   SUBROUTINE trc_wri_trc( kt )   
     60      !!--------------------------------------------------------------------- 
     61      !!                     ***  ROUTINE trc_wri_trc  *** 
    4062      !! 
    4163      !! ** Purpose :   output passive tracers fields  
     
    4365      INTEGER, INTENT( in ) :: kt       ! ocean time-step 
    4466      INTEGER               :: jn 
    45       CHARACTER (len=20)    :: cltra 
     67      CHARACTER (len=20)    :: cltra, cltras 
    4668#if defined key_off_tra 
    4769      CHARACTER (len=40) :: clhstnam 
    4870      INTEGER ::   inum = 11            ! temporary logical unit 
    4971#endif 
    50  
    5172      !!--------------------------------------------------------------------- 
    5273  
    53       ! Initialisation 
    54       ! -------------- 
    55  
    56       CALL iom_setkt( kt + ndttrc - 1 ) ! set the passive tracer time step 
    57  
    5874#if defined key_off_tra 
    5975      IF( kt == nittrc000 ) THEN 
     
    6783      ENDIF 
    6884#endif 
    69  
    70  
    7185      ! write the tracer concentrations in the file 
    7286      ! --------------------------------------- 
     
    7690      END DO 
    7791      ! 
    78       CALL iom_setkt( kt )       ! set the model time step 
     92   END SUBROUTINE trc_wri_trc 
    7993 
     94# if defined key_trc_diatrd 
     95 
     96   SUBROUTINE trc_wri_trd( kt ) 
     97      !!---------------------------------------------------------------------- 
     98      !!                     ***  ROUTINE trc_wri_trd  *** 
     99      !! 
     100      !! ** Purpose :   output of passive tracer : advection-diffusion trends 
     101      !! 
     102      !!---------------------------------------------------------------------- 
     103      INTEGER, INTENT( in ) ::   kt          ! ocean time-step 
     104      !! 
     105      CHARACTER (len=3) ::   cltra 
     106      INTEGER  ::   jn, jl, ikn 
     107      !!---------------------------------------------------------------------- 
     108 
     109      DO jn = 1, jptra 
     110         IF( luttrd(jn) ) THEN 
     111            ikn = ikeep(jn) 
     112            DO jl = 1, jpdiatrc 
     113               IF( jl == jptrc_xad ) WRITE (cltra,"(3a)") 'XAD' ! x advection for tracer 
     114               IF( jl == jptrc_yad ) WRITE (cltra,"(3a)") 'YAD'  ! y advection for tracer 
     115               IF( jl == jptrc_zad ) WRITE (cltra,"(3a)") 'ZAD'  ! z advection for tracer 
     116               IF( jl == jptrc_xdf ) WRITE (cltra,"(3a)") 'XDF'  ! x diffusion for tracer 
     117               IF( jl == jptrc_ydf ) WRITE (cltra,"(3a)") 'YDF'  ! y diffusion for tracer 
     118               IF( jl == jptrc_zdf ) WRITE (cltra,"(3a)") 'ZDF'  ! z diffusion for tracer 
     119# if defined key_trcldf_eiv 
     120               IF( jl == jptrc_xei ) WRITE (cltra,"(3a)") 'XGV'  ! x gent velocity for tracer 
     121               IF( jl == jptrc_yei ) WRITE (cltra,"(3a)") 'YGV'  ! y gent velocity for tracer 
     122               IF( jl == jptrc_zei ) WRITE (cltra,"(3a)") 'ZGV'  ! z gent velocity for tracer 
     123# endif 
     124# if defined key_trcdmp 
     125               IF( jl == jptrc_dmp ) WRITE (cltra,"(3a)") 'DMP'  ! damping 
     126# endif 
     127               IF( jl == jptrc_sbc ) WRITE (cltra,"(3a)") 'SBC'  ! surface boundary conditions 
     128               ! write the trends 
     129               CALL iom_put( cltra, trtrd(:,:,:,ikn,jl) ) 
     130            END DO 
     131         END IF 
     132      END DO 
    80133      ! 
    81    END SUBROUTINE trc_wri 
     134   END SUBROUTINE trc_wri_trd 
    82135 
     136# else 
     137   SUBROUTINE trc_wri_trd( kt )                      ! Dummy routine 
     138      INTEGER, INTENT ( in ) ::   kt 
     139   END SUBROUTINE trc_wri_trd 
     140#endif 
    83141#else 
    84142   !!---------------------------------------------------------------------- 
     
    90148   INTEGER, INTENT(in) :: kt 
    91149   END SUBROUTINE trc_wri 
    92  
    93150#endif 
    94151 
Note: See TracChangeset for help on using the changeset viewer.