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

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

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


Revision 1.24 - (hide 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 heimbach 1.24 c $Header: /u/gcmpack/MITgcm/pkg/exf/exf_check_range.F,v 1.23 2005/07/28 13:53:31 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     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.24 & maskC(i,j,1,bi,bj) .NE. 0. ) then
68 heimbach 1.23 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 heimbach 1.3 exferr = 1
72     endif
73 heimbach 1.1 c
74     c Salt flux.
75 heimbach 1.2 if ( ABS(sflux(i,j,bi,bj)) .GT. 1.E-6 .AND.
76 heimbach 1.24 & maskC(i,j,1,bi,bj) .NE. 0. ) then
77 heimbach 1.23 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 heimbach 1.3 exferr = 1
81     endif
82 heimbach 1.1 c
83     c Zonal wind stress.
84 dimitri 1.21 if ( ABS(ustress(i,j,bi,bj)) .GT. 2.7 .AND.
85 heimbach 1.24 & maskW(i,j,1,bi,bj) .NE. 0. ) then
86 heimbach 1.23 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 heimbach 1.3 exferr = 1
90     endif
91 heimbach 1.1 c
92     c Meridional wind stress.
93 dimitri 1.19 if ( ABS(vstress(i,j,bi,bj)) .GT. 2.3 .AND.
94 heimbach 1.24 & maskS(i,j,1,bi,bj) .NE. 0. ) then
95 heimbach 1.23 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 heimbach 1.3 exferr = 1
99     endif
100 heimbach 1.1 c
101     #ifdef ALLOW_ATM_WIND
102     c zonal wind speed
103 heimbach 1.3 if ( ABS(uwind(i,j,bi,bj)) .GT. 100. .AND.
104 heimbach 1.24 & maskW(i,j,1,bi,bj) .NE. 0. ) then
105 heimbach 1.23 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 heimbach 1.3 exferr = 1
109     endif
110 heimbach 1.1 c
111     c zonal wind speed
112 heimbach 1.3 if ( ABS(vwind(i,j,bi,bj)) .GT. 100. .AND.
113 heimbach 1.24 & maskS(i,j,1,bi,bj) .NE. 0. ) then
114 heimbach 1.23 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 heimbach 1.3 exferr = 1
118     endif
119 heimbach 1.1 #endif
120 heimbach 1.24 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 heimbach 1.1
131     #ifdef ALLOW_ATM_TEMP
132     c 2-m air temperature
133 heimbach 1.3 if ( (atemp(i,j,bi,bj) .LT. 183 .OR.
134     & atemp(i,j,bi,bj) .GT. 343 ) .AND.
135 heimbach 1.24 & maskC(i,j,1,bi,bj) .NE. 0. ) then
136 heimbach 1.23 write(standardmessageunit,'(2A,3(1X,I6),2X,D22.15)')
137 heimbach 1.18 & 'EXF WARNING: atemp + exf_offset_atemp ',
138 heimbach 1.23 & 'out of range for i,j,it= ',
139     & i, j, myiter, atemp(i,j,bi,bj)
140 heimbach 1.3 exferr = 1
141     endif
142 heimbach 1.1 c
143     c 2-m specific humidity
144 heimbach 1.2 if ( (aqh(i,j,bi,bj) .LT. 0. .OR.
145 heimbach 1.3 & aqh(i,j,bi,bj) .GT. 0.1 ) .AND.
146 heimbach 1.24 & maskC(i,j,1,bi,bj) .NE. 0. ) then
147 heimbach 1.23 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 heimbach 1.3 exferr = 1
151     endif
152 heimbach 1.1 c
153     c precipitation rate
154 heimbach 1.2 if ( (precip(i,j,bi,bj) .LT. 0. .OR.
155 dimitri 1.14 & precip(i,j,bi,bj) .GT. 2.E-6 ) .AND.
156 heimbach 1.24 & maskC(i,j,1,bi,bj) .NE. 0. ) then
157 heimbach 1.23 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 heimbach 1.3 exferr = 1
161     endif
162 heimbach 1.24 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 heimbach 1.1 #endif
173    
174     #ifdef SHORTWAVE_HEATING
175     c Short wave radiative flux.
176 dimitri 1.5 if ( (swflux(i,j,bi,bj) .GT. 1. .OR.
177 dimitri 1.16 & swflux(i,j,bi,bj) .LT. -1000. ) .AND.
178 heimbach 1.24 & maskC(i,j,1,bi,bj) .NE. 0. ) then
179 heimbach 1.23 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 heimbach 1.3 exferr = 1
183     endif
184 heimbach 1.1 #endif
185    
186 heimbach 1.3 #ifdef ALLOW_RUNOFF
187 dimitri 1.4 c Runoff.
188 edhill 1.10 if ( (runoff(i,j,bi,bj) .LT. 0. .OR.
189 heimbach 1.3 & runoff(i,j,bi,bj) .GT. 1.E-6 ) .AND.
190 heimbach 1.24 & maskC(i,j,1,bi,bj) .NE. 0. ) then
191 heimbach 1.23 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 heimbach 1.18 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 heimbach 1.3 exferr = 1
203     endif
204     #endif
205    
206     if ( exferr .NE. 0 ) then
207 heimbach 1.18 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 heimbach 1.3 STOP 'in S/R exf_check_range'
212     endif
213    
214 heimbach 1.1 enddo
215     enddo
216     c
217     enddo
218     enddo
219    
220     end

  ViewVC Help
Powered by ViewVC 1.1.22