next up previous contents
Next: How to link your Up: DASH: A Data Analysis Previous: What to put in

How to tell DASH about your module

There is a subroutine that you have to provide. The subroutine name is DASH_DECL, but it is best if you name the file MYPROGRAM.FOR, where MYPROGRAM is what you will call your executable. MYPROGRAM.FOR will have a very short main PROGRAM section which calls DASH_CLI. The rest of the file is a subroutine named DASH_DECL that DASH will call. A complete example (including comments) is included in appendix A.

The DASH_DECL subroutine is used to list the entrypoints of all of the modules you intend to link with your program. Lets say you have copied a working example from someone and wish to add your own analysis module. Here are the modifications you make to the DASH_DECL subroutine. First, make subroutine calls which declare to DASH the name of your module and which entrypoints you have written:

c
c     Declarations for module MYANA:
c     ==============================
      CALL DASH_DEC_MOD('MYANA','INI',MYANA_INIT)
      CALL DASH_DEC_MOD('MYANA','BEG',MYANA_BEGINRUN)
      CALL DASH_DEC_MOD('MYANA','EVT',MYANA_EVENT)
      CALL DASH_DEC_MOD('MYANA','END',MYANA_ENDRUN)
      CALL DASH_DEC_MOD('MYANA','TAL',MYANA_TALK)
      CALL DASH_DEC_MOD('MYANA','BOO',MYANA_BOOK)
      CALL DASH_DEC_MOD('MYANA','FIN',MYANA_FINISH)

You also must declare (to FORTRAN) the subroutine names as EXTERNAL:

      EXTERNAL MYANA_INIT
      EXTERNAL MYANA_BEGINRUN
      EXTERNAL MYANA_EVENT
      EXTERNAL MYANA_ENDRUN
      EXTERNAL MYANA_TALK
      EXTERNAL MYANA_BOOK
      EXTERNAL MYANA_FINISH

The other important thing you do in DASH_DECL is to declare the size of CERN arrays and initialize the packages. So you will typically see lines like as follows, which you can change as needed:

      INTEGER PAW
      COMMON/PAWC/PAW(800000)
      ...
      CALL HLIMIT(760000)
      CALL KUINIT(40000)

You may see other modules declared in the DASH_DECL you start with. Leave them in if you want them in your program, delete the lines if you do not. You may see other DASH_DEC_xxx routines; see the section on utility routines below for an explanation of more advanced use.





ETK