program mkpfday C 9/11 ~emery/reu11/mkpfday.f C pgf77 -o mkpfday.exe mkpfday.f C Split yearly Poynting flux files of 1sec data in /hao/aim2/dmsp/poynting_flux C into daily files for 2000 character*45 dayfile character*3 char3,sda3,beg,snum character*2 sda2,char2 character*1 charp,char1 character*80 char80 real rda C open (9,file='/hao/aim2/dmsp/poynting_flux/pfomni_NS00.txt', C | status='old') iyear = 2000 open (9,file='/hao/aim2/dmsp/poynting_flux/pfomni_NS05.txt', | status='old') iyear = 2005 iw = 10 do 3000 ida=1,365 C write (dayfile,"('/hao/aim2/dmsp/poynting_flux/pfomni_00', write (dayfile,"('/hao/aim2/dmsp/poynting_flux/pfomni_05', | i3.3,'.txt')") ida write (sda3,"(i3.3)") ida if (ida .lt. 100) then write (sda3,"(i2.2,'.')") ida if (ida .lt. 10) then write (sda2,"(i1.1,'.')") ida endif endif open (iw,file=dayfile) C Sometimes last one is first of next day with no period and is before end if (ida .gt. 1) then char1 = char80(1:1) if (char1 .ne. 'E') then write (iw,"(a80)") char80 read (9,"(a80)") char80 write (6,"(1x,'write out last as first'/1x,a80)") char80 C Chunk 00047, 242, and 365 are missing so skip out for them if (iyear .eq. 2000) then if (ida .eq. 47 .or. ida .eq. 242 .or. ida .eq. 365) | go to 2000 endif endif endif C Read 2 lines to get to ' Beginning of chunk #' read (9,"(a80)") char80 read (9,"(a80)") char80 beg = char80(2:4) snum = char80(21:23) write (6,"(1x,'snum ida sda2,3 char80 =',a3,1x,i3,1x,a2,1x,a3, | 1x,a80)") snum,ida,sda2,sda3,char80 C This structure only good for first 3 times if (beg .ne. 'Beg') then stop endif jj = 0 1000 continue read (9,"(a80)") char80 char3 = char80(1:3) if (char3 .eq. 'End') go to 2000 charp = char80(4:4) if (ida .lt. 100) then charp = char80(3:3) if (ida .lt. 10) then charp = char80(2:2) endif endif if (charp .ne. '.') go to 2000 char2 = char80(1:2) jj = jj + 1 if (jj .eq. 1) then write (6,"(1x,'char2,3 =',a2,1x,a3,' char80=',a80)") | char2,char3,char80 endif if (ida .lt. 10 .and. sda2 .eq. char2) then write (iw,"(a80)") char80 go to 1000 endif if (ida .ge. 10 .and. sda3 .eq. char3) then write (iw,"(a80)") char80 go to 1000 endif 2000 continue write (6,"(1x,a80)") char80 close (iw) 3000 continue stop end