PAW example
Using the paw commands:
hi/file 2 aptuple.hbook ntuple/loop 10 test_rnd.f
REAL FUNCTION test_rnd() c******************************************************** c * c This file was generated by HUWFUN. * c * c******************************************************** c c Ntuple Id: 1 c Ntuple Title: prodV2.1 LAY01 c Creation: 24/04/01 09.15.22 c c******************************************************** c c implicit none include ? c logical start integer RunNumber_1 real gau(2),prescale integer ranlux external ranlux data start/.true./ if (start) then call rluxgo(4,87973028,0,0) start = .false. endif call rnormx(gau,2,ranlux) call ranmar(prescale,1) print *,prescale,gau test_rnd = 0 if (test_rnd .eq. 0) stop return end"rnormx" and "ranlux" are internal paw routines. The problem with this example is the 3rd argument in "call rnormx" which is an external and its value (address) is stored relative to the address of the "jumpad" external.
A faster execution of the "ntuple/loop" instruction can be obtained using dynamically loaded user code. But this requires to replace the
include ?by the code included with it. A paw kumac file should then look like this:
hi/file 2 aptuple.hbook appl comis quit !file 0.csl !file test_rnd_sh.f quit ntuple/loop 10 test_rnd