-
Notifications
You must be signed in to change notification settings - Fork 1
/
trcwri.F90
99 lines (90 loc) · 4.16 KB
/
trcwri.F90
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
MODULE trcwri
!!======================================================================
!! *** MODULE trcwri ***
!! TOP : Output of passive tracers
!!======================================================================
!! History : 1.0 ! 2009-05 (C. Ethe) Original code
!!----------------------------------------------------------------------
#if defined key_top && defined key_iomput
!!----------------------------------------------------------------------
!! 'key_top' TOP models
!!----------------------------------------------------------------------
!! trc_wri_trc : outputs of concentration fields
!!----------------------------------------------------------------------
USE dom_oce ! ocean space and time domain variables
USE oce_trc ! shared variables between ocean and passive tracers
USE trc ! passive tracers common variables
USE iom ! I/O manager
USE dianam ! Output file name
IMPLICIT NONE
PRIVATE
PUBLIC trc_wri
!! * Substitutions
# include "top_substitute.h90"
CONTAINS
SUBROUTINE trc_wri( kt )
!!---------------------------------------------------------------------
!! *** ROUTINE trc_wri ***
!!
!! ** Purpose : output passive tracers fields and dynamical trends
!!---------------------------------------------------------------------
INTEGER, INTENT( in ) :: kt
!!---------------------------------------------------------------------
!
IF( nn_timing == 1 ) CALL timing_start('trc_wri')
!
CALL iom_setkt ( kt + nn_dttrc - 1 ) ! set the passive tracer time step
CALL trc_wri_trc( kt ) ! outputs for tracer concentration
CALL iom_setkt ( kt ) ! set the model time step
!
IF( nn_timing == 1 ) CALL timing_stop('trc_wri')
!
END SUBROUTINE trc_wri
SUBROUTINE trc_wri_trc( kt )
!!---------------------------------------------------------------------
!! *** ROUTINE trc_wri_trc ***
!!
!! ** Purpose : output passive tracers fields
!!---------------------------------------------------------------------
INTEGER, INTENT( in ) :: kt ! ocean time-step
INTEGER :: jn
CHARACTER (len=20) :: cltra
CHARACTER (len=40) :: clhstnam
INTEGER :: inum = 11 ! temporary logical unit
!!---------------------------------------------------------------------
IF( lk_offline .AND. kt == nittrc000 .AND. lwp ) THEN ! WRITE root name in date.file for use by postpro
CALL dia_nam( clhstnam, nn_writetrc,' ' )
CALL ctl_opn( inum, 'date.file', 'REPLACE', 'FORMATTED', 'SEQUENTIAL', -1, numout, lwp, narea )
WRITE(inum,*) clhstnam
CLOSE(inum)
ENDIF
! write the tracer concentrations in the file
! ---------------------------------------
DO jn = 1, jptra
cltra = TRIM( ctrcnm(jn) ) ! short title for tracer
CALL iom_put( cltra, trn(:,:,:,jn) )
END DO
!
CALL iom_put( "toce", tsn(:,:,:,jp_tem) )
CALL iom_put( "soce", tsn(:,:,:,jp_sal) )
CALL iom_put( "somxl010", hmld(:,:) )
CALL iom_put( "soshfldo", qsr(:,:) )
CALL iom_put( "votkeavt", avt(:,:,:) )
!
END SUBROUTINE trc_wri_trc
#else
!!----------------------------------------------------------------------
!! Dummy module : No passive tracer
!!----------------------------------------------------------------------
PUBLIC trc_wri
CONTAINS
SUBROUTINE trc_wri( kt ) ! Empty routine
INTEGER, INTENT(in) :: kt
END SUBROUTINE trc_wri
#endif
!!----------------------------------------------------------------------
!! NEMO/TOP 3.3 , NEMO Consortium (2010)
!! $Id: trcwri.F90 3160 2011-11-20 14:27:18Z cetlod $
!! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
!!======================================================================
END MODULE trcwri