c c VOLUME FRACTION : reads in a structure and calculates a volume fraction c -------------------------------------------------------------- c this subr. reads in a microstructure from a previous run from a file c called "micro.input"; the information can be copied in from a "ph" file c c program volfrac c include 'common.f' integer site, mfile, nfile, mn, lenfile, col, row real linefile, nucfile, rbarfile, tfile, tempfile, radius, bdry character*25 run_name, fname integer spins(1000000),llimit,ulimit,mvol,mtot c write(*,*) 'Enter a file name enclosed in quotes, e.g. "cube11.ph.13" ' read(*,*) fname open(17,file=fname, status='old') read (17,*) mfile, nfile mn=mfile*nfile c c if((mfile.ne.m).or.(nfile.ne.n)) stop 'mismatched lattices' read (17,*) run_name,tfile,rbarfile, tempfile write(*,*) ' run= ',run_name write(*,*) 'time= ',tfile write(*,*) 'mena radius= ',rbarfile read (17,*) lenfile,linefile,nucfile c these variables are dummies for now. read (17,*) (spins(site), site=1,mn) close (17) c write(*,*) 'Lower limit for vol. frac. ?' read(*,*) llimit write(*,*) 'Upper limit for vol. frac. ?' read(*,*) ulimit c vol=0.0 mvol=0 mtot=0 do 100, i=1,mn mtot=mtot+1 if((spins(i).ge.llimit).and.(spins(i).le.ulimit)) then mvol=mvol+1 endif 100 continue c vol=float(mvol)/float(mtot) write(*,*) 'Volume fraction = ', vol c call exit end