1 |
dimitri |
1.16 |
c $Header: /u/gcmpack/MITgcm/pkg/exf/exf_check_range.F,v 1.15 2004/12/29 22:49:55 dimitri 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 |
|
|
do bi = itlo,ithi |
60 |
|
|
|
61 |
|
|
do j = jmin,jmax |
62 |
|
|
do i = imin,imax |
63 |
|
|
c |
64 |
|
|
c Heat flux. |
65 |
dimitri |
1.15 |
if ( ( hflux(i,j,bi,bj) .GT. 1600. .OR. |
66 |
dimitri |
1.12 |
& hflux(i,j,bi,bj) .LT. -500. ) .AND. |
67 |
heimbach |
1.3 |
& 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 |
heimbach |
1.1 |
c |
73 |
|
|
c Salt flux. |
74 |
heimbach |
1.2 |
if ( ABS(sflux(i,j,bi,bj)) .GT. 1.E-6 .AND. |
75 |
heimbach |
1.3 |
& 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 |
heimbach |
1.1 |
c |
81 |
|
|
c Zonal wind stress. |
82 |
dimitri |
1.8 |
if ( ABS(ustress(i,j,bi,bj)) .GT. 2.5 .AND. |
83 |
heimbach |
1.3 |
& 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 |
heimbach |
1.1 |
c |
89 |
|
|
c Meridional wind stress. |
90 |
heimbach |
1.2 |
if ( ABS(vstress(i,j,bi,bj)) .GT. 2. .AND. |
91 |
heimbach |
1.3 |
& 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 |
heimbach |
1.1 |
c |
97 |
|
|
#ifdef ALLOW_ATM_WIND |
98 |
|
|
c zonal wind speed |
99 |
heimbach |
1.3 |
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 |
heimbach |
1.1 |
c |
106 |
|
|
c zonal wind speed |
107 |
heimbach |
1.3 |
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 |
heimbach |
1.1 |
#endif |
114 |
|
|
|
115 |
|
|
#ifdef ALLOW_ATM_TEMP |
116 |
|
|
c 2-m air temperature |
117 |
heimbach |
1.3 |
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 |
heimbach |
1.1 |
c |
126 |
|
|
c 2-m specific humidity |
127 |
heimbach |
1.2 |
if ( (aqh(i,j,bi,bj) .LT. 0. .OR. |
128 |
heimbach |
1.3 |
& 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 |
heimbach |
1.1 |
c |
135 |
|
|
c precipitation rate |
136 |
heimbach |
1.2 |
if ( (precip(i,j,bi,bj) .LT. 0. .OR. |
137 |
dimitri |
1.14 |
& precip(i,j,bi,bj) .GT. 2.E-6 ) .AND. |
138 |
heimbach |
1.3 |
& 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 |
heimbach |
1.1 |
#endif |
144 |
|
|
|
145 |
|
|
#ifdef SHORTWAVE_HEATING |
146 |
|
|
c Short wave radiative flux. |
147 |
dimitri |
1.5 |
if ( (swflux(i,j,bi,bj) .GT. 1. .OR. |
148 |
dimitri |
1.16 |
& swflux(i,j,bi,bj) .LT. -1000. ) .AND. |
149 |
heimbach |
1.3 |
& 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 |
heimbach |
1.1 |
#endif |
155 |
|
|
|
156 |
heimbach |
1.3 |
#ifdef ALLOW_RUNOFF |
157 |
dimitri |
1.4 |
c Runoff. |
158 |
edhill |
1.10 |
if ( (runoff(i,j,bi,bj) .LT. 0. .OR. |
159 |
heimbach |
1.3 |
& 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 |
dimitri |
1.4 |
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 |
dimitri |
1.7 |
print *, 'exf_inscal_runoff=3.171e-8' |
166 |
dimitri |
1.4 |
print *, 'in the data.exf input file.' |
167 |
heimbach |
1.3 |
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 |
heimbach |
1.1 |
enddo |
178 |
|
|
enddo |
179 |
|
|
c |
180 |
|
|
enddo |
181 |
|
|
enddo |
182 |
|
|
|
183 |
|
|
end |