The program go to the end
of the first snapshot and get nbody
and time (tlast). Then, it reads each timestep of the second snapshot and
starts to append to the first snapshot, only if the time of the current
timestep is greater than tlast, and if the nbody values in both snapshots
are identical.
-1 : an error occured, no merging. 0 : the second snapshot does not have a time step greater than the last time step of the first snapshot, no merging. 1 : merging have been successfully completed.
#!/usr/bin/perl use strict; my $out="cosmo256.snap_sp"; foreach my $i ( <snapshot_???> ) { # read all snapshot_XXX printf STDERR "[$i]\n"; system("gadget2nemo $i /tmp/snap.$$"); # gadget2nemo if ( ! -f $out ) { system("mv /tmp/snap.$$ $out"); # first snapshot } else { system("snapmerge_a_sp $out /tmp/snap.$$");# merging system("/bin/rm /tmp/snap.$$"); } }
Notice this is an example for the single precision (_sp) version, the double precision (_dp) works the same way.
28-Nov-06 V1.21: added to CVS JCL 28-nov-06 merged two man pages into one PJT 29-nov-06 fix perl script example in manual JCL