reinitialize meam -> runtime error

Dear Lammps users,

I tried running the ELASTIC_T example with a meam potential. This resulted in a runtime error because of the repeated initialization of the meam pair_style (indicating to meam_setup_done.F, line 187 ff).

At line 187 of file meam_setup_done.F

Fortran runtime error: Attempting to allocate already allocated variable ‘phir’

At line 192 of file meam_setup_done.F

Fortran runtime error: Attempting to allocate already allocated variable ‘phirar’

Minimal example:

units metal

dimension 3

boundary p p p

atom_style atomic

----------------------- ATOM DEFINITION ----------------------------

lattice fcc 4.05

region whole block 0 10 0 10 0 10

create_box 1 whole

create_atoms 1 region whole

------------------------ FORCE FIELDS ------------------------------

pair_style meam

pair_coeff * * library.meam Al AlSiMgCuFe.meam Al

fix 1 all nve

run 10

unfix 1

pair_style meam

pair_coeff * * library.meam Al AlSiMgCuFe.meam Al

fix 1 all nve

run 10

unfix 1

I’m not sure if you want to include my quick fix into the official distribution. Nevertheless I wanted to post it to the mailing list in case somebody has the same problem.

— meam_setup_done.F.bak 2016-08-31 11:01:15.620402591 +0200

+++ meam_setup_done.F 2016-08-31 11:12:20.132379486 +0200

@@ -183,6 +183,16 @@

real*8, external :: zbl

real*8, external :: compute_phi

+c check for preallocated arrays

  • if(allocated(phir)) deallocate(phir)

  • if(allocated(phirar)) deallocate(phirar)

  • if(allocated(phirar1)) deallocate(phirar1)

  • if(allocated(phirar2)) deallocate(phirar2)

  • if(allocated(phirar3)) deallocate(phirar3)

  • if(allocated(phirar4)) deallocate(phirar4)

  • if(allocated(phirar5)) deallocate(phirar5)

  • if(allocated(phirar6)) deallocate(phirar6)

image001.png

I think Axel fixed this in the most recent couple of patches.

Steve

image001.png