UPP (upp-srw-2.2.0)
Loading...
Searching...
No Matches
GPVS.f
Go to the documentation of this file.
1
22 SUBROUTINE gpvs
23! ******************************************************************
24
25!----------------------------------------------------------------------
26 use svptbl_mod, only: nx, c1xpvs, c2xpvs, c1xpvs0, c2xpvs0, tbpvs, tbpvs0
27!- - - - - - - - - - -- - - -- - - -- - - -- - - - - -- - - -- - - -
28 implicit none
29!
30 real xmin,xmax,xinc,x,t
31 integer jx
32 real,external :: fpvsx,fpvsx0
33!----------------------------------------------------------------------
34 xmin=180.0
35 xmax=330.0
36 xinc=(xmax-xmin)/(nx-1)
37 c1xpvs=1.-xmin/xinc
38 c2xpvs=1./xinc
39 c1xpvs0=1.-xmin/xinc
40 c2xpvs0=1./xinc
41!
42 DO jx=1,nx
43 x=xmin+(jx-1)*xinc
44 t=x
45 tbpvs(jx)=fpvsx(t)
46 tbpvs0(jx)=fpvsx0(t)
47 ENDDO
48!
49 RETURN
50 END
51!-----------------------------------------------------------------------
52!***********************************************************************
53!-----------------------------------------------------------------------
54 FUNCTION fpvs(T)
55!-----------------------------------------------------------------------
78!-----------------------------------------------------------------------
79 use svptbl_mod, only : nx,c1xpvs,c2xpvs,tbpvs
80!
81 implicit none
82!
83! integer,parameter::NX=7501
84! real C1XPVS,C2XPVS,TBPVS(NX)
85
86 real t
87 real xj
88 integer jx
89 real fpvs
90!-----------------------------------------------------------------------
91 xj=min(max(c1xpvs+c2xpvs*t,1.),float(nx))
92 jx=min(xj,nx-1.)
93 fpvs=tbpvs(jx)+(xj-jx)*(tbpvs(jx+1)-tbpvs(jx))
94!
95 RETURN
96 END
97!-----------------------------------------------------------------------
98!-----------------------------------------------------------------------
99 FUNCTION fpvs0(T,NX,C1XPVS0,C2XPVS0,TBPVS0)
100!-----------------------------------------------------------------------
101! use svptbl_mod, only : NX,C1XPVS0,C2XPVS0,TBPVS0
102 implicit none
103!
104 integer nx
105 real c1xpvs0,c2xpvs0,tbpvs0(nx)
106
107 real t
108 real xj1
109 integer jx1
110 real fpvs0
111!-----------------------------------------------------------------------
112 xj1=min(max(c1xpvs0+c2xpvs0*t,1.),float(nx))
113 jx1=min(xj1,nx-1.)
114 fpvs0=tbpvs0(jx1)+(xj1-jx1)*(tbpvs0(jx1+1)-tbpvs0(jx1))
115!
116 RETURN
117 END
118!-----------------------------------------------------------------------
119!***********************************************************************
120!-----------------------------------------------------------------------
121 FUNCTION fpvsx(T)
122!-----------------------------------------------------------------------
150!-----------------------------------------------------------------------
151 implicit none
152!
153 real,PARAMETER :: cp=1.0046e+3,rd=287.04,rv=4.6150e+2, &
154 ttp=2.7316e+2,hvap=2.5000e+6,psat=6.1078e+2, &
155 cliq=4.1855e+3,cvap= 1.8460e+3,cice=2.1060e+3,hsub=2.8340e+6
156 real,PARAMETER :: psatk=psat*1.e-3
157 real,PARAMETER :: dldt=cvap-cliq,xa=-dldt/rv,xb=xa+hvap/(rv*ttp)
158 real,PARAMETER :: dldti=cvap-cice,xai=-dldti/rv,xbi=xai+hsub/(rv*ttp)
159 real :: tr, t
160 real :: fpvsx
161!-----------------------------------------------------------------------
162 tr=ttp/t
163!
164 IF(t>=ttp)THEN
165 fpvsx=psatk*(tr**xa)*exp(xb*(1.-tr))
166 ELSE
167 fpvsx=psatk*(tr**xai)*exp(xbi*(1.-tr))
168 ENDIF
169!
170 RETURN
171 END
172!-----------------------------------------------------------------------
173!-----------------------------------------------------------------------
174 FUNCTION fpvsx0(T)
175!-----------------------------------------------------------------------
176 implicit none
177!
178 real,PARAMETER :: cp=1.0046e+3,rd=287.04,rv=4.6150e+2, &
179 ttp=2.7316e+2,hvap=2.5000e+6,psat=6.1078e+2, &
180 cliq=4.1855e+3,cvap=1.8460e+3,cice=2.1060e+3, &
181 hsub=2.8340e+6
182 real,PARAMETER :: psatk=psat*1.e-3
183 real,PARAMETER :: dldt=cvap-cliq,xa=-dldt/rv,xb=xa+hvap/(rv*ttp)
184 real,PARAMETER :: dldti=cvap-cice,xai=-dldt/rv,xbi=xa+hsub/(rv*ttp)
185 real tr
186 real t,fpvsx0
187!-----------------------------------------------------------------------
188 tr=ttp/t
189 fpvsx0=psatk*(tr**xa)*exp(xb*(1.-tr))
190!
191 RETURN
192 END
real function fpvs(t)
Definition GPVS.f:55
real function fpvsx(t)
Definition GPVS.f:122