c initialize character runfil*12, outfil*12 integer*4 td,wban,yr,mo,day,hr,min,lst,etr,dirct,dif,net,tilt,obs, i engrg,stand,a,b,ss,ot,ceil,sky,vsby,weather,pres1,pres2, i dry,dewpt,dir,speed,tc1,tc2,sl1,sl2,tl1,tl2,fl1,fl2,s, i tstwb logical fexist c formats 100 format (a12) 150 format (' yr mo day hr mn dir sp') 200 format (i4,i5,5i2,2i4,9i5,2i2,i4,i5,i4,i8,2i5,2i4,i3,i4,8i5,i1) 300 format (5(1x,i2),1x,i3,2x,i4) c open files write(*,*) 'please enter input file name' 5 read (*,'(a)') runfil inquire(file = runfil, exist = fexist) if(.not.fexist) write(*,*) runfil, '- file not found, please & enter the correct file name' if(.not.fexist) goto 5 open (unit = 5,file = runfil) write(*,*) 'please enter the output file name' read (*,'(a)') outfil open (unit = 6, file = outfil) tstwb = 23047 write (6,100) runfil write (6,150) do 20 while (.not. eof(5)) read(5,200) td,wban,yr,mo,day,hr,min,lst,etr,dirct,dif,net,tilt, i obs,engrg,stand,a,b,ss,ot,ceil,sky,vsby,weather,pres1,pres2, i dry,dewpt,dir,speed,tc1,tc2,sl1,sl2,tl1,tl2,fl1,fl2,s if (tstwb .ne. wban) write (*,*) 'ERROR wban changed to',wban write(6,300) yr,mo,day,hr,min,dir,speed 20 continue stop end