function input1(nsta,npt,ir,x,y,z,np,n,m,l) c c*************************************************************************** c (1) function : c a. read input data from input file c b. generate the offsets for whole section c (2) variables : c nsta : number of stations c sta : x-coord. of station c npt : number of input points of each station c ofy : y-coord. of input point c ofz : z-coord. of input point c ir : relation between local node number and global node number c (3) note : c a. the max. number of input stations : 21 c b. the max. number of input points of each station : 8 c c. the number of input points of each station must be the same c (4) files: c sphere.dat: input file (offset of the grid points) c output.dat: output file of the potential at centroid of each element c***************************************************************************** c integer ir(n,m),npt(n) real*8 x(l),y(l),z(l) integer nsta,np real*8 sta(30),ofy(30,20),ofz(30,20) c open(9,file='sphere.dat',access='sequential',status='unknown') open(11,file='output.dat',access='sequential',status='unknown') read(9,*) nsta nsta1=nsta-1 do 10 i=1,nsta write(*,*) 'i=',i read(9,*) sta(i),npt(i) write(*,*) sta(i),npt(i) nt=npt(i) do 10 j=1,nt read(9,*) ofy(i,j),ofz(i,j) write(*,*) ofy(i,j),ofz(i,j) 10 continue do 20 i=1,nsta nt=npt(i)-1 do 30 j=1,nt k=npt(i)-j ofz(i,npt(i)+j)=ofz(i,k) ofy(i,npt(i)+j)=-ofy(i,k) 30 continue npt(i)=npt(i)*2-1 20 continue np=0 do 70 i=1,nsta nn=npt(i) do 80 j=1,nn np=np+1 x(np)=sta(i) y(np)=ofy(i,j) z(np)=ofz(i,j) ir(i,j)=np 80 continue 70 continue input1=1.0 return end