[Clas_offline] help needed in compiling clas package

Jixie Zhang jixie at jlab.org
Fri Aug 30 15:22:10 EDT 2013


HI,
Thanks to Paul and Nerses for the feedback.

I compare the same file in
/group/clas/builds/centos62/trunk/reconstruction/ana/fill_seb_ntn.F

The way to extract bit 31 from iw(ind3+1)  is exactly the same in both
version.


ifarm1102> grep -i 'stbit'
/group/clas/builds/centos62/trunk/reconstruction/ana/fill_seb_ntn.F
../ana/fill_seb_ntn.F
/group/clas/builds/centos62/trunk/reconstruction/ana/fill_seb_ntn.F:
integer hbit,sbit,htbit,stbit,sbitold,hbitold,j,sect
/group/clas/builds/centos62/trunk/reconstruction/ana/fill_seb_ntn.F:
stbit=3
/group/clas/builds/centos62/trunk/reconstruction/ana/fill_seb_ntn.F:
stbit=int(iw(ind3+1)/2**31)
/group/clas/builds/centos62/trunk/reconstruction/ana/fill_seb_ntn.F:
htbit=int((iw(ind3+1)-stbit*2**31)/2**30)
../ana/fill_seb_ntn.F:      integer
hbit,sbit,htbit,stbit,sbitold,hbitold,j,sect
../ana/fill_seb_ntn.F:      stbit=3
../ana/fill_seb_ntn.F:         stbit=int(iw(ind3+1)/2**31)
../ana/fill_seb_ntn.F:         htbit=int((iw(ind3+1)-stbit*2**31)/2**30)


Nerse's suggestion of using preprocessor commands should solve the problem.
Here is my modification only for gfortran.

#ifdef __GFORTRAN__
         stbit=ibits(iw(ind3+1),31,1)
         htbit=ibits(iw(ind3+1),30,1)
#else
         stbit=int(iw(ind3+1)/2**31)
         htbit=int((iw(ind3+1)-stbit*2**31)/2**30)
#endif



On Fri, Aug 30, 2013 at 2:11 PM, Nerses Gevorgyan <nerses at jlab.org> wrote:

>  I agree with Paul it is very possible somebody fixed that somewhere.
>
> Just in case if You'll not find it.
> -----------------------------------------
> stbit=int(iw(ind3+1)/2**31)
> htbit=int((iw(ind3+1)-stbit*2**31)/2**30)
>
> These type of commands are happening in more than one place.
> I guess it is just first one encountered.
> It is just a way of extracting some bits(#32 and #31) from 32 bit from
> integer iw.
>
> I've used a replacement code using ibits intrinsic function (available for
> FORTRAN95 and later versions).
>          stbit=ibits(iw(ind3+1),31,1)
>          htbit=ibits(iw(ind3+1),30,1)
> Then in the code using preprocessor commands use appropriate code
> depending on g77 or gfortran compiler is used.
>
> HTH,
> Nerses
>
> --
With Best Regards,
Jixie Zhang
757-269-7735
_______________________________________________
-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://mailman.jlab.org/pipermail/clas_offline/attachments/20130830/fc9b01a8/attachment-0001.html 


More information about the Clas_offline mailing list