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

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

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


Revision 1.18 - (show annotations) (download)
Tue Mar 16 00:22:26 2010 UTC (14 years, 3 months ago) by jmc
Branch: MAIN
CVS Tags: checkpoint64y, checkpoint64x, checkpoint64z, checkpoint64q, checkpoint64p, checkpoint64s, checkpoint64r, checkpoint64u, checkpoint64t, checkpoint64w, checkpoint64v, checkpoint64i, checkpoint64h, checkpoint64k, checkpoint64j, checkpoint64m, checkpoint64l, checkpoint64o, checkpoint64n, checkpoint64a, checkpoint64c, checkpoint64b, checkpoint64e, checkpoint64d, checkpoint64g, checkpoint64f, checkpoint63p, checkpoint63q, checkpoint63r, checkpoint63s, checkpoint63l, checkpoint63m, checkpoint63n, checkpoint63o, checkpoint63h, checkpoint63i, checkpoint63j, checkpoint63k, checkpoint63d, checkpoint63e, checkpoint63f, checkpoint63g, checkpoint63a, checkpoint63b, checkpoint63c, checkpoint64, checkpoint65, checkpoint63, checkpoint66g, checkpoint66f, checkpoint66e, checkpoint66d, checkpoint66c, checkpoint66b, checkpoint66a, checkpoint66l, checkpoint66k, checkpoint66j, checkpoint66i, checkpoint66h, checkpoint65z, checkpoint65x, checkpoint65y, checkpoint65r, checkpoint65s, checkpoint65p, checkpoint65q, checkpoint65v, checkpoint65w, checkpoint65t, checkpoint65u, checkpoint65j, checkpoint65k, checkpoint65h, checkpoint65i, checkpoint65n, checkpoint65o, checkpoint65l, checkpoint65m, checkpoint65b, checkpoint65c, checkpoint65a, checkpoint65f, checkpoint65g, checkpoint65d, checkpoint65e, checkpoint62g, checkpoint62f, checkpoint62e, checkpoint62d, checkpoint62k, checkpoint62j, checkpoint62i, checkpoint62h, checkpoint62o, checkpoint62n, checkpoint62m, checkpoint62l, checkpoint62s, checkpoint62r, checkpoint62q, checkpoint62p, checkpoint62w, checkpoint62v, checkpoint62u, checkpoint62t, checkpoint62z, checkpoint62y, checkpoint62x
Changes since 1.17: +3 -3 lines
avoid unbalanced quote (single or double) in commented line

1 C $Header: /u/gcmpack/MITgcm/pkg/ptracers/ptracers_monitor.F,v 1.17 2009/12/21 00:17:00 jmc Exp $
2 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 I myIter, myTime, myThid )
12
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_PARAMS.h"
24 #include "PTRACERS_FIELDS.h"
25 #ifdef ALLOW_MONITOR
26 #include "MONITOR.h"
27 #endif
28
29 C !INPUT PARAMETERS: ===================================================
30 C myTime :: current time
31 C myIter :: current timestep
32 C myThid :: thread number
33 _RL myTime
34 INTEGER myIter
35 INTEGER myThid
36
37 C === Functions ====
38 LOGICAL DIFFERENT_MULTIPLE
39 EXTERNAL DIFFERENT_MULTIPLE
40 LOGICAL MASTER_CPU_IO
41 EXTERNAL MASTER_CPU_IO
42
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 CHARACTER*(MAX_LEN_MBUF) msgBuf
50 CHARACTER*(MAX_LEN_MBUF) suff
51 INTEGER ip
52 _RL dummyRL(6)
53 CEOP
54
55 IF ( DIFFERENT_MULTIPLE( PTRACERS_monitorFreq,myTime,deltaTClock )
56 & ) THEN
57
58 C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
59
60 C-- Ptracers field monitor start
61 IF ( MASTER_CPU_IO(myThid) ) THEN
62 C-- only the master thread is allowed to switch On/Off mon_write_stdout
63 C & mon_write_mnc (since it is 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 CALL MNC_CW_RL_W_S(
78 & 'D',mon_fname,1,1,'T', myTime, myThid)
79 CALL MNC_CW_SET_UDIM(mon_fname, 0, myThid)
80 mon_write_mnc = .TRUE.
81 ENDIF
82 #endif /* ALLOW_MNC */
83
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 C-- endif master cpu io
97 ENDIF
98
99 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 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 ENDIF
109 C Print the basic statistics of ptracer variables
110 CALL MON_SET_PREF('trcstat_',myThid)
111 DO ip = 1, PTRACERS_numInUse
112 WRITE(suff,'(A7,A2)') 'ptracer',PTRACERS_ioLabel(ip)
113 c WRITE(suff,'(A6,I4.4)') 'ptrac', ip
114 CALL MON_WRITESTATS_RL(
115 & Nr, pTracer(1-OLx,1-OLy,1,1,1,ip), suff,
116 & hFacC, maskInC, rA ,drF, dummyRL, myThid )
117 ENDDO
118
119 C-- Ptracers field monitor finish
120 IF ( MASTER_CPU_IO(myThid) ) THEN
121 C- only the master thread is allowed to switch On/Off mon_write_stdout
122 C & mon_write_mnc (since it is the only thread that uses those flags):
123
124 IF ( mon_write_stdout ) THEN
125 WRITE(msgBuf,'(2A)') '// ==========================',
126 & '============================='
127 CALL PRINT_MESSAGE( msgBuf, mon_ioUnit, SQUEEZE_RIGHT , 1)
128 WRITE(msgBuf,'(A)')
129 & '// End MONITOR ptracers field statistics'
130 CALL PRINT_MESSAGE( msgBuf, mon_ioUnit, SQUEEZE_RIGHT , 1)
131 WRITE(msgBuf,'(2A)') '// ==========================',
132 & '============================='
133 CALL PRINT_MESSAGE( msgBuf, mon_ioUnit, SQUEEZE_RIGHT , 1)
134 ENDIF
135
136 mon_write_stdout = .FALSE.
137 mon_write_mnc = .FALSE.
138
139 C- endif master cpu io
140 ENDIF
141
142 C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
143
144 C--- endif different multiple
145 ENDIF
146
147 #endif /* ALLOW_MONITOR */
148 #endif /* ALLOW_PTRACERS */
149
150 RETURN
151 END

  ViewVC Help
Powered by ViewVC 1.1.22