Issues about wrap/unwrap coordinates in triclinic NPT simulation

Hello. I tried NPT simulation of ionic crystal in triclinic cell.
With temperature above 400K, crystals become melts.
In this simulation, pair correlation function shows weird peak below 0.5 A which is impossible because of the non bonding interactions.

To check this problem, I checked the coordinates of atoms in my simulation. I found that wrapped and unwrapped coordinates are differ.

Can anyone can explain this strange things?
Thank you.

======= My script =========

units real
atom_style full
dimension 3
boundary p p p
neighbor 3.0 bin
neigh_modify delay 0 every 1 check yes page 500000 one 50000

variable r index 10000
variable dcd index 100
variable t index 400
variable ts index 1.0

variable a equal 100.0*${ts}

variable b equal 1000.0*${ts}

pair_style lj/cut/coul/long 10.0
bond_style harmonic
angle_style harmonic
dihedral_style charmm
improper_style cvff
kspace_style ewald 0.0001
pair_modify shift yes mix geometric

special_bonds lj/coul 0.0 0.0 0.5

read_data re.init

fix 1 all npt temp $t $t $a iso 1.0 1.0 $b

thermo ${dcd}

timestep ${ts}

dump 1 all dcd ${dcd} posnpt1_no.dat
dump_modify 1 unwrap no

dump 2 all dcd ${dcd} posnpt1_yes.dat
dump_modify 2 unwrap yes

run $r
write_restart re.dcd

Of course the wrapped and unwrapped coordinates differ, that is the whole point. But what has that to do with your g(r) calculation?

Thank you for your fast reply.
I checked this by calculating g(r) with lammps commands.
I compared g(r) which calculated by my codes and by lammps.

I found that if I use unwrap coordinates to calculate the g(r)
show peaks in very short distance while g(r) calculated by wrap coordinates show same distribution with lammps output.

What way is more precise and reliable?
Using wrap coordinates?

Thank you.

The g(r) calculation should produce the same output with both trajectory files. If the output differs, that is an indication of a bug in the code to compute the g(r), not an issue of which of the trajectories is “better”. They are equivalent.

Thank you for your answers.
I rechecked my code and I found that
my code calculates the box parameters improperly.
Now g(r) shows same results with g(r) by lammps.