ERROR: Invalid fix command of fix ave/correlate

Hi, everyone!
I am working on the heat transfer of nanochannel by lammps. However, I stopped for the Error: Invalid fix command of fix ave/correlate. Even though I run the example of “compute heat/flux command”, the error still remains.

My in files is following:
units real
dimension 3
processors 2 2 2
boundary p p p
atom_style full
read_data plate.txt
neighbor 2 bin
neigh_modify delay 5
pair_style lj/cut 10.0
mass 1 195.08 #Pt
mass 2 195.08
mass 3 195.08
mass 4 195.08
mass 5 39.94 #Ar

LJ potentials

LJ w/ epsilon, sigma

pair_coeff * * 0 0
pair_coeff 1 1 12.014 2.475
pair_coeff 1 2 12.014 2.475
pair_coeff 1 5 1.699 2.9375
pair_coeff 5 5 0.24 3.4
pair_coeff 3 3 12.014 2.475
pair_coeff 3 4 12.014 2.475
pair_coeff 3 5 1.699 2.9375

define groups

group substrate1 type 2
group substrate2 type 4
group Pt1 type 1
group Pt2 type 3
group Ar type 5

compute 1 Ar temp/com
compute 2 Pt1 temp/com
compute 3 Pt2 temp/com

fixes

fix 1 Pt1 nvt temp 190.0 190.0 100.0 drag 0.2
fix 2 Pt2 nvt temp 210.0 210.0 100.0 drag 0.2
fix 3 Ar nvt temp 200.0 200.0 100.0 drag 0.2
fix 4 substrate1 setforce 0.0 0.0 0.0
fix 5 substrate2 setforce 0.0 0.0 0.0

timestep .5
thermo 500
thermo_style custom step c_1 c_2 c_3
run 50000

unfix 3
fix 6 Ar nve
thermo 500
thermo_style custom step c_1 c_2 c_3
run 200000

#define variable #the following is rewrite of the example
variable T equal 200
variable V equal 188225 #this volume is fluid Ar not the system vol
variable dt equal 4.0
variable p equal 200 # correlation length
variable s equal 10 # sample interval
variable d equal $p*$s # dump interval

convert from LAMMPS real units to SI

variable kB equal 1.3806504e-23 # [J/K] Boltzmann
variable kCal2J equal 4186.0/6.02214e23
variable A2m equal 1.0e-10
variable fs2s equal 1.0e-15
variable convert equal {kCal2J}*{kCal2J}/{fs2s}/{A2m}

timestep ${dt}

reset_timestep 0
compute myKE Ar ke/atom
compute myPE Ar pe/atom
compute myStress Ar stress/atom virial
compute flux Ar heat/flux myKE myPE myStress
variable Jx equal c_flux[1]/V
variable Jy equal c_flux[2]/V
variable Jz equal c_flux[3]/V
fix JJ Ar ave/correlate $s $p d & c_flux[1] c_flux[2] c_flux[3] type auto file J0Jt.dat ave running variable scale equal {convert}/${kB}/$T/$T/$V*s*{dt}
variable k11 equal trap(f_JJ[3]){scale} variable k22 equal trap(f_JJ[4])*{scale}
variable k33 equal trap(f_JJ[5])
${scale}
thermo_style custom step c_1 c_2 c_3 v_Jx v_Jy v_Jz v_k11 v_k22 v_k33
run 100000
variable k equal (v_k11+v_k22+v_k33)/3.0
variable ndens equal count(Ar)/V
print “average conductivity: $k[W/mK] @ T K, {ndens} /A^3”

My run command is: /usr/mpi/intel/openmpi-1.4.3-qlc/bin/mpirun -nolocal -np 8 -hostfile hostfile /usr/lammps/bin/lmp_openmpi -in in.water >log &

The programm run 250000 and start to compute heat conductivity. And the error come:

fix JJ Ar ave/correlate 10 200 2000 c_flux[1] c_flux[2] c_flux[3] type auto file J0Jt.dat ave running
ERROR: Invalid fix style

Best regards
Qibin LI

That error is generated when your executable isn't built
with the fix in question. If you do a lmp_foo -h do you
see ave/correlate in the list of fixes it knows about?

Steve