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 1830 for branches/CMIP5_IPSL/NEMO/TOP_SRC/trcwri.F90 – NEMO

Ignore:
Timestamp:
2010-04-12T15:03:51+02:00 (14 years ago)
Author:
cetlod
Message:

Computation of additional diagnostics for PISCES model ( under CPP key key_diaar5 )

  • needed for AR5 outputs (vertical inventories, passive tracers at surface,... )
  • new output file with suffix dbio_T
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/CMIP5_IPSL/NEMO/TOP_SRC/trcwri.F90

    r1656 r1830  
    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 
    14    !!---------------------------------------------------------------------- 
     13   !! trc_wri_trc   :  outputs of concentration fields 
     14   !! trc_wri_trd   :  outputs of transport trends 
     15   !!---------------------------------------------------------------------- 
     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  
     72#if defined key_diaar5  && defined key_pisces 
     73      INTEGER                      :: ji, jj, jk  ! dummy loop indices 
     74      REAL(wp)                     :: zoxy        ! oxygen concentration  
     75      REAL(wp), DIMENSION(jpi,jpj) :: zdic        ! DIC content  
     76      REAL(wp), DIMENSION(jpi,jpj) :: zo2min      ! O2 minimum concentration  
     77      REAL(wp), DIMENSION(jpi,jpj) :: zdepo2min   ! Depth of O2 minimum concentration  
     78#endif 
    5179      !!--------------------------------------------------------------------- 
    5280  
    53       ! Initialisation 
    54       ! -------------- 
    55  
    56       CALL iom_setkt( kt + ndttrc - 1 ) ! set the passive tracer time step 
    57  
    5881#if defined key_off_tra 
    5982      IF( kt == nittrc000 ) THEN 
     
    6790      ENDIF 
    6891#endif 
    69  
    70  
    7192      ! write the tracer concentrations in the file 
    7293      ! --------------------------------------- 
     
    7596         CALL iom_put( cltra, trn(:,:,:,jn) ) 
    7697      END DO 
    77       ! 
    78       CALL iom_setkt( kt )       ! set the model time step 
    79  
    80       ! 
    81    END SUBROUTINE trc_wri 
    82  
     98#if defined key_diaar5  && defined key_pisces 
     99      ! DIC content in kg/m2 
     100      zdic(:,:) = 0. 
     101      DO jk = 1, jpkm1 
     102         zdic(:,:) = zdic(:,:) + trn(:,:,jk,jpdic) * fse3t(:,:,jk) * tmask(:,:,jk) * 12.  
     103      ENDDO 
     104      ! Oxygen minimum concentration and depth 
     105      zo2min   (:,:) = trn(:,:,1,jpoxy) * tmask(:,:,1) 
     106      zdepo2min(:,:) = fsdepw(:,:,1)    * tmask(:,:,1) 
     107      DO jk = 2, jpkm1 
     108         DO jj = 1, jpj                
     109            DO ji = 1, jpi  
     110               IF( tmask(ji,jj,jk) == 1 ) then 
     111                  IF( trn(ji,jj,jk,jpoxy) < zo2min(ji,jj) ) then 
     112                     zo2min   (ji,jj) = trn(ji,jj,jk,jpoxy)  
     113                     zdepo2min(ji,jj) = fsdepw(ji,jj,jk) 
     114                  ENDIF 
     115               ENDIF 
     116            END DO 
     117         END DO 
     118      END DO 
     119      ! 
     120      CALL iom_put('INTDIC', zdic       )                              ! DIC content 
     121      CALL iom_put('O2MIN' , zo2min     )                              ! oxygen minimum concentration 
     122      CALL iom_put('ZO2MIN', zdepo2min  )                              ! depth of oxygen minimum concentration 
     123      CALL iom_put('PHYT'  , trn(:,:,:,jpphy) + trn(:,:,:,jpdia) )     ! total phytoplankton 
     124      CALL iom_put('ZOOT'  , trn(:,:,:,jpzoo) + trn(:,:,:,jpmes) )     ! total zooplankton 
     125      CALL iom_put('CHLT'  , trn(:,:,:,jpnch) + trn(:,:,:,jpdch) )     ! total chlorophyll 
     126      CALL iom_put('POCT'  , trn(:,:,:,jppoc) + trn(:,:,:,jpgoc) )     ! total carbon particles 
     127      CALL iom_put('PFET'  , trn(:,:,:,jpnfe) + trn(:,:,:,jpdfe) )     ! total biogenic iron 
     128      ! passive tracers at surface 
     129      DO jn = 1, jptra 
     130         cltras = TRIM(ctrcnm(jn))//'SFC'                   ! short title for tracer 
     131         CALL iom_put( cltras, trn(:,:,1,jn) ) 
     132      END DO 
     133      CALL iom_put('PHYTSFC',trn(:,:,1,jpphy) + trn(:,:,1,jpdia) ) 
     134      CALL iom_put('ZOOTSFC',trn(:,:,1,jpzoo) + trn(:,:,1,jpmes) ) 
     135      CALL iom_put('CHLTSFC',trn(:,:,1,jpnch) + trn(:,:,1,jpdch) ) 
     136      CALL iom_put('POCTSFC',trn(:,:,1,jppoc) + trn(:,:,1,jpgoc) ) 
     137      CALL iom_put('PFETSFC',trn(:,:,1,jpnfe) + trn(:,:,1,jpdfe) ) 
     138#endif 
     139      ! 
     140   END SUBROUTINE trc_wri_trc 
     141 
     142# if defined key_trc_diatrd 
     143 
     144   SUBROUTINE trc_wri_trd( kt ) 
     145      !!---------------------------------------------------------------------- 
     146      !!                     ***  ROUTINE trc_wri_trd  *** 
     147      !! 
     148      !! ** Purpose :   output of passive tracer : advection-diffusion trends 
     149      !! 
     150      !!---------------------------------------------------------------------- 
     151      INTEGER, INTENT( in ) ::   kt          ! ocean time-step 
     152      !! 
     153      CHARACTER (len=3) ::   cltra 
     154      INTEGER  ::   jn, jl, ikn 
     155      !!---------------------------------------------------------------------- 
     156 
     157      DO jn = 1, jptra 
     158         IF( luttrd(jn) ) THEN 
     159            ikn = ikeep(jn) 
     160            DO jl = 1, jpdiatrc 
     161               IF( jl == jptrc_xad ) WRITE (cltra,"(3a)") 'XAD' ! x advection for tracer 
     162               IF( jl == jptrc_yad ) WRITE (cltra,"(3a)") 'YAD'  ! y advection for tracer 
     163               IF( jl == jptrc_zad ) WRITE (cltra,"(3a)") 'ZAD'  ! z advection for tracer 
     164               IF( jl == jptrc_xdf ) WRITE (cltra,"(3a)") 'XDF'  ! x diffusion for tracer 
     165               IF( jl == jptrc_ydf ) WRITE (cltra,"(3a)") 'YDF'  ! y diffusion for tracer 
     166               IF( jl == jptrc_zdf ) WRITE (cltra,"(3a)") 'ZDF'  ! z diffusion for tracer 
     167# if defined key_trcldf_eiv 
     168               IF( jl == jptrc_xei ) WRITE (cltra,"(3a)") 'XGV'  ! x gent velocity for tracer 
     169               IF( jl == jptrc_yei ) WRITE (cltra,"(3a)") 'YGV'  ! y gent velocity for tracer 
     170               IF( jl == jptrc_zei ) WRITE (cltra,"(3a)") 'ZGV'  ! z gent velocity for tracer 
     171# endif 
     172# if defined key_trcdmp 
     173               IF( jl == jptrc_dmp ) WRITE (cltra,"(3a)") 'DMP'  ! damping 
     174# endif 
     175               IF( jl == jptrc_sbc ) WRITE (cltra,"(3a)") 'SBC'  ! surface boundary conditions 
     176               ! write the trends 
     177               CALL iom_put( cltra, trtrd(:,:,:,ikn,jl) ) 
     178            END DO 
     179         END IF 
     180      END DO 
     181      ! 
     182   END SUBROUTINE trc_wri_trd 
     183 
     184# else 
     185   SUBROUTINE trc_wri_trd( kt )                      ! Dummy routine 
     186      INTEGER, INTENT ( in ) ::   kt 
     187   END SUBROUTINE trc_wri_trd 
     188#endif 
    83189#else 
    84190   !!---------------------------------------------------------------------- 
     
    90196   INTEGER, INTENT(in) :: kt 
    91197   END SUBROUTINE trc_wri 
    92  
    93198#endif 
    94199 
Note: See TracChangeset for help on using the changeset viewer.