/[MITgcm]/MITgcm/pkg/diagnostics/diagnostics_switch_onoff.F
ViewVC logotype

Annotation of /MITgcm/pkg/diagnostics/diagnostics_switch_onoff.F

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


Revision 1.1 - (hide annotations) (download)
Mon Dec 20 01:53:53 2004 UTC (19 years, 4 months ago) by jmc
Branch: MAIN
CVS Tags: checkpoint57b_post, checkpoint57c_pre, checkpoint57c_post
Implement instantaneous output in diagnostics:
 setting a negative frequency in data.diagnostics produces
 "snap-shot" output (as opposed to time-average if freq > 0)

1 jmc 1.1 C $Header: $
2     C $Name: $
3    
4     #include "DIAG_OPTIONS.h"
5    
6     C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
7     CBOP 0
8     C !ROUTINE: DIAGNOSTICS_SWITCH_ONOFF
9    
10     C !INTERFACE:
11     SUBROUTINE DIAGNOSTICS_SWITCH_ONOFF( myIter, myThid )
12    
13     C !DESCRIPTION:
14     C-----
15     C Called at the beginning of the time-step,
16     C to switch on/off diagnostics for snap-shot output
17     C-----
18     C during iterations that are multiple of |freq|,
19     C switch ON diagnostics (ndiag>=0) that will become active
20     C and then can be written at the end of the time-step ;
21     C otherwise, put diagnostics in non-active mode (ndiag=-1)
22     C-----
23    
24     C !USES:
25     IMPLICIT NONE
26     #include "SIZE.h"
27     #include "EEPARAMS.h"
28     #include "PARAMS.h"
29     #include "DIAGNOSTICS_SIZE.h"
30     #include "DIAGNOSTICS.h"
31    
32     C !INPUT PARAMETERS:
33     C myIter :: current Iteration number
34     C myThid :: my Thread Id number
35     INTEGER myIter
36     INTEGER myThid
37     CEOP
38    
39     C !LOCAL VARIABLES:
40     C newIter :: future iteration number
41     C j,m,n :: loop index
42     c CHARACTER*(MAX_LEN_MBUF) msgBuf
43     INTEGER newIter
44     INTEGER j, m, n
45    
46     _BEGIN_MASTER(myThid)
47    
48     C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
49    
50     newIter = 1 + myIter
51     DO n = 1,nlists
52     IF ( freq(n).LT.0 ) THEN
53     C-- Select diagnostics list that uses instantaneous output
54    
55     IF ( MOD(newIter,freq(n)).EQ.0 ) THEN
56     C-- switch ON diagnostics of output-stream # n
57     DO m=1,nActive(n)
58     j = jdiag(m,n)
59     c IF (ndiag(j).NE.0) WRITE(0,*) myIter,j,ndiag(j),' ->',0
60     ndiag(j) = 0
61     ENDDO
62     ELSE
63     C-- switch OFF diagnostics of output-stream # n
64     DO m=1,nActive(n)
65     j = jdiag(m,n)
66     c IF (ndiag(j).NE.-1) WRITE(0,*) myIter,j,ndiag(j),' ->',-1
67     ndiag(j) = -1
68     ENDDO
69     ENDIF
70    
71     ENDIF
72     ENDDO
73    
74     C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
75    
76     _END_MASTER(myThid)
77    
78     C-jmc: do we need a "BARRIER" at this point ?
79     c _BARRIER
80    
81     RETURN
82     END

  ViewVC Help
Powered by ViewVC 1.1.22