c read_mfi_asc_1m.f c c c Purpose: provide an example of how to read Wind/mfi 1 min ascii files c c Content of the 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 integer*4 sec Second (0-59) 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 real*4 pgse(1) X component of s/c position in GSE coordinate in Re c real*4 pgse(2) Y component of s/c position in GSE coordinate in Re c real*4 pgse(3) Z component of s/c position in GSE coordinate in Re c real*4 pgsm(2) Y component of s/c position in GSM coordinate in Re c real*4 pgsm(3) Z component of s/c position in GSM coordinate in Re c c Note that the format used in generating the ascii files is in G floating c with 6-digit precision. c c c Create by, Sean Chen, HSTX 10/17/97 c integer*4 i,yr,mon,day,hr,min,sec,npts real*4 bgse(3),bgsm(3),bt,brmsgsm(3),brmst,pgse(3),pgsm(3) 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, 3 pgse(1),pgse(2),pgse(3),pgsm(2),pgsm(3) bgsm(1)=bgse(1) pgsm(1)=pgse(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, 3 pgse(1),pgse(2),pgse(3),pgsm(1),pgsm(2),pgsm(3) 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,5i3,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, 4 8h PGSE=( ,g12.6,g12.6,g12.6,12h) Re; PGSM=( , 5 g12.6,g12.6,g12.6,4h) Re ) end