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

source: branches/UKMO/AMM15_v3_6_STABLE_package/NEMOGCM/NEMO/TOP_SRC/trcwri.F90 @ 10162

Last change on this file since 10162 was 10162, checked in by dford, 6 years ago

Add NEMO-FABM coupling code, essentially identical to commit 4bc68d33 of the PML NEMO-FABM GitLab?.

File size: 4.1 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      ! +++>>>FABM
49#if defined key_tracer_budget
50      INTEGER, INTENT( in ), OPTIONAL     :: fl  ! slwa
51#endif
52      ! FABM <<<+++
53      !
54      INTEGER                   :: jn
55      CHARACTER (len=20)        :: cltra
56      CHARACTER (len=40)        :: clhstnam
57      INTEGER ::   inum = 11            ! temporary logical unit
58      !!---------------------------------------------------------------------
59      !
60      IF( nn_timing == 1 )  CALL timing_start('trc_wri')
61      !
62      IF( lk_offline .AND. kt == nittrc000 .AND. lwp ) THEN    ! WRITE root name in date.file for use by postpro
63         CALL dia_nam( clhstnam, nn_writetrc,' ' )
64         CALL ctl_opn( inum, 'date.file', 'REPLACE', 'FORMATTED', 'SEQUENTIAL', -1, numout, lwp, narea )
65         WRITE(inum,*) clhstnam
66         CLOSE(inum)
67      ENDIF
68      ! write the tracer concentrations in the file
69      ! ---------------------------------------
70      IF( lk_pisces  )   CALL trc_wri_pisces     ! PISCES
71      IF( lk_cfc     )   CALL trc_wri_cfc        ! surface fluxes of CFC
72      IF( lk_c14b    )   CALL trc_wri_c14b       ! surface fluxes of C14
73      ! +++>>>FABM
74#if defined key_tracer_budget
75      IF( PRESENT(fl) ) THEN
76         IF( lk_fabm    )   CALL trc_wri_fabm (kt, fl) ! MY_TRC  tracers for budget
77         IF( lk_my_trc ) CALL trc_wri_my_trc (kt, fl)    ! MY_TRC  tracers for budget
78      ELSE
79         IF( lk_fabm    )   CALL trc_wri_fabm (kt) ! FABM  tracers for budget
80         IF( lk_my_trc  )   CALL trc_wri_my_trc (kt) ! MY_TRC  tracers
81      ENDIF
82#else
83      IF( lk_fabm  )   CALL trc_wri_fabm (kt)     ! FABM  tracers
84      IF( lk_my_trc  )   CALL trc_wri_my_trc(kt)     ! MY_TRC  tracers
85#endif
86      ! FABM <<<+++
87      !
88
89      IF( nn_timing == 1 )  CALL timing_stop('trc_wri')
90      !
91   END SUBROUTINE trc_wri
92
93#else
94   !!----------------------------------------------------------------------
95   !!  Dummy module :                                     No passive tracer
96   !!----------------------------------------------------------------------
97   PUBLIC trc_wri
98CONTAINS
99   SUBROUTINE trc_wri( kt )                     ! Empty routine   
100   INTEGER, INTENT(in) :: kt
101   END SUBROUTINE trc_wri
102#endif
103
104   !!----------------------------------------------------------------------
105   !! NEMO/TOP 3.3 , NEMO Consortium (2010)
106   !! $Id$
107   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
108   !!======================================================================
109END MODULE trcwri
Note: See TracBrowser for help on using the repository browser.