GNU WOCSS (gwocss)  2.2.4-pre
GNU version of Winds On Critical Streamline Surfaces (WOCSS)
Functions/Subroutines
utils.f File Reference

Go to the source code of this file.

Functions/Subroutines

real function degdif (A1, A2)
 
real function sp (UU, VV)
 
real function dd (UU, VV)
 
real function xlintr (X0, X1, Z, ZZ0, Z1)
 
real function tpot (PP, TT)
 
real function pt2t (PP, TT)
 
real function altset (Z, P)
 
real function cvt2p (ALTIM, ELEV)
 
integer function julmin (KYEAR, IMO, MDATE, IHOUR, IMIN)
 
subroutine lgntrp (Y, X0, X1, X, Y0, Y1)
 
real function wndwt (X, Y, XOBS, YOBS)
 
subroutine setint (IVALUE, IARRAY, NUM1, NUM2)
 
subroutine setmat (VALUE, ARRAY, NUM1, NUM2)
 

Function/Subroutine Documentation

real function altset ( real  Z,
real  P 
)

Definition at line 94 of file utils.f.

Referenced by geosig(), and strat().

94 C*************************************************************
95 C
96 C GETS LOCAL ALTIMETER SETTING (IN HG.) FROM STATION PRESSURE (NOT
97 C REDUCED TO SEA LEVEL) AND THE STATION ELEVATION IN METERS.
98 C
99 C FROM A FORMULA PROVIDED BY MICHAEL SPLITT OF THE U. OF UTAH.
100 C
101 C FLUDWIG, 4/01
102 C
103  parameter(badat=-9999.0,p0=1013.3,fact=44308.0)
104  parameter(xpon=0.19028,cv2mb=1013.25/29.921)
105 C
106 C ALTIM IS THE ALTIMETER IN INCHES OF HG
107 C ELEV IS THE STATION ELEVATION IN METERS
108 C
109 C ALTIMETER IN INCHES, CONVERT TO MB (HP) AS FOLLOWS:
110 C
111  REAL z,altmb,p
112 C
113 C CONVERT HECTOPASCAL TO INCHES
114 C
115  altmb=p/(1.0-(0.0065*z/288.0))**5.256
116  altset=altmb/cv2mb
117 C
118 C DISCARD EXTREME VALUES, I.E. SEALEVEL PRESSURES OUTSIDE THE
119 C APPROXIMATE RANGE 965 TO 1063 HP (MB)
120 C
121  IF (altset.GT.31.4 .OR. altset.LT.28.5 ) altset=badat
122 C
123  RETURN
124 C
real function altset(Z, P)
Definition: utils.f:94

Here is the caller graph for this function:

real function cvt2p ( real  ALTIM,
real  ELEV 
)

Definition at line 129 of file utils.f.

Referenced by betpar(), levwnd(), putout(), and strat().

129 C**************************************************
130 C
131 C GETS LOCAL STATION PRESSURE (NOT REDUCED TO SEA LEVEL)
132 C USING THE LOCAL ALTIMETER SETTING IN INCHES OF HG AND THE
133 C STATION ELEVATION IN METERS.
134 C
135 C FROM A FORMULA PROVIDED BY MICHAEL SPLITT OF THE U. OF UTAH.
136 C
137 C FLUDWIG, 4/01
138 C
139  parameter(badat=-999.9,p0=1013.3,fact=44308.0)
140  parameter(xpon=0.19028,cv2mb=1013.25/29.921)
141 C
142 C ALTIM IS THE ALTIMETER IN INCHES OF HG
143 C ELEV IS THE STATION ELEVATION IN METERS
144 C
145 C ALTIMETER IN INCHES, CONVERT TO MB (HP) AS FOLLOWS:
146 C
147  REAL altim,elev,altmb
148 C
149 C CONVERT INCHES TO HECTOPASCAL
150 C
151  altmb=altim*cv2mb
152  cvt2p=altmb*(1.0-(0.0065*elev/288.0))**5.256
153 C
154 C CHECK ELEVATION AGAINST STANDARD ATMOSPHERE -- SEE:
155 C
156 C HOLMBOE, FORSYTHE & GUSTIN, 1945: "DYNAMIC METEOROLOGY,"
157 C J. WILEY & SONS, NEW YORK, P 120.
158 C
159 C REJECT IF DIFFERENCE EXCEEDS 450 M -- THE EQUIVALENT OF
160 C HAVING SEA LEVEL PRESSURE BETWEEN ABOUT 978 & 1058 MB)
161 C
162  zstd=fact*(1.0-(cvt2p/p0)**xpon)
163  IF (abs(zstd-elev) .GT. 450.0) cvt2p=badat
164 C
165  RETURN
166 C
real function cvt2p(ALTIM, ELEV)
Definition: utils.f:129

Here is the caller graph for this function:

real function dd (   UU,
  VV 
)

Definition at line 30 of file utils.f.

Referenced by levwnd(), putout(), and tstwnd().

30 C**********************************************
31 C
32 C FUNCTION TO GET DIRECTION (DEGREES) FROM COMPONENTS
33 C
34  parameter(rad2d=180./3.14159)
35 C
36  IF (sp(uu,vv).GT.0.0) THEN
37  dd=amod(540.+ rad2d*atan2(uu,vv),360.)
38  ELSE
39  dd=0.0
40  END IF
41 C
42  RETURN
real function sp(UU, VV)
Definition: utils.f:19
real function dd(UU, VV)
Definition: utils.f:30

Here is the call graph for this function:

Here is the caller graph for this function:

real function degdif (   A1,
  A2 
)

Definition at line 3 of file utils.f.

Referenced by tstwnd().

3 C*********************************************************************
4 C
5 C GETS THE DIFFERENCE BETWEEN TWO ANGLES (A1-A2, DEGREES)
6 C
7 C FLUDWIG, 7/2002
8 C
9  degdif=a2-a1
10  IF (degdif .LT. -180.0) degdif=degdif+360.0
11  IF (degdif .GT. 180.0) degdif=degdif-360.0
12 C
13  RETURN
14 C
real function degdif(A1, A2)
Definition: utils.f:3

Here is the caller graph for this function:

integer function julmin ( integer  KYEAR,
integer  IMO,
integer  MDATE,
integer  IHOUR,
integer  IMIN 
)

Definition at line 171 of file utils.f.

Referenced by wocss().

171 C****************************************************************
172 C
173 C GETS MINUTE SINCE 0000 ON 1 JANUARY CORRESPONDING TO YEAR
174 C KYEAR (FROM 1901 TO 2099) AND JULIAN DAY JD.
175 C
176 C FLUDWIG 3/02
177 C
178  INTEGER lastd (12),kyear,imo,mdate,ihour,imin
179 C
180  DATA lastd /0,31,59,90,120,151,181,
181  $ 212,243,273,304,334/
182 C
183 C CORRECT FOR LEAP YEAR EFFECT -- GOOD UNTIL 2100
184 C
185  jadj=lastd(imo)
186  IF (mod(kyear,4) .EQ.0. and. imo.GT.2) THEN
187  jadj=jadj+1
188  END IF
189 C
190  idajul=jadj+mdate-1
191  julmin=1440*idajul+60*ihour+imin
192 
193  RETURN
integer function julmin(KYEAR, IMO, MDATE, IHOUR, IMIN)
Definition: utils.f:171

Here is the caller graph for this function:

subroutine lgntrp (   Y,
  X0,
  X1,
  X,
  Y0,
  Y1 
)

Definition at line 198 of file utils.f.

Referenced by betwin(), dopsig(), levwnd(), and sfctrp().

198 C**********************************************************************
199 C
200 C DOES LOG-LINEAR INTERPOLATION OF Y VS. LOG X.
201 C
202  IF (x1.EQ.x0 .OR. x.EQ.x0) THEN
203  y=y0
204  ELSE IF (x.EQ.x1) THEN
205  y=y1
206  ELSE
207  ratio = alog10(x/x0)/alog10(x1/x0)
208  y = y0 + ratio * (y1-y0)
209  END IF
210 C
211  RETURN

Here is the caller graph for this function:

real function pt2t (   PP,
  TT 
)

Definition at line 80 of file utils.f.

Referenced by strat().

80 C**************************************************
81 C
82 C TEMPERATURE (DEGREES K) FROM PRESSURE (PP, HP OR MB)
83 C AND POTENTIAL TEMPERATURE (TT, DEGREES K).
84 C
85 C
86  pt2t=tt*((pp/1000.)**0.288)
87 C
88  RETURN
89 C
real function pt2t(PP, TT)
Definition: utils.f:80

Here is the caller graph for this function:

subroutine setint (   IVALUE,
dimension(nxgrd,nygrd)  IARRAY,
  NUM1,
  NUM2 
)

Definition at line 240 of file utils.f.

Referenced by putout().

240 C*********************************************************************
241 C
242 C INITIALIZES ALL ELEMENTS OF ARRAY TO VALUE. (THIS SUBPROGRAM
243 C IS IDENTICAL TO 'SETMAT,' EXCEPT WITH INTEGER ARGUMENTS)
244 C REVISED 11/87
245 C
246  include 'NGRIDS.PAR'
247 C
248  dimension iarray(nxgrd,nygrd)
249  DO 10 i=1,num1
250  DO 10 j=1,num2
251  iarray(i,j)=ivalue
252  10 CONTINUE
253  RETURN

Here is the caller graph for this function:

subroutine setmat (   VALUE,
dimension(nxgrd,nygrd)  ARRAY,
  NUM1,
  NUM2 
)

Definition at line 258 of file utils.f.

Referenced by bal5().

258 C*******************************************************************
259 C
260 C INITIALIZES ALL ELEMENTS OF ARRAY TO VALUE.(THIS SUBPROGRAM IS
261 C IDETICAL TO 'SETINT,' EXCEPT WITH REAL ARGUMENTS.
262 C REVISED 11/87
263 C
264  include 'NGRIDS.PAR'
265 C
266  dimension array(nxgrd,nygrd)
267  DO 10 i=1,num1
268  DO 10 j=1,num2
269  array(i,j)=VALUE
270  10 CONTINUE
271  RETURN

Here is the caller graph for this function:

real function sp (   UU,
  VV 
)

Definition at line 19 of file utils.f.

Referenced by dd(), levwnd(), putout(), and tstwnd().

19 C**********************************************
20 C
21 C FUNCTION TO GET SPEED FROM COMPONENTS
22 C
23  sp=sqrt(uu*uu+vv*vv)
24 C
25  RETURN
real function sp(UU, VV)
Definition: utils.f:19

Here is the caller graph for this function:

real function tpot (   PP,
  TT 
)

Definition at line 66 of file utils.f.

Referenced by betpar(), putout(), and strat().

66 C**************************************************
67 C
68 C POTENTIAL TEMPERATURE (DEGREES K) FROM PRESSURE (PP, HP OR MB)
69 C AND TEMPERATURE (TT, DEGREES CELSIUS).
70 C
71 C
72  tpot=(tt+273.13)*((1000./pp)**0.288)
73 C
74  RETURN
75 C
real function tpot(PP, TT)
Definition: utils.f:66

Here is the caller graph for this function:

real function wndwt (   X,
  Y,
  XOBS,
  YOBS 
)

Definition at line 216 of file utils.f.

Referenced by dopsig(), rinvmod(), rinvmold(), strat(), topwnd(), and vrsmoo().

216 C**********************************************************************
217 C
218 C THIS VERSION DETERMINES THE SQUARED DISTANCE BETWEEN
219 C THE 2 PTS (X,Y) & (XOBS,YOBS).
220 C
221 C F. L. LUDWIG, 10/97
222 C
223  include 'NGRIDS.PAR'
224 C
225  include 'LIMITS.CMM'
226 C
227  xdif=xobs-x
228  ydif=yobs-y
229  dist=sqrt(xdif**2 + ydif**2)
230 C
231  IF (dist.LT.d2min) dist=d2min
232 C
233  wndwt=1.0/(dist**dtwt)
234 C
235  RETURN
real function wndwt(X, Y, XOBS, YOBS)
Definition: utils.f:216

Here is the caller graph for this function:

real function xlintr (   X0,
  X1,
  Z,
  ZZ0,
  Z1 
)

Definition at line 47 of file utils.f.

Referenced by levwnd(), and strat().

47 C***************************************************************
48 C
49 C FUNCTION FOR LINEAR INTERPOLATION OF X TO PT Z BETWEEN ZZ0
50 C AND Z1, WHERE ITS VALUES ARE X0 AND X1
51 C
52  IF (z.EQ.zz0) THEN
53  xlintr=x0
54  ELSE IF (z.EQ.z1) THEN
55  xlintr=x1
56  ELSE
57  xlintr=x0+(x1-x0)*(z-zz0)/(z1-zz0)
58  END IF
59 C
60  RETURN
61 C
real function xlintr(X0, X1, Z, ZZ0, Z1)
Definition: utils.f:47

Here is the caller graph for this function: