When we use PAW to do data analysis , we usually edit selection functions to pick some interesting events and do all kinds of histograms. In those selection functions, we call some other subroutines or functions. Usually you have to put all those routines into one file in which case the file itself could become very large and complicated. In many situation, your selection functions call some common basic routines and you have to put those basic routines into each of your selection functions. To change one of those basic routines will end up changing many files that call that routine.
Using libraries is a natural thought for this situation. You can put those basic routines together and build a few of your own libraries, then dynamically load those libraries ( actually all useful libraries too ) when we start PAW. In the mean time, you can call those routines in your selection functions without appending source files of those routines.
Here are the steps to take:
Suppose you have several fortran files called a.f, b.f, c.f, d.f
the following UNIX commands will build an archive library mylib.a for you.
<d0chb> f77 -c -g -mips2 *.f <d0chb> ar r mylib.a a.o b.o c.o. d.o
#! /bin/csh # sample mypaw script, change to use your own library names setenv D0UNIX /d0library/unix/unix.a setenv MYLIB1 /proj4/whatever/mylib1.a setenv MYLIB2 /path/mylib2.a setenv USERLIB "$MYLIB1 $MYLIB2 $D0UNIX -lcurses" setup d0paw # use d0 version of PAW pawX11
Note:
EXAMPLE:
d0chb% mypaw ****************************************************** * * * W E L C O M E to P A W * * * * Version 2.07/23 13 May 1996 * * * ****************************************************** Workstation type (?=HELP) <CR>=1 : Version 1.23/07 of HIGZ started *** Using default PAWLOGON file "/d0sgi0/usr0/dongzhao/.pawlogon.kumac" KUIP/RECORD is OFF Welcome to PAW via the default PAWLOGON PAW [1] exec my_chain PAW [2] nt/loop 10 my_selection.f77(1.0)