/[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.10 - (hide annotations) (download)
Tue Nov 8 15:53:41 2005 UTC (18 years, 6 months ago) by cnh
Branch: MAIN
CVS Tags: checkpoint58e_post, checkpoint57y_post, checkpoint58h_post, checkpoint57y_pre, checkpoint58j_post, checkpoint58, checkpoint58f_post, checkpoint57x_post, checkpoint58d_post, checkpoint58c_post, checkpoint58a_post, checkpoint58i_post, checkpoint58g_post, checkpoint57z_post, checkpoint58b_post
Changes since 1.9: +6 -2 lines
Changes toward getting exf working multi-threaded.
  o added some opitonal consistency check in barrier for
    trapping barrier calls in singel threaded region
  o removed a single thread block in ini_depths - singleCpuIO
    still broken.
  o modified parts of exf_ that were setting local stack variables
    in single threaded section and then referencing them from all
    threads.
  o commented out strange stop in mdsio for multithreading which
    seems uneeded.
  o fixed ptracers initialization and changed ptracers monitor
    to avoid race condition in which several threads set a shared
    logical flag at arbitrary moments with respect to each other

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

  ViewVC Help
Powered by ViewVC 1.1.22