/[MITgcm]/MITgcm/pkg/opps/opps_output.F
ViewVC logotype

Contents of /MITgcm/pkg/opps/opps_output.F

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


Revision 1.2 - (show annotations) (download)
Sun Jan 3 19:15:31 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, checkpoint66e, checkpoint66d, checkpoint66c, checkpoint66b, checkpoint66a, 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, checkpoint62c, checkpoint62b, checkpoint62a, 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.1: +45 -86 lines
- fix missing filling of time-ave array.
- use simpler (no level index) cumulative-time counter: OPPS_timeAve(bi,bj)
- cumulate fields only if doing time-ave output (OPPStaveFreq > 0)
- changed to only full time-step increment (no first & last
   "half time-step"): this fix weird 1rst average after restart.
- remove MULTIPLE_RECORD_OPPS_STATE_FILES part (not fixed since a "stop"
    was added on 2009/06/17)

1 C $Header: /u/gcmpack/MITgcm/pkg/opps/opps_output.F,v 1.1 2009/06/17 14:20:54 jmc Exp $
2 C $Name: $
3
4 #include "OPPS_OPTIONS.h"
5
6 CBOP
7 C !ROUTINE: OPPS_OUTPUT
8 C !INTERFACE:
9 SUBROUTINE OPPS_OUTPUT( myTime, myIter, myThid )
10
11 C !DESCRIPTION: \bv
12 C *==========================================================*
13 C | SUBROUTINE OPPS_OUTPUT
14 C | o Do OPPS diagnostic output.
15 C *==========================================================
16 C | The following CPP flag (MULTIPLE_RECORD_OPPS_STATE_FILES) is
17 C | #define/#undefed here since it is specific to this routine
18 C | and very user-preference specific.
19 C |
20 C | If #undefed (default) the state files are written as in all versions
21 C | prior to checkpoint32, where a file is created per variable, per time
22 C | and per tile. This *has* to be the default because most users use this
23 C | mode and all utilities and scripts (diagnostic) assume this form.
24 C | It is also robust, as explained below.
25 C |
26 C | If #defined, subsequent snap-shots are written as records in the
27 C | same file (no iteration number in filenames).
28 C | Advantages: - fewer files
29 C | - for small problems, is easy to copy the output around
30 C | Disadvantages:
31 C | - breaks a lot of diagnostic scripts
32 C | - for large or long problems this creates huge files
33 C | - is an unexpected, unsolicited change in behaviour which came
34 C | as a surprise (in c32) and inconvenience to several users
35 C | - can not accomodate changing the frequency of output
36 C | after a pickup (this is trivial in previous method
37 C | but needs new code and parameters in this new method)
38 C *==========================================================*
39 C \ev
40
41 C !USES:
42 IMPLICIT NONE
43 C === Global variables ===
44 #include "SIZE.h"
45 #include "EEPARAMS.h"
46 #include "PARAMS.h"
47 #include "OPPS.h"
48 #include "OPPS_TAVE.h"
49
50 C !INPUT/OUTPUT PARAMETERS:
51 C == Routine arguments ==
52 C myTime :: my time in simulation ( s )
53 C myIter :: my Iteration number
54 C myThid :: my Thread Id number
55 _RL myTime
56 INTEGER myIter
57 INTEGER myThid
58
59 #ifdef ALLOW_OPPS
60 #ifdef ALLOW_TIMEAVE
61
62 C !FUNCTIONS:
63 LOGICAL DIFFERENT_MULTIPLE
64 EXTERNAL DIFFERENT_MULTIPLE
65
66 C !LOCAL VARIABLES:
67 C == Local variables ==
68 CHARACTER*(MAX_LEN_MBUF) suff
69 INTEGER bi, bj
70 _RL DDTT
71 #endif /* ALLOW_TIMEAVE */
72 CEOP
73
74 CMLC----------------------------------------------------------------
75 CMLC Dump snapshot of OPPS variables.
76 CMLC----------------------------------------------------------------
77 CML
78 CML IF ( myIter.NE.nIter0 .AND.
79 CML & DIFFERENT_MULTIPLE( OPPSdumpFreq, myTime, deltaTClock )
80 CML & ) THEN
81 CML
82 CML if (OPPSwriteState) then
83 CMLC Write each snap-shot as a new file
84 CMLC - creates many files but for large configurations is easier to
85 CMLC transfer analyse a particular snap-shots
86 CML WRITE(suff,'(I10.10)') myIter
87 CML CALL WRITE_FLD_XYZ_RL('OPPSconv.',suff,OPPSconvectCount,
88 CML & myIter,myThid)
89 CML endif
90 CML
91 CML ENDIF
92
93 C----------------------------------------------------------------
94 C Do OPPS time averaging.
95 C----------------------------------------------------------------
96
97 #ifdef ALLOW_TIMEAVE
98 IF ( OPPStaveFreq.GT.0. _d 0 ) THEN
99
100 IF ( myIter.EQ.nIter0 ) THEN
101 C Initialize averages to zero
102 DO bj = myByLo(myThid), myByHi(myThid)
103 DO bi = myBxLo(myThid), myBxHi(myThid)
104 CALL TIMEAVE_RESET( OPPSconvCountTave, Nr, bi, bj, myThid )
105 OPPS_timeAve(bi,bj) = 0.
106 ENDDO
107 ENDDO
108
109 ELSE
110 C Cumulate OPPS fields (for Time Average)
111 DDTT=deltaTclock
112 DO bj = myByLo(myThid), myByHi(myThid)
113 DO bi = myBxLo(myThid), myBxHi(myThid)
114 CALL TIMEAVE_CUMULATE( OPPSconvCountTave, OPPSconvectCount,
115 & Nr, DDTT, bi, bj, myThid )
116 C Keep record of how much time has been integrated over
117 OPPS_timeAve(bi,bj) = OPPS_timeAve(bi,bj)+DDTT
118 ENDDO
119 ENDDO
120 ENDIF
121
122 C Dump files and restart average computation if needed
123 IF ( myIter.NE.nIter0 .AND.
124 & DIFFERENT_MULTIPLE( OPPStaveFreq, myTime, deltaTClock )
125 & ) THEN
126
127 C Normalize by integrated time
128 DO bj = myByLo(myThid), myByHi(myThid)
129 DO bi = myBxLo(myThid), myBxHi(myThid)
130 CALL TIMEAVE_NORMALIZE( OPPSconvCountTave,
131 & OPPS_timeAve, Nr, bi, bj, myThid )
132 ENDDO
133 ENDDO
134
135 C Write each snap-shot as a new file
136 WRITE(suff,'(I10.10)') myIter
137 CALL WRITE_FLD_XYZ_RL('OPPSconvtave.',suff,OPPSconvCountTave,
138 & myIter,myThid)
139
140 C Reset averages to zero
141 DO bj = myByLo(myThid), myByHi(myThid)
142 DO bi = myBxLo(myThid), myBxHi(myThid)
143 CALL TIMEAVE_RESET( OPPSconvCountTave, Nr, bi, bj, myThid )
144 OPPS_timeAve(bi,bj) = 0.
145 ENDDO
146 ENDDO
147
148 C- end dump-files block
149 ENDIF
150
151 C- end if OPPStaveFreq > 0
152 ENDIF
153 #endif /* ALLOW_TIMEAVE */
154
155 #endif /* ALLOW_OPPS */
156
157 RETURN
158 END

  ViewVC Help
Powered by ViewVC 1.1.22