* This program reads the heating rate output from Streamer into * arrays, in order to enable efficient post-processing. This code * was written for use for AOS 640 projects; certain assumptions are * made about the options used in Streamer. This code will not work * without modification on output files not meeting those * assumptions. Code by G. Petty (4/22/02). logical startnewcase,haveheader character*80 line,fname character*10 string fname = 'petty_test2' iu1 = 10 open(iu1, file = fname, status = 'OLD') icase = 0 10 startnewcase = .true. haveheader = .false. 1 read(iu1, '(a80)',err=888,end=999)line goto 2 888 continue stop 'Error reading input file' 2 continue * advance to beginning of case read(line,'(t3,a10)')string if (string .ne. '++++++++++' .and. startnewcase) then goto 1 else if (startnewcase) then icase = icase + 1 startnewcase = .false. write(*,*) write(*,*)'Case = ',icase endif endif if (.not. haveheader) then * skip to band number line read(iu1, '(a80)',err=888,end=999)line read(iu1, '(a80)',err=888,end=999)line read(iu1, '(a80)',err=888,end=999)line read(line, '(t21,i3,t27,i3)')iband1,iband2 write(*,*)iband1,iband2 * read spectral range read(iu1, '(a80)',err=888,end=999)line read(line, '(t33,f6.2,t59,f6.2)')alambda1,alambda2 write(*,*)alambda1,alambda2 haveheader = .true. idashcount = 0 endif * advance to line containing second series of dashes, marking the * beginning of the flux data for this case 3 read(line,'(t3,a10)')string if (string .ne. '----------' ) then if (idashcount .lt. 2) goto 1 else idashcount = idashcount + 1 goto 1 endif read(line,'(i3,f8.2,6f9.2,f10.3)',err=890)ilev,dirswdn, & diffswdn,totswdn, & alwdn,diffswup,alwup,anet,aheating if (ilev .le. 0) goto 890 *** If we're here, we've gotten a valid line of flux data from the *** current case. If desired store in an appropriate array for *** post-processing. write(*,'(i3,f8.2,6f9.2,f10.3)')ilev,dirswdn,diffswdn,totswdn, & alwdn,diffswup,alwup,anet,aheating read(iu1, '(a80)',err=889,end=999)line goto 4 889 continue stop 'Error reading input file' 4 continue goto 3 890 continue * finished with current case, go on to next one goto 10 999 continue *** If we're here, we've finished reading all of the data in the input *** file. If desired, post-process whatever data you have saved stop end