/[MITgcm]/MITgcm/pkg/exf/exf_check_range.F
ViewVC logotype

Contents of /MITgcm/pkg/exf/exf_check_range.F

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.24 - (show annotations) (download)
Thu May 25 18:32:55 2006 UTC (18 years ago) by heimbach
Branch: MAIN
CVS Tags: checkpoint58h_post, checkpoint58j_post, checkpoint58f_post, checkpoint58i_post, checkpoint58g_post
Changes since 1.23: +32 -12 lines
o add new fields wspeed, snowprecip (to be able to couple to thsice)
o correct Stefan-Boltzmann constant
o new parameter for longwave surface emittance
o separate some stuff from exf_bulkformulae into new routines
  exf_radiation, exf_wind

1 c $Header: /u/gcmpack/MITgcm/pkg/exf/exf_check_range.F,v 1.23 2005/07/28 13:53:31 heimbach 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 & maskC(i,j,1,bi,bj) .NE. 0. ) then
68 write(standardmessageunit,'(A,3(1X,I6),2X,D22.15)')
69 & 'EXF WARNING: hflux out of range for i,j,it= ',
70 & 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,3(1X,I6),2X,D22.15)')
78 & 'EXF WARNING: sflux out of range for i,j,it= ',
79 & 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,3(1X,I6),2X,D22.15)')
87 & 'EXF WARNING: ustress out of range for i,j,it= ',
88 & 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,3(1X,I6),2X,D22.15)')
96 & 'EXF WARNING: vstress out of range for i,j,it= ',
97 & i, j, myiter, vstress(i,j,bi,bj)
98 exferr = 1
99 endif
100 c
101 #ifdef ALLOW_ATM_WIND
102 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,3(1X,I6),2X,D22.15)')
106 & 'EXF WARNING: uwind out of range for i,j,it= ',
107 & 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,3(1X,I6),2X,D22.15)')
115 & 'EXF WARNING: vwind out of range for i,j,it= ',
116 & i, j, myiter, vwind(i,j,bi,bj)
117 exferr = 1
118 endif
119 #endif
120 c
121 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,3(1X,I6),2X,D22.15)')
126 & 'EXF WARNING: wspeed out of range for i,j,it= ',
127 & i, j, myiter, wspeed(i,j,bi,bj)
128 exferr = 1
129 endif
130
131 #ifdef ALLOW_ATM_TEMP
132 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,3(1X,I6),2X,D22.15)')
137 & 'EXF WARNING: atemp + exf_offset_atemp ',
138 & 'out of range for i,j,it= ',
139 & 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,3(1X,I6),2X,D22.15)')
148 & 'EXF WARNING: aqh out of range for i,j,it= ',
149 & 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,3(1X,I6),2X,D22.15)')
158 & 'EXF WARNING: precip out of range for i,j,it= ',
159 & 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,'(A,3(1X,I6),2X,D22.15)')
168 & 'EXF WARNING: snowprecip out of range for i,j,it= ',
169 & i, j, myiter, snowprecip(i,j,bi,bj)
170 exferr = 1
171 endif
172 #endif
173
174 #ifdef SHORTWAVE_HEATING
175 c Short wave radiative flux.
176 if ( (swflux(i,j,bi,bj) .GT. 1. .OR.
177 & swflux(i,j,bi,bj) .LT. -1000. ) .AND.
178 & maskC(i,j,1,bi,bj) .NE. 0. ) then
179 write(standardmessageunit,'(A,3(1X,I6),2X,D22.15)')
180 & 'EXF WARNING: swflux out of range for i,j,it= ',
181 & i, j, myiter, swflux(i,j,bi,bj)
182 exferr = 1
183 endif
184 #endif
185
186 #ifdef ALLOW_RUNOFF
187 c Runoff.
188 if ( (runoff(i,j,bi,bj) .LT. 0. .OR.
189 & runoff(i,j,bi,bj) .GT. 1.E-6 ) .AND.
190 & maskC(i,j,1,bi,bj) .NE. 0. ) then
191 write(standardmessageunit,'(A,3(1X,I6),2X,D22.15)')
192 & 'EXF WARNING: runoff out of range for i,j,it= ',
193 & i, j, myiter, runoff(i,j,bi,bj)
194 write(standardmessageunit,'(A)')
195 & 'Please note that input units for runoff are'
196 write(standardmessageunit,'(A)')
197 & 'm/s not m/yr. If input file is in m/yr, set'
198 write(standardmessageunit,'(A)')
199 & 'exf_inscal_runoff=3.170979198E-8'
200 write(standardmessageunit,'(A)')
201 & 'in the data.exf input file.'
202 exferr = 1
203 endif
204 #endif
205
206 if ( exferr .NE. 0 ) then
207 write(standardmessageunit,'(A)')
208 & 'EXF WARNING: If you think these values are OK '
209 write(standardmessageunit,'(A)')
210 & 'EXF WARNING: then set useExfCheckRange=.FALSE.'
211 STOP 'in S/R exf_check_range'
212 endif
213
214 enddo
215 enddo
216 c
217 enddo
218 enddo
219
220 end

  ViewVC Help
Powered by ViewVC 1.1.22