C PRITH1 SOURCE BECC 09/12/07 21:15:57 6579 subroutine prith1(nordpo, acv, Tmaxcv, T, ether, cvtot) C C This subroutine creates ether and cvtot (T and acv given. C C INPUT C ***** C C nordpo = order of polynomial for cp and cv (see also C Tmaxcv) C C acv = vector such that C cv = \sum_{i=1,nordpo+1} acv(i) T^{i-1} C ether = \sum_{i=1,nordpo+1} acv(i) T^{i} / (i) C C Tmaxcv = maximum temperature for cv polynomial expansion C cv(T) = cv(Tmaxcv) if T > Tmaxcv C C T = temperature C C OUTPUT C ****** C C cvtot = cv C C ether = sensible energy (0 at 0K) C C************************************************************************ C C HISTORY AND MODIFICATIONS C c 07/12/2009 Created. C C************************************************************************ C C implicit none integer nordpo real*8 acv(1:(nordpo + 1)), Tmaxcv, T, ether, cvtot & , t2, funt, funcv C t2 = min (t, tmaxcv) t2 = 0.5d0 * ((t + tmaxcv) - abs (t - tmaxcv)) cvtot = acv(1) ether = t2 * cvtot funt = 1.0d0 do i1 = 2, nordpo + 1, 1 funt = funt * t2 funcv = acv(i1) * funt cvtot = cvtot + funcv ether = ether + (funcv * t2/ i1) enddo c t2 = max ((t - tmaxcv),0) t2 = 0.5d0 * ((t - tmaxcv) + abs (t - tmaxcv)) ether = ether + (cvtot * t2) return end C