/[MITgcm]/MITgcm/pkg/ptracers/ptracers_monitor.F
ViewVC logotype

Annotation of /MITgcm/pkg/ptracers/ptracers_monitor.F

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.17 - (hide annotations) (download)
Mon Dec 21 00:17:00 2009 UTC (14 years, 6 months ago) by jmc
Branch: MAIN
CVS Tags: checkpoint62, checkpoint62c, checkpoint62b, checkpoint62a
Changes since 1.16: +5 -4 lines
- use new S/R version for statistics with mask & volume;
- use interior masks (instead of maskH, <- to be remove).

1 jmc 1.17 C $Header: /u/gcmpack/MITgcm/pkg/ptracers/ptracers_monitor.F,v 1.16 2009/02/19 01:42:15 dfer Exp $
2 mlosch 1.1 C $Name: $
3    
4     #include "PTRACERS_OPTIONS.h"
5    
6     CBOP
7     C !ROUTINE: PTRACERS_MONITOR
8    
9     C !INTERFACE: ==========================================================
10     SUBROUTINE PTRACERS_MONITOR(
11 jmc 1.12 I myIter, myTime, myThid )
12 mlosch 1.1
13     C !DESCRIPTION:
14     C writes out ptracer statistics
15    
16     C !USES: ===============================================================
17     IMPLICIT NONE
18     #include "SIZE.h"
19     #include "EEPARAMS.h"
20     #include "PARAMS.h"
21     #include "GRID.h"
22     #include "PTRACERS_SIZE.h"
23 jmc 1.14 #include "PTRACERS_PARAMS.h"
24     #include "PTRACERS_FIELDS.h"
25 mlosch 1.1 #ifdef ALLOW_MONITOR
26     #include "MONITOR.h"
27     #endif
28    
29     C !INPUT PARAMETERS: ===================================================
30 jmc 1.12 C myTime :: current time
31     C myIter :: current timestep
32 mlosch 1.1 C myThid :: thread number
33 jmc 1.12 _RL myTime
34 mlosch 1.1 INTEGER myIter
35     INTEGER myThid
36    
37     C === Functions ====
38 jmc 1.8 LOGICAL DIFFERENT_MULTIPLE
39     EXTERNAL DIFFERENT_MULTIPLE
40 jmc 1.13 LOGICAL MASTER_CPU_IO
41     EXTERNAL MASTER_CPU_IO
42 mlosch 1.1
43     #ifdef ALLOW_PTRACERS
44     #ifdef ALLOW_MONITOR
45    
46     C !LOCAL VARIABLES: ====================================================
47     C i,j :: loop indices
48     C ip :: ptracer number
49 jmc 1.12 CHARACTER*(MAX_LEN_MBUF) msgBuf
50 mlosch 1.1 CHARACTER*(MAX_LEN_MBUF) suff
51 jmc 1.12 INTEGER ip
52 jmc 1.17 _RL dummyRL(6)
53 mlosch 1.1 CEOP
54    
55 jmc 1.12 IF ( DIFFERENT_MULTIPLE( PTRACERS_monitorFreq,myTime,deltaTClock )
56     & ) THEN
57 mlosch 1.1
58 jmc 1.8 C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
59 mlosch 1.1
60 jmc 1.12 C-- Ptracers field monitor start
61 jmc 1.13 IF ( MASTER_CPU_IO(myThid) ) THEN
62     C-- only the master thread is allowed to switch On/Off mon_write_stdout
63 jmc 1.12 C & mon_write_mnc (since it's the only thread that uses those flags):
64    
65     IF (monitor_stdio) THEN
66     mon_write_stdout = .TRUE.
67     ELSE
68     mon_write_stdout = .FALSE.
69     ENDIF
70     mon_write_mnc = .FALSE.
71     #ifdef ALLOW_MNC
72     IF (useMNC .AND. PTRACERS_monitor_mnc) THEN
73     WRITE(mon_fname,'(A)') 'monitor_ptracer'
74     CALL MNC_CW_APPEND_VNAME(
75     & 'T', '-_-_--__-__t', 0,0, myThid)
76     CALL MNC_CW_SET_UDIM(mon_fname, -1, myThid)
77 dfer 1.16 CALL MNC_CW_RL_W_S(
78     & 'D',mon_fname,1,1,'T', myTime, myThid)
79 jmc 1.12 CALL MNC_CW_SET_UDIM(mon_fname, 0, myThid)
80     mon_write_mnc = .TRUE.
81     ENDIF
82 dfer 1.16 #endif /* ALLOW_MNC */
83 jmc 1.12
84     IF ( mon_write_stdout ) THEN
85     WRITE(msgBuf,'(2A)') '// ==========================',
86     & '============================='
87     CALL PRINT_MESSAGE( msgBuf, mon_ioUnit, SQUEEZE_RIGHT , 1)
88     WRITE(msgBuf,'(A)')
89     & '// Begin MONITOR ptracer field statistics'
90     CALL PRINT_MESSAGE( msgBuf, mon_ioUnit, SQUEEZE_RIGHT , 1)
91     WRITE(msgBuf,'(2A)') '// ==========================',
92     & '============================='
93     CALL PRINT_MESSAGE( msgBuf, mon_ioUnit, SQUEEZE_RIGHT , 1)
94     ENDIF
95    
96 jmc 1.13 C-- endif master cpu io
97 mlosch 1.1 ENDIF
98    
99 jmc 1.12 C-- Ptracers field monitor : compute stats & write
100     IF ( PTRACERS_monitorFreq .NE. monitorFreq
101     & .OR. (useMNC.AND.PTRACERS_monitor_mnc) ) THEN
102     C repeat printing of time to make grepping easier, default is not
103     C to do this, because the default is to use the same monitorFreq
104     C for ptracers as for the dynamics variables.
105 mlosch 1.1 CALL MON_SET_PREF('trctime',myThid)
106     CALL MON_OUT_I( '_tsnumber', myIter,mon_string_none,myThid)
107     CALL MON_OUT_RL('_secondsf', myTime,mon_string_none,myThid)
108 jmc 1.12 ENDIF
109     C Print the basic statistics of ptracer variables
110 mlosch 1.1 CALL MON_SET_PREF('trcstat_',myThid)
111     DO ip = 1, PTRACERS_numInUse
112 jmc 1.15 WRITE(suff,'(A7,A2)') 'ptracer',PTRACERS_ioLabel(ip)
113     c WRITE(suff,'(A6,I4.4)') 'ptrac', ip
114 jmc 1.17 CALL MON_WRITESTATS_RL(
115     & Nr, pTracer(1-OLx,1-OLy,1,1,1,ip), suff,
116     & hFacC, maskInC, rA ,drF, dummyRL, myThid )
117 mlosch 1.1 ENDDO
118    
119 jmc 1.12 C-- Ptracers field monitor finish
120 jmc 1.13 IF ( MASTER_CPU_IO(myThid) ) THEN
121 jmc 1.12 C- only the master thread is allowed to switch On/Off mon_write_stdout
122     C & mon_write_mnc (since it's the only thread that uses those flags):
123    
124     IF ( mon_write_stdout ) THEN
125 mlosch 1.1 WRITE(msgBuf,'(2A)') '// ==========================',
126     & '============================='
127     CALL PRINT_MESSAGE( msgBuf, mon_ioUnit, SQUEEZE_RIGHT , 1)
128 jmc 1.12 WRITE(msgBuf,'(A)')
129 mlosch 1.1 & '// End MONITOR ptracers field statistics'
130 jmc 1.12 CALL PRINT_MESSAGE( msgBuf, mon_ioUnit, SQUEEZE_RIGHT , 1)
131 mlosch 1.1 WRITE(msgBuf,'(2A)') '// ==========================',
132     & '============================='
133     CALL PRINT_MESSAGE( msgBuf, mon_ioUnit, SQUEEZE_RIGHT , 1)
134     ENDIF
135    
136     mon_write_stdout = .FALSE.
137 jmc 1.12 mon_write_mnc = .FALSE.
138    
139 jmc 1.13 C- endif master cpu io
140 mlosch 1.1 ENDIF
141 mlosch 1.9
142 jmc 1.12 C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
143 mlosch 1.9
144 jmc 1.13 C--- endif different multiple
145 mlosch 1.1 ENDIF
146    
147     #endif /* ALLOW_MONITOR */
148     #endif /* ALLOW_PTRACERS */
149    
150     RETURN
151     END

  ViewVC Help
Powered by ViewVC 1.1.22