C Electron_Moment_Avg_Screen.for C H. K. Hills, Hughes STX, April 1995. C Entered as B44626 in NSSDC's TRF (Technical Reference File). C This program was written and checked on a Micro-VAX. Program El_Mom_Avg_Screen real*4 plasma(8),parmsum(14),parmavg(14),phiavg(3),sigma(14) real*4 sumsquare(14),sq_avg(14),sigma_phi(3),rsq(3) character*1 yesno,iecho Integer*4 itime,ltime,parmcount(14) Real*4 utime,time Integer*2 hour,uhour,express(8) character*60 dataname,infilename,header integer*4 iyymmdd icnt=0 ! input records read icnt7=0 ! output records written write(6,600) 600 format(/,' For use with ISEE 3 Solar Wind Electron Moments Hour-', 1 /,'averaged data set (78-079A-01S), generated from the original ', 2 /,'Los Alamos Experiment data set by NSSDC.',/, 3 ' H. K. Hills, April, 1995.',/, 4 ' FORTRAN source for this program is entered as',/ 5 ' B44626 in NSSDC''s Technical Reference File (TRF).',//, 6 ' This reads the long ASCII records,', 7 ' and writes a new file with max record size 78 bytes.', 8 //, ' User enters output file name, then input file name.',//) write(6,*) 'Enter name of output file (up to 60 characters).' read(5,10,end=30) dataname open(unit=8,file=dataname,access='sequential', 1 status='new',form='formatted',iostat=ios) if(ios.ne.0) go to 3007 write(8,2099) 2099 format(' Date Hr Density Speed Az_Sp', 1 ' Tperp Tpar Az_T Heatflux Az_HF') write(8,2100) 2100 format(' Sigma values, aligned in their columns', 1 /, ' N1 N2 N3 N4 N5 N6 N7 N8 Mag1',22x,'Mag2',12x,'Mag3', 2 /) write(6,*) 'Enter name of first input file (up to 60 characters).' 111 read(5,10,end=30) infilename 10 format(A60) open(unit=10,file=infilename,status='old',access='sequential', 1 iostat=ios,readonly) if(ios.ne.0) go to 3010 write(6,*) 'Opened File ',infilename read(10,20,end=36,err=37) header 20 format(A60) iend=0 go to 301 CA program to read the long ASCII record and break it up into screen size C and aligned in appropriate columns. 301 read(10,2112,err=3033,end=300)(itime,hour, 1 (parmavg(j),j=1,2),phiavg(1), 2 (parmavg(j),j=4,5),phiavg(2),parmavg(7),phiavg(3), 3 (sigma(n),n=1,8),(parmcount(n),n=1,8),rsq) icnt=icnt+1 cc 2112 format(1x,I6,1x,I2,2(1PE10.3),0PF6.1,2(1PE10.3),0PF6.1, cc 1 1PE10.3,0PF6.1, cc 2 2(1PE10.3),0PF6.1,2(1PE10.3),0PF6.1, cc 3 1PE10.3,0PF6.1,8I3,3F6.3) 2112 format(1x,I6,1x,I2,2E10.3,F6.1,2E10.3,F6.1,E10.3,F6.1, 2 2E10.3,F6.1,2E10.3,F6.1,E10.3,F6.1, 3 8I3,3F6.3) write(8,2212)(itime,hour,(parmavg(j),j=1,2),phiavg(1), 1 (parmavg(j),j=4,5),phiavg(2),parmavg(7),phiavg(3), 2 (sigma(n),n=1,8),(parmcount(n),n=1,8),rsq) icnt7=icnt7+1 2212 format(1x,I6,1x,I2,2(1PE10.3),0PF6.1,2(1PE10.3),0PF6.1, 1 1PE10.3,0PF6.1,/, 2 10x,2(1PE10.3),0PF6.1,2(1PE10.3),0PF6.1, 3 1PE10.3,0PF6.1,/,8I3,6x,F6.3,20x,F6.3,10x,F6.3) go to 301 300 continue write(6,*) icnt,' input data records read;' write(6,*) icnt7,' output data records written.' 3001 write(6,*) ' DONE.' stop 3007 write(6,*) 'Error while trying to open ', dataname stop 3010 write(6,*) 'Error while trying to open ', infilename stop 3033 write(6,*) 'Error in reading data.' go to 300 30 stop 36 write(6,*) 'EOF while trying to read first input record.' stop 37 write(6,*) 'Error while trying to read first input record.' stop end