program uhbd_to_delphi1 convert a 65x65x65 uhbd .phi grid to DELPHI binary form real phi(65,65,65),oldmid(3),scale,h,ox,oy,oz character*10 nxtlbl character*80 toplbl,uhbdfile,delphifile character*72 title integer im,jm,km,idum1,idum2,idum3,idum4,grdflg,kdum1,kdum2 real dum2,dum3,dum4,dum5,dum6,dum7,dum8 print * ,'I assume binary uhbd output; must be 65x65x65' 100 continue print * ,'UHBD .phi grid file name:' read (5,991) uhbdfile print *, 'Desired DelPhi output file name:' read (5,991) delphifile 991 format (a80) open (unit=10,file=uhbdfile,readonly,form='unformatted') read (10) title, scale,dum2,grdflg,idum2,km,idum1,kdum1, & im,jm,kdum2, & h,ox,oy,oz,dum3,dum4,dum5,dum6,dum7,dum8,idum3,idum4 print *, title print *, 'im,jm,km:', im,jm,km print *, 'h,ox,oy,oz:', h,ox,oy,oz do k = 1, km read (10) idum1,im,jm read (10) ( (phi(i,j,k),i=1,im),j=1,jm ) end do close(10) if (im.ne.65 .or. jm .ne.65 .or. km .ne. 65) then print *, 'uhbd grid not 65x65x65' stop end if nxtlbl='potential' toplbl = title open (unit=11,file=delphifile,form='unformatted') write (11) 'now starting phimap ' write (11) nxtlbl,toplbl write (11) phi write (11) ' end of phimap ' scale=1./h c MJP 5/11/94 Added +h/2 to the midpoint calc c to correct for overlay problems. c See nb2.txt for 5/11/94 oldmid(1) = ox + h/2 + h*65./2. oldmid(2) = oy + h/2 + h*65./2. oldmid(3) = oz + h/2 + h*65./2. c MJP 5/11/94 END modifications write (11) scale,oldmid close(11) goto 100 end