c======================================================================= c This is a subroutine that calculates (or reads from a file) c the energy eigenvalues of a conservative quantum system for c use with the 'accel' program (accel.f). This routine is c currently set up to calculate energy eigenvalues for the c triangle well: c c H = p**2/(2*m) - V0*x, where x < L (infinite wall at L) c c Note: This program is currently set to read from the file c 'trianglE'. This file is a list of eigenvalues created by the c program 'triwev' (triwev.f) using parameters: V0=0.4 L=600. c======================================================================= subroutine gete(fname,minst,maxst,e) implicit none c----------------------------------------------------------------------- c fname: File containing energy eigenvalues (not used currently) c minst: minimum state whose energy is calculated c maxst: maximum state whose energy is calculated c E: vector storing energy eigenvalues c mxmxst: Largest value of maxst for which eigenvalues have c been computed c----------------------------------------------------------------------- character*(*) fname integer ist, jst real*8 ejst integer minst, maxst real*8 e(minst:maxst) integer mxmxst parameter (mxmxst = 1000) integer getu, ufrom integer indlnb, rc c----------------------------------------------------------------------- c Check if maxst .gt. mxmxst c----------------------------------------------------------------------- if (maxst .gt. mxmxst) then write(0,*) 'File ',fname(1:indlnb(fname)),' only '// & 'contains ',mxmxst,' eigenvalues.' write(0,*) 'Use smaller maxst or recompute eigenvalues' return end if c----------------------------------------------------------------------- c Get available unit number c----------------------------------------------------------------------- ufrom = getu() c----------------------------------------------------------------------- c Open file fname for formatted I/O c----------------------------------------------------------------------- open(ufrom,file=fname(1:indlnb(fname)), & form='formatted',status='old',iostat=rc) if (rc .ne. 0) then c----------------------------------------------------------------------- c Couldn't open file, print error message and return c----------------------------------------------------------------------- write(0,*) 'getE: Error opening ',fname(1:indlnb(fname)) return end if c----------------------------------------------------------------------- c Input eigenvalues into vector E, making sure to start at minst c and stop at maxst c----------------------------------------------------------------------- do ist = 1, maxst read(ufrom,*,iostat=rc) jst, ejst if (rc .eq. 0) then if (jst .ge. minst) then if (jst .le. maxst) then e(jst) = ejst end if end if else write(0,*) 'Error reading from ', & fname(1:indlnb(fname)) write(0,*) fname(1:indlnb(fname)),' may not have '// & 'enough eigenvalues (needs ',maxst,')' return end if end do return end