I am trying to compile a code using gfortran. The subroutine plumed_f_gcmd is where I am having some trouble. Here is the piece of the code
call plumed_f_gcmd("setMDTimeUnits"//char(0),timeUnits)
call plumed_f_gcmd("setPlumedDat"//char(0),"plumed.dat"//char(0))
call plumed_f_gcmd("setLogFile"//char(0),"PLUMED.OUT"//char(0))
call plumed_f_gcmd("setNatoms"//char(0),natms)
call plumed_f_gcmd("setMDEngine"//char(0),"dlpoly1.90"//char(0))
the compiler throws the following error:
call plumed_f_gcmd("setPlumedDat"//char(0),"plumed.dat"//char(0
1
Error: Syntax error in argument list at (1)
call plumed_f_gcmd("setMDEngine"//char(0),"dlpoly1.90"//char(0)
1
Error: Syntax error in argument list at (1)
First of all I don't quite understand how in a subroutine, the second input can be once a number and once a string? does '//char(0)' somehow changes the string to another data type? Can someone please explain this to me?
And my second question is why the error is not happening also for the case of the third line (PLUMED.OUT)?
I don't know how but some C and C++ wrappers are also involved; this is the subroutine in C:
void plumed_f_gcmd(char*key,void*val){
plumed_gcmd(key,val);
}