Index: /trunk/Cosmo/SimLSS/cmvobserv3d.cc
===================================================================
--- /trunk/Cosmo/SimLSS/cmvobserv3d.cc	(revision 3593)
+++ /trunk/Cosmo/SimLSS/cmvobserv3d.cc	(revision 3594)
@@ -60,4 +60,5 @@
      <<"              e=1 : write fourier transform of previous cube (_k)"<<endl
      <<" -S : write cube slices in PPF format"<<endl
+     <<" -o root_name_out : root string for output file name (def: cmvobserv3d)"<<endl
      <<" -V : compute variance from real space (for check, default: no)"<<endl
      <<" -T nth : nombre de threads (si compil multi-thread, default: 0)"<<endl
@@ -133,4 +134,5 @@
  bool compvarreal = false;
  unsigned short whattowrt[5] = {1,1,1,1,1};
+ string rootnameout = "cmvobserv3d";
 
  unsigned long ntnent = 10000;  // 0 = do not fill NTuple
@@ -145,5 +147,5 @@
 
  char c;
- while((c = getopt(narg,arg,"ha0PWSV2U:G:F:x:y:z:s:Z:M:A:T:N:Q:R:8:O:")) != -1) {
+ while((c = getopt(narg,arg,"ha0PWSV2U:G:F:x:y:z:s:Z:M:A:T:N:Q:R:8:O:o:")) != -1) {
   int nth = 0;
   switch (c) {
@@ -217,4 +219,7 @@
   case 'S' :
     wslice = true;
+    break;
+  case 'o' :
+    rootnameout = optarg;
     break;
   case 'T' :
@@ -256,6 +261,7 @@
      <<whattowrt[0]<<","<<whattowrt[1]<<","<<whattowrt[2]<<","<<whattowrt[3]<<","
      <<whattowrt[4]<<endl;
-
- string tagobs = "cmvobserv3d.ppf";
+ cout<<"rootnameout="<<rootnameout<<endl;
+
+ string tagobs = rootnameout + ".ppf";
  POutPersist posobs(tagobs);
 
@@ -507,9 +513,11 @@
  if(whattowrt[0]==1) {
  if(wfits) {
-   fluct3d.WriteFits("!cmvobserv3d_k0.fits");
+   tagobs = "!" + rootnameout + "_k0.fits";
+   fluct3d.WriteFits(tagobs);
    PrtTim(">>>> End WriteFits");
  }
  if(wppf) {
-   fluct3d.WritePPF("cmvobserv3d_k0.ppf",false);
+   tagobs = rootnameout + "_k0.ppf";
+   fluct3d.WritePPF(tagobs,false);
    PrtTim(">>>> End WritePPF");
  }
@@ -543,13 +551,16 @@
  if(whattowrt[1]==1) {
  if(wfits) {
-   fluct3d.WriteFits("!cmvobserv3d_r0.fits");
+   tagobs = "!" + rootnameout + "_r0.fits";
+   fluct3d.WriteFits(tagobs);
    PrtTim(">>>> End WriteFits");
  }
  if(wppf) {
-   fluct3d.WritePPF("cmvobserv3d_r0.ppf",true);
+   tagobs = rootnameout + "_r0.ppf";
+   fluct3d.WritePPF(tagobs,true);
    PrtTim(">>>> End WritePPF");
  }
  if(wslice) {
-   fluct3d.WriteSlicePPF("cmvobserv3d_s_r0.ppf");
+   tagobs = rootnameout + "_s_r0.ppf";
+   fluct3d.WriteSlicePPF(tagobs);
    PrtTim(">>>> End WriteSlicePPF");
  }
@@ -604,5 +615,6 @@
    PrtTim(">>>> End Apply poisson on galaxy number");
    if(wslice) {
-     fluct3d.WriteSlicePPF("cmvobserv3d_s_rn.ppf");
+     tagobs = rootnameout + "_s_rn.ppf";
+     fluct3d.WriteSlicePPF(tagobs);
      PrtTim(">>>> End WriteSlicePPF");
    }
@@ -633,13 +645,16 @@
  if(whattowrt[2]==1) {
  if(wfits) {
-   fluct3d.WriteFits("!cmvobserv3d_r.fits");
+   tagobs = "!" + rootnameout + "_r.fits";
+   fluct3d.WriteFits(tagobs);
    PrtTim(">>>> End WriteFits");
  }
  if(wppf) {
-   fluct3d.WritePPF("cmvobserv3d_r.ppf",true);
+   tagobs = rootnameout + "_r.ppf";
+   fluct3d.WritePPF(tagobs,true);
    PrtTim(">>>> End WritePPF");
  }
  if(wslice) {
-   fluct3d.WriteSlicePPF("cmvobserv3d_s_r.ppf");
+   tagobs = rootnameout + "_s_r.ppf";
+   fluct3d.WriteSlicePPF(tagobs);
    PrtTim(">>>> End WriteSlicePPF");
  }
@@ -681,13 +696,16 @@
  if(whattowrt[3]==1) {
  if(wfits) {
-   fluct3d.WriteFits("!cmvobserv3d_rf.fits");
+   tagobs = "!" + rootnameout + "_rf.fits";
+   fluct3d.WriteFits(tagobs);
    PrtTim(">>>> End WriteFits");
  }
  if(wppf) {
-   fluct3d.WritePPF("cmvobserv3d_rf.ppf",true);
+   tagobs = rootnameout + "_rf.ppf";
+   fluct3d.WritePPF(tagobs,true);
    PrtTim(">>>> End WritePPF");
  }
  if(wslice) {
-   fluct3d.WriteSlicePPF("cmvobserv3d_s_rf.ppf");
+   tagobs = rootnameout + "_s_rf.ppf";
+   fluct3d.WriteSlicePPF(tagobs);
    PrtTim(">>>> End WriteSlicePPF");
  }
@@ -704,9 +722,11 @@
  if(whattowrt[4]==1) {
  if(wfits) {
-   fluct3d.WriteFits("!cmvobserv3d_k.fits");
+   tagobs = "!" + rootnameout + "_k.fits";
+   fluct3d.WriteFits(tagobs);
    PrtTim(">>>> End WriteFits");
  }
  if(wppf) {
-   fluct3d.WritePPF("cmvobserv3d_k.ppf",false);
+   tagobs = rootnameout + "_k.ppf";
+   fluct3d.WritePPF(tagobs,false);
    PrtTim(">>>> End WritePPF");
  }
Index: /trunk/Cosmo/SimLSS/genefluct3d.cc
===================================================================
--- /trunk/Cosmo/SimLSS/genefluct3d.cc	(revision 3593)
+++ /trunk/Cosmo/SimLSS/genefluct3d.cc	(revision 3594)
@@ -910,9 +910,8 @@
 
  // On corrige du pb de la normalisation de FFTW3
- double v = (double)NRtot_;
+ complex<r_8> v((r_8)NRtot_,0.);
  for(long i=0;i<Nx_;i++)
    for(long j=0;j<Ny_;j++)
-     for(long l=0;l<NCz_;l++) T_(l,j,i) /= complex<r_8>(v);
-
+     for(long l=0;l<NCz_;l++) T_(l,j,i) /= v;
 }
 
