c read_mfi_asc_3s.f c c c Purpose: provide an example of how to read Wind/mfi 3 s ascii files c c Content of the 3-s Wind/mfi ascii files in each recod: c c integer*4 yr Year (e.g., 1996) c integer*4 mon Month (e.g. 1-January...12-December) c integer*4 day Day of Month (1...28/29/30/31) c integer*4 hr Hour (1 -24) c integer*4 min Minute (0-59) c real*4 sec Second (0.0-59.9999) c real*4 bgse(1) X component of B in GSE coordinate in nT c real*4 bgse(2) Y component of B in GSE coordinate in nT c real*4 bgse(3) Z component of B in GSE coordinate in nT c real*4 bgsm(1) X component of B in GSM coordinate in nT c real*4 bgsm(2) Y component of B in GSM coordinate in nT c real*4 bgsm(3) Z component of B in GSM coordinate in nT c real*4 bt Total magnetic flux in nT c real*4 brmsgsm(1) X component of the rms of B in nT c real*4 brmsgsm(2) Y component of the rms of B in nT c real*4 brmsgsm(3) Z component of the rms of B in nT c real*4 brmst Total magnitude of the rms of B in nT c integer*4 npts No. of Points used in averaging c c Note: c (1) The orbital information of the s/c is only provided with c the 1-m or hourly average ascii files. These files can be obtained c at the NASA/Goddar Space Flight Center, National Space Science Data c Center archive. c c (2) The format used in generating the magnetic field components c is in G floating with 6-digit precision. c c c Written by, Sean Chen, HSTX 10/17/97 c integer*4 i,yr,mon,day,hr,min,npts real*4 sec,bgse(3),bgsm(3),bt,brmsgsm(3),brmst character*80 filename print*,"input file?" read(*,'(a)') filename print*,filename open(30,file=filename,status='old',form='formatted') i=0 10 continue read(30,*,end=999,err=999) yr,mon,day,hr,min,sec, 1 bgse(1),bgse(2),bgse(3),bgsm(2),bgsm(3),bt, 2 brmsgsm(1),brmsgsm(2),brmsgsm(3),brmst,npts bgsm(1)=bgse(1) write(*,1000) yr,mon,day,hr,min,sec, 1 bgse(1),bgse(2),bgse(3),bgsm(1),bgsm(2),bgsm(3),bt, 2 brmsgsm(1),brmsgsm(2),brmsgsm(3),brmst,npts i=i+1 go to 10 999 close(30) print*,"Total number of records:",i stop 1000 format(28h (Year,mon,day,hr,min,sec)= , 1 i4,4i3,f5.1,7h BGSE=( ,g12.6,g12.6,g12.6,2h) ,12h nT; BGSM=( , 2 g12.6,g12.6,g12.6,2h) ,g12.6, 5h nT , 3 11h BRMSGSM=( ,g12.6,g12.6,g12.6,2h) ,g12.6,5h nT ,i8) end