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