1 |
C $Header: $ |
2 |
C $Name: $ |
3 |
|
4 |
#include "EXF_OPTIONS.h" |
5 |
|
6 |
subroutine exf_check_range( mytime, myiter, mythid ) |
7 |
|
8 |
c ================================================================== |
9 |
c SUBROUTINE exf_check_range |
10 |
c ================================================================== |
11 |
c |
12 |
implicit none |
13 |
|
14 |
c == global variables == |
15 |
|
16 |
#include "EEPARAMS.h" |
17 |
#include "SIZE.h" |
18 |
#include "FFIELDS.h" |
19 |
#include "GRID.h" |
20 |
|
21 |
#include "EXF_PARAM.h" |
22 |
#include "EXF_CONSTANTS.h" |
23 |
#include "EXF_FIELDS.h" |
24 |
#include "EXF_CLIM_FIELDS.h" |
25 |
c == routine arguments == |
26 |
|
27 |
c mythid - thread number for this instance of the routine. |
28 |
|
29 |
_RL mytime |
30 |
integer myiter, mythid |
31 |
|
32 |
c == local variables == |
33 |
|
34 |
integer bi,bj |
35 |
integer i,j |
36 |
integer jtlo |
37 |
integer jthi |
38 |
integer itlo |
39 |
integer ithi |
40 |
integer jmin |
41 |
integer jmax |
42 |
integer imin |
43 |
integer imax |
44 |
integer exferr |
45 |
|
46 |
c == end of interface == |
47 |
|
48 |
exferr = 0 |
49 |
|
50 |
jtlo = mybylo(mythid) |
51 |
jthi = mybyhi(mythid) |
52 |
itlo = mybxlo(mythid) |
53 |
ithi = mybxhi(mythid) |
54 |
|
55 |
C Change checking range because some atmospheric fields will |
56 |
C not always have valid values in the tile edges. |
57 |
C jmin = 1-oly |
58 |
C jmax = sny+oly |
59 |
C imin = 1-olx |
60 |
C imax = snx+olx |
61 |
jmin = 1 |
62 |
jmax = sny |
63 |
imin = 1 |
64 |
imax = snx |
65 |
|
66 |
do bj = jtlo,jthi |
67 |
do bi = itlo,ithi |
68 |
|
69 |
do j = jmin,jmax |
70 |
do i = imin,imax |
71 |
c |
72 |
c Heat flux. |
73 |
if ( ( hflux(i,j,bi,bj) .GT. 1600. .OR. |
74 |
& hflux(i,j,bi,bj) .LT. -500. ) .AND. |
75 |
& maskC(i,j,1,bi,bj) .NE. 0. ) then |
76 |
write(standardmessageunit,'(A,5(1X,I6),2X,D22.15)') |
77 |
& 'EXF WARNING: hflux out of range for bi,bj,i,j,it= ', |
78 |
& bi, bj, i, j, myiter, hflux(i,j,bi,bj) |
79 |
exferr = 1 |
80 |
endif |
81 |
c |
82 |
c Salt flux. |
83 |
if ( ABS(sflux(i,j,bi,bj)) .GT. 1.E-6 .AND. |
84 |
& maskC(i,j,1,bi,bj) .NE. 0. ) then |
85 |
write(standardmessageunit,'(A,5(1X,I6),2X,D22.15)') |
86 |
& 'EXF WARNING: sflux out of range for bi,bj,i,j,it= ', |
87 |
& bi, bj, i, j, myiter, sflux(i,j,bi,bj) |
88 |
exferr = 1 |
89 |
endif |
90 |
c |
91 |
c Zonal wind stress. |
92 |
if ( ABS(ustress(i,j,bi,bj)) .GT. 2.7 .AND. |
93 |
& maskW(i,j,1,bi,bj) .NE. 0. ) then |
94 |
write(standardmessageunit,'(A,5(1X,I6),2X,D22.15)') |
95 |
& 'EXF WARNING: ustress out of range for bi,bj,i,j,it= ', |
96 |
& bi, bj, i, j, myiter, ustress(i,j,bi,bj) |
97 |
exferr = 1 |
98 |
endif |
99 |
c |
100 |
c Meridional wind stress. |
101 |
if ( ABS(vstress(i,j,bi,bj)) .GT. 2.3 .AND. |
102 |
& maskS(i,j,1,bi,bj) .NE. 0. ) then |
103 |
write(standardmessageunit,'(A,5(1X,I6),2X,D22.15)') |
104 |
& 'EXF WARNING: vstress out of range for bi,bj,i,j,it= ', |
105 |
& bi, bj, i, j, myiter, vstress(i,j,bi,bj) |
106 |
exferr = 1 |
107 |
endif |
108 |
c |
109 |
#ifdef ALLOW_ATM_WIND |
110 |
c zonal wind speed |
111 |
if ( ABS(uwind(i,j,bi,bj)) .GT. 100. .AND. |
112 |
& maskW(i,j,1,bi,bj) .NE. 0. ) then |
113 |
write(standardmessageunit,'(A,5(1X,I6),2X,D22.15)') |
114 |
& 'EXF WARNING: uwind out of range for bi,bj,i,j,it= ', |
115 |
& bi, bj, i, j, myiter, uwind(i,j,bi,bj) |
116 |
exferr = 1 |
117 |
endif |
118 |
c |
119 |
c zonal wind speed |
120 |
if ( ABS(vwind(i,j,bi,bj)) .GT. 100. .AND. |
121 |
& maskS(i,j,1,bi,bj) .NE. 0. ) then |
122 |
write(standardmessageunit,'(A,5(1X,I6),2X,D22.15)') |
123 |
& 'EXF WARNING: vwind out of range for bi,bj,i,j,it= ', |
124 |
& bi, bj, i, j, myiter, vwind(i,j,bi,bj) |
125 |
exferr = 1 |
126 |
endif |
127 |
#endif |
128 |
c |
129 |
c wind speed modulus |
130 |
if ( ( wspeed(i,j,bi,bj) .LT. 0. .OR. |
131 |
& wspeed(i,j,bi,bj) .GT. 100. ) .AND. |
132 |
& maskS(i,j,1,bi,bj) .NE. 0. ) then |
133 |
write(standardmessageunit,'(A,5(1X,I6),2X,D22.15)') |
134 |
& 'EXF WARNING: wspeed out of range for bi,bj,i,j,it= ', |
135 |
& bi, bj, i, j, myiter, wspeed(i,j,bi,bj) |
136 |
exferr = 1 |
137 |
endif |
138 |
|
139 |
#ifdef ALLOW_ATM_TEMP |
140 |
c 2-m air temperature |
141 |
if ( (atemp(i,j,bi,bj) .LT. 183 .OR. |
142 |
& atemp(i,j,bi,bj) .GT. 343 ) .AND. |
143 |
& maskC(i,j,1,bi,bj) .NE. 0. ) then |
144 |
write(standardmessageunit,'(2A,5(1X,I6),2X,D22.15)') |
145 |
& 'EXF WARNING: atemp + exf_offset_atemp ', |
146 |
& 'out of range for bi,bj,i,j,it= ', |
147 |
& bi, bj, i, j, myiter, atemp(i,j,bi,bj) |
148 |
exferr = 1 |
149 |
endif |
150 |
c |
151 |
c 2-m specific humidity |
152 |
if ( (aqh(i,j,bi,bj) .LT. 0. .OR. |
153 |
& aqh(i,j,bi,bj) .GT. 0.1 ) .AND. |
154 |
& maskC(i,j,1,bi,bj) .NE. 0. ) then |
155 |
write(standardmessageunit,'(A,5(1X,I6),2X,D22.15)') |
156 |
& 'EXF WARNING: aqh out of range for bi,bj,i,j,it= ', |
157 |
& bi, bj, i, j, myiter, aqh(i,j,bi,bj) |
158 |
exferr = 1 |
159 |
endif |
160 |
c |
161 |
c precipitation rate |
162 |
if ( (precip(i,j,bi,bj) .LT. 0. .OR. |
163 |
& precip(i,j,bi,bj) .GT. 2.E-6 ) .AND. |
164 |
& maskC(i,j,1,bi,bj) .NE. 0. ) then |
165 |
write(standardmessageunit,'(A,5(1X,I6),2X,D22.15)') |
166 |
& 'EXF WARNING: precip out of range for bi,bj,i,j,it= ', |
167 |
& bi, bj, i, j, myiter, precip(i,j,bi,bj) |
168 |
exferr = 1 |
169 |
endif |
170 |
c |
171 |
c snow |
172 |
if ( (snowprecip(i,j,bi,bj) .LT. 0. .OR. |
173 |
& snowprecip(i,j,bi,bj) .GT. 2.E-6 ) .AND. |
174 |
& maskC(i,j,1,bi,bj) .NE. 0. ) then |
175 |
write(standardmessageunit,'(2A,5(1X,I6),2X,D22.15)') |
176 |
& 'EXF WARNING: snowprecip out of range ', |
177 |
& 'for bi,bj,i,j,it= ', |
178 |
& bi, bj, i, j, myiter, snowprecip(i,j,bi,bj) |
179 |
exferr = 1 |
180 |
endif |
181 |
#endif |
182 |
|
183 |
#ifdef SHORTWAVE_HEATING |
184 |
c Short wave radiative flux. |
185 |
if ( (swflux(i,j,bi,bj) .GT. 1. .OR. |
186 |
& swflux(i,j,bi,bj) .LT. -1000. ) .AND. |
187 |
& maskC(i,j,1,bi,bj) .NE. 0. ) then |
188 |
write(standardmessageunit,'(A,5(1X,I6),2X,D22.15)') |
189 |
& 'EXF WARNING: swflux out of range for bi,bj,i,j,it= ', |
190 |
& bi, bj, i, j, myiter, swflux(i,j,bi,bj) |
191 |
exferr = 1 |
192 |
endif |
193 |
#endif |
194 |
|
195 |
#ifdef ALLOW_RUNOFF |
196 |
c Runoff. |
197 |
if ( (runoff(i,j,bi,bj) .LT. 0. .OR. |
198 |
& runoff(i,j,bi,bj) .GT. 1.E-6 ) .AND. |
199 |
& maskC(i,j,1,bi,bj) .NE. 0. ) then |
200 |
write(standardmessageunit,'(A,5(1X,I6),2X,D22.15)') |
201 |
& 'EXF WARNING: runoff out of range for bi,bj,i,j,it= ', |
202 |
& bi, bj, i, j, myiter, runoff(i,j,bi,bj) |
203 |
write(standardmessageunit,'(A)') |
204 |
& 'Please note that input units for runoff are' |
205 |
write(standardmessageunit,'(A)') |
206 |
& 'm/s not m/yr. If input file is in m/yr, set' |
207 |
write(standardmessageunit,'(A)') |
208 |
& 'exf_inscal_runoff=3.170979198E-8' |
209 |
write(standardmessageunit,'(A)') |
210 |
& 'in the data.exf input file.' |
211 |
exferr = 1 |
212 |
endif |
213 |
#endif |
214 |
enddo |
215 |
enddo |
216 |
c |
217 |
enddo |
218 |
enddo |
219 |
|
220 |
if ( exferr .NE. 0 ) then |
221 |
write(standardmessageunit,'(A)') |
222 |
& 'EXF WARNING: If you think these values are OK ' |
223 |
write(standardmessageunit,'(A)') |
224 |
& 'EXF WARNING: then set useExfCheckRange=.FALSE.' |
225 |
STOP 'in S/R exf_check_range' |
226 |
endif |
227 |
|
228 |
end |