/[MITgcm]/MITgcm/pkg/ggl90/ggl90_output.F
ViewVC logotype

Contents of /MITgcm/pkg/ggl90/ggl90_output.F

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


Revision 1.3 - (show annotations) (download)
Fri Aug 6 18:37:05 2010 UTC (13 years, 8 months ago) by gforget
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, checkpoint62k, checkpoint62j, checkpoint62o, checkpoint62n, checkpoint62m, checkpoint62l, checkpoint62s, checkpoint62r, checkpoint62q, checkpoint62p, checkpoint62w, checkpoint62v, checkpoint62u, checkpoint62t, checkpoint62z, checkpoint62y, checkpoint62x
Changes since 1.2: +19 -9 lines
Minor changes in pkg/ggl90:
 o GGL90diffKrS was removed --> always use GGL90diffKr
 o GGL90viscAr was removed --> replaced with GGL90viscArU, GGL90viscArV
 o hack of mxlMaxFlag=2 --> ensure mixing between first and second level (commented out for now)
 o change in max/min operations to ensure that smoothing is ok
 o smoothing of GGL90viscAr was moved to ggl90_calc.F (as done for GGL90diffKr)
 o always use diffKrNrT as background profile (i.e. never use diffKr field)

1 C $Header: /u/gcmpack/MITgcm/pkg/ggl90/ggl90_output.F,v 1.2 2010/01/03 18:55:06 jmc Exp $
2 C $Name: $
3
4 #include "GGL90_OPTIONS.h"
5
6 CBOP
7 C !ROUTINE: GGL90_OUTPUT
8 C !INTERFACE:
9 SUBROUTINE GGL90_OUTPUT( myTime, myIter, myThid )
10
11 C !DESCRIPTION: \bv
12 C *==========================================================*
13 C | SUBROUTINE GGL90_OUTPUT
14 C | o Do GGL90 diagnostic output.
15 C *==========================================================
16 C | The following CPP flag (MULTIPLE_RECORD_GGL90_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 "GGL90.h"
48 #include "GGL90_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_GGL90
60
61 C !FUNCTIONS:
62 LOGICAL DIFFERENT_MULTIPLE
63 EXTERNAL DIFFERENT_MULTIPLE
64
65 C !LOCAL VARIABLES:
66 C == Local variables ==
67 CHARACTER*(MAX_LEN_MBUF) suff
68 #ifdef ALLOW_TIMEAVE
69 INTEGER bi, bj
70 _RL DDTT
71 #endif
72 CEOP
73
74 C----------------------------------------------------------------
75 C Dump snapshot of GGL90 variables.
76 C----------------------------------------------------------------
77
78 IF (
79 & DIFFERENT_MULTIPLE(GGL90dumpFreq,myTime,deltaTClock)
80 & ) THEN
81
82 IF (GGL90writeState) THEN
83 C Write each snap-shot as a new file
84 WRITE(suff,'(I10.10)') myIter
85 IF ( myIter.NE.nIter0 ) THEN
86 CALL WRITE_FLD_XYZ_RL( 'GGL90viscArU.', suff,
87 & GGL90viscArU, myIter, myThid )
88 CALL WRITE_FLD_XYZ_RL( 'GGL90viscArV.', suff,
89 & GGL90viscArV, myIter, myThid )
90 CALL WRITE_FLD_XYZ_RL( 'GGL90diffKr.', suff,
91 & GGL90diffKr, myIter, myThid )
92 ENDIF
93 CALL WRITE_FLD_XYZ_RL( 'GGL90TKE.', suff,
94 & GGL90TKE, myIter, myThid )
95 ENDIF
96
97 ENDIF
98
99 C----------------------------------------------------------------
100 C Do GGL90 time averaging.
101 C----------------------------------------------------------------
102
103 #ifdef ALLOW_TIMEAVE
104 IF ( GGL90taveFreq .GT. 0. _d 0 ) THEN
105
106 IF ( myIter.EQ.nIter0 ) THEN
107 C Initialize averages to zero
108 DO bj = myByLo(myThid), myByHi(myThid)
109 DO bi = myBxLo(myThid), myBxHi(myThid)
110 CALL TIMEAVE_RESET( GGL90viscArUtave, Nr, bi, bj, myThid )
111 CALL TIMEAVE_RESET( GGL90viscArVtave, Nr, bi, bj, myThid )
112 CALL TIMEAVE_RESET( GGL90diffKrtave, Nr, bi, bj, myThid )
113 CALL TIMEAVE_RESET( GGL90TKEtave, Nr, bi, bj, myThid )
114 GGL90_timeAve(bi,bj) = 0.
115 ENDDO
116 ENDDO
117
118 ELSE
119 C Cumulate GGL90 fields (for Time Average)
120 DDTT=deltaTclock
121 DO bj = myByLo(myThid), myByHi(myThid)
122 DO bi = myBxLo(myThid), myBxHi(myThid)
123 CALL TIMEAVE_CUMULATE( GGL90viscArUtave, GGL90viscArU,
124 & Nr, DDTT, bi, bj, myThid )
125 CALL TIMEAVE_CUMULATE( GGL90viscArVtave, GGL90viscArV,
126 & Nr, DDTT, bi, bj, myThid )
127 CALL TIMEAVE_CUMULATE( GGL90diffKrtave, GGL90diffKr,
128 & Nr, DDTT, bi, bj, myThid )
129 CALL TIMEAVE_CUMULATE( GGL90TKEtave, GGL90TKE,
130 & Nr, DDTT, bi, bj, myThid )
131 C Keep record of how much time has been integrated over
132 GGL90_timeAve(bi,bj) = GGL90_timeAve(bi,bj)+DDTT
133 ENDDO
134 ENDDO
135 ENDIF
136
137 C Dump files and restart average computation if needed
138 IF ( myIter.NE.nIter0 .AND.
139 & DIFFERENT_MULTIPLE(GGL90taveFreq,myTime,deltaTClock)
140 & ) THEN
141
142 C Normalize by integrated time
143 DO bj = myByLo(myThid), myByHi(myThid)
144 DO bi = myBxLo(myThid), myBxHi(myThid)
145 CALL TIMEAVE_NORMALIZE( GGL90viscArUtave,
146 & GGL90_timeAve, Nr, bi, bj, myThid )
147 CALL TIMEAVE_NORMALIZE( GGL90viscArVtave,
148 & GGL90_timeAve, Nr, bi, bj, myThid )
149 CALL TIMEAVE_NORMALIZE( GGL90diffKrtave,
150 & GGL90_timeAve, Nr, bi, bj, myThid )
151 CALL TIMEAVE_NORMALIZE( GGL90TKEtave,
152 & GGL90_timeAve, Nr, bi, bj, myThid )
153 ENDDO
154 ENDDO
155
156 C Write each snap-shot as a new file
157 WRITE(suff,'(I10.10)') myIter
158 CALL WRITE_FLD_XYZ_RL( 'GGL90viscArU-T.', suff,
159 & GGL90viscArUtave, myIter, myThid )
160 CALL WRITE_FLD_XYZ_RL( 'GGL90viscArV-T.', suff,
161 & GGL90viscArVtave, myIter, myThid )
162 CALL WRITE_FLD_XYZ_RL( 'GGL90diffKr-T.', suff,
163 & GGL90diffKrTave, myIter, myThid )
164 CALL WRITE_FLD_XYZ_RL( 'GGL90TKE-T.', suff,
165 & GGL90TKETave, myIter, myThid )
166
167 C Reset averages to zero
168 DO bj = myByLo(myThid), myByHi(myThid)
169 DO bi = myBxLo(myThid), myBxHi(myThid)
170 CALL TIMEAVE_RESET( GGL90viscArUtave, Nr, bi, bj, myThid )
171 CALL TIMEAVE_RESET( GGL90viscArVtave, Nr, bi, bj, myThid )
172 CALL TIMEAVE_RESET( GGL90diffKrtave, Nr, bi, bj, myThid )
173 CALL TIMEAVE_RESET( GGL90TKEtave, Nr, bi, bj, myThid )
174 GGL90_timeAve(bi,bj) = 0.
175 ENDDO
176 ENDDO
177
178 C- end dump-files block
179 ENDIF
180
181 C- end if GGL90taveFreq > 0
182 ENDIF
183 #endif /* ALLOW_TIMEAVE */
184
185 #endif /* ALLOW_GGL90 */
186
187 RETURN
188 END

  ViewVC Help
Powered by ViewVC 1.1.22