[Fortran] syntaxhighlighter_viewsource syntaxhighlighter_copycode
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
first: if(th>thj) then kss=1.0 !此行报错为Error: Syntax error, found IDENTIFIER 'THEN' when expecting one of: THEN
             else !此行报错为Error: An ELSE statement occurred without a corresponding IF THEN statement.
next: if(t>=0.and.t<dx1) then kss=c1*((th-thwp)/(thj-thwp))**d1  !此行报错为Error: Syntax error, found IDENTIFIER 'THEN' when expecting one of: THEN
            elseif(t>=dx1.and.t<(dx1+dx2)) then kss=c2*((th-thwp)/(thj-thwp))**d2   !此行报错为Error: Syntax error, found IDENTIFIER 'THEN' when expecting one of: THEN
         elseif(t>=(dx1+dx2).and.t<(dx1+dx2+dx3)) then kss=c3*((th-thwp)/(thj-thwp))**d3   !此行报错为Error: Syntax error, found IDENTIFIER 'THEN' when expecting one of: THEN
         elseif(t>=(dx1+dx2+dx3).and.t<=(dx1+dx2+dx3+dx4)) then kss=c4*((th-thwp)/(thj-thwp))**d4   !此行报错为Error: Syntax error, found IDENTIFIER 'THEN' when expecting one of: THEN
         else print*,'该时间超出计算范围' !此行报错为Error: Syntax error, found '*' when expecting one of: <END-OF-STATEMENT> ;
         endif next !此行报错为Error: An ENDIF occurred without a corresponding IF THEN or ELSE statement.
endif first
end function