Restrict screen output calling from Fortran

Hello all,

I'm trying to couple LAMMPS to a Fortran code and would like to have LAMMPS write screen information to a file or not print any information to the screen.

I see when using LAMMPS at the command line this can be done with -screen file and -screen none but I do not see how to do this when calling LAMMPS as a library.

Thanks,
David

david,

Hello all,

I'm trying to couple LAMMPS to a Fortran code and would like to have LAMMPS write screen information to a file or not print any information to the screen.

I see when using LAMMPS at the command line this can be done with -screen file and -screen none but I do not see how to do this when calling LAMMPS as a library.

it can be easily done, in principle when you call lammps from C or C++,
but from fortran it i not as easy, since there is no *easy and portable*
way to pass an argument array from fortran to C.

you have essentially three choices:

use the fortran 2003/2008 style iso C
bindings and the C library interface,

or make a suggestion what would be
a good and portable way to pass the
list of arguments from fortran to C
(in a fortran 77 compatible way by preference)

or hack the fortran library wrapper to
provide the flags that you want to be
when initializing the lammps object.

let us know, if you have additional
questions on this.

ciao,
    axel.

I see when using LAMMPS at the command line this can be done with -screen file and -screen none but I do not see how to do this when calling >> LAMMPS as a library.

it can be easily done, in principle when you call lammps from C or C++,
but from fortran it i not as easy, since there is no *easy and portable*
way to pass an argument array from fortran to C.

The lammps_open() method in the lib interface takes argc and argv,
so if those were filled with "-screen none" then it will operate exactly
the same as if you ran LAMMPS as a stand-alone code with those
command line args.

Thus the issue is, as Axel said, how to pass an array of char strings
in from Fortran. There is probably a way to do it, but it would be Fortran
and Fortran-to-C specific. I'd check your Fortran documentation.

I also have a new, updated Fortran wrapper that has been submitted
to release. Hope to get to it this week. Maybe it provides a mechanism
for this.

Steve