/[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.13 - (hide annotations) (download)
Tue Oct 17 18:22:33 2006 UTC (17 years, 7 months ago) by jmc
Branch: MAIN
CVS Tags: checkpoint58u_post, checkpoint58w_post, checkpoint58r_post, checkpoint58x_post, checkpoint58t_post, checkpoint58q_post, checkpoint59e, checkpoint59d, checkpoint59g, checkpoint59f, checkpoint59a, checkpoint59c, checkpoint59b, checkpoint59i, checkpoint59h, checkpoint59, checkpoint58y_post, checkpoint58v_post, checkpoint58s_post
Changes since 1.12: +9 -18 lines
use function "MASTER_CPU_IO" to hide EESUPPORT.h from TAF.

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

  ViewVC Help
Powered by ViewVC 1.1.22