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