diff options
author | Erik Schnetter <schnetter@cct.lsu.edu> | 2008-12-08 17:42:21 -0600 |
---|---|---|
committer | Erik Schnetter <schnetter@cct.lsu.edu> | 2008-12-08 17:42:21 -0600 |
commit | abeda2d8b42b9667095df68c72b2a3d3b28a1e70 (patch) | |
tree | 252624d94ae78fb76f204301071f55e1b0cbcbbe /Carpet | |
parent | 57d349b1f6c058e0c5f20623fd4b1532fd2b4cdf (diff) | |
parent | 5bc3d75360afc2bc64a82db0617f10f11d717e5c (diff) |
Merge branch 'master' of /Users/eschnett/Cbeta/carpet/
Diffstat (limited to 'Carpet')
-rwxr-xr-x | Carpet/CarpetIOASCII/src/util/Carpet2ygraphCat.pl | 18 | ||||
-rw-r--r-- | Carpet/CarpetIOHDF5/src/Input.cc | 9 |
2 files changed, 14 insertions, 13 deletions
diff --git a/Carpet/CarpetIOASCII/src/util/Carpet2ygraphCat.pl b/Carpet/CarpetIOASCII/src/util/Carpet2ygraphCat.pl index 7e85340df..de8ad2626 100755 --- a/Carpet/CarpetIOASCII/src/util/Carpet2ygraphCat.pl +++ b/Carpet/CarpetIOASCII/src/util/Carpet2ygraphCat.pl @@ -102,7 +102,6 @@ if ($direction == 0) { my %data; my $time = -1; my $new = 0; -my $currentit = -1; my $lastit = -1; my @datatoprint; @@ -117,22 +116,19 @@ while (<CARPETFILE>) chomp; next if (/^$/); - if (/iteration/) { - @itline = split(/ +/); - $currentit = $itline[2]; - } @dataColumns = split(/[ :]/, $1) if (/^# data columns: (.+)/); #Do nothing for headers! next if (/^#/); - @dataline = split(/[ \t]+/); + my @dataline = split(/[ \t]+/); + my $currentit = $dataline[0]; if ($currentit != $lastit) { if ($new) { # do not print "Time..." for zero-D data - push(@datatoprint,"\n\n\#Time = ".$time."\n") if ($direction !~ 8); + push(@datatoprint,"\n\n\#Time = $time\n") if ($direction !~ 8); - my @sortedcoords = sort numerically (keys %data); + my @sortedcoords = sort {$a <=> $b} (keys %data); foreach my $localcoord (@sortedcoords) { push(@datatoprint, $localcoord." ".$data{$localcoord}."\n"); } @@ -158,9 +154,9 @@ while (<CARPETFILE>) } # do not print "Time..." for zero-D data -push(@datatoprint,"\n\n\#Time = ".$time."\n") if ($direction !~ 8); +push(@datatoprint,"\n\n\#Time = $time\n") if ($direction !~ 8); -my @sortedcoords = sort numerically (keys %data); +my @sortedcoords = sort {$a <=> $b} (keys %data); foreach my $localcoord (@sortedcoords) { push(@datatoprint, $localcoord." ".$data{$localcoord}."\n"); } @@ -214,5 +210,3 @@ foreach $line (@datatoprint) { # $nouts++; # print $fh $oldline; #} - -sub numerically {$a <=> $b;} diff --git a/Carpet/CarpetIOHDF5/src/Input.cc b/Carpet/CarpetIOHDF5/src/Input.cc index 7abdd1232..b37e84a74 100644 --- a/Carpet/CarpetIOHDF5/src/Input.cc +++ b/Carpet/CarpetIOHDF5/src/Input.cc @@ -106,7 +106,14 @@ void CarpetIOHDF5_RecoverGridStructure (CCTK_ARGUMENTS) // Abort with an error if there is no grid structure in the // checkpoint file, or if the number of maps is wrong - assert (int(fileset.grid_structure.size()) == maps); + if (fileset.grid_structure.empty()) { + CCTK_WARN(0, "No grid structure information found in checkpoint file !"); + } else if (int(fileset.grid_structure.size()) != maps) { + CCTK_VWarn(0, __LINE__, __FILE__, CCTK_THORNSTRING, + "Number of maps in the checkpoint's grid structure information " + "(%d) doesn't match current number of maps (%d) !", + int(fileset.grid_structure.size()), maps); + } vector<vector<vector<region_t> > > superregsss = fileset.grid_structure; vector<vector<vector<vector<region_t> > > > regssss (maps); |