UPP (develop)
Loading...
Searching...
No Matches
GPVS.f
Go to the documentation of this file.
1
22!-----------------------------------------------------------------------
27 SUBROUTINE gpvs
28! ******************************************************************
29
30!----------------------------------------------------------------------
31 use svptbl_mod, only: nx, c1xpvs, c2xpvs, c1xpvs0, c2xpvs0, tbpvs, tbpvs0
32!- - - - - - - - - - -- - - -- - - -- - - -- - - - - -- - - -- - - -
33 implicit none
34!
35 real xmin,xmax,xinc,x,t
36 integer jx
37 real,external :: fpvsx,fpvsx0
38!----------------------------------------------------------------------
39 xmin=180.0
40 xmax=330.0
41 xinc=(xmax-xmin)/(nx-1)
42 c1xpvs=1.-xmin/xinc
43 c2xpvs=1./xinc
44 c1xpvs0=1.-xmin/xinc
45 c2xpvs0=1./xinc
46!
47 DO jx=1,nx
48 x=xmin+(jx-1)*xinc
49 t=x
50 tbpvs(jx)=fpvsx(t)
51 tbpvs0(jx)=fpvsx0(t)
52 ENDDO
53!
54 RETURN
55 END
56!-----------------------------------------------------------------------
57!***********************************************************************
58!-----------------------------------------------------------------------
83!-----------------------------------------------------------------------
84 FUNCTION fpvs(T)
85!-----------------------------------------------------------------------
86 use svptbl_mod, only : nx,c1xpvs,c2xpvs,tbpvs
87!
88 implicit none
89!
90! integer,parameter::NX=7501
91! real C1XPVS,C2XPVS,TBPVS(NX)
92
93 real t
94 real xj
95 integer jx
96 real fpvs
97!-----------------------------------------------------------------------
98 xj=min(max(c1xpvs+c2xpvs*t,1.),float(nx))
99 jx=min(xj,nx-1.)
100 fpvs=tbpvs(jx)+(xj-jx)*(tbpvs(jx+1)-tbpvs(jx))
101!
102 RETURN
103 END
104!-----------------------------------------------------------------------
105!-----------------------------------------------------------------------
116
117 FUNCTION fpvs0(T,NX,C1XPVS0,C2XPVS0,TBPVS0)
118!-----------------------------------------------------------------------
119! use svptbl_mod, only : NX,C1XPVS0,C2XPVS0,TBPVS0
120 implicit none
121!
122 integer nx
123 real c1xpvs0,c2xpvs0,tbpvs0(nx)
124
125 real t
126 real xj1
127 integer jx1
128 real fpvs0
129!-----------------------------------------------------------------------
130 xj1=min(max(c1xpvs0+c2xpvs0*t,1.),float(nx))
131 jx1=min(xj1,nx-1.)
132 fpvs0=tbpvs0(jx1)+(xj1-jx1)*(tbpvs0(jx1+1)-tbpvs0(jx1))
133!
134 RETURN
135 END
136!-----------------------------------------------------------------------
137!***********************************************************************
138!-----------------------------------------------------------------------
166!-----------------------------------------------------------------------
167 FUNCTION fpvsx(T)
168!-----------------------------------------------------------------------
169 implicit none
170!
171 real,PARAMETER :: cp=1.0046e+3,rd=287.04,rv=4.6150e+2, &
172 ttp=2.7316e+2,hvap=2.5000e+6,psat=6.1078e+2, &
173 cliq=4.1855e+3,cvap= 1.8460e+3,cice=2.1060e+3,hsub=2.8340e+6
174 real,PARAMETER :: psatk=psat*1.e-3
175 real,PARAMETER :: dldt=cvap-cliq,xa=-dldt/rv,xb=xa+hvap/(rv*ttp)
176 real,PARAMETER :: dldti=cvap-cice,xai=-dldti/rv,xbi=xai+hsub/(rv*ttp)
177 real :: tr, t
178 real :: fpvsx
179!-----------------------------------------------------------------------
180 tr=ttp/t
181!
182 IF(t>=ttp)THEN
183 fpvsx=psatk*(tr**xa)*exp(xb*(1.-tr))
184 ELSE
185 fpvsx=psatk*(tr**xai)*exp(xbi*(1.-tr))
186 ENDIF
187!
188 RETURN
189 END
190!-----------------------------------------------------------------------
191!-----------------------------------------------------------------------
196!
197 FUNCTION fpvsx0(T)
198!-----------------------------------------------------------------------
199 implicit none
200!
201 real,PARAMETER :: cp=1.0046e+3,rd=287.04,rv=4.6150e+2, &
202 ttp=2.7316e+2,hvap=2.5000e+6,psat=6.1078e+2, &
203 cliq=4.1855e+3,cvap=1.8460e+3,cice=2.1060e+3, &
204 hsub=2.8340e+6
205 real,PARAMETER :: psatk=psat*1.e-3
206 real,PARAMETER :: dldt=cvap-cliq,xa=-dldt/rv,xb=xa+hvap/(rv*ttp)
207 real,PARAMETER :: dldti=cvap-cice,xai=-dldt/rv,xbi=xa+hsub/(rv*ttp)
208 real tr
209 real t,fpvsx0
210!-----------------------------------------------------------------------
211 tr=ttp/t
212 fpvsx0=psatk*(tr**xa)*exp(xb*(1.-tr))
213!
214 RETURN
215 END
subroutine gpvs
gpvs computes saturation vapor pressure table as a function of temperature for the table lookup funct...
Definition GPVS.f:28
real function fpvs0(t, nx, c1xpvs0, c2xpvs0, tbpvs0)
FPVS0() computes saturation vapor pressure.
Definition GPVS.f:118
real function fpvs(t)
fpvs() computes saturation vapor pressure.
Definition GPVS.f:85
real function fpvsx(t)
fpvsx() computes saturation vapor pressure.
Definition GPVS.f:168
real function fpvsx0(t)
fpvsx0() computes saturation vapor pressure.
Definition GPVS.f:198