1 |
c $Header: /u/gcmpack/MITgcm/pkg/exf/exf_check_range.F,v 1.14 2004/12/20 23:32:52 dimitri Exp $ |
2 |
|
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 |
_RL mytime |
29 |
integer myiter, mythid |
30 |
|
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 |
integer exferr |
44 |
|
45 |
c == end of interface == |
46 |
|
47 |
exferr = 0 |
48 |
|
49 |
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 |
do bi = itlo,ithi |
60 |
|
61 |
do j = jmin,jmax |
62 |
do i = imin,imax |
63 |
c |
64 |
c Heat flux. |
65 |
if ( ( hflux(i,j,bi,bj) .GT. 1600. .OR. |
66 |
& hflux(i,j,bi,bj) .LT. -500. ) .AND. |
67 |
& hFacC(i,j,1,bi,bj) .NE. 0. ) then |
68 |
print *, 'EXF WARNING: hflux out of range for i,j= ', |
69 |
& i, j, hflux(i,j,bi,bj) |
70 |
exferr = 1 |
71 |
endif |
72 |
c |
73 |
c Salt flux. |
74 |
if ( ABS(sflux(i,j,bi,bj)) .GT. 1.E-6 .AND. |
75 |
& hFacC(i,j,1,bi,bj) .NE. 0. ) then |
76 |
print *, 'EXF WARNING: sflux out of range for i,j= ', |
77 |
& i, j, sflux(i,j,bi,bj) |
78 |
exferr = 1 |
79 |
endif |
80 |
c |
81 |
c Zonal wind stress. |
82 |
if ( ABS(ustress(i,j,bi,bj)) .GT. 2.5 .AND. |
83 |
& hFacW(i,j,1,bi,bj) .NE. 0. ) then |
84 |
print *, 'EXF WARNING: ustress out of range for i,j= ', |
85 |
& i, j, ustress(i,j,bi,bj) |
86 |
exferr = 1 |
87 |
endif |
88 |
c |
89 |
c Meridional wind stress. |
90 |
if ( ABS(vstress(i,j,bi,bj)) .GT. 2. .AND. |
91 |
& hFacS(i,j,1,bi,bj) .NE. 0. ) then |
92 |
print *, 'EXF WARNING: vstress out of range for i,j= ', |
93 |
& i, j, vstress(i,j,bi,bj) |
94 |
exferr = 1 |
95 |
endif |
96 |
c |
97 |
#ifdef ALLOW_ATM_WIND |
98 |
c zonal wind speed |
99 |
if ( ABS(uwind(i,j,bi,bj)) .GT. 100. .AND. |
100 |
& hFacW(i,j,1,bi,bj) .NE. 0. ) then |
101 |
print *, 'EXF WARNING: uwind out of range for i,j= ', |
102 |
& i, j, uwind(i,j,bi,bj) |
103 |
exferr = 1 |
104 |
endif |
105 |
c |
106 |
c zonal wind speed |
107 |
if ( ABS(vwind(i,j,bi,bj)) .GT. 100. .AND. |
108 |
& hFacS(i,j,1,bi,bj) .NE. 0. ) then |
109 |
print *, 'EXF WARNING: vwind out of range for i,j= ', |
110 |
& i, j, vwind(i,j,bi,bj) |
111 |
exferr = 1 |
112 |
endif |
113 |
#endif |
114 |
|
115 |
#ifdef ALLOW_ATM_TEMP |
116 |
c 2-m air temperature |
117 |
if ( (atemp(i,j,bi,bj) .LT. 183 .OR. |
118 |
& atemp(i,j,bi,bj) .GT. 343 ) .AND. |
119 |
& hFacC(i,j,1,bi,bj) .NE. 0. ) then |
120 |
print *, 'EXF WARNING: atemp + exf_offset_atemp ', |
121 |
& 'out of range for i,j= ', |
122 |
& i, j, atemp(i,j,bi,bj) |
123 |
exferr = 1 |
124 |
endif |
125 |
c |
126 |
c 2-m specific humidity |
127 |
if ( (aqh(i,j,bi,bj) .LT. 0. .OR. |
128 |
& aqh(i,j,bi,bj) .GT. 0.1 ) .AND. |
129 |
& hFacC(i,j,1,bi,bj) .NE. 0. ) then |
130 |
print *, 'EXF WARNING: aqh out of range for i,j= ', |
131 |
& i, j, aqh(i,j,bi,bj) |
132 |
exferr = 1 |
133 |
endif |
134 |
c |
135 |
c precipitation rate |
136 |
if ( (precip(i,j,bi,bj) .LT. 0. .OR. |
137 |
& precip(i,j,bi,bj) .GT. 2.E-6 ) .AND. |
138 |
& hFacC(i,j,1,bi,bj) .NE. 0. ) then |
139 |
print *, 'EXF WARNING: precip out of range for i,j= ', |
140 |
& i, j, precip(i,j,bi,bj) |
141 |
exferr = 1 |
142 |
endif |
143 |
#endif |
144 |
|
145 |
#ifdef SHORTWAVE_HEATING |
146 |
c Short wave radiative flux. |
147 |
if ( (swflux(i,j,bi,bj) .GT. 1. .OR. |
148 |
& swflux(i,j,bi,bj) .LT. -800. ) .AND. |
149 |
& hFacC(i,j,1,bi,bj) .NE. 0. ) then |
150 |
print *, 'EXF WARNING: swflux out of range for i,j= ', |
151 |
& i, j, swflux(i,j,bi,bj) |
152 |
exferr = 1 |
153 |
endif |
154 |
#endif |
155 |
|
156 |
#ifdef ALLOW_RUNOFF |
157 |
c Runoff. |
158 |
if ( (runoff(i,j,bi,bj) .LT. 0. .OR. |
159 |
& runoff(i,j,bi,bj) .GT. 1.E-6 ) .AND. |
160 |
& hFacC(i,j,1,bi,bj) .NE. 0. ) then |
161 |
print *, 'EXF WARNING: runoff out of range for i,j= ', |
162 |
& i, j, runoff(i,j,bi,bj) |
163 |
print *, 'Please note that input units for runoff are' |
164 |
print *, 'm/s not m/yr. If input file is in m/yr, set' |
165 |
print *, 'exf_inscal_runoff=3.171e-8' |
166 |
print *, 'in the data.exf input file.' |
167 |
exferr = 1 |
168 |
endif |
169 |
#endif |
170 |
|
171 |
if ( exferr .NE. 0 ) then |
172 |
print *, 'EXF WARNING: If you think these values are OK ' |
173 |
print *, 'EXF WARNING: then set useExfCheckRange=.FALSE.' |
174 |
STOP 'in S/R exf_check_range' |
175 |
endif |
176 |
|
177 |
enddo |
178 |
enddo |
179 |
c |
180 |
enddo |
181 |
enddo |
182 |
|
183 |
end |