[30-IX-2013]
Hi Jason,
Thanks for your prompt answer. Actually, I only tried to "mirror" the rem variable because I found problems in doing it just as a new one. If there is a simpler way to declare my variable "myvar" as global (in md.h; parallel.h or any other file) and make it accesible to all the program I think that I would like to do that rather than editing many subrotines here and there.
Since it is not an MPI variable, at the beginning I thought that it shouldn't be very difficult to create it. It is just an integer ("0" or "1"). And I also need it to be global because I will use it in a couple of subroutines in other if-statements.
I will continue trying...
Thanks!!
Kepa K.
*************************************************
________________________________
De: Jason Swails <jason.swails.gmail.com>
Para: Kepa K. Burusco <kekoburgo.yahoo.es>; AMBER Mailing List <amber.ambermd.org>
Enviado: Lunes 30 de septiembre de 2013 17:28
Asunto: Re: [AMBER] passing a new argument to sander on command line
On Mon, Sep 30, 2013 at 11:56 AM, Kepa K. Burusco <kekoburgo.yahoo.es>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
like
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).
HTH,
Jason
--
Jason M. Swails
BioMaPS,
Rutgers University
Postdoctoral Researcher
_______________________________________________
AMBER mailing list
AMBER.ambermd.org
http://lists.ambermd.org/mailman/listinfo/amber
_______________________________________________
AMBER mailing list
AMBER.ambermd.org
http://lists.ambermd.org/mailman/listinfo/amber
Received on Mon Sep 30 2013 - 10:30:03 PDT