[lammps-users] Use of variable command for text

I am try to use the variable command for text in the following way:

variable JOBNAME equal “job-xyz”

dump 1 all atom 100 ${JOBNAME}.lammpstrj

which gives the error message: ERROR: Invalid thermo keyword in variable formula

So it is not interpreting the ${JOBNAME} as text. How to fix this?

Thanks,

Fred Phelan

I am try to use the variable command for text in the following way:

variable JOBNAME equal "job-xyz"

dump 1 all atom 100 ${JOBNAME}.lammpstrj

which gives the error message: ERROR: Invalid thermo keyword in variable
formula

So it is not interpreting the ${JOBNAME} as text. How to fix this?

there is no reason to define an equal-style variable for this.

you can use an index style variable, for example.

that would have the added benefit, that you can override it
from the command line with: -var JOBNAME new-job

i often use this in the form: -var JOBNAME myjob-${PBS_JOBID}
to name output files uniquely by the unique job identifier
from the batch system.

cheers,
     axel.

there is no reason to define an equal-style variable for this.

More strongly, it's an error to do so. An equal-style
variable is an equation. LAMMPS can't evalulate
an equation with arbitrary strings in it.

As Axel says, the other styles of variables are what you
want for this case.

Steve