How to create a Column Wise NTuple (CWN) ?


The following example should be linked with CERN program library. It creates the Column Wise NTuple (CWN) number 1 in the file cwn.hbook.

The following important points should be noticed:

  1. The ntuple variables must be declared in a common block in the same order they are declared in the Hbname call.
  2. The common block address should be passed to Hbname via the first common block's variable.
  3. If some variables are variable size arrays, the common block corresponding variables should be dimensioned to a maximal value.
  4. If the ntuple contains some Character variables, a special common block containing only Character variables must be declared and Hbnamc should be called in place of Hbname, because in Fortran Character variables cannot be mixed with other variables in a common block.
       Program CWN
 *
       Common /Pawc/ H(100000)
       Parameter (Nmax = 100)
       Common /CWN/  N,X(Nmax),Y(Nmax),Z(Nmax)
 *.___________________________________________
 *
       Call Hlimit(100000)
 *
       Call Hropen(1,'CWN','cwn.hbook','N',1024,Istat)
       If (Istat.Ne.0) Then
          Print*, 'Error in opening file ...'
          Stop
       Endif
 *
       Call Hbnt(1,'CWN',' ')
       Call Hbname(1,'Block1',N,'N[0,100], X(N), Y(N), Z(N)')
 *
       Do N=1,Nmax
          Do I=1,N
             X(N) = N*N
             Y(N) = N*N*N
             Z(N) = SIN(X(N))
          EndDo
          Call HFNT(1)
       EndDo
 *
       Call Hrout(0,Icycle,' ')
       Call Hrend('CWN')
 *
       end
 


Release NotesKnown bugsFAQsContributionsTutorialReference manualDown loadMiscellaneous

Paw.Support@cern.ch