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.
trcwri.F90 in NEMO/trunk/src/TOP – NEMO

source: NEMO/trunk/src/TOP/trcwri.F90 @ 14255

Last change on this file since 14255 was 14255, checked in by cetlod, 3 years ago

trunk : consolidation of OFFLINE with key_qco ; use the ORCA2_OFF_TRC configuration for that purpose

  • Property svn:keywords set to Id
File size: 4.8 KB
Line 
1MODULE trcwri
2   !!======================================================================
3   !!                       *** MODULE trcwri ***
4   !!    TOP :   Output of passive tracers
5   !!======================================================================
6   !! History :   1.0  !  2009-05 (C. Ethe)  Original code
7   !!----------------------------------------------------------------------
8#if defined key_top && defined key_xios
9   !!----------------------------------------------------------------------
10   !!   'key_top'                                           TOP models
11   !!----------------------------------------------------------------------
12   !! trc_wri_trc   :  outputs of concentration fields
13   !!----------------------------------------------------------------------
14   USE dom_oce     ! ocean space and time domain variables
15   USE oce_trc     ! shared variables between ocean and passive tracers
16   USE trc         ! passive tracers common variables
17   USE iom         ! I/O manager
18   USE dianam      ! Output file name
19   USE trcwri_pisces
20   USE trcwri_cfc
21   USE trcwri_c14
22   USE trcwri_age
23   USE trcwri_my_trc
24
25   IMPLICIT NONE
26   PRIVATE
27
28   PUBLIC trc_wri     
29
30   !! * Substitutions
31#  include "do_loop_substitute.h90"
32#  include "domzgr_substitute.h90"
33
34CONTAINS
35
36   SUBROUTINE trc_wri( kt, Kmm )
37      !!---------------------------------------------------------------------
38      !!                     ***  ROUTINE trc_wri  ***
39      !!
40      !! ** Purpose :   output passive tracers fields and dynamical trends
41      !!---------------------------------------------------------------------
42      INTEGER, INTENT( in )     :: kt
43      INTEGER, INTENT( in )     :: Kmm  ! time level indices
44      !
45      INTEGER                   :: jk, jn
46      CHARACTER (len=20)        :: cltra
47      CHARACTER (len=40)        :: clhstnam
48      INTEGER ::   inum = 11            ! temporary logical unit
49      REAL(wp), DIMENSION(jpi,jpj,jpk) ::   z3d   ! 3D workspace
50      !!---------------------------------------------------------------------
51      !
52      IF( ln_timing )   CALL timing_start('trc_wri')
53      !
54      IF( l_offline ) THEN    ! WRITE root name in date.file for use by postpro
55         IF(  kt == nittrc000 .AND. lwp ) THEN    ! WRITE root name in date.file for use by postpro
56           CALL dia_nam( clhstnam, nn_writetrc,' ' )
57           CALL ctl_opn( inum, 'date.file', 'REPLACE', 'FORMATTED', 'SEQUENTIAL', -1, numout, lwp, narea )
58           WRITE(inum,*) clhstnam
59           CLOSE(inum)
60         ENDIF
61
62         ! Output of initial vertical scale factor
63         CALL iom_put( "e3t_0", e3t_0(:,:,:) )
64         CALL iom_put( "e3u_0", e3u_0(:,:,:) )
65         CALL iom_put( "e3v_0", e3v_0(:,:,:) )
66         !
67         IF( .NOT.ln_linssh )  CALL iom_put( "ssh" , ssh(:,:,Kmm) )              ! sea surface height
68         !
69         IF ( iom_use("e3t") ) THEN  ! time-varying e3t
70            DO jk = 1, jpk
71               z3d(:,:,jk) =  e3t(:,:,jk,Kmm)
72            END DO
73            CALL iom_put( "e3t", z3d(:,:,:) )
74         ENDIF
75         IF ( iom_use("e3u") ) THEN                         ! time-varying e3u
76            DO jk = 1, jpk
77               z3d(:,:,jk) =  e3u(:,:,jk,Kmm)
78            END DO
79            CALL iom_put( "e3u", z3d(:,:,:) )
80         ENDIF
81         IF ( iom_use("e3v") ) THEN                         ! time-varying e3v
82            DO jk = 1, jpk
83               z3d(:,:,jk) =  e3v(:,:,jk,Kmm)
84            END DO
85            CALL iom_put( "e3v", z3d(:,:,:) )
86         ENDIF
87         !
88      ENDIF
89      !
90      ! write the tracer concentrations in the file
91      ! ---------------------------------------
92      IF( ln_pisces  )   CALL trc_wri_pisces( Kmm )     ! PISCES
93      IF( ll_cfc     )   CALL trc_wri_cfc   ( Kmm )     ! surface fluxes of CFC
94      IF( ln_c14     )   CALL trc_wri_c14   ( Kmm )     ! surface fluxes of C14
95      IF( ln_age     )   CALL trc_wri_age   ( Kmm )     ! AGE tracer
96      IF( ln_my_trc  )   CALL trc_wri_my_trc( Kmm )     ! MY_TRC  tracers
97      !
98      IF( ln_timing )   CALL timing_stop('trc_wri')
99      !
100   END SUBROUTINE trc_wri
101
102#else
103   !!----------------------------------------------------------------------
104   !!  Dummy module :                                     No passive tracer
105   !!----------------------------------------------------------------------
106   PUBLIC trc_wri
107CONTAINS
108   SUBROUTINE trc_wri( kt, Kmm )                     ! Empty routine   
109   INTEGER, INTENT(in) :: kt
110   INTEGER, INTENT(in) :: Kmm  ! time level indices
111   END SUBROUTINE trc_wri
112#endif
113
114   !!----------------------------------------------------------------------
115   !! NEMO/TOP 4.0 , NEMO Consortium (2018)
116   !! $Id$
117   !! Software governed by the CeCILL license (see ./LICENSE)
118   !!======================================================================
119END MODULE trcwri
Note: See TracBrowser for help on using the repository browser.