HTML automatically generated with rman
Table of Contents

Name

snapmerge_a_sp, snapmerge_a_dp - Merge the second input snapshot at the end of the first one (single and double precision output).

Synopsis

snapmerge_a_sp in1=... in2=... [parameter=value]

Description

snapmerge_a merges the second input snapshot at the end of the first snapshot but without making a copy of the first snapshot. This is very convenient when the first snapshot is very large and prevent problems of space disk. Please, notice that the input snaphot will be modified. You have been warned...

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.

Parameters

The following parameters are recognized in any order if the keyword is also given:
in1=
Input NEMO snapshot [???]
in2=
Input NEMO snapshot to append after in1 [???]

Return Value

The program print out (on stdout) the following codes:
-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.

Example

The following perl script program, convert all snapshots produced by the gadget2 program to a single one NEMO file. It can be usefull to make analysis of the whole NEMO snaphot or to display with glnemo.
#!/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.

See Also

snapmerge(1NEMO) , snapshot(5NEMO)

Files

src/nbody/trans/snapmerge_a.c

Author

Jean-Charles LAMBERT

Update History


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


Table of Contents