Index: trunk/Cosmo/SimLSS/cmvtuniv.cc
===================================================================
--- trunk/Cosmo/SimLSS/cmvtuniv.cc	(revision 3949)
+++ trunk/Cosmo/SimLSS/cmvtuniv.cc	(revision 3952)
@@ -27,5 +27,5 @@
  <<"cmvtuniv [options] z1,z2"<<endl
  <<"  -D dz"<<endl
- <<"  -U h100,om0,or0,ol0,w0"<<endl
+ <<"  -U h100,om0,or0,ol0,w0,wa"<<endl
  <<"  -F flat(0,1,2)"<<endl
  <<"  -I perc,dzinc,dzmax,glorder"<<endl
@@ -44,11 +44,11 @@
  unsigned short flat = 0;
  // -- WMAP
- double h100=0.71, om0=0.267804, or0=7.9e-05, ol0=0.73,w0=-1.;
+ double h100=0.71, om0=0.267804, or0=7.9e-05, ol0=0.73,w0=-1.,wa=0.;
  // -- ouvert matter only
- //double h100=0.71, om0=0.3, or0=0., ol0=0.,w0=-1.;
+ //double h100=0.71, om0=0.3, or0=0., ol0=0.,w0=-1,wa=0..;
  // -- plat matter only
- //double h100=0.71, om0=1., or0=0., ol0=0.,w0=-1.; flat = 1;
+ //double h100=0.71, om0=1., or0=0., ol0=0.,w0=-1.,wa=0.; flat = 1;
  // -- plat lambda only
- //double h100=0.71, om0=0., or0=0., ol0=1.,w0=-1.; flat = 2;
+ //double h100=0.71, om0=0., or0=0., ol0=1.,w0=-1.,wa=0.; flat = 2;
 
  // -- parametre d'integration
@@ -70,5 +70,5 @@
     break;
   case 'U' :
-    sscanf(optarg,"%lf,%lf,%lf,%lf,%lf",&h100,&om0,&or0,&ol0,&w0);
+    sscanf(optarg,"%lf,%lf,%lf,%lf,%lf,%lf",&h100,&om0,&or0,&ol0,&w0,&wa);
     break;
   case 'F' :
@@ -94,10 +94,10 @@
  cout<<"z1="<<z1<<"  z2="<<z2<<"  dz="<<dz<<endl;
  cout<<"perc="<<perc<<" dzinc="<<dzinc<<" dzmax="<<dzmax<<" glorder="<<glorder<<endl;
- cout<<"h100="<<h100<<" om0="<<om0<<" or0="<<or0<<" ol0="<<ol0<<" w0="<<w0<<" flat="<<flat<<endl;
+ cout<<"h100="<<h100<<" om0="<<om0<<" or0="<<or0<<" ol0="<<ol0<<" w0="<<w0<<" wa="<<wa<<" flat="<<flat<<endl;
  cout<<"todo ="<<todo<<endl;
 
  CosmoCalc univ1(flat,true,z2);
  univ1.SetInteg(perc,dzinc,dzmax,glorder);
- univ1.SetDynParam(h100,om0,or0,ol0,w0);
+ univ1.SetDynParam(h100,om0,or0,ol0,w0,wa);
  univ1.PrtInteg();
  univ1.Print();
@@ -108,5 +108,5 @@
    CosmoCalc univ2(flat,false,z2);
    univ2.SetInteg(perc,dzinc,dzmax,glorder);
-   univ2.SetDynParam(h100,om0,or0,ol0,w0);
+   univ2.SetDynParam(h100,om0,or0,ol0,w0,wa);
    univ2.PrtInteg();
    univ2.Print();
@@ -115,5 +115,5 @@
  else if(todo==3) tstspeed(univ1,z1,z2,dz);
  else if(todo==4) tstntuple(univ1,z1,z2,dz);
- else if(todo==5)tstinterp(univ1,z1,z2,dz);
+ else if(todo==5) tstinterp(univ1,z1,z2,dz);
  else cout<<"Unknown job to be done !!!!!  todo="<<todo<<endl;
 
@@ -215,5 +215,18 @@
    nt.Fill(xnt);
  }
+
  cout<<">>>> Ecriture"<<endl;
+ nt.Info()["flat"] = univ.Flat();
+ nt.Info()["h100"] = univ.h100();
+ nt.Info()["Olambda0"] = univ.Olambda0();
+ nt.Info()["W0"] = univ.W0();
+ nt.Info()["Wa"] = univ.Wa();
+ nt.Info()["Omatter0"] = univ.Omatter0();
+ nt.Info()["Obaryon0"] = univ.Obaryon0();
+ nt.Info()["Orelat0"] = univ.Orelat0();
+ nt.Info()["Ocurv0"] = univ.Ocurv0();
+ nt.Info()["Otot0"] = univ.Otot0();
+ nt.Info()["ZMax"] = univ.ZMax();
+
  string tag = "cmvtuniv_nt.ppf";
  POutPersist pos(tag);
Index: trunk/Cosmo/SimLSS/cosmocalc.cc
===================================================================
--- trunk/Cosmo/SimLSS/cosmocalc.cc	(revision 3949)
+++ trunk/Cosmo/SimLSS/cosmocalc.cc	(revision 3952)
@@ -67,4 +67,5 @@
  _Olambda0 = univ._Olambda0;
  _W0 = univ._W0;
+ _Wa = univ._Wa;
  _Omatter0 = univ._Omatter0;
  _Obaryon0 = univ._Obaryon0;
@@ -149,5 +150,5 @@
 }
 
-void CosmoCalc::SetDynParam(double h100,double om0,double or0,double ol0,double w0)
+void CosmoCalc::SetDynParam(double h100,double om0,double or0,double ol0,double w0,double wa)
 {
   _computespl=true;
@@ -161,4 +162,5 @@
   _Olambda0 = ol0;
   _W0 = w0;
+  _Wa = wa;
   _Otot0 = _Olambda0 + _Omatter0 + _Orelat0;
   _Ocurv0 = 1. - _Otot0;
@@ -209,9 +211,9 @@
 
   double h100 = 0.71;
-  double ol0 = 0.73, w0 = -1.;
+  double ol0 = 0.73, w0 = -1., wa = 0.;
   double om0 = 0.135/(h100*h100);
   // Relat = photons (2.725 K) + neutrinos (1.9 K)
   double or0 = 2.47e-5 * (1. + 21./8.*pow(T_NU_Par/T_CMB_Par,4.)) / (h100*h100);
-  SetDynParam(h100,om0,or0,ol0,w0);
+  SetDynParam(h100,om0,or0,ol0,w0,wa);
   _Obaryon0 = 0.0224/(h100*h100);
 
@@ -224,8 +226,9 @@
   if(z<0.) z = 0.;
 
-  printf("CosmoCalc::Print(spl=%d,zmax=%g,flat=%u)  for z=%g\n",int(_usespline),ZMax(),Flat(),z);
+  printf("CosmoCalc::Print(spl=%d,zmax=%g,flat=%u)  for z=%g (a=%g)\n"
+	 ,int(_usespline),ZMax(),Flat(),z,1./(1.+z));
   printf("h100=%g H0=%g Dhub=%g  H(z)=%g  Rhoc=%g g/cm^3 =%g Msol/Mpc^3\n"
         ,h100(),H0(),Dhubble(),H(z),Rhoc(z),Rhoc(z)*GCm3toMsolMpc3_Cst);
-  printf("Olambda=%g  W0=%g\n",Olambda(z),_W0);
+  printf("Olambda=%g  W=%g   (%g+(%g)*(1-a))\n",Olambda(z),W(z),_W0,_Wa);
   printf("Omatter=%g  Obaryon=%g\n",Omatter(z),Obaryon(z));
   printf("Orelat=%g\n",Orelat(z));
@@ -240,7 +243,10 @@
 //----------------------------------------------------------
 double CosmoCalc::Olambda(double z)
-{
-  double v = _Olambda0;
-  if(_W0 != -1.) v *= pow((1.+z),3.*(1+_W0));
+// Equation d'etat de l'energie noire: P=W(z)*Rho*C^2
+//   avec W(z) = W0 + Wa*(1-a) = W0 + Wa * z/(1+z) et a=1/(1+z)
+{
+  double zp1 = 1. + z;
+  double v = _Olambda0 * pow(zp1,3.*(1.+_W0+_Wa));
+  if(_Wa!=0.) v *= exp(-3.*_Wa*z/zp1);
   return v / E2(z);
 }
@@ -248,10 +254,12 @@
 double CosmoCalc::Omatter(double z)
 {
-  return _Omatter0 * (1.+z)*(1.+z)*(1.+z) /E2(z);
+  double zp1 = 1. + z;
+  return _Omatter0 * zp1*zp1*zp1 /E2(z);
 }
 
 double CosmoCalc::Obaryon(double z)
 {
-  return _Obaryon0 * (1.+z)*(1.+z)*(1.+z) /E2(z);
+  double zp1 = 1. + z;
+  return _Obaryon0 * zp1*zp1*zp1 /E2(z);
 }
 
@@ -269,5 +277,5 @@
 double CosmoCalc::Otot(double z)
 {
-  return Olambda(z)+Omatter(z)+Orelat(z);
+  return Olambda(z) + Omatter(z) + Orelat(z);
 }
 
@@ -369,10 +377,13 @@
 double CosmoCalc::E2(double z) const
 {
-  z += 1.;
+  double zp1 = 1. + z;
+
   double oldum = _Olambda0;
-
-  if(oldum>0. && _W0!=-1.) oldum *= pow(z,3.*(1.+_W0));
-
-  return oldum + z*z*(_Ocurv0 + z*(_Omatter0+z*_Orelat0));
+  if(oldum>0.) {
+    oldum *= pow(zp1,3.*(1.+_W0+_Wa));
+    if(_Wa!=0.) oldum *= exp(-3.*_Wa*z/zp1);
+  }
+
+  return oldum + zp1*zp1*(_Ocurv0 + zp1*(_Omatter0+zp1*_Orelat0));
 }
 
Index: trunk/Cosmo/SimLSS/cosmocalc.h
===================================================================
--- trunk/Cosmo/SimLSS/cosmocalc.h	(revision 3949)
+++ trunk/Cosmo/SimLSS/cosmocalc.h	(revision 3952)
@@ -25,5 +25,5 @@
   void PrtInteg(void);
 
-  void SetDynParam(double h100,double om0,double or0,double ol0,double w0=-1.);
+  void SetDynParam(double h100,double om0,double or0,double ol0,double w0=-1.,double wa=0.);
   void SetObaryon0(double v);
   void DefaultParam(void);
@@ -34,4 +34,5 @@
   inline double Olambda0(void) {return _Olambda0;}
   inline double W0(void) {return _W0;}
+  inline double Wa(void) {return _Wa;}
   inline double Omatter0(void) {return _Omatter0;}
   inline double Obaryon0(void) {return _Obaryon0;}
@@ -43,4 +44,5 @@
   inline double H(double z) {return _H0 * E(z);}
   double Olambda(double z);
+  inline double W(double z) {return _W0 + _Wa * z/(1.+z);} // W(z) = W0 + Wa*(1-a)
   double Omatter(double z);
   double Obaryon(double z);
@@ -76,5 +78,5 @@
   unsigned short _flat;
   double _h100, _H0;  /* km/s/Mpc */
-  double _Olambda0,_W0;
+  double _Olambda0,_W0,_Wa;
   double _Omatter0,_Obaryon0;
   double _Orelat0;
