Process Flow, Fortran Codes

The following is a description of the process flow for bmst.f, and any codes based on this master.

  1. The application prefix (4 characters) is written into character variable aplc. You will want to edit this according to your new process name.
  2. Subroutine GETPRM:
    call GETPRM(nargsx,infil,parm1, . . .). This subroutine is located inline with every main program. You only need to modify the arguments starting with “parm”. This is your interactive/command line input parameter subroutine.
  3. Subroutine CHKTRC:
    call CHKTRC(iunit1,icall1,npts,s1,fsamin,infil,bar,invbar,ibar,ntrace,ndim) checks the input file and outputs number of samples, sample interval, number of traces, and some additional parameters needed for the execution progress bar. Type:

    man chktrc

    for more on this subroutine.

  4. Subroutine LSTPRM:
    call LSTPRM(io11,ntrace,aplc,outlst,outfil, parm1, . . .) This subroutine provides an echo check of the input parameters by writing to a listing file. Examining the listing file is sometimes useful when you wish to see what you have previously done. The listing file name is the same as the output data file name, but with a different suffix. Thus, if the ouput data file were named bfoobbar.seg, the listing file name would be, bfoobbar.lst.
  5. Then there is the trace loop. The do loop runs over the number of traces found in the chktrc() call. The sequence in bmst.f is:

    {vlist19}
    c...data loop=======================================....
          do 100 jrec=1,ntrace
    c
    c...input a trace
          call BSEGIN(iunit1,ndim,
         +icall1,npts,s1,fsamin,infil,jrec,iexit)
    c
          ntr = ntr + 1
      . . . .    [  DO SOME COMPUTATIONS ON THE SIGNAL S1 ]
    c...output trace
          iunit2=2
          call BSEGOUT(iunit2,
         +icall2,npts,s2,fsamin,outfil,jrec)
    c...display progress....
          call pltbar(bar,invbar,ibar,jrec,ntrace)
    c...END LOOP========================================....
      100 continue
    
    vlist19

    where BSEGIN reads a trace, BSEGOUT writes a trace, and PLTBAR writes a progress bar to the screen in real time. You would insert your own code at the “do some computations” location in the trace loop. The secret to supressing a carriage return and line feed for the progress bar is the non standard “$” format for Linux. In other operating systems, it may be different, try “\” if you plan on porting these codes to another OS and “$” doesn't work. This is a simple example, and more complicated flows with multiple loops are possible. The other programs in the BSU package provide examples.