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

source: trunk/NEMO/TOP_SRC/trcwri.F90 @ 1656

Last change on this file since 1656 was 1656, checked in by cetlod, 15 years ago

Creation of the date.file in OFFLINE mode, see ticket:551

File size: 3.3 KB
Line 
1MODULE trcwri
2   !!======================================================================
3   !!                       *** MODULE trcwri ***
4   !!    TOP :   Output of passive tracers
5   !!======================================================================
6   !!             1.0  ! 
7   !!                  !  2009-05 (C. Ethe )
8   !!----------------------------------------------------------------------
9#if defined key_top &&  defined key_iomput
10   !!----------------------------------------------------------------------
11   !!   'key_top' && 'key_iomput'                              TOP models
12   !!----------------------------------------------------------------------
13   !! trc_wri     :  outputs of concentration fields
14   !!----------------------------------------------------------------------
15   USE trc
16   USE iom
17#if defined key_off_tra
18   USE oce_trc
19   USE dianam
20#endif
21
22   IMPLICIT NONE
23   PRIVATE
24
25   PUBLIC trc_wri     
26
27   !! * Substitutions
28#  include "top_substitute.h90"
29   !!----------------------------------------------------------------------
30   !! NEMO/TOP 1.0 , LOCEAN-IPSL (2005)
31   !! $Id: trcdia.F90 1450 2009-05-15 14:12:12Z cetlod $
32   !! Software governed by the CeCILL licence (modipsl/doc/NEMO_CeCILL.txt)
33   !!----------------------------------------------------------------------
34
35CONTAINS
36
37   SUBROUTINE trc_wri( kt ) 
38      !!---------------------------------------------------------------------
39      !!                     ***  ROUTINE trc_wri  ***
40      !!
41      !! ** Purpose :   output passive tracers fields
42      !!---------------------------------------------------------------------
43      INTEGER, INTENT( in ) :: kt       ! ocean time-step
44      INTEGER               :: jn
45      CHARACTER (len=20)    :: cltra
46#if defined key_off_tra
47      CHARACTER (len=40) :: clhstnam
48      INTEGER ::   inum = 11            ! temporary logical unit
49#endif
50
51      !!---------------------------------------------------------------------
52 
53      ! Initialisation
54      ! --------------
55
56      CALL iom_setkt( kt + ndttrc - 1 ) ! set the passive tracer time step
57
58#if defined key_off_tra
59      IF( kt == nittrc000 ) THEN
60        ! WRITE root name in date.file for use by postpro
61         IF(lwp) THEN
62            CALL dia_nam( clhstnam, nwritetrc,' ' )
63            CALL ctl_opn( inum, 'date.file', 'REPLACE', 'FORMATTED', 'SEQUENTIAL', -1, numout, lwp, narea )
64            WRITE(inum,*) clhstnam
65            CLOSE(inum)
66         ENDIF
67      ENDIF
68#endif
69
70
71      ! write the tracer concentrations in the file
72      ! ---------------------------------------
73      DO jn = 1, jptra
74         cltra = ctrcnm(jn)                   ! short title for tracer
75         CALL iom_put( cltra, trn(:,:,:,jn) )
76      END DO
77      !
78      CALL iom_setkt( kt )       ! set the model time step
79
80      !
81   END SUBROUTINE trc_wri
82
83#else
84   !!----------------------------------------------------------------------
85   !!  Dummy module :                                     No passive tracer
86   !!----------------------------------------------------------------------
87   PUBLIC trc_wri
88CONTAINS
89   SUBROUTINE trc_wri( kt )                     ! Empty routine   
90   INTEGER, INTENT(in) :: kt
91   END SUBROUTINE trc_wri
92
93#endif
94
95   !!======================================================================
96END MODULE trcwri
Note: See TracBrowser for help on using the repository browser.