/FORTRAN

Interface to MINUIT, COMIS, SIGMA and FORTRAN Input/Output.

/FORTRAN/HMINUIT

To input commands for Interactive MINUIT in a macro. Example:

Application HMINUIT EXIT SET EPS 1.E-14 MIGRAD SET PRIN 2 MINOS EXIT Histo/fit 10 g m

/FORTRAN/COMIS

Invoke the COMIS FORTRAN interpreter. COMIS allows to execute FORTRAN routines without recompiling and relinking. It communicates with PAW commands through vectors and functions. COMIS has its PAW-independent command structure. Example in command mode:

PAW > Comis CS > do 10 i=1,10 MND> x=sqrt(i)*10. MND> print *,i,x MND> 10 continue MND> END CS > quit PAW >

COMIS code may be inserted into a macro. Example:

Vector/Create Y(10) r 1 2 3 4 5 6 7 8 9 10 * * In the following COMIS code, the statement 'Vector Y' declares * to COMIS an existing KUIP vector. KUIP dimension is assumed. * The statement 'Vector X(10)' creates a new KUIP vector. * (Note that SUBROUTINEs must be declared before the MAIN program) * (KUIP vectors cannot be created into the MAIN program) * APPLIcation COMIS QUIT SUBROUTINE DEMO Vector Y Vector X(10) do 10 i=1,10 XX=i X(i)=Y(i)*sqrt(XX)*10. 10 CONTINUE END CALL DEMO END QUIT Vector/print X | Print KUIP vector created by COMIS

/FORTRAN/CALL urout

UROUT C User routine

Execute the routine UROUT. UROUT may be a routine compiled and linked with PAW. For example : CALL HPRINT(10).

UROUT may also be the name of a file which can be edited interactively with the command EDIT. For example if file UROUT.FOR contains:

SUBROUTINE UROUT(N) SUM=0. DO 10 I=1,N SUM=SUM+I 10 CONTINUE PRINT *,SUM END

Then one can type CALL UROUT.FOR(10). The routine UROUT may also contain references to the library routines mentioned below.

The functions $CALL, $ICALL, and $DCALL allow to call REAL, INTEGER, and DOUBLE PRECISION functions, respectively. The function call must be enclosed in quotes, for example:

$CALL('fun.f(1.5)')

with file fun.f containing

FUNCTION FUN(X) FUN=X**2 END

The following routines from the CERN Program Library can be called:

From HBOOK: HBOOK1,HBOOK2,HBOOKN,HFILL,HF1,HF1E,HPRINT,HDELET,HRESET HFITGA,HFITPO,HFITEX,HPROJ1,HPROJ2,HFN,HGFIT,HRENID HROPEN,PAOPEN,PACLOS,PAREAD,PAWRIT,HCDIR,HGIVEN,HKIND HTITLE,HBFUN1,HBFUN2,HRNDM1,HRNDM2,HBARX,HBARY,HDIFFB HPAK,HPAKE,HUNPAK,HGIVE,HGN,HGNF,HGNPAR,HF2,HFF1,HFF2 HRIN,HROUT,HI,HIE,HIX,HXE,HIJ,HIF,HIDALL,HNOENT,HX,HXY HTITLE,HCOPY,HSTATI,HBPROF,HOPERA,HIDOPT,HDERIV,HBAR2 HMAXIM,HMINIM,HMAX,HMIN,HSUM,HNORMA,HMCINI,HMCMLL HEXIST,HREND,HRGET,HRPUT,HSCR,HFIND,HCX,HCXY,HLABEL HBPROX,HBPROY,HBANDX,HBANDY,HBSLIX,HBSLIY,HPROF2,HRDIR HBOOKB,HBSTAT,HDIFF,HUNPKE,HREBIN,HERROR,HGNTB,HSTAF HOUTPU,HERMES,HISTDO,HFUNC,HXI,HIJXY,HXYIJ,HLPOS,HFC1 HSPLI1,HSPLI2,HMDIR,HLDIR,HLOCAT,HFITH,HFITV,HFINAM HBNT,HBNAME,HBNAMC,HFNT,HFNTB,HGNT,HGNTF,HGNTV,HBSET HRENAME,HNTDUP,HFITHN,HIJE From MINUIT: MNEMAT,MNERRS,MNSTAT From HPLOT: HPLOT,HPLSYM,HPLERR,HPLEGO,HPLNT,HPLSUR,HPLSOF,HPLFRA HPLABL,HPLSET,HPLGIV,HPLOC,HPLTOC,HPLNEW,HPLOPT From ZEBRA: MZSTOR,MZDIV,MZLINK,MZWORK,MZBOOK,MZDROP,MZPUSH MZWIPE,MZGARB,MZFORM,LZFIND,LZFID,DZSHOW,DZVERI FZIN,FZOUT,FZFILE,FZENDI,FZENDO RZCDIR,RZLDIR,RZFILE,RZEND,RZIN,RZOUT,RZVIN,RZVOUT RZOPEN,RZIODO,RZCLOS,RZQUOT From KUIP: KUGETV,KUDPAR,KUVECT,KILEXP,KUTIME,KUEXEL,KUPROS KUNWG,KUCMD,KUGUID,KUNDPV,KUPAR,KUPVAL,KUACT From HIGZ: IPL,IPM,IFA,IGTEXT,IGBOX,IGAXIS,IGPIE,IGRAPH,IGHIST IGARC,IGLBL,IGRNG,IGMETA,IGSA,IGSET,IRQLC,IRQST,ISCR ISELNT,ISFAIS,ISFASI,ISLN,ISMK,ISVP,ISWN,ITX,ITX3,ICLRWK IGPAVE,IGTERM,IPL3,IPM3,IFA3,ISMKSC,ISPMCI,ISFACI IGCOLM,IGHTOR,IGQ,IGQWK,IGIWTY From KERNLIB: VZERO,UCOPY,RANNOR,LENOCC,SBIT0,SBIT1,SBYT RANMAR,RNORML,RANLUX,RNORMX JBIT,JBYT,UCTOH,UHTOC,CLTOU,CUTOL,ERF,ERFC,FREQ,GAMMA PROB,DENLAN,DSTLAN,DIFLAN,XM1LAN,XM2LAN,RANLAN RNDM,RDMIN,RDMOUT,SORTZV,CSF77,VMOD,VDIST,VDOTN2 VSUB,VUNIT,CHISIN,VDOT,VADD,VSCALE,CROSS The following common blocks may be referenced: /PAWC/, /QUEST/, /KCWORK/, /PAWPAR/, /PAWIDN/ /HCFITS/, /HCFITD/, /RZCLUN/, /HCBOOK/, /HIGRAF/ /PAWCHN/, /PAWCR8/, /PAWCR4/, /RZCOUNT/, /RZCLUN /PAWCHC/, /PAWC32/

/FORTRAN/UNITS

List all Input/Output logical units currently open. The files attached to them are also shown.

/FORTRAN/LOOP ntimes urout

NTIMES I Number of calls D=1
UROUT C User routine

The routine UROUT is called NTIMES times. See command CALL for explanation of UROUT.

/FORTRAN/FILE lun fname [ status ]

LUN I Logical unit number
FNAME C File name
STATUS C File status D='DONTKNOW'

STATUS:

'OLD' Open existing file for reading.
'APPEND' Open existing file and position at EOF.
'NEW' Create new file; error if already existing.
'UNKNOWN' Open existing or create new file.
'DONTKNOW' Like UNKNOWN except on VMS opens highest cycle.

Open a FORTRAN formatted text file. UNKNOWN opens a file for write access without flagging an error if the file already exists. On VMS a new cycle is created. DONTKNOW is the same as UNKNOWN except on VMS where the highest cycle is opened. This option should be used if it is not yet known whether the file will be read or written.

/FORTRAN/CLOSE lun

LUN I Logical unit number R=0:128

Close the file on unit LUN. If the file has been opened with HISTO/FILE, PICTURE/FILE, etc, then before closing the unit, PAW will close correctly the file with CALL HREND or FZENDI(O), ICLWK, etc. Giving 0 as unit will close all open files.

/FORTRAN/REWIND lun

LUN I Logical unit number R=1:128

Rewind the file on unit LUN.

/FORTRAN/SIGMA [ expr ]

EXPR C Expression D=' '

Invoke the SIGMA package. SIGMA is an array manipulation package using its own vector-oriented language, outside the PAW command conventions. SIGMA may be invoked in one of the three following ways:

1- Using the KUIP $SIGMA function. Example:

PAW > Vector/Create x(10) r 1 2 3 4 5 6 7 8 9 10 PAW > Graph 10 x $sigma(sqrt(x))

2- Using the SIGMA command. Example:

PAW > sigma x=array(10,1#10) PAW > sigma y=sqrt(x) PAW > Graph 10 x y

3- Using the APPLication command. Example:

PAW > APPLication SIGMA SIGMA > x=array(10,1#10) SIGMA > y=sqrt(x) SIGMA > exit PAW > Graph 10 x y