C PROGRAM READTRD - READS PIONEER 10/11 TRD EXPERIMENT SUMMARY FILES C ACCUMULATES HOUR AVERAGES FROM 30-MINUTE AND ODD-INTERVAL RECORDS C FINAL VERSION 3/10/93 BY J. F. COOPER, NSSDC/HUGHES STX CHARACTER*14 NFMOD CHARACTER*12 FSPARE CHARACTER*11 SAT CHARACTER*8 UCSD,BSPARE(7),ESPARE(7) CHARACTER*6 EDRTAP CHARACTER*5 HMI CHARACTER*3 TDF CHARACTER*50 INFILE,OUTFIL INTEGER*4 DELT,BRTLT,ERTLT,NCOUNT(21),TOTIME(21) INTEGER*4 BYR,BMON,BDAY,BHR,BMIN,BSEC,BMSEC,EYR,EMON,EDAY,EHR, * EMIN,ESEC,EMSEC,TBR,NREAD(21),MREAD(6) REAL*8 PMIN(3),PMAX(3),PAVE(3),RMSSUM(21),PRESMAX(21),PRESMIN(21), * AVG(6),RMSCUR(6),ERESMAX(6),ERESMIN(6),AVGA(6),EMAX(6), * EMIN6(6),BATCCLT,BATCLNG,BRADPS,BCLTPSC,BALGPSC,BRADES,BCLTESC, * BALGESC,BRADJS, BCLTJSC, BALGJSC, EATCCLT, EATCLNG, ERADPS, * ECLTPSC,EALGPSC, ERADES, ECLTESC, EALGESC, ERADJS, ECLTJSC, * EALGJSC C C INPUT I/O PARAMETERS WRITE(6,*) ' ENTER INPUT FILE NAME:' READ(5,10) INFILE 10 FORMAT(A50) OPEN(UNIT=10,FILE=INFILE,STATUS='OLD') WRITE(6,*) ' ENTER OUTPUT FILE NAME:' READ(5,10) OUTFIL OPEN(UNIT=20,FILE=OUTFIL,STATUS='NEW') IFIRST=0 N=0 C WRITE(6,330) N,IYY,BMON,BDAY,IHROUT,BMIN,BSEC,TBR,TDF,RM3L, C * RM1L,RC1,RC3,XRAD 110 READ(10,120,ERR=110,END=999) *SAT, UCSD, HMI, DELT, BYR, BMON, BDAY, BHR, BMIN, BSEC, BMSEC,EYR, *EMON, EDAY, EHR, EMIN, ESEC, EMSEC, EDRTAP, TDF, TBR, BRTLT,ERTLT, *(PMIN(I),I=1,3),(PMAX(I),I=1,3),(PAVE(I),I=1,3),(RMSSUM(I),I=1,21) *,(PRESMAX(I),I=1,21),(PRESMIN(I),I=1,21),(NREAD(I),I=1,21), *(NCOUNT(I),I=1,21),(TOTIME(I),I=1,21),(AVG(I),I=1,6), *(RMSCUR(I),I=1,6),(ERESMAX(I),I=1,6),(ERESMIN(I),I=1,6), *(AVGA(I),I=1,6),(EMAX(I),I=1,6),(EMIN6(I),I=1,6),(MREAD(I),I=1,6), *NFMOD, *BATCCLT,BATCLNG, BRADPS, BCLTPSC, BALGPSC, BRADES,BCLTESC,BALGESC, *BRADJS,BCLTJSC, BALGJSC, (BSPARE(I),I=1,7), EATCCLT, EATCLNG, *ERADPS,ECLTPSC, *EALGPSC,ERADES, ECLTESC, EALGESC, ERADJS, ECLTJSC, EALGJSC, *(ESPARE(I),I=1,7),FSPARE 120 FORMAT(A11,A8,A5,I6,I4,1X,I2,1X,I2,1X,I2,1X,I2,1X,I2,1X,I3,1X,I4, * 1X,I2,1X,I2,1X,I2,1X,I2,1X,I2,1X,I3,A6,A3,I1,I8,I8,9F6.1, * 63E9.2E2,21I4,21I9,21I8,6F5.1,36E8.1E2,6I4,A14,11F8.3,7A8, * 11F8.3,7A8,A12) IYY= BYR - 1900 ! TWO DIGIT YEAR C C TEST *** C WRITE(20,121) BYR,BMON,BDAY,BHR,BMIN,BSEC,BRADPS C121 FORMAT(' RECORD DATE/TIME: ',I4,5(1X,I2),1X,F7.3) C C CHECK FOR FIRST RECORD IF(IFIRST.EQ.0) THEN IFIRST=1 IYRSAV= BYR IMOSAV= BMON IDASAV= BDAY IHRSAV= BHR XM3LC= 0.0 XM3LT= 0.0 XM3LR= 0.0 XM1LC= 0.0 XM1LT= 0.0 XM1LR= 0.0 XC1C= 0.0 XC1T= 0.0 XC1R= 0.0 XC3C= 0.0 XC3T= 0.0 XC3R= 0.0 XN= 0.0 ENDIF C C300 WRITE(20,310) BYR,BMON,BDAY,BHR,BMIN,BSEC,TBR,TDF, C * NCOUNT(18),TOTIME(18),NREAD(18) ! M3L COUNTS, TIME, READOUTS C * NCOUNT(16),TOTIME(16),NREAD(16), ! M1L COUNTS, TIME, READOUTS C * NCOUNT(1),TOTIME(1),NREAD(1), ! C1 COUNTS, TIME, READOUTS C * NCOUNT(3),TOTIME(3),NREAD(3) ! C3 COUNTS, TIME, READOUTS C310 FORMAT(1X,I4,5(1X,I2),1X,I1,1X,A3,3(1X,I5,1X,I10,1X,I2)) C C COHO OUTPUT FORMAT C C CHECK FOR BEGINNING OF NEXT HOUR. IF SO, OUTPUT LAST HOUR IF(IHRSAV.NE.BHR.OR.IDASAV.NE.BDAY.OR.IYRSAV.NE.BYR) THEN IYROUT= IYRSAV - 1900 IMOOUT= IMOSAV IDAOUT= IDASAV IHROUT= IHRSAV IYRSAV= BYR IMOSAV= BMON IDASAV= BDAY IHRSAV= BHR IF(XM3LT.GT.1.0E-10) THEN RM3L= XM3LC/XM3LT ENDIF IF(XM1LT.GT.1.0E-10) THEN RM1L= XM1LC/XM1LT ENDIF IF(XC1T.GT.1.0E-10) THEN RC1= XC1C/XC1T ENDIF IF(XC3T.GT.1.0E-10) THEN RC3= XC3C/XC3T ENDIF XRADIS= XRAD/XN XN= 0.0 XRAD=0.0 XM3LC= 0.0 XM3LT= 0.0 XM3LR= 0.0 XM1LC= 0.0 XM1LT= 0.0 XM1LR= 0.0 XC1C= 0.0 XC1T= 0.0 XC1R= 0.0 XC3C= 0.0 XC3T= 0.0 XC3R= 0.0 WRITE(20,320) IYROUT,IMOOUT,IDAOUT,IHROUT,TBR,TDF,RM3L, * RM1L,RC1,RC3,XRADIS 320 FORMAT(4(1X,I2),1X,I1,1X,A3,4E11.4,1X,F7.3) RM3L= 0.0 RM1L= 0.0 RC1= 0.0 RC3= 0.0 XRADIUS= 0.0 ENDIF C C ACCUMULATE COUNTS AND TIME FOR CURRENT 30-MINUTE RECORD XM3LC= XM3LC + NCOUNT(18) ! M3L COUNTS XM3LT= XM3LT + TOTIME(18)/1000.0 ! M3L CUMULATIVE TIME IN SECONDS XM3LR= XM3LR + NREAD(18) ! M3L CUMMULATIVE READOUTS XM1LC= XM1LC + NCOUNT(16) ! M1L CUMMULATIVE COUNTS XM1LT= XM1LT + TOTIME(16)/1000.0 XM1LR= XM1LR + NREAD(16) XC1C= XC1C + NCOUNT(1) ! C1 CUMMULATIVE COUNTS XC1T= XC1T + TOTIME(1)/1000.0 XC1R= XC1R + NREAD(1) XC3C= XC3C + NCOUNT(3) ! C3 CUMMULATIVE COUNTS XC3T= XC3T + TOTIME(3)/1000.0 XC3R= XC3R + NREAD(3) XRAD= XRAD + BRADPS XN= XN + 1.0 N= XN C TEST *** C WRITE(6,330) N,IYY,BMON,BDAY,BHR,BMIN,BSEC,TBR,TDF,XM3LC, C * XM1LC,XC1C,XC3C,BRADPS C330 FORMAT(' C ',I1,6(1X,I2),1X,I1,1X,A3,4E11.4,1X,F8.3) C WRITE(6,331) N,IYY,BMON,BDAY,BHR,BMIN,BSEC,TBR,TDF,XM3LT, C * XM1LT,XC1T,XC3T,XRAD C331 FORMAT(' T ',I1,6(1X,I2),1X,I1,1X,A3,4E11.4,1X,F8.3) C END OF TEST *** C C BRADPS = SPACECRAFT-SUN DISTANCE IN AU C C210 WRITE(6,250) SAT,BYR,BMON,BDAY,IHRSAV,BMIN,BSEC,TDF C250 FORMAT(1X,A11,1X,I4,5(1X,I2),1X,A3) C WRITE(6,180) (RMSSUM(I),I=1,7) C180 FORMAT(' RMSSUM: ',7E10.2E2) C WRITE(6,181) (PRESMAX(I),I=1,7) C181 FORMAT(' PRESMAX:',7E10.2E2) C WRITE(6,182) (PRESMIN(I),I=1,7) C182 FORMAT(' PRESMIN:',7E10.2E2) C WRITE(6,211) (NREAD(I),I=1,7) C211 FORMAT(' NREAD: ',7(2X,4X,I4)) C WRITE(6,212) (NCOUNT(I),I=1,7) C212 FORMAT(' NCOUNT: ',7(2X,I8)) C WRITE(6,213) (TOTIME(I),I=1,7) C213 FORMAT(' TOTIME: ',7(2X,I8)) C WRITE(6,214) (AVG(I),I=1,6) C214 FORMAT(' AVG: ',6(5X,F5.1)) C WRITE(6,215) (RMSCUR(I),I=1,6) C215 FORMAT(' RMSCUR: ',6(2X,E8.1E2)) C WRITE(6,216) (ERESMAX(I),I=1,6) C216 FORMAT(' ERESMAX:',6(2X,E8.1E2)) C WRITE(6,217) (ERESMIN(I),I=1,6) C217 FORMAT(' ERESMIN:',6(2X,E8.1E2)) C WRITE(6,219) (MREAD(I),I=1,6) C219 FORMAT(' MREAD: ',6(6X,I4)) C WRITE(6,220) NFMOD,BRADPS,BRADES,BCLTESC,BALGESC,BRADJS,BCLTJSC, C * BALGJSC C220 FORMAT(' NFMOD: ',A14/ C * ' BRADPS: ',2X,F8.3/ C * ' BRADES: ',2X,F8.3/ C * ' BCLTESC:',2X,F8.3/ C * ' BALGESC:',2X,F8.3/ C * ' BRADJS: ',2X,F8.3/ C * ' BCLTJSC:',2X,F8.3/ C * ' BALGJSC:',2X,F8.3) C WRITE(6,*) GOTO 110 999 STOP END