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