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/UKMO/CO6_KD490_amm7_oper_fabm/NEMOGCM/NEMO/TOP_SRC – NEMO

source: branches/UKMO/CO6_KD490_amm7_oper_fabm/NEMOGCM/NEMO/TOP_SRC/trcwri.F90 @ 8049

Last change on this file since 8049 was 8049, checked in by dford, 7 years ago

Add FABM-related code changes.

File size: 3.9 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_iomput
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_c14b
22   USE trcwri_my_trc
23   ! +++>>> FABM
24   USE trcwri_fabm
25   ! FABM <<<+++
26
27   IMPLICIT NONE
28   PRIVATE
29
30   PUBLIC trc_wri     
31
32   !! * Substitutions
33#  include "top_substitute.h90"
34
35CONTAINS
36
37#if defined key_tracer_budget
38   SUBROUTINE trc_wri( kt , fl)  !slwa
39#else
40   SUBROUTINE trc_wri( kt )
41#endif
42      !!---------------------------------------------------------------------
43      !!                     ***  ROUTINE trc_wri  ***
44      !!
45      !! ** Purpose :   output passive tracers fields and dynamical trends
46      !!---------------------------------------------------------------------
47      INTEGER, INTENT( in )     :: kt
48#if defined key_tracer_budget
49      INTEGER, INTENT( in ), OPTIONAL     :: fl  ! slwa
50#endif
51      !
52      INTEGER                   :: jn
53      CHARACTER (len=20)        :: cltra
54      CHARACTER (len=40)        :: clhstnam
55      INTEGER ::   inum = 11            ! temporary logical unit
56      !!---------------------------------------------------------------------
57      !
58      IF( nn_timing == 1 )  CALL timing_start('trc_wri')
59      !
60      IF( lk_offline .AND. kt == nittrc000 .AND. lwp ) THEN    ! WRITE root name in date.file for use by postpro
61         CALL dia_nam( clhstnam, nn_writetrc,' ' )
62         CALL ctl_opn( inum, 'date.file', 'REPLACE', 'FORMATTED', 'SEQUENTIAL', -1, numout, lwp, narea )
63         WRITE(inum,*) clhstnam
64         CLOSE(inum)
65      ENDIF
66      ! write the tracer concentrations in the file
67      ! ---------------------------------------
68      IF( lk_pisces  )   CALL trc_wri_pisces     ! PISCES
69      IF( lk_cfc     )   CALL trc_wri_cfc        ! surface fluxes of CFC
70      IF( lk_c14b    )   CALL trc_wri_c14b       ! surface fluxes of C14
71#if defined key_tracer_budget
72      IF( .NOT.PRESENT(fl) .AND. lk_my_trc  )   CALL trc_wri_my_trc (kt)     ! MY_TRC  tracers   slwa
73      IF( PRESENT(fl) .AND. lk_my_trc  )   CALL trc_wri_my_trc (kt, fl)    ! MY_TRC  tracers for budget slwa
74#else
75      IF( lk_my_trc  )   CALL trc_wri_my_trc     ! MY_TRC  tracers
76#endif
77      ! +++>>>FABM
78      IF( lk_fabm    )   CALL trc_wri_fabm      ! FABM tracers
79      ! FABM <<<+++
80      !
81      IF( nn_timing == 1 )  CALL timing_stop('trc_wri')
82      !
83   END SUBROUTINE trc_wri
84
85#else
86   !!----------------------------------------------------------------------
87   !!  Dummy module :                                     No passive tracer
88   !!----------------------------------------------------------------------
89   PUBLIC trc_wri
90CONTAINS
91   SUBROUTINE trc_wri( kt )                     ! Empty routine   
92   INTEGER, INTENT(in) :: kt
93   END SUBROUTINE trc_wri
94#endif
95
96   !!----------------------------------------------------------------------
97   !! NEMO/TOP 3.3 , NEMO Consortium (2010)
98   !! $Id$
99   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
100   !!======================================================================
101END MODULE trcwri
Note: See TracBrowser for help on using the repository browser.