1 |
C $Header: /u/gcmpack/MITgcm/pkg/land/land_monitor.F,v 1.1 2004/03/11 14:41:59 jmc Exp $ |
2 |
C $Name: $ |
3 |
|
4 |
#include "LAND_OPTIONS.h" |
5 |
|
6 |
CBOP |
7 |
C !ROUTINE: LAND_MONITOR |
8 |
C !INTERFACE: |
9 |
SUBROUTINE LAND_MONITOR( land_frc, myTime, myIter, myThid ) |
10 |
|
11 |
C !DESCRIPTION: \bv |
12 |
C *==========================================================* |
13 |
C | SUBROUTINE LAND_MONITOR |
14 |
C | o Do land global & Hemispheric diagnostic |
15 |
C *==========================================================* |
16 |
C \ev |
17 |
|
18 |
C !USES: |
19 |
IMPLICIT NONE |
20 |
|
21 |
C === Global variables === |
22 |
C-- size for MITgcm & Land package : |
23 |
#include "LAND_SIZE.h" |
24 |
|
25 |
#include "EEPARAMS.h" |
26 |
#include "PARAMS.h" |
27 |
#include "GRID.h" |
28 |
#include "LAND_PARAMS.h" |
29 |
#include "LAND_VARS.h" |
30 |
#ifdef ALLOW_MONITOR |
31 |
#include "MONITOR.h" |
32 |
#endif |
33 |
|
34 |
C !INPUT/OUTPUT PARAMETERS: |
35 |
C == Routine arguments == |
36 |
C land_frc :: land fraction [0-1] |
37 |
C myTime :: Current time of simulation ( s ) |
38 |
C myIter :: Iteration number |
39 |
C myThid :: Number of this instance of INI_FORCING |
40 |
_RS land_frc(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) |
41 |
_RL myTime |
42 |
INTEGER myIter |
43 |
INTEGER myThid |
44 |
CEOP |
45 |
|
46 |
#ifdef ALLOW_LAND |
47 |
#ifdef ALLOW_MONITOR |
48 |
|
49 |
LOGICAL DIFFERENT_MULTIPLE |
50 |
EXTERNAL DIFFERENT_MULTIPLE |
51 |
|
52 |
C == Local variables == |
53 |
C nLatBnd :: Number of latitude bands |
54 |
C msgBuf :: Informational/error meesage buffer |
55 |
C mon_var :: Variable sufix name |
56 |
C mon_sufx :: Latitude band sufix |
57 |
C n, k :: loop counter |
58 |
C yBand :: latitude separation |
59 |
C locDr :: thickness (= 1. here) |
60 |
C theMin :: lat. band minimum value |
61 |
C theMax :: lat. band maximum value |
62 |
C theMean :: lat. band mean value |
63 |
C theVar :: lat. band variance |
64 |
C theVol :: lat. band volume (or area if locDr=1.) |
65 |
C theMeanG :: global mean value |
66 |
C theVarG :: global variance |
67 |
C theVolG :: global volume (or area if locDr=1.) |
68 |
C theEng :: lat. band energy content |
69 |
C theEnergy :: total energy |
70 |
INTEGER nLatBnd |
71 |
PARAMETER ( nLatBnd = 3 ) |
72 |
CHARACTER*(MAX_LEN_MBUF) msgBuf |
73 |
CHARACTER*10 mon_var |
74 |
CHARACTER*2 mon_sufx(0:nLatBnd) |
75 |
INTEGER n, k |
76 |
_RS yBand(nLatBnd), locDr(land_nLev) |
77 |
_RL theMin(nLatBnd), theMax(nLatBnd) |
78 |
_RL theMean(nLatBnd), theVar(nLatBnd), theVol(nLatBnd) |
79 |
_RL theMeanG, theVarG, theVolG |
80 |
_RL theEng(nLatBnd), theEnergy |
81 |
|
82 |
DATA yBand / 0. , -24. , 24. / |
83 |
DATA mon_sufx / '_G' , '_S' , '_T' , '_N' / |
84 |
|
85 |
C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----| |
86 |
|
87 |
IF ( DIFFERENT_MULTIPLE(land_monFreq,myTime,myTime-deltaTclock) |
88 |
& .OR. myIter.EQ.nIter0 ) THEN |
89 |
|
90 |
mon_write_stdout = .TRUE. |
91 |
|
92 |
DO k=1,land_nLev |
93 |
locDr(k)= 1. |
94 |
ENDDO |
95 |
|
96 |
_BEGIN_MASTER(myThid) |
97 |
WRITE(msgBuf,'(A)') |
98 |
&'// =======================================================' |
99 |
CALL PRINT_MESSAGE( msgBuf, mon_ioUnit, SQUEEZE_RIGHT , 1) |
100 |
WRITE(msgBuf,'(A)') '// Begin MONITOR Land statistics' |
101 |
CALL PRINT_MESSAGE( msgBuf, mon_ioUnit, SQUEEZE_RIGHT , 1) |
102 |
WRITE(msgBuf,'(A)') |
103 |
&'// =======================================================' |
104 |
CALL PRINT_MESSAGE( msgBuf, mon_ioUnit, SQUEEZE_RIGHT , 1) |
105 |
_END_MASTER(myThid) |
106 |
|
107 |
CALL MON_SET_PREF('land_',myThid) |
108 |
CALL MON_OUT_RL('time_sec', myTime,mon_string_none,myThid) |
109 |
|
110 |
C-- Snow thickness : |
111 |
CALL MON_STATS_LATBND_RL( |
112 |
I 1, 1, 1, nLatBnd, yBand, |
113 |
I land_hSnow, land_frc, maskH, rA, yC, locDr, |
114 |
O theMin, theMax, theMean, theVar, theVol, |
115 |
I myThid ) |
116 |
theVolG = 0. |
117 |
theMeanG= 0. |
118 |
DO n=1,nLatBnd |
119 |
theVolG = theVolG + theVol(n) |
120 |
theMeanG = theMeanG + theMean(n)*theVol(n) |
121 |
theEng(n)= -land_rhoSnow*land_Lfreez*theMean(n)*theVol(n) |
122 |
ENDDO |
123 |
IF (theVolG.GT.0.) theMeanG = theMeanG / theVolG |
124 |
|
125 |
mon_var='SnwH_ave' |
126 |
CALL MON_OUT_RL(mon_var,theMeanG , mon_sufx(0), myThid) |
127 |
CALL MON_OUT_RL(mon_var,theMean(1), mon_sufx(1), myThid) |
128 |
CALL MON_OUT_RL(mon_var,theMean(2), mon_sufx(2), myThid) |
129 |
CALL MON_OUT_RL(mon_var,theMean(3), mon_sufx(3), myThid) |
130 |
mon_var='SnwH_max' |
131 |
CALL MON_OUT_RL(mon_var, theMax(1), mon_sufx(1), myThid) |
132 |
CALL MON_OUT_RL(mon_var, theMax(2), mon_sufx(2), myThid) |
133 |
CALL MON_OUT_RL(mon_var, theMax(3), mon_sufx(3), myThid) |
134 |
|
135 |
IF ( myIter.EQ.1+nIter0 ) THEN |
136 |
_BEGIN_MASTER(myThid) |
137 |
WRITE(msgBuf,'(A,1PE16.9,A,0P9F7.2)') '%MON LAND : Area=', |
138 |
& theVolG, ' ; Lat sep=', (yBand(n),n=2,nLatBnd) |
139 |
CALL PRINT_MESSAGE( msgBuf, mon_ioUnit, SQUEEZE_RIGHT , 1) |
140 |
WRITE(msgBuf,'(A,1P9E16.9)') '%MON LAND : LatA=', |
141 |
& (theVol(n),n=1,nLatBnd) |
142 |
CALL PRINT_MESSAGE( msgBuf, mon_ioUnit, SQUEEZE_RIGHT , 1) |
143 |
_END_MASTER(myThid) |
144 |
ENDIF |
145 |
|
146 |
C-- Total Energy : |
147 |
CALL MON_STATS_LATBND_RL( |
148 |
I land_nLev, 1, 0, nLatBnd, yBand, |
149 |
I land_enthalp, land_frc, maskH, rA, yC, land_dzF, |
150 |
O theMin, theMax, theMean, theVar, theVol, |
151 |
I myThid ) |
152 |
theEnergy = 0. |
153 |
DO n=1,nLatBnd |
154 |
theEng(n) = theEng(n) + theMean(n)*theVol(n) |
155 |
theEnergy = theEnergy + theEng(n) |
156 |
ENDDO |
157 |
mon_var='TotEnerg' |
158 |
CALL MON_OUT_RL(mon_var,theEnergy, mon_sufx(0), myThid) |
159 |
CALL MON_OUT_RL(mon_var,theEng(1), mon_sufx(1), myThid) |
160 |
CALL MON_OUT_RL(mon_var,theEng(2), mon_sufx(2), myThid) |
161 |
CALL MON_OUT_RL(mon_var,theEng(3), mon_sufx(3), myThid) |
162 |
|
163 |
C-- Surface Temp. : |
164 |
CALL MON_STATS_LATBND_RL( |
165 |
I 1, 1, 1, nLatBnd, yBand, |
166 |
I land_skinT, land_frc, maskH, rA, yC, locDr, |
167 |
O theMin, theMax, theMean, theVar, theVol, |
168 |
I myThid ) |
169 |
theVolG = 0. |
170 |
theMeanG= 0. |
171 |
DO n=1,nLatBnd |
172 |
theVolG = theVolG + theVol(n) |
173 |
theMeanG = theMeanG + theMean(n)*theVol(n) |
174 |
ENDDO |
175 |
IF (theVolG.GT.0.) theMeanG = theMeanG / theVolG |
176 |
|
177 |
mon_var='Tsrf_ave' |
178 |
CALL MON_OUT_RL(mon_var,theMeanG , mon_sufx(0), myThid) |
179 |
CALL MON_OUT_RL(mon_var,theMean(1), mon_sufx(1), myThid) |
180 |
CALL MON_OUT_RL(mon_var,theMean(2), mon_sufx(2), myThid) |
181 |
CALL MON_OUT_RL(mon_var,theMean(3), mon_sufx(3), myThid) |
182 |
mon_var='Tsrf_min' |
183 |
CALL MON_OUT_RL(mon_var, theMin(1), mon_sufx(1), myThid) |
184 |
CALL MON_OUT_RL(mon_var, theMin(2), mon_sufx(2), myThid) |
185 |
CALL MON_OUT_RL(mon_var, theMin(3), mon_sufx(3), myThid) |
186 |
mon_var='Tsrf_max' |
187 |
CALL MON_OUT_RL(mon_var, theMax(1), mon_sufx(1), myThid) |
188 |
CALL MON_OUT_RL(mon_var, theMax(2), mon_sufx(2), myThid) |
189 |
CALL MON_OUT_RL(mon_var, theMax(3), mon_sufx(3), myThid) |
190 |
|
191 |
C-- 1rst level (volume-mean) Temp. : |
192 |
CALL MON_STATS_LATBND_RL( |
193 |
I land_nLev, 1, 1, nLatBnd, yBand, |
194 |
I land_groundT, land_frc, maskH, rA, yC, locDr, |
195 |
O theMin, theMax, theMean, theVar, theVol, |
196 |
I myThid ) |
197 |
theVolG = 0. |
198 |
theMeanG= 0. |
199 |
DO n=1,nLatBnd |
200 |
theVolG = theVolG + theVol(n) |
201 |
theMeanG = theMeanG + theMean(n)*theVol(n) |
202 |
ENDDO |
203 |
IF (theVolG.GT.0.) theMeanG = theMeanG / theVolG |
204 |
|
205 |
mon_var='Tgr1_ave' |
206 |
CALL MON_OUT_RL(mon_var,theMeanG , mon_sufx(0), myThid) |
207 |
CALL MON_OUT_RL(mon_var,theMean(1), mon_sufx(1), myThid) |
208 |
CALL MON_OUT_RL(mon_var,theMean(2), mon_sufx(2), myThid) |
209 |
CALL MON_OUT_RL(mon_var,theMean(3), mon_sufx(3), myThid) |
210 |
mon_var='Tgr1_min' |
211 |
CALL MON_OUT_RL(mon_var, theMin(1), mon_sufx(1), myThid) |
212 |
CALL MON_OUT_RL(mon_var, theMin(2), mon_sufx(2), myThid) |
213 |
CALL MON_OUT_RL(mon_var, theMin(3), mon_sufx(3), myThid) |
214 |
mon_var='Tgr1_max' |
215 |
CALL MON_OUT_RL(mon_var, theMax(1), mon_sufx(1), myThid) |
216 |
CALL MON_OUT_RL(mon_var, theMax(2), mon_sufx(2), myThid) |
217 |
CALL MON_OUT_RL(mon_var, theMax(3), mon_sufx(3), myThid) |
218 |
|
219 |
C-- 2nd level (volume-mean) Temp. : |
220 |
CALL MON_STATS_LATBND_RL( |
221 |
I land_nLev, 1, 2, nLatBnd, yBand, |
222 |
I land_groundT, land_frc, maskH, rA, yC, locDr, |
223 |
O theMin, theMax, theMean, theVar, theVol, |
224 |
I myThid ) |
225 |
theVolG = 0. |
226 |
theMeanG= 0. |
227 |
DO n=1,nLatBnd |
228 |
theVolG = theVolG + theVol(n) |
229 |
theMeanG = theMeanG + theMean(n)*theVol(n) |
230 |
ENDDO |
231 |
IF (theVolG.GT.0.) theMeanG = theMeanG / theVolG |
232 |
|
233 |
mon_var='Tgr2_ave' |
234 |
CALL MON_OUT_RL(mon_var,theMeanG , mon_sufx(0), myThid) |
235 |
CALL MON_OUT_RL(mon_var,theMean(1), mon_sufx(1), myThid) |
236 |
CALL MON_OUT_RL(mon_var,theMean(2), mon_sufx(2), myThid) |
237 |
CALL MON_OUT_RL(mon_var,theMean(3), mon_sufx(3), myThid) |
238 |
mon_var='Tgr2_min' |
239 |
CALL MON_OUT_RL(mon_var, theMin(1), mon_sufx(1), myThid) |
240 |
CALL MON_OUT_RL(mon_var, theMin(2), mon_sufx(2), myThid) |
241 |
CALL MON_OUT_RL(mon_var, theMin(3), mon_sufx(3), myThid) |
242 |
mon_var='Tgr2_max' |
243 |
CALL MON_OUT_RL(mon_var, theMax(1), mon_sufx(1), myThid) |
244 |
CALL MON_OUT_RL(mon_var, theMax(2), mon_sufx(2), myThid) |
245 |
CALL MON_OUT_RL(mon_var, theMax(3), mon_sufx(3), myThid) |
246 |
|
247 |
C-- Soil water content (level 1+2): |
248 |
CALL MON_STATS_LATBND_RL( |
249 |
I land_nLev, 1, 0, nLatBnd, yBand, |
250 |
I land_groundW, land_frc, maskH, rA, yC, land_dzF, |
251 |
O theMin, theMax, theMean, theVar, theVol, |
252 |
I myThid ) |
253 |
theVolG = 0. |
254 |
theMeanG= 0. |
255 |
DO n=1,nLatBnd |
256 |
theVolG = theVolG + theVol(n) |
257 |
theMeanG = theMeanG + theMean(n)*theVol(n) |
258 |
ENDDO |
259 |
IF (theVolG.GT.0.) theMeanG = theMeanG / theVolG |
260 |
|
261 |
mon_var='grdW_ave' |
262 |
CALL MON_OUT_RL(mon_var,theMeanG , mon_sufx(0), myThid) |
263 |
CALL MON_OUT_RL(mon_var,theMean(1), mon_sufx(1), myThid) |
264 |
CALL MON_OUT_RL(mon_var,theMean(2), mon_sufx(2), myThid) |
265 |
CALL MON_OUT_RL(mon_var,theMean(3), mon_sufx(3), myThid) |
266 |
mon_var='grdW_min' |
267 |
CALL MON_OUT_RL(mon_var, theMin(1), mon_sufx(1), myThid) |
268 |
CALL MON_OUT_RL(mon_var, theMin(2), mon_sufx(2), myThid) |
269 |
CALL MON_OUT_RL(mon_var, theMin(3), mon_sufx(3), myThid) |
270 |
c mon_var='grdW_max' |
271 |
c CALL MON_OUT_RL(mon_var, theMax(1), mon_sufx(1), myThid) |
272 |
c CALL MON_OUT_RL(mon_var, theMax(2), mon_sufx(2), myThid) |
273 |
c CALL MON_OUT_RL(mon_var, theMax(3), mon_sufx(3), myThid) |
274 |
|
275 |
_BEGIN_MASTER(myThid) |
276 |
WRITE(msgBuf,'(A)') |
277 |
&'// =======================================================' |
278 |
CALL PRINT_MESSAGE( msgBuf, mon_ioUnit, SQUEEZE_RIGHT , 1) |
279 |
WRITE(msgBuf,'(A)') '// End MONITOR Land statistics' |
280 |
CALL PRINT_MESSAGE( msgBuf, mon_ioUnit, SQUEEZE_RIGHT , 1) |
281 |
WRITE(msgBuf,'(A)') |
282 |
&'// =======================================================' |
283 |
CALL PRINT_MESSAGE( msgBuf, mon_ioUnit, SQUEEZE_RIGHT , 1) |
284 |
_END_MASTER(myThid) |
285 |
|
286 |
mon_write_stdout = .FALSE. |
287 |
|
288 |
ENDIF |
289 |
|
290 |
#endif /* ALLOW_MONITOR */ |
291 |
#endif /* ALLOW_LAND */ |
292 |
|
293 |
RETURN |
294 |
END |