program ncar c c convert *.nc ascii data file into a *.cgm CGM graphics meta file c c c originally by Scott Parker, Summer 1993 c modified by Greg Hammett, Oct 1993 to read input file from command line c implicit none integer nmx,mxcurves parameter(nmx=20001,mxcurves=5) real x(nmx),y(nmx,mxcurves) character*(40) label,xlabel,ylabel character*(80) infile integer npoints,ncurves, np,i integer icount,iargc external iargc, getarg c determine namelist file name: icount=iargc() if(icount .ge. 1) then call getarg(1,infile) else infile='outdata' endif call opngks() c below is a test c dt=1 c nm=101 c do n=0,nm-1 c x(n+1)=dt*n c y(n+1,1)=cos(6.28/100.*x(n+1)) c y(n+1,2)=sin(6.28/100.*x(n+1)) c y(n+1,3)=sin(6.28/100.*x(n+1))+cos(6.28/100.*x(n+1)) c enddo c call plot(x,y,3,nm,nmx,"top","time","mode") open(21,file=infile) c begin loop for reading data 10 read(21,*,err=99,end=99) label read(21,*,err=99,end=99) xlabel,ylabel read(21,*,err=99,end=99) npoints,ncurves if(npoints .gt. nmx) then write(6,*) 'ncar warning: npoints>nmx. Will only plot the' write(6,*) 'first nmx points of this plot...' npoints=nmx endif if(ncurves .gt. mxcurves) then write(6,*) 'ncar warning: ncurves>mxcurves...' ncurves=mxcurves endif do np=1,npoints read(21,*,err=99,end=99) x(np),(y(np,i),i=1,ncurves) enddo call plot(x,y,nmx,ncurves,npoints,label,xlabel,ylabel) go to 10 ! repeat to do the next plot 99 call clsgks() end c---------------------------------------------------------------------- subroutine plot( x1,y1,nmx,ncurves,npoints, % toplabel, xlabel, ylabel) implicit none real x1(*),y1(*) integer nmx,ncurves,npoints character*(*) xlabel,ylabel,toplabel integer i1,i2,i3,i4 i1=0 i2=0 i3=0 i4=-1 call anotat(xlabel,ylabel,i1,i2,i3," ") if (ncurves.gt.1) call agseti("DASH/SELECTOR.$",i4) call ezmxy(x1,y1,nmx,ncurves,npoints,toplabel) return end c----------------------------------------------------------------------