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 branches/NERC/dev_r5518_NOC_MEDUSA_Stable/NEMOGCM/NEMO/TOP_SRC – NEMO

source: branches/NERC/dev_r5518_NOC_MEDUSA_Stable/NEMOGCM/NEMO/TOP_SRC/trcwri.F90 @ 6245

Last change on this file since 6245 was 6047, checked in by jpalmier, 8 years ago

JPALM -- 14-12-2015 -- idtra debugg

File size: 4.5 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   !!              -   !  2014-06 (A. Yool, J. Palmieri) adding MEDUSA-2
8   !!----------------------------------------------------------------------
9#if defined key_top && defined key_iomput
10   !!----------------------------------------------------------------------
11   !!   'key_top'                                           TOP models
12   !!----------------------------------------------------------------------
13   !! trc_wri_trc   :  outputs of concentration fields
14   !!----------------------------------------------------------------------
15   USE dom_oce     ! ocean space and time domain variables
16   USE oce_trc     ! shared variables between ocean and passive tracers
17   USE trc         ! passive tracers common variables
18   USE iom         ! I/O manager
19   USE dianam      ! Output file name
20   USE trcwri_pisces
21   USE trcwri_cfc
22   USE trcwri_c14b
23   USE trcwri_my_trc
24   USE trcwri_medusa
25   USE trcwri_idtra
26
27   IMPLICIT NONE
28   PRIVATE
29
30   PUBLIC trc_wri     
31
32   !! * Substitutions
33#  include "top_substitute.h90"
34
35CONTAINS
36
37   SUBROUTINE trc_wri( kt )
38      !!---------------------------------------------------------------------
39      !!                     ***  ROUTINE trc_wri  ***
40      !!
41      !! ** Purpose :   output passive tracers fields and dynamical trends
42      !!---------------------------------------------------------------------
43      INTEGER, INTENT( in )     :: kt
44      !
45      INTEGER                   :: jn
46      CHARACTER (len=20)        :: cltra
47      CHARACTER (len=40)        :: clhstnam
48      INTEGER ::   inum = 11            ! temporary logical unit
49      !!---------------------------------------------------------------------
50      !
51      IF( nn_timing == 1 )  CALL timing_start('trc_wri')
52      !
53      IF( lk_offline .AND. kt == nittrc000 .AND. lwp ) THEN    ! WRITE root name in date.file for use by postpro
54         CALL dia_nam( clhstnam, nn_writetrc,' ' )
55         CALL ctl_opn( inum, 'date.file', 'REPLACE', 'FORMATTED', 'SEQUENTIAL', -1, numout, lwp, narea )
56         WRITE(inum,*) clhstnam
57         CLOSE(inum)
58      ENDIF
59      ! write the tracer concentrations in the file
60      ! ---------------------------------------
61      IF( lk_pisces  )   CALL trc_wri_pisces     ! PISCES
62      IF( lk_cfc     )   CALL trc_wri_cfc        ! surface fluxes of CFC
63      IF( lk_c14b    )   CALL trc_wri_c14b       ! surface fluxes of C14
64      IF( lk_my_trc  )   CALL trc_wri_my_trc     ! MY_TRC  tracers
65      !
66# if defined key_debug_medusa
67      CALL flush(numout)
68      IF (lwp) write (numout,*) '------------------------------'
69      IF (lwp) write (numout,*) 'Jpalm - debug'
70      IF (lwp) write (numout,*) 'Just before call trc_wri_medusa'
71      IF (lwp) write (numout,*) ' '
72      CALL flush(numout)
73# endif
74      !
75      IF( lk_medusa  )   CALL trc_wri_medusa     ! MESDUSA
76      !
77# if defined key_debug_medusa
78      CALL flush(numout)
79      IF (lwp) write (numout,*) '------------------------------'
80      IF (lwp) write (numout,*) 'Jpalm - debug'
81      IF (lwp) write (numout,*) 'CALL trc_wri_medusa -- OK'
82      IF (lwp) write (numout,*) ' '
83      CALL flush(numout)
84# endif
85      !
86      IF( lk_idtra   )   CALL trc_wri_idtra       ! Idealize tracers
87      !
88# if defined key_debug_medusa
89      CALL flush(numout)
90      IF (lwp) write (numout,*) '------------------------------'
91      IF (lwp) write (numout,*) 'Jpalm - debug'
92      IF (lwp) write (numout,*) 'CALL trc_wri_idtra -- OK'
93      IF (lwp) write (numout,*) ' '
94      CALL flush(numout)
95# endif
96      !
97      IF( nn_timing == 1 )  CALL timing_stop('trc_wri')
98      !
99   END SUBROUTINE trc_wri
100
101#else
102   !!----------------------------------------------------------------------
103   !!  Dummy module :                                     No passive tracer
104   !!----------------------------------------------------------------------
105   PUBLIC trc_wri
106CONTAINS
107   SUBROUTINE trc_wri( kt )                     ! Empty routine   
108   INTEGER, INTENT(in) :: kt
109   END SUBROUTINE trc_wri
110#endif
111
112   !!----------------------------------------------------------------------
113   !! NEMO/TOP 3.3 , NEMO Consortium (2010)
114   !! $Id$
115   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
116   !!======================================================================
117END MODULE trcwri
Note: See TracBrowser for help on using the repository browser.