Re: [AMBER] passing a new argument to sander on command line

From: Jason Swails <>
Date: Mon, 30 Sep 2013 12:28:18 -0400

On Mon, Sep 30, 2013 at 11:56 AM, Kepa K. Burusco <>wrote:

> [30-IX-2013]
> Hi amber users,
> I am working with amber11 code and I would like to do a test with the MPI
> communicators. In order to do this, I need to create an integer variable to
> be read on the command line BEFORE the MPI code at "multisander.f" is
> executed (this variable is used in a if-statement block before the MPI
> "commsander and commmaster" communicators asre created). Something like:
> $AMBERHOME/exe/sander.MPI -ng 8 -myVariable 1 -groupfile myGroupFile
> I want to do something like the -rem variable for the Replica Exchange MD.
> It has to be initialised before the MPI code is started.
> I have already included some lines in "mdfil.f" to be able to parse the
> argument into sander (similarly to -rem). Also, the variable is initialised
> to zero at multisander.f in a similar way to rem=0 (actually, just after
> rem=0 is initialised).
> But the variable has to be declared as global beforehand to be used and to
> be accesible to all the program.
> At the beginning I tried different combinations including the variable in
> "md.h" and "parallel.h" to make it available to all the program and also in
> "mdread.f" to print its value in the output file, but I obtained some error
> messages reading that the variable was of a type "undefined".
> Later, I tried to do something similar to "-rem" variable. I thought that
> if I define the variable similarly as the rem variable is defined, it will
> work. Then I declared the variable as an "integer, save" at "remd.f" (this
> module is first read in multisander.f so rem variable is accesible). But
> doing this I also get errors saying that the variable is undefined in
> mdread.f:
> _mdread.f(2715): error #6404: This name does not have a type, and must
> have an explicit type. [MYVAR]

The compiler seems to think you did not declare this variable anywhere...
 You have to make sure that you have declared it (like below) and that it
is available where you are trying to use it.

integer :: myVar

If you are really trying to mirror the "rem" variable, then put something

integer, save :: myVar

in whatever module you are editing (e.g., remd) and make sure you "use"
that module in every subroutine you want to access it in. (If the module
was used before in that subroutine, add myVar to the list of "only"
variables there instead of creating a whole new "use" statement).


Jason M. Swails
Rutgers University
Postdoctoral Researcher
AMBER mailing list
Received on Mon Sep 30 2013 - 09:30:05 PDT
Custom Search