Commit b2447d70 authored by jclamber's avatar jclamber

add 5th digits to simulation name, fix "." errot on NEMO filename

git-svn-id: http://svn.oamp.fr/repos/unsio/trunk@226 ce2cc22f-6084-46ce-a062-084b172ee5dc
parent fd031b2a
......@@ -8,7 +8,7 @@ nemocvs:
tar :
cd ..;tar czhvf unsio/unsio-`date "+%d%b-%Y-%H.%M"`.tar.gz `ls unsio/src/*.{f,F,cc,h} unsio/test_src/*.{f,F,cc,h} unsio/CMakeLists.txt unsio/cmake/*.cmake unsio/doc/*.{odp,pdf,txt} unsio/ChangeLog unsio/INSTALL unsio/mmakefile unsio/man/man3/* unsio/3rdparty/nemolight/CMakeLists.txt unsio/3rdparty/nemolight/src/*.{c,h} unsio/3rdparty/nemolight/src/inc/*.{c,h} unsio/3rdparty/nemolight/src/inc/snapshot/*.{c,h} unsio/3rdparty/nemolight/src/fortran_old_gcc/*.{c,h} unsio/template/uns_devel/cmake/*.cmake unsio/template/uns_devel/README unsio/template/uns_devel/CMakeLists.txt unsio/template/uns_devel/src/*.{c,cc,F} unsio/template/uns_devel/lib/src/*.{c,cc,F} unsio/scripts/perl/lib/Tools/*.pm unsio/scripts/perl/mains/*.pl unsio/scripts/sql/*.sql unsio/scripts/sql/README unsio/py/CMakeLists.txt unsio/py/cmake/*.cmake unsio/py/INSTALL unsio/py/swig/*.i unsio/py/test/uns_demo.py unsio/py/test/uns_2dplot.py 2> /dev/null`
template:
template1:
cd template; tar czhvf ../uns_devel.tar.gz `ls uns_devel/cmake/*.cmake uns_devel/README uns_devel/CMakeLists.txt uns_devel/src/*.{c,cc,F} uns_devel/lib/src/*.{c,cc,F}`
#
......@@ -224,11 +224,14 @@ template <class T> int CSnapshotGadgetIn::readCompData(T ** data, const int * in
*data = new T[dim*nsel];
}
T * ptr = *data;
float fskip; // file skip factor
int fskip; // file skip factor
if (array_vs_file_size<=1) {
fskip=float(array_vs_file_size+1);
// 0 keep
// 1 X 2
fskip = sizeof(T) << array_vs_file_size;
} else {
fskip=0.5;
// 2 divide by 2
fskip= sizeof(T) >> 1;
}
for(int k=0;k<6;k++) {
if (header.npart[k]>0) { // there are particles for the component
......@@ -236,7 +239,7 @@ template <class T> int CSnapshotGadgetIn::readCompData(T ** data, const int * in
if (idx != -1) {
readData((char *) &ptr[dim*idx], sizeof(T), dim*header.npart[k]);
} else {
skipData(fskip*sizeof(T)*dim*header.npart[k]);
skipData(fskip*dim*header.npart[k]);
}
}
}
......
......@@ -854,7 +854,7 @@ int CSnapshotNemoOut::save()
float * t = &time;
int * b = &bits;
int status=0;
if (simname=="-" || (simname!="-" && !tools::Ctools::isFileExist(simname))) {
if (simname=="." || simname=="-" || (simname!="-" && !tools::Ctools::isFileExist(simname))) {
status=io_nemo(simname.c_str(),"float,save,n,t,x,v,m,p,a,aux,k,dens,e,b",
&n,&t,&pos,&vel,&mass,&pot,&acc,&aux,&keys,&rho,&eps,&b);
} else {
......
......@@ -568,7 +568,7 @@ bool CSnapshotSimIn::buildGadgetFile()
// loop on all the possibility of file
// dirname+basename+nframe
// ex : gas001_0 gas001_00 gas001_000
while (!force_stop && !stop && cpt<5) {
while (!force_stop && !stop && cpt<=5) {
std::ostringstream ss;
ss << std::setw(cpt) << std::setfill('0') << nframe;
std::string myfile = dirname+'/'+basename+'_'+ss.str();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment