IAP GITLAB

Commit 8faea1ec authored by Tanguy Pierog's avatar Tanguy Pierog

do not use TRIM to be compatible with f77


git-svn-id: https://devel-ik.fzk.de/svn/mc/crmc/trunk@4516 c7a5e08c-de06-0410-9364-b41cf42a0b17
parent d72d1cd6
......@@ -49,12 +49,11 @@ CRMC<OutputPolicy>::init()
fCfg.fHEModel,
fCfg.fProduceTables,
fCfg.fTypout,
fCfg.GetOutputFileName().c_str(),
fCfg.fParamFileName.c_str());
//call here variable settings from c++ interface
//init models with set variables
fInterface.crmc_init();
fInterface.crmc_init(fCfg.GetOutputFileName().c_str(),fCfg.GetOutputFileName().size());
OutputPolicy::InitOutput(fCfg);
return true;
}
......
......@@ -86,7 +86,7 @@ bool CRMCinterface::init(int HEmodel)
crmc_set = (void(*)( const int&, const int&, const double&, const double&,
const int&, const int&, const int&, const int&,
const int&, const char*, const char*)) dlsym(fLibrary, "crmc_set_f_");
const int&, const char*)) dlsym(fLibrary, "crmc_set_f_");
if(crmc_set == NULL)
{
ostringstream errMsg;
......@@ -96,7 +96,7 @@ bool CRMCinterface::init(int HEmodel)
exit(1);
}
crmc_init = (void(*)()) dlsym(fLibrary, "crmc_init_f_");
crmc_init = (void(*)(const char*,const int&)) dlsym(fLibrary, "crmc_init_f_");
if(crmc_init == NULL)
{
ostringstream errMsg;
......
......@@ -13,8 +13,8 @@ extern "C"
double&, double&,double&, double&, int&);
void crmc_set_f_( const int&, const int&, const double&, const double&,
const int&, const int&, const int&, const int&, const int&,
const char*, const char*);
void crmc_init_f_();
const char*);
void crmc_init_f_(const char*,const int&);
void crmc_xsection_f_(double&, double&, double&, double&, double&, double&, double&, double&, double&);
}
#endif
......@@ -170,8 +170,8 @@ class CRMCinterface
double&, double&,double&, double&, int&); //crmc_f
void (*crmc_set)( const int&, const int&, const double&, const double&,
const int&, const int&, const int&, const int&, const int&,
const char*, const char*);
void (*crmc_init)();
const char*);
void (*crmc_init)(const char*,const int&);
void (*crmc_xsection)(double&, double&, double&, double&, double&, double&, double&, double&, double&);
private:
......
......@@ -21,7 +21,7 @@ CRMCoptions::CRMCoptions(int argc, char** argv)
fHEModel(0),
fProjectileMomentum(3500),
fTargetMomentum(-3500),
fParamFileName("crmc.param"),
fParamFileName("crmc.param "),
fOutputFileName(""),
fTypout(0),
fProduceTables(false),
......@@ -183,8 +183,10 @@ CRMCoptions::ParseOptions(int argc, char** argv)
if (opt.count("target-id"))
fTargetId = opt["target-id"].as<int>();
if (opt.count("config"))
if (opt.count("config")) {
fParamFileName = opt["config"].as<string>();
fParamFileName += ' '; //space needed at the end for Fortran command "index". "trim" needs f90 therefore not used here
}
if (opt.count("out"))
fOutputFileName = opt["out"].as<string>();
......
......@@ -2,7 +2,7 @@
c 15.01.2009 Simplified Main program and random number generator for epos
subroutine crmc_set_f(iEvent,iSeed,pproj,ptarg,
$ ipart,itarg,imodel,itab,itypout,lheoutfile,param)
$ ipart,itarg,imodel,itab,itypout,iParam)
***************************************************************
*
......@@ -27,8 +27,8 @@ c 15.01.2009 Simplified Main program and random number generator for epos
c Input values
integer iSeed,ipart,itarg,imodel,itab,itypout,iEvent,iout
double precision pproj, ptarg
character*1000 param,lheoutfile,output
common/typoutput/iout,output
character*1000 iParam
common/typoutput/iout
real m1,m2
double precision decms,e1,e2
......@@ -48,7 +48,6 @@ c Stop program if missing tables (after aaset)
c Set common for crmc_init
iout=itypout
output=lheoutfile
c Calculations of energy of the center-of-mass in the detector frame
call idmass(1120,m2) !target mass = proton
......@@ -79,7 +78,7 @@ c Update some parameters value to run correctly
c The parameters can be changed optionnaly by reading a file
c (example.param) using the following subroutine call
call EposInput(param) !(it can be commented)
call EposInput(iParam) !(it can be commented)
if ( model.ne.1 )istmax=0 !for most models virtual mothers are not defined
c if you put what is in input.optns in example.param, you can even run
......@@ -88,24 +87,23 @@ c the command : "EndEposInput" at the end of example.param, otherwise it
c will not run.
end
subroutine crmc_init_f()
subroutine crmc_init_f(output,lout)
***************************************************************
*
* init models with values set in crmc_set_f
*
***************************************************************
implicit none
integer iout
integer iout,lout
character*1000 output
common/typoutput/iout,output
common/typoutput/iout
c initialization for the given energy
call ainit
c Here the cross section sigineaa is defined
c LHE type output done by EPOS
if(iout.eq.1)call EposOutput(output)
if(iout.eq.1)call EposOutput(output(1:lout)//' ')
end
......@@ -232,7 +230,7 @@ c-----------------------------------------------------------------------
iadd=0
endif
nfnii=15 ! epos tab file name lenght
nfnii=15 ! epos tab file name length
fnii="tabs/epos.initl" ! epos tab file name
nfnid=15
fnid="tabs/epos.inidi"
......@@ -505,10 +503,10 @@ c-----------------------------------------------------------------------
c Use EPOS to create lhe file output
c-----------------------------------------------------------------------
include "epos.inc"
character*1000 iFile
character*(*) iFile
istore=4
nfndt=index(iFile,'.lhe')+4 !'.lhe' extension added in bstora
nfndt=index(iFile,' ') !final space important in bstora
fndt(1:nfndt)=iFile(1:nfndt)
kdtopen=0
......@@ -533,9 +531,12 @@ c-----------------------------------------------------------------------
nopen=0
ifop=52
open(unit=ifop,file=TRIM(iParam),status='old')
imax=index(iParam,' ')
if(imax.gt.1)then
open(unit=ifop,file=iParam(1:imax),status='old')
call aread
close(ifop)
endif
end
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment