Class | Thermo_Function |
In: |
thermo_function.f90
|
熱力学に関係する関数集 熱力学変数間の変換関数の場合, "..2.."という形になる. この場合, 2 の前に来ているものから 2 の後にくるものに変換するという ことを意味している.
Function : | |||
LH : | real | ||
T : | real, intent(in)
|
温度 T における潜熱の計算 本関数は, 潜熱を一定とした場合の結果とそれほど大きな差は生まれない. 本計算式は, 潜熱の温度変化に関する方程式「キルヒホッフの式」を用いた. また, その際に必要な液相の水の定圧比熱および水蒸気圧の定圧比熱は 温度依存性がないものと仮定し, それぞれ $C_l=4190,\; C_{pv}=1870$という値を用いて導出した関係式である. よって, 用いる比熱の値やその温度依存性を考慮すると係数が少し変化する可能性.
real function LH(T) ! 温度 T における潜熱の計算 ! 本関数は, 潜熱を一定とした場合の結果とそれほど大きな差は生まれない. ! 本計算式は, 潜熱の温度変化に関する方程式「キルヒホッフの式」を用いた. ! また, その際に必要な液相の水の定圧比熱および水蒸気圧の定圧比熱は ! 温度依存性がないものと仮定し, それぞれ ! $C_l=4190,\; C_{pv}=1870$という値を用いて導出した関係式である. ! よって, 用いる比熱の値やその温度依存性を考慮すると係数が少し変化する可能性. use Thermo_Const implicit none real, intent(in) :: T ! 大気の温度 [K] LH=LH0-2.32e3*(T-t0) return end function
Function : | |||
RHTP_2_qv : | real | ||
RH : | real, intent(in)
| ||
T : | real, intent(in)
| ||
P : | real, intent(in)
|
相対湿度と温度から混合比を計算する RHT_2_e から水蒸気圧を計算し, eP_2_qv から混合比を計算する.
real function RHTP_2_qv(RH,T,P) ! 相対湿度と温度から混合比を計算する ! RHT_2_e から水蒸気圧を計算し, eP_2_qv から混合比を計算する. use Thermo_Const implicit none real, intent(in) :: RH ! 相対湿度 [%] real, intent(in) :: T ! 温度 [K] real, intent(in) :: P ! 全圧 [Pa] real :: e e=RHT_2_e(RH,T) RHTP_2_qv=eP_2_qv(e,P) return end function
Function : | |||
RHT_2_e : | real | ||
RH : | real, intent(in)
| ||
T : | real, intent(in)
|
相対湿度と温度から水蒸気圧を計算する $RH=(e/es)times 100$ という定義から計算.
real function RHT_2_e(RH,T) ! 相対湿度と温度から水蒸気圧を計算する ! $RH=(e/es)\times 100$ という定義から計算. use Thermo_Const implicit none real, intent(in) :: RH ! 相対湿度 [%] real, intent(in) :: T ! 温度 [K] real :: es es=es_Bolton(T) RHT_2_e=RH*es*1.0e-2 return end function
Function : | |||
TP_2_qvs : | real | ||
T : | real, intent(in)
| ||
P : | real, intent(in)
|
温度と全圧から飽和混合比を計算する ここでは, es_Bolton を用いて飽和水蒸気圧を計算した後, eP_2_qv を用いて混合比に変換することで飽和混合比を計算する.
real function TP_2_qvs(T,P) ! 温度と全圧から飽和混合比を計算する ! ここでは, es_Bolton を用いて飽和水蒸気圧を計算した後, ! eP_2_qv を用いて混合比に変換することで飽和混合比を計算する. use Thermo_Const implicit none real, intent(in) :: T ! 温度 [K] real, intent(in) :: P ! 大気の全圧 [Pa] real :: eps real :: eP_2_qv, es eps=Rd/Rv es=es_Bolton(T) TP_2_qvs=eps*es/(P-es) return end function
Function : | |||
TP_2_rho : | real | ||
T : | real, intent(in)
| ||
P : | real, intent(in)
|
乾燥大気の状態方程式から, 温度と気圧を与えて密度を得る.
real function TP_2_rho( T, P ) ! 乾燥大気の状態方程式から, 温度と気圧を与えて密度を得る. use Thermo_Const implicit none real, intent(in) :: T ! 大気の温度 [K] real, intent(in) :: P ! 大気の圧力 [Pa] TP_2_rho=p/(Rd*T) return end function
Function : | |||
TqvP_2_TLCL : | real | ||
T : | real, intent(in)
| ||
qv : | real, intent(in)
| ||
P : | real, intent(in)
|
! 温度と混合比と全圧から T_LCL を計算する 混合比から水蒸気圧を求め, そこから T_LCL を計算する
real function TqvP_2_TLCL(T,qv,P) !! 温度と混合比と全圧から T_LCL を計算する ! 混合比から水蒸気圧を求め, そこから T_LCL を計算する use Thermo_Const implicit none real, intent(in) :: T ! 温度 [K] real, intent(in) :: qv ! 混合比 [kg / kg] real, intent(in) :: P ! 全圧 [Pa] real, parameter :: coe=2840.0, a=3.5, b=4.805, c=55.0 real :: e e=qvP_2_e(qv,P) e=e*1.0e-2 TqvP_2_TLCL=coe/(a*log(T)-log(e)-b)+55.0 return end function
Function : | |||
TqvP_2_thetae : | real | ||
T : | real, intent(in)
| ||
qv : | real, intent(in)
| ||
P : | real, intent(in)
|
温度, 混合比, 全圧から相当温位を計算する. T_LCL を用いるので, そのための関数を使用する.
real function TqvP_2_thetae(T,qv,P) ! 温度, 混合比, 全圧から相当温位を計算する. ! T_LCL を用いるので, そのための関数を使用する. use Thermo_Const implicit none real, intent(in) :: T ! 温度 [K] real, intent(in) :: qv ! 混合比 [kg / kg] real, intent(in) :: P ! 全圧 [Pa] real :: T_LCL, kappa, theta_d, e, qvs real, parameter :: a=0.2854, b=0.28, c=3376.0, d=0.81 kappa=Rd/Cpd e=qvP_2_e(qv,P) T_LCL=TqvP_2_TLCL(T,qv,P) theta_d=T*(p0/(P-e))**kappa qvs=TP_2_qvs(T_LCL,P) TqvP_2_thetae=theta_d*exp(LH(T_LCL)*qvs/(Cpd*T_LCL)) return end function
Function : | |||
TqvP_2_thetaes : | real | ||
T : | real, intent(in)
| ||
P : | real, intent(in)
|
温度, 混合比, 全圧から飽和相当温位を計算する. T_LCL を用いるので, そのための関数を使用する.
real function TqvP_2_thetaes(T,P) ! 温度, 混合比, 全圧から飽和相当温位を計算する. ! T_LCL を用いるので, そのための関数を使用する. use Thermo_Const implicit none real, intent(in) :: T ! 温度 [K] ! real, intent(in) :: qv ! 混合比 [kg / kg] real, intent(in) :: P ! 全圧 [Pa] real :: kappa, theta_d, qvs !,e real, parameter :: a=0.2854, b=0.28, c=3376.0, d=0.81 kappa=Rd/Cpd ! e=qvP_2_e(qv,P) ! theta_d=T*(p0/(P-e))**kappa theta_d=T*(p0/P)**kappa qvs=TP_2_qvs(T,P) TqvP_2_thetaes=theta_d*exp(LH(T)*qvs/(Cpd*T)) return end function
Function : | |||
eP_2_qv : | real | ||
e : | real, intent(in)
| ||
P : | real, intent(in)
|
水蒸気圧と全圧から混合比を計算する
real function eP_2_qv(e,P) ! 水蒸気圧と全圧から混合比を計算する use Thermo_Const implicit none real, intent(in) :: e ! 水蒸気圧 [Pa] real, intent(in) :: P ! 大気の全圧 [Pa] real :: eps eps=Rd/Rv eP_2_qv=eps*e/(P-e) return end function
Function : | |||
eT_2_RH : | real | ||
e : | real, intent(in)
| ||
T : | real, intent(in)
|
水蒸気圧と温度から相対湿度を計算する $RH=(e/es)times 100$ という定義から計算.
real function eT_2_RH(e,T) ! 水蒸気圧と温度から相対湿度を計算する ! $RH=(e/es)\times 100$ という定義から計算. use Thermo_Const implicit none real, intent(in) :: e ! 水蒸気圧 [Pa] real, intent(in) :: T ! 温度 [K] real :: es es=es_Bolton(T) eT_2_RH=100.0*e/es return end function
Function : | |||
es_Bolton : | real | ||
T : | real, intent(in)
|
Bolton(1980) の手法を用いて飽和水蒸気圧を計算する.
real function es_Bolton(T) ! Bolton(1980) の手法を用いて飽和水蒸気圧を計算する. use Thermo_Const implicit none real, intent(in) :: T ! 大気の温度 [K] real, parameter :: a=17.67, c=29.65 es_Bolton=e0*exp(a*((T-t0)/(T-c))) return end function
Function : | |||
es_TD : | real | ||
e : | real, intent(in)
|
es_Bolton を用いて飽和水蒸気圧の計算式の逆算から 露点温度を計算する.
real function es_TD(e) ! es_Bolton を用いて飽和水蒸気圧の計算式の逆算から ! 露点温度を計算する. use Thermo_Const implicit none real, intent(in) :: e ! 大気の水蒸気圧 [Pa] real, parameter :: a=17.67, c=29.65 es_TD=c+(a*(t0-c))/(a-log(e/e0)) return end function
Function : | |||
exner_func_dry : | real | ||
P : | real, intent(in)
|
乾燥大気についてのエクスナー関数を計算する
real function exner_func_dry(P) ! 乾燥大気についてのエクスナー関数を計算する use Thermo_Const implicit none real, intent(in) :: P ! 圧力 [Pa] real :: kappa kappa=Rd/Cpd exner_func_dry=(P/p0)**kappa return end function
Function : | |
get_gamma_d : | real |
乾燥断熱減率を呼ぶ関数(この関数必要か?)
real function get_gamma_d() ! 乾燥断熱減率を呼ぶ関数(この関数必要か?) use Thermo_Const use Phys_Const implicit none get_gamma_d=-g/Cpd return end function
Function : | |||
goff_gratch : | real | ||
T : | real, intent(in)
|
goff-gratch の式を用いて飽和水蒸気圧を計算する.
real function goff_gratch(T) ! goff-gratch の式を用いて飽和水蒸気圧を計算する. use Thermo_Const implicit none real, intent(in) :: T ! 大気の温度 [K] real, parameter :: a=-7.90298, b=5.02808, c=-1.3816e-7, d=8.1328e-3 real, parameter :: pa=11.344, pb=-3.49149 real, parameter :: tst=373.15 real, parameter :: est=1.01325e5 real :: term term=a*(tst/T-1.0)+b*log10(tst/T)+c*(10.0**(pa*(1.0-T/tst))-1.0)+d*(10.0**(pb*(tst/T-1.0))-1.0) goff_gratch=est*10.0**(term) return end function
Function : | |||
goff_gratch_i : | real | ||
T : | real, intent(in)
|
goff-gratch の式を用いて飽和水蒸気圧 (氷飽和) を計算する.
real function goff_gratch_i(T) ! goff-gratch の式を用いて飽和水蒸気圧 (氷飽和) を計算する. use Thermo_Const implicit none real, intent(in) :: T ! 大気の温度 [K] real, parameter :: a=-9.09718, b=-3.56654, c=0.876793 real, parameter :: est=6.1173e2 real :: term term=a*(ti0/T-1.0)+b*log10(ti0/T)+c*(1.0-t/ti0) goff_gratch_i=ei0*10.0**(term) return end function
Function : | |||
hypsometric_form : | real | ||
p : | real, intent(in)
| ||
z : | real, intent(in)
| ||
T : | real, intent(in)
| ||
z_t : | real, intent(in), optional
|
高度と気圧を与えてある高度の気圧を求める.
気圧の更正には対流圏における標準大気の温度減率である 6.5 [K/km] で計算する.
real function hypsometric_form(p,z,T,z_t) ! 高度と気圧を与えてある高度の気圧を求める. ! 気圧の更正には対流圏における標準大気の温度減率である 6.5 [K/km] で計算する. use Thermo_Const implicit none real, intent(in) :: p ! 基準となる高度における圧力 [Pa] real, intent(in) :: z ! 基準となる高度 [m] real, intent(in) :: T ! 基準点での温度 [K] real, intent(in), optional :: z_t ! 求める高度 [m] : デフォルトでは 0 m. real, parameter :: gam = 6.5e-3 ! 標準大気の温度減率 [K/m] real :: z_calc, p_tmp !write(*,*) "hypsometric, g=", g if(present(z_t))then z_calc=z_t else z_calc=0.0 end if p_tmp=p*((T+gam*z)/(T+gam*z_calc))**(g/(gam*Rd)) hypsometric_form=p_tmp return end function
Function : | |||
moist_laps_temp : | real | ||
p_stan : | real, intent(in)
| ||
T_stan : | real, intent(in)
| ||
p : | real, intent(in)
|
偽断熱過程における湿潤断熱減率に従う, 高度 p における気温を求める関数. 気温はパーセルの気温.
real function moist_laps_temp( p_stan, T_stan, p ) ! 偽断熱過程における湿潤断熱減率に従う, 高度 p における気温を求める関数. ! 気温はパーセルの気温. use Thermo_Const implicit none real, intent(in) :: p_stan ! 基準気圧座標 [Pa] real, intent(in) :: T_stan ! 基準温度 [K] real, intent(in) :: p ! 求める高度における気圧 [Pa] real :: seqpt, t_temp, seqpt_temp, dt, seqpt_temp2 integer :: i, j, k integer, parameter :: ilim=20 real, parameter :: limit=2.0e-4 seqpt=thetaes_Bolton( T_stan, p_stan ) seqpt_temp=thetaes_Bolton( t_stan, p ) dt=1.0 t_temp=t_stan-dt seqpt_temp2=thetaes_Bolton( t_temp, p ) do while ( (seqpt_temp2-seqpt)*(seqpt_temp-seqpt) >0 ) t_temp=t_temp-dt seqpt_temp=seqpt_temp2 seqpt_temp2=thetaes_Bolton( t_temp, p ) end do seqpt_temp=seqpt_temp2 do while ( abs(seqpt_temp-seqpt) > limit ) dt=0.5*dt if( (seqpt_temp-seqpt)>0.0 )then t_temp=t_temp-dt else t_temp=t_temp+dt end if seqpt_temp=thetaes_Bolton( t_temp, p ) end do moist_laps_temp=t_temp return end function
Function : | |||
qvP_2_e : | real | ||
qv : | real, intent(in)
| ||
P : | real, intent(in)
|
混合比と全圧から水蒸気圧を計算する
real function qvP_2_e(qv,P) ! 混合比と全圧から水蒸気圧を計算する use Thermo_Const implicit none real, intent(in) :: qv ! 混合比 [kg / kg] real, intent(in) :: P ! 全圧 [Pa] real :: eps eps=Rd/Rv qvP_2_e=P*qv/(eps+qv) return end function
Function : | |||
qvTP_2_RH : | real | ||
qv : | real, intent(in)
| ||
T : | real, intent(in)
| ||
P : | real, intent(in)
|
混合比と温度から相対湿度を計算する. qvP_2_e から水蒸気圧を計算し, 相対湿度の定義を用いる.
real function qvTP_2_RH(qv,T,P) ! 混合比と温度から相対湿度を計算する. ! qvP_2_e から水蒸気圧を計算し, 相対湿度の定義を用いる. use Thermo_Const implicit none real, intent(in) :: qv ! 相対湿度 [kg / kg] real, intent(in) :: T ! 温度 [K] real, intent(in) :: P ! 全圧 [Pa] real :: e, es e=qvP_2_e(qv,P) qvTP_2_RH=eT_2_RH(e,T) return end function
Function : | |||
rhoP_2_T : | real | ||
rho : | real, intent(in)
| ||
P : | real, intent(in)
|
乾燥大気の状態方程式から, 密度と気圧を与えて温度を得る.
real function rhoP_2_T( rho, P ) ! 乾燥大気の状態方程式から, 密度と気圧を与えて温度を得る. use Thermo_Const implicit none real, intent(in) :: rho ! 大気の密度 [kg/m^3] real, intent(in) :: P ! 大気の圧力 [Pa] rhoP_2_T=P/(Rd*rho) return end function
Function : | |||
rhoT_2_P : | real | ||
rho : | real, intent(in)
| ||
T : | real, intent(in)
|
乾燥大気の状態方程式から, 密度と温度を与えて気圧を得る.
real function rhoT_2_P( rho, T ) ! 乾燥大気の状態方程式から, 密度と温度を与えて気圧を得る. use Thermo_Const implicit none real, intent(in) :: rho ! 大気の密度 [kg/m^3] real, intent(in) :: T ! 大気の温度 [K] rhoT_2_P=rho*Rd*T return end function
Function : | |||
tetens : | real | ||
T : | real, intent(in)
|
テテンの実験式を用いて飽和水蒸気圧を計算する.
real function tetens(T) ! テテンの実験式を用いて飽和水蒸気圧を計算する. use Thermo_Const implicit none real, intent(in) :: T ! 大気の温度 [K] real, parameter :: a=7.5, b=237.7, c=9.5, d=265.5 if(t<=t0)then tetens=e0*10.0**(c*(t-t0)/(t-t0+d)) else tetens=e0*10.0**(a*(t-t0)/(t-t0+b)) end if return end function
Function : | |||
thetaP_2_T : | real | ||
theta : | real, intent(in)
| ||
P : | real, intent(in)
|
温位, 圧力から温度を計算する(乾燥大気として計算)
real function thetaP_2_T(theta,P) ! 温位, 圧力から温度を計算する(乾燥大気として計算) use Thermo_Const implicit none real, intent(in) :: theta ! 温位 [K] real, intent(in) :: P ! 湿潤大気の全圧 [Pa] real :: kappa kappa=Rd/Cpd thetaP_2_T=theta*(P/p0)**kappa return end function
Function : | |||
thetaT_2_P : | real | ||
theta : | real, intent(in)
| ||
T : | real, intent(in)
|
温位, 温度から圧力を計算する(乾燥大気として計算)
real function thetaT_2_P(theta,T) ! 温位, 温度から圧力を計算する(乾燥大気として計算) use Thermo_Const implicit none real, intent(in) :: theta ! 温位 [K] real, intent(in) :: T ! 温度 [T] real :: kappa kappa=Cpd/Rd thetaT_2_P=p0*(T/theta)**kappa return end function
Function : | |||
theta_dry : | real | ||
T : | real, intent(in)
| ||
P : | real, intent(in)
|
乾燥大気における温位を計算する ただし, 湿潤大気においても, 観測される全圧を P として計算することができ その結果は別関数 theta_moist の結果とそれほど変わらない.
real function theta_dry(T,P) ! 乾燥大気における温位を計算する ! ただし, 湿潤大気においても, 観測される全圧を P として計算することができ ! その結果は別関数 theta_moist の結果とそれほど変わらない. use Thermo_Const implicit none real, intent(in) :: T ! 温度 [K] real, intent(in) :: P ! 乾燥大気の気圧(もしくは, 湿潤大気の全圧) [Pa] real :: kappa kappa=Rd/Cpd theta_dry=T*(p0/P)**kappa return end function
Function : | |||
theta_moist : | real | ||
T : | real, intent(in)
| ||
P : | real, intent(in)
| ||
qv : | real, intent(in)
|
湿潤大気における温位を計算する
real function theta_moist(T,P,qv) ! 湿潤大気における温位を計算する use Thermo_Const implicit none real, intent(in) :: T ! 温度 [K] real, intent(in) :: P ! 湿潤大気の全圧 [Pa] real, intent(in) :: qv ! 混合比 [kg / kg] real :: eps, kappa, CR eps=Rd/Rv kappa=Rd/Cpd CR=Cpv/Cpd kappa=kappa*((1.0+qv/eps)/(1.0+qv*CR)) ! kappa の値が上から上書きされていることに注意 theta_moist=T*(p0/P)**kappa return end function
Function : | |||
thetae_Bolton : | real | ||
T : | real, intent(in)
| ||
qv : | real, intent(in)
| ||
P : | real, intent(in)
|
Bolton(1980) による手法を用いて相当温位を計算する. T_LCL を用いるので, そのための関数を使用する.
real function thetae_Bolton(T,qv,P) ! Bolton(1980) による手法を用いて相当温位を計算する. ! T_LCL を用いるので, そのための関数を使用する. use Thermo_Const implicit none real, intent(in) :: T ! 温度 [K] real, intent(in) :: qv ! 混合比 [kg / kg] real, intent(in) :: P ! 全圧 [Pa] real :: T_LCL, qvs real, parameter :: a=0.2854, b=0.28, c=3376.0, d=0.81 T_LCL=TqvP_2_TLCL(T,qv,P) qvs=TP_2_qvs(T_LCL,P) thetae_Bolton=T*((p0/P)**(a*(1.0-b*qvs))) *exp((c/T_LCL-2.54)*qvs*(1.0+d*qvs)) return end function
Function : | |||
thetaes_Bolton : | real | ||
T : | real, intent(in)
| ||
P : | real, intent(in)
|
Bolton(1980) による手法を用いて飽和相当温位を計算する.
real function thetaes_Bolton(T,P) ! Bolton(1980) による手法を用いて飽和相当温位を計算する. use Thermo_Const implicit none real, intent(in) :: T ! 温度 [K] real, intent(in) :: P ! 全圧 [Pa] real :: qvs real, parameter :: a=0.2854, b=0.28, c=3376.0, d=0.81 qvs=TP_2_qvs(T,P) thetaes_Bolton=T*((p0/P)**(a*(1.0-b*qvs))) *exp((c/T-2.54)*qvs*(1.0+d*qvs)) return end function