subroutine hitran(fn, selmin, selmax & ,wav, str, wid, eng, nlines,stot,wav0 & ,wmin,wmax) implicit double precision (o-z, a-h) include "parameters.dat" character*(*) fn dimension wav(1), str(1), wid(1), eng(1) if (iverbose .gt. 0) then write (*,*) 'Opening ', fn, selmin, '-', selmax endif c Opens and reads line list for band open(unit=20, file=fn) c Initialize the line counter, the end-of-file check, and wmin and wmax n = 1 nlines = 0 ios = 0 stot = 0.d0 wav0 = 0.d0 c loop though the file, reading lines until we hit selmin 10 continue read(unit=20, fmt=910 , iostat=ios) wav(n), str(n) & ,wid(n), eng(n) if ((wav(n) .le. selmin) .and. (ios .ge. 0)) go to 10 if ((ios .lt. 0) .or. (wav(n) .ge. selmax)) then return end if 20 continue stot = stot + str(n) wav0 = wav0 + str(n)*wav(n) n = n + 1 read(unit=20, fmt=910 , iostat=ios) wav(n), str(n) & ,wid(n), eng(n) if ((ios .ge. 0) .and. (wav(n) .le. selmax)) go to 20 close(unit=20) nlines = n-1 wav0 = wav0/stot wmin = wav(1) wmax = wav(nlines) if (iverbose .gt. 0) then write (*,*) nlines, ' lines read, with strength ', stot & , ' at ', wav0 endif return 910 format(3X,f12.6,e10.3,10X,f5.4,5X,f10.4,43X) end