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

source: branches/UKMO/dev_r5518_GO6_under_ice_relax_dr_hook/NEMOGCM/NEMO/TOP_SRC/trcwri.F90 @ 11738

Last change on this file since 11738 was 11738, checked in by marc, 5 years ago

The Dr Hook changes from my perl code.

File size: 4.4 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_age
24   USE trcwri_my_trc
25   USE trcwri_idtra
26   USE trcwri_medusa
27
28   USE yomhook, ONLY: lhook, dr_hook
29   USE parkind1, ONLY: jprb, jpim
30
31   IMPLICIT NONE
32   PRIVATE
33
34   PUBLIC trc_wri     
35
36   !! * Substitutions
37#  include "top_substitute.h90"
38
39CONTAINS
40
41   SUBROUTINE trc_wri( kt )
42      !!---------------------------------------------------------------------
43      !!                     ***  ROUTINE trc_wri  ***
44      !!
45      !! ** Purpose :   output passive tracers fields and dynamical trends
46      !!---------------------------------------------------------------------
47      INTEGER, INTENT( in )     :: kt
48      !
49      INTEGER                   :: jn
50      CHARACTER (len=20)        :: cltra
51      CHARACTER (len=40)        :: clhstnam
52      INTEGER ::   inum = 11            ! temporary logical unit
53      INTEGER(KIND=jpim), PARAMETER :: zhook_in = 0
54      INTEGER(KIND=jpim), PARAMETER :: zhook_out = 1
55      REAL(KIND=jprb)               :: zhook_handle
56
57      CHARACTER(LEN=*), PARAMETER :: RoutineName='TRC_WRI'
58
59      IF (lhook) CALL dr_hook(RoutineName,zhook_in,zhook_handle)
60
61      !!---------------------------------------------------------------------
62      !
63      IF( nn_timing == 1 )  CALL timing_start('trc_wri')
64      !
65      IF( lk_offline .AND. kt == nittrc000 .AND. lwp ) THEN    ! WRITE root name in date.file for use by postpro
66         CALL dia_nam( clhstnam, nn_writetrc,' ' )
67         CALL ctl_opn( inum, 'date.file', 'REPLACE', 'FORMATTED', 'SEQUENTIAL', -1, numout, lwp, narea )
68         WRITE(inum,*) clhstnam
69         CLOSE(inum)
70      ENDIF
71      ! write the tracer concentrations in the file
72      ! ---------------------------------------
73      IF( lk_pisces  )   CALL trc_wri_pisces     ! PISCES
74      IF( lk_cfc     )   CALL trc_wri_cfc        ! surface fluxes of CFC
75      IF( lk_c14b    )   CALL trc_wri_c14b       ! surface fluxes of C14
76      IF( lk_age     )   CALL trc_wri_age        ! AGE tracer
77      IF( lk_my_trc  )   CALL trc_wri_my_trc     ! MY_TRC  tracers
78      IF( lk_idtra   )   CALL trc_wri_idtra       ! Idealize tracers
79      IF( lk_medusa  )   CALL trc_wri_medusa     ! MESDUSA
80      !
81      IF( nn_timing == 1 )  CALL timing_stop('trc_wri')
82      !
83      IF (lhook) CALL dr_hook(RoutineName,zhook_out,zhook_handle)
84   END SUBROUTINE trc_wri
85
86#else
87   !!----------------------------------------------------------------------
88   !!  Dummy module :                                     No passive tracer
89   !!----------------------------------------------------------------------
90   PUBLIC trc_wri
91CONTAINS
92   SUBROUTINE trc_wri( kt )                     ! Empty routine   
93   INTEGER, INTENT(in) :: kt
94   INTEGER(KIND=jpim), PARAMETER :: zhook_in = 0
95   INTEGER(KIND=jpim), PARAMETER :: zhook_out = 1
96   REAL(KIND=jprb)               :: zhook_handle
97
98   CHARACTER(LEN=*), PARAMETER :: RoutineName='TRC_WRI'
99
100   IF (lhook) CALL dr_hook(RoutineName,zhook_in,zhook_handle)
101
102   IF (lhook) CALL dr_hook(RoutineName,zhook_out,zhook_handle)
103   END SUBROUTINE trc_wri
104#endif
105
106   !!----------------------------------------------------------------------
107   !! NEMO/TOP 3.3 , NEMO Consortium (2010)
108   !! $Id$
109   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
110   !!======================================================================
111END MODULE trcwri
Note: See TracBrowser for help on using the repository browser.