[Fortran] 纯文本查看 复制代码 function ks(n,th,thwp,thj,c1,c2,c3,c4,d1,d2,d3,d4,dx1,dx2,dx3,dx4,t) result(kss)
implicit none
integer,intent(in)::n,dx1,dx2,dx3,dx4,t
real,intent(in)::th,thwp,thj,c1,c2,c3,c4,d1,d2,d3,d4
real::kss
if(th>thj) then
kss=1.0
else
if(t>=0.and.t<dx1) then
kss=c1*((th-thwp)/(thj-thwp))**d1
elseif(t>=dx1.and.t<(dx1+dx2)) then
kss=c2*((th-thwp)/(thj-thwp))**d2
elseif(t>=(dx1+dx2).and.t<(dx1+dx2+dx3)) then
kss=c3*((th-thwp)/(thj-thwp))**d3
elseif(t>=(dx1+dx2+dx3).and.t<=(dx1+dx2+dx3+dx4)) then
kss=c4*((th-thwp)/(thj-thwp))**d4
else
print*,'该时间超出计算范围'
endif
endif
end function |