! Author: Clare Quarman (cquarman@pp.rhul.ac.uk) ! File: wrapperHelper.f (prev called stringHelper.f) ! Purpose: these subroutines are to aid the wrapping ! of the fortran package QCDNUM in C++ ! Date Begun: Nov 2003 !============================================== subroutine openhelper(lun, filename) ! ! some qcdnum routines require a lun to know where ! to output to or read from, this seems to easiest ! way of making those routines useful ! see also closehelper and writefile subroutines !---------------------------------------------- implicit none integer lun character*(*) filename !not sure if this will work !but is like in qcdnum.f open(lun,file=filename,form='unformatted',status='unknown') end !============================================== subroutine closehelper(lun) !---------------------------------------------- implicit none integer lun close(lun) end !============================================== subroutine writefile(lun,output) ! ! not designed to be used much, only in case qcdnum ! user wants to add a descriptive line at the beginning ! of a file that qcdnum is about to output to so as ! to avoid outputting to the same file from both c++ ! and fortran - as I expect that would be messy! ! NOT intended to be the main way of writing to a file! !---------------------------------------------- implicit none integer lun character*(*) output write(lun,*)output end !---------------------------------------------- subroutine qnvershelper(l,i,j) !---------------------------------------------- implicit none logical l integer i,j character*8 c8 call qnvers(c8,l,i,j) open(1,file='qcdnumWrapperHelper.temp') write(1,*)c8 close(1) end !----------------------------------------------