diff --git a/Modules/Adapters/OSSIMAdapters/src/otbFilterFunctionValues.cxx b/Modules/Adapters/OSSIMAdapters/src/otbFilterFunctionValues.cxx
index 51fad9e99cbb2590642cdb01b9741435b064895e..4a5965cd144b640f244284025e7ab915c1fbdc07 100644
--- a/Modules/Adapters/OSSIMAdapters/src/otbFilterFunctionValues.cxx
+++ b/Modules/Adapters/OSSIMAdapters/src/otbFilterFunctionValues.cxx
@@ -53,7 +53,7 @@ FilterFunctionValues
     total2 += m_FilterFunctionValues6S[centerIndex];
     if (total2 > total / 2) break;
     }
-  return m_MinSpectralValue + m_UserStep * centerIndex;
+  return m_MinSpectralValue + 0.0025 * centerIndex;
 }
 
 /**PrintSelf method */
diff --git a/Modules/Applications/AppClassification/app/otbMultiImageSamplingRate.cxx b/Modules/Applications/AppClassification/app/otbMultiImageSamplingRate.cxx
index 0a33c98a8652d209d57418b1dc8cba96352ed38b..d02a0cb89491f6c90405e94f534758c240476bf5 100644
--- a/Modules/Applications/AppClassification/app/otbMultiImageSamplingRate.cxx
+++ b/Modules/Applications/AppClassification/app/otbMultiImageSamplingRate.cxx
@@ -163,7 +163,7 @@ private:
     SetDocExampleParameterValue("il", "stats_1.xml stats_2.xml");
     SetDocExampleParameterValue("out", "rates.csv");
     SetDocExampleParameterValue("strategy", "smallest");
-    SetDocExampleParameterValue("mode","proportional");
+    SetDocExampleParameterValue("mim","proportional");
   }
 
   void DoUpdateParameters()
diff --git a/Modules/Core/Metadata/src/otbSpot6ImageMetadataInterface.cxx b/Modules/Core/Metadata/src/otbSpot6ImageMetadataInterface.cxx
index 0167446fc5801ad89d1bb7d5e7e6dce1512390ea..5fa789428e18be42c640c939a89b73ec5254615f 100644
--- a/Modules/Core/Metadata/src/otbSpot6ImageMetadataInterface.cxx
+++ b/Modules/Core/Metadata/src/otbSpot6ImageMetadataInterface.cxx
@@ -559,6 +559,11 @@ Spot6ImageMetadataInterface::GetSatElevation() const
   // MSD: for the moment take only topCenter value
   std::string valueString = imageKeywordlist.GetMetadataByKey("support_data.incident_angle");
   double value = atof(valueString.c_str());
+
+  // Elevation is measured from ground, incidence from zenith
+  // Elevation angle = 90° - Incidence angle
+  value = 90. - value;
+
   return value;
 }
 
@@ -617,18 +622,15 @@ Spot6ImageMetadataInterface
   if (nbBands == 1)
     {
     wavel.SetSize(1);
-    wavel.Fill(0.455); // todo
     }
-  else if (nbBands > 1 && nbBands < 5) // todo
+  else if (nbBands > 1 && nbBands < 5)
     {
     wavel.SetSize(4);
-    wavel[0] = 0.454;
-    wavel[1] = 0.527;
-    wavel[2] = 0.624;
-    wavel[3] = 0.756;
     }
   else itkExceptionMacro(<< "Invalid number of bands...");
 
+  wavel.Fill(0.4);
+
   return wavel;
 }
 
@@ -655,21 +657,18 @@ Spot6ImageMetadataInterface
   int nbBands = this->GetNumberOfBands();
 
   // Panchromatic case
-  if (nbBands == 1) // todo
+  if (nbBands == 1)
     {
     wavel.SetSize(1);
-    wavel.Fill(0.744);
     }
-  else if (nbBands > 1 && nbBands < 5) // todo
+  else if (nbBands > 1 && nbBands < 5)
     {
     wavel.SetSize(4);
-    wavel[0] = 0.519;
-    wavel[1] = 0.587;
-    wavel[2] = 0.694;
-    wavel[3] = 0.880;
     }
   else itkExceptionMacro(<< "Invalid number of bands...");
 
+  wavel.Fill(1.0);
+
   return wavel;
 }
 
diff --git a/Modules/IO/IOGDAL/include/otbGDALOverviewsBuilder.h b/Modules/IO/IOGDAL/include/otbGDALOverviewsBuilder.h
index 9aa172a6d73471282a8f033c6633fe18ec22dba1..5b1da9b5f7856e7814d884a5bc83ad83d96584c4 100644
--- a/Modules/IO/IOGDAL/include/otbGDALOverviewsBuilder.h
+++ b/Modules/IO/IOGDAL/include/otbGDALOverviewsBuilder.h
@@ -103,7 +103,10 @@ public:
    * factor^n. 
    */
   unsigned int
-  CountResolutions( unsigned int factor, unsigned int size =1 ) const;
+  CountResolutions( unsigned int factor, unsigned int size ) const;
+
+  unsigned int
+  CountResolutions( unsigned int size ) const;
 
   unsigned int
   CountResolutions() const;
diff --git a/Modules/IO/IOGDAL/src/otbGDALOverviewsBuilder.cxx b/Modules/IO/IOGDAL/src/otbGDALOverviewsBuilder.cxx
index 40393537b984fa30665b237d5925ec44c94947cc..ecfdfcbeb1690a06cc0a0a513a53a83c2b7923bd 100644
--- a/Modules/IO/IOGDAL/src/otbGDALOverviewsBuilder.cxx
+++ b/Modules/IO/IOGDAL/src/otbGDALOverviewsBuilder.cxx
@@ -156,12 +156,20 @@ GDALOverviewsBuilder
   return count;
 }
 
+/***************************************************************************/
+unsigned int
+GDALOverviewsBuilder
+::CountResolutions( unsigned int minSize ) const
+{
+  return CountResolutions( m_ResolutionFactor, minSize );
+}
+
 /***************************************************************************/
 unsigned int
 GDALOverviewsBuilder
 ::CountResolutions() const
 {
-  return CountResolutions( m_ResolutionFactor );
+  return CountResolutions( 1 );
 }
 
 /***************************************************************************/
diff --git a/Modules/ThirdParty/6S/src/6SV1.0B/INTERP.c b/Modules/ThirdParty/6S/src/6SV1.0B/INTERP.c
index 30a93427fd75c4b9be1563ba26978905ca4b5ab2..df2bb5442a5e313fefabfc4437b9529a419e6818 100644
--- a/Modules/ThirdParty/6S/src/6SV1.0B/INTERP.c
+++ b/Modules/ThirdParty/6S/src/6SV1.0B/INTERP.c
@@ -65,6 +65,7 @@ Extern struct {
 	    arinf, drinf, dtinf, uainf, atinf, dtotc, wlinf, dasup, urinf, 
 	    utinf, drsup, dtsup, utotc, uasup, arsup, atsup, aasup, ursup, 
 	    utsup, ruaer0, alphaa, alphac, alphar, depolar1, depolar2;
+    doublereal rwl, rwl_1;
 
 /*<       include "paramdef.inc" >*/
 /*<       real test1,test2,test3 >*/
@@ -210,6 +211,11 @@ Extern struct {
     coef = log(sixs_disc__1.wldis[lsup - 1] / sixs_disc__1.wldis[linf - 1]);
 /*<       wlinf=wldis(linf) >*/
     wlinf = sixs_disc__1.wldis[linf - 1];
+
+    // coefficients for logarithmic interpolation
+    rwl = log( *wl / sixs_disc__1.wldis[linf - 1]) / coef;
+    rwl_1 = 1. - rwl;
+
 /* Here we spectrally interpolate phase functions and Stokes' */
 /* parameters I, Q and U (all divided by cos(teta_sun)), both */
 /* for Rayleigh, Aerosol, and a mixture Rayleigh+aerosol */
@@ -230,12 +236,9 @@ Extern struct {
 	goto L2240;
     }
 /*<           alphaa=alog(phase(lsup)/phase(linf))/coef >*/
-    alphaa = log(sixs_aer__1.phase[lsup - 1] / sixs_aer__1.phase[linf - 1]) / 
-	    coef;
 /*<           betaa=phase(linf)/(wlinf**(alphaa)) >*/
-    betaa = sixs_aer__1.phase[linf - 1] / pow_dd(&wlinf, &alphaa);
 /*<           phaa=betaa*(wl**alphaa) >*/
-    *phaa = betaa * pow_dd(wl, &alphaa);
+    *phaa = pow_dd(sixs_aer__1.phase + linf - 1, &rwl_1) * pow_dd(sixs_aer__1.phase + lsup - 1, &rwl);
 /*<  2240     continue >*/
 L2240:
 /*<           phar=depolar1*.75*(1.+xmud*xmud)+depolar2 >*/
@@ -249,23 +252,16 @@ L2240:
 /*     s       *(wl-wldis(linf))/(wldis(lsup)-wldis(linf)) */
 /*          else */
 /*<              alphar=alog(roatm(1,lsup)/roatm(1,linf))/ coef >*/
-    alphar = log(sixs_disc__1.roatm[lsup * 3 - 3] / sixs_disc__1.roatm[linf * 
-	    3 - 3]) / coef;
 /*<              betar=roatm(1,linf)/(wlinf**(alphar)) >*/
-    betar = sixs_disc__1.roatm[linf * 3 - 3] / pow_dd(&wlinf, &alphar);
 /*<  	    rorayl=betar*(wl**alphar) >*/
-    *rorayl = betar * pow_dd(wl, &alphar);
+    *rorayl = pow_dd(sixs_disc__1.roatm + linf * 3 - 3, &rwl_1) * pow_dd(sixs_disc__1.roatm + lsup * 3 - 3, &rwl);
 /*< 	    do ifi=1,nfi >*/
     i__1 = *nfi;
     for (ifi = 1; ifi <= i__1; ++ifi) {
 /*< 	    alphar=alog(roatm_fi(1,lsup,ifi)/roatm_fi(1,linf,ifi))/ coef >*/
-	alphar = log(roatm_fi__[(lsup + ifi * 20) * 3 + 1] / roatm_fi__[(linf 
-		+ ifi * 20) * 3 + 1]) / coef;
 /*<             betar=roatm_fi(1,linf,ifi)/(wlinf**(alphar)) >*/
-	betar = roatm_fi__[(linf + ifi * 20) * 3 + 1] / pow_dd(&wlinf, &
-		alphar);
 /*< 	    rorayl_fi(ifi)=betar*(wl**alphar) >*/
-	rorayl_fi__[ifi] = betar * pow_dd(wl, &alphar);
+      rorayl_fi__[ifi] = pow_dd(roatm_fi__ + (linf + ifi * 20) * 3 + 1, &rwl_1) * pow_dd(roatm_fi__ + (lsup + ifi * 20) * 3 + 1, &rwl);
 /*<             enddo >*/
     }
 /*          endif */
@@ -282,23 +278,16 @@ L2240:
 /*            enddo */
 /*          else */
 /*<             alphac=alog(roatm(2,lsup)/roatm(2,linf))/coef >*/
-    alphac = log(sixs_disc__1.roatm[lsup * 3 - 2] / sixs_disc__1.roatm[linf * 
-	    3 - 2]) / coef;
 /*<             betac=roatm(2,linf)/(wlinf**(alphac)) >*/
-    betac = sixs_disc__1.roatm[linf * 3 - 2] / pow_dd(&wlinf, &alphac);
 /*< 	    romix=betac*(wl**alphac) >*/
-    *romix = betac * pow_dd(wl, &alphac);
+    *romix = pow_dd(sixs_disc__1.roatm + linf * 3 - 2, &rwl_1) * pow_dd(sixs_disc__1.roatm + lsup * 3 - 2, &rwl);
 /*<      	    do ifi=1,nfi >*/
     i__1 = *nfi;
     for (ifi = 1; ifi <= i__1; ++ifi) {
 /*<             alphac=alog(roatm_fi(2,lsup,ifi)/roatm_fi(2,linf,ifi))/coef >*/
-	alphac = log(roatm_fi__[(lsup + ifi * 20) * 3 + 2] / roatm_fi__[(linf 
-		+ ifi * 20) * 3 + 2]) / coef;
 /*<             betac=roatm_fi(2,linf,ifi)/(wlinf**(alphac)) >*/
-	betac = roatm_fi__[(linf + ifi * 20) * 3 + 2] / pow_dd(&wlinf, &
-		alphac);
 /*< 	    romix_fi(ifi)=betac*(wl**alphac) >*/
-	romix_fi__[ifi] = betac * pow_dd(wl, &alphac);
+      romix_fi__[ifi] = pow_dd(roatm_fi__ + (linf + ifi * 20) * 3 + 2, &rwl_1) * pow_dd(roatm_fi__ + (lsup + ifi * 20) * 3 + 2, &rwl);
 /*< 	    enddo >*/
     }
 /*          endif */
@@ -311,12 +300,9 @@ L2240:
 /*     s       *(wl-wldis(linf))/(wldis(lsup)-wldis(linf)) */
 /*          else */
 /*<             alphaa=alog(roatm(3,lsup)/roatm(3,linf))/coef >*/
-    alphaa = log(sixs_disc__1.roatm[lsup * 3 - 1] / sixs_disc__1.roatm[linf * 
-	    3 - 1]) / coef;
 /*<             betaa=roatm(3,linf)/(wlinf**(alphaa)) >*/
-    betaa = sixs_disc__1.roatm[linf * 3 - 1] / pow_dd(&wlinf, &alphaa);
 /*<             roaero=betaa*(wl**alphaa) >*/
-    *roaero = betaa * pow_dd(wl, &alphaa);
+    *roaero = pow_dd(sixs_disc__1.roatm + linf * 3 - 1, &rwl_1) * pow_dd(sixs_disc__1.roatm + lsup * 3 - 1 , &rwl);
 /*          endif */
 /* Look up table update */
 /*<         coefl=(wl-wldis(linf))/(wldis(lsup)-wldis(linf)) >*/
@@ -331,13 +317,9 @@ L2240:
 /* 	if ((roluts(lsup,i,j).gt.0.001).and.(roluts(linf,i,j).gt.0.001
 )) then */
 /*<            alphac=alog(roluts(lsup,i,j)/roluts(linf,i,j))/coef >*/
-	    alphac = log(roluts[lsup + (i__ + j * 25) * 20] / roluts[linf + (
-		    i__ + j * 25) * 20]) / coef;
 /*<            betac=roluts(linf,i,j)/(wlinf**(alphac)) >*/
-	    betac = roluts[linf + (i__ + j * 25) * 20] / pow_dd(&wlinf, &
-		    alphac);
 /*< 	   rolut(i,j)=betac*(wl**alphac) >*/
-	    rolut[i__ + j * 25] = betac * pow_dd(wl, &alphac);
+      rolut[i__ + j * 25] = pow_dd(roluts + linf + (i__ + j * 25) * 20, &rwl_1) * pow_dd(roluts + lsup + (i__ + j * 25) * 20, &rwl);
 /* 	   else */
 /* 	   rolut(i,j)=roluts(linf,i,j) */
 /*     &      +(roluts(lsup,i,j)-roluts(linf,i,j))*coefl */
@@ -346,13 +328,9 @@ L2240:
 	    if (rolutsq[lsup + (i__ + j * 25) * 20] > .001 && rolutsq[linf + (
 		    i__ + j * 25) * 20] > .001) {
 /*<            alphac=alog(rolutsq(lsup,i,j)/rolutsq(linf,i,j))/coef >*/
-		alphac = log(rolutsq[lsup + (i__ + j * 25) * 20] / rolutsq[
-			linf + (i__ + j * 25) * 20]) / coef;
 /*<            betac=rolutsq(linf,i,j)/(wlinf**(alphac)) >*/
-		betac = rolutsq[linf + (i__ + j * 25) * 20] / pow_dd(&wlinf, &
-			alphac);
 /*< 	   rolutq(i,j)=betac*(wl**alphac) >*/
-		rolutq[i__ + j * 25] = betac * pow_dd(wl, &alphac);
+        rolutq[i__ + j * 25] = pow_dd(rolutsq + linf + (i__ + j * 25) * 20, &rwl_1) * pow_dd(rolutsq + lsup + (i__ + j * 25) * 20 , &rwl);
 /*< 	   else >*/
 	    } else {
 /*< 	  >*/
@@ -365,13 +343,9 @@ L2240:
 	    if (rolutsu[lsup + (i__ + j * 25) * 20] > .001 && rolutsu[linf + (
 		    i__ + j * 25) * 20] > .001) {
 /*<            alphac=alog(rolutsu(lsup,i,j)/rolutsu(linf,i,j))/coef >*/
-		alphac = log(rolutsu[lsup + (i__ + j * 25) * 20] / rolutsu[
-			linf + (i__ + j * 25) * 20]) / coef;
 /*<            betac=rolutsu(linf,i,j)/(wlinf**(alphac)) >*/
-		betac = rolutsu[linf + (i__ + j * 25) * 20] / pow_dd(&wlinf, &
-			alphac);
 /*< 	   rolutu(i,j)=betac*(wl**alphac) >*/
-		rolutu[i__ + j * 25] = betac * pow_dd(wl, &alphac);
+    rolutu[i__ + j * 25] = pow_dd(rolutsu + linf + (i__ + j * 25) * 20, &rwl_1) * pow_dd(rolutsu + lsup + (i__ + j * 25) * 20, &rwl);
 /*< 	   else >*/
 	    } else {
 /*< 	  >*/
@@ -396,12 +370,9 @@ L2234:
     if (sixs_aer__1.qhase[lsup - 1] > .001 && sixs_aer__1.qhase[linf - 1] > 
 	    .001) {
 /*<         alphaa=alog(qhase(lsup)/qhase(linf))/coef >*/
-	alphaa = log(sixs_aer__1.qhase[lsup - 1] / sixs_aer__1.qhase[linf - 1]
-		) / coef;
 /*<         betaa=qhase(linf)/(wlinf**(alphaa)) >*/
-	betaa = sixs_aer__1.qhase[linf - 1] / pow_dd(&wlinf, &alphaa);
 /*<         qhaa=betaa*(wl**alphaa) >*/
-	*qhaa = betaa * pow_dd(wl, &alphaa);
+	*qhaa = pow_dd(sixs_aer__1.qhase + linf - 1, &rwl_1) * pow_dd(sixs_aer__1.qhase + lsup - 1, &rwl);
 /*< 	else >*/
     } else {
 /*< 	qhaa=qhase(linf)+(qhase(lsup)-qhase(linf))*coefl >*/
@@ -434,12 +405,9 @@ L3240:
 /*<         else >*/
     } else {
 /*<           alphar=alog(rqatm(1,lsup)/rqatm(1,linf))/ coef >*/
-	alphar = log(sixs_disc__1.rqatm[lsup * 3 - 3] / sixs_disc__1.rqatm[
-		linf * 3 - 3]) / coef;
 /*<           betar=rqatm(1,linf)/(wlinf**(alphar)) >*/
-	betar = sixs_disc__1.rqatm[linf * 3 - 3] / pow_dd(&wlinf, &alphar);
 /*< 	  rqrayl=betar*(wl**alphar) >*/
-	*rqrayl = betar * pow_dd(wl, &alphar);
+	*rqrayl = pow_dd(sixs_disc__1.rqatm + linf * 3 - 3, &rwl_1) * pow_dd(sixs_disc__1.rqatm + lsup * 3 - 3, &rwl);
 /*< 	endif >*/
     }
 /*       write(6,*)'Q ',qhar,rqrayl,betar,alphar,rqatm(1,lsup), */
@@ -461,12 +429,9 @@ L3240:
 /*< 	else >*/
     } else {
 /*<           alphac=alog(rqatm(2,lsup)/rqatm(2,linf))/coef >*/
-	alphac = log(sixs_disc__1.rqatm[lsup * 3 - 2] / sixs_disc__1.rqatm[
-		linf * 3 - 2]) / coef;
 /*<           betac=rqatm(2,linf)/(wlinf**(alphac)) >*/
-	betac = sixs_disc__1.rqatm[linf * 3 - 2] / pow_dd(&wlinf, &alphac);
 /*<           rqmix=betac*(wl**alphac) >*/
-	*rqmix = betac * pow_dd(wl, &alphac);
+	*rqmix = pow_dd(sixs_disc__1.rqatm + linf * 3 - 2, &rwl_1) * pow_dd(sixs_disc__1.rqatm + lsup * 3 - 2, &rwl);
 /*<         endif >*/
     }
 /*<         if(iaer.eq.0) goto 3234 >*/
@@ -491,12 +456,9 @@ L3240:
 /*< 	else >*/
     } else {
 /*<           alphaa=alog(rqatm(3,lsup)/rqatm(3,linf))/coef >*/
-	alphaa = log(sixs_disc__1.rqatm[lsup * 3 - 1] / sixs_disc__1.rqatm[
-		linf * 3 - 1]) / coef;
 /*<           betaa=rqatm(3,linf)/(wlinf**(alphaa)) >*/
-	betaa = sixs_disc__1.rqatm[linf * 3 - 1] / pow_dd(&wlinf, &alphaa);
 /*<           rqaero=betaa*(wl**alphaa) >*/
-	*rqaero = betaa * pow_dd(wl, &alphaa);
+	*rqaero = pow_dd(sixs_disc__1.rqatm + linf * 3 - 1, &rwl_1) * pow_dd(sixs_disc__1.rqatm + lsup * 3 - 1, &rwl);
 /*< 	endif >*/
     }
 /*        write(6,*) "rqaero ",rqaero */
@@ -511,12 +473,9 @@ L3234:
     if (sixs_aer__1.uhase[lsup - 1] > .001 && sixs_aer__1.uhase[linf - 1] > 
 	    .001) {
 /*<         alphaa=alog(uhase(lsup)/uhase(linf))/coef >*/
-	alphaa = log(sixs_aer__1.uhase[lsup - 1] / sixs_aer__1.uhase[linf - 1]
-		) / coef;
 /*<         betaa=uhase(linf)/(wlinf**(alphaa)) >*/
-	betaa = sixs_aer__1.uhase[linf - 1] / pow_dd(&wlinf, &alphaa);
 /*<         uhaa=betaa*(wl**alphaa) >*/
-	*uhaa = betaa * pow_dd(wl, &alphaa);
+	*uhaa = pow_dd(sixs_aer__1.uhase + linf - 1, &rwl_1) * pow_dd(sixs_aer__1.uhase + lsup - 1, &rwl);
 /*< 	else >*/
     } else {
 /*< 	uhaa=uhase(linf)+(uhase(lsup)-uhase(linf))*coefl >*/
@@ -549,12 +508,9 @@ L4242:
 /*<         else >*/
     } else {
 /*<           alphar=alog(ruatm(1,lsup)/ruatm(1,linf))/ coef >*/
-	alphar = log(sixs_disc__1.ruatm[lsup * 3 - 3] / sixs_disc__1.ruatm[
-		linf * 3 - 3]) / coef;
 /*<           betar=ruatm(1,linf)/(wlinf**(alphar)) >*/
-	betar = sixs_disc__1.ruatm[linf * 3 - 3] / pow_dd(&wlinf, &alphar);
 /*< 	  rurayl=betar*(wl**alphar) >*/
-	*rurayl = betar * pow_dd(wl, &alphar);
+	*rurayl = pow_dd(sixs_disc__1.ruatm + linf * 3 - 3, &rwl_1) * pow_dd(sixs_disc__1.ruatm + lsup * 3 - 3, &rwl);
 /*< 	endif >*/
     }
 /*       write(6,*)'U ',uhar,rurayl,betar,alphar,ruatm(1,lsup), */
@@ -576,12 +532,9 @@ L4242:
 /*< 	else >*/
     } else {
 /*<           alphac=alog(ruatm(2,lsup)/ruatm(2,linf))/coef >*/
-	alphac = log(sixs_disc__1.ruatm[lsup * 3 - 2] / sixs_disc__1.ruatm[
-		linf * 3 - 2]) / coef;
 /*<           betac=ruatm(2,linf)/(wlinf**(alphac)) >*/
-	betac = sixs_disc__1.ruatm[linf * 3 - 2] / pow_dd(&wlinf, &alphac);
 /*<           rumix=betac*(wl**alphac) >*/
-	*rumix = betac * pow_dd(wl, &alphac);
+	*rumix = pow_dd(sixs_disc__1.ruatm + linf * 3 - 2, &rwl_1) * pow_dd(sixs_disc__1.ruatm + lsup * 3 - 2, &rwl);
 /*<         endif >*/
     }
 /*<         if(iaer.eq.0) goto 4234 >*/
@@ -605,12 +558,9 @@ L4242:
 /*< 	else >*/
     } else {
 /*<           alphaa=alog(ruatm(3,lsup)/ruatm(3,linf))/coef >*/
-	alphaa = log(sixs_disc__1.ruatm[lsup * 3 - 1] / sixs_disc__1.ruatm[
-		linf * 3 - 1]) / coef;
 /*<           betaa=ruatm(3,linf)/(wlinf**(alphaa)) >*/
-	betaa = sixs_disc__1.ruatm[linf * 3 - 1] / pow_dd(&wlinf, &alphaa);
 /*<           ruaero=betaa*(wl**alphaa) >*/
-	*ruaero = betaa * pow_dd(wl, &alphaa);
+	*ruaero = pow_dd(sixs_disc__1.ruatm + linf * 3 - 1, &rwl_1) * pow_dd(sixs_disc__1.ruatm + lsup * 3 - 1, &rwl);
 /*<         endif >*/
     }
 /*<  4234  	continue >*/
@@ -618,21 +568,15 @@ L4234:
 
 
 /*<       alphar=alog(trayl(lsup)/trayl(linf))/coef >*/
-    alphar = log(sixs_disc__1.trayl[lsup - 1] / sixs_disc__1.trayl[linf - 1]) 
-	    / coef;
 /*<       betar=trayl(linf)/(wlinf**(alphar)) >*/
-    betar = sixs_disc__1.trayl[linf - 1] / pow_dd(&wlinf, &alphar);
 /*<       tray=betar*(wl**alphar) >*/
-    *tray = betar * pow_dd(wl, &alphar);
+    *tray = pow_dd(sixs_disc__1.trayl + linf - 1, &rwl_1) * pow_dd(sixs_disc__1.trayl + lsup - 1, &rwl);
 /*<       if (idatmp.ne.0.) then >*/
     if ((doublereal) (*idatmp) != 0.) {
 /*<         alphar=alog(traypl(lsup)/traypl(linf))/coef >*/
-	alphar = log(sixs_disc__1.traypl[lsup - 1] / sixs_disc__1.traypl[linf 
-		- 1]) / coef;
 /*<         betar=traypl(linf)/(wlinf**(alphar)) >*/
-	betar = sixs_disc__1.traypl[linf - 1] / pow_dd(&wlinf, &alphar);
 /*<         trayp=betar*(wl**alphar) >*/
-	*trayp = betar * pow_dd(wl, &alphar);
+  *trayp = pow_dd(sixs_disc__1.traypl + linf - 1, &rwl_1) * pow_dd(sixs_disc__1.traypl + lsup - 1, &rwl);
 /*<       else >*/
     } else {
 /*<         trayp=0. >*/
@@ -645,22 +589,17 @@ L4234:
 	goto L1235;
     }
 /*<       alphaa=alog(ext(lsup)*ome(lsup)/(ext(linf)*ome(linf)))/coef >*/
-    alphaa = log(sixs_aer__1.ext[lsup - 1] * sixs_aer__1.ome[lsup - 1] / (
-	    sixs_aer__1.ext[linf - 1] * sixs_aer__1.ome[linf - 1])) / coef;
+    alphaa = sixs_aer__1.ext[linf - 1] * sixs_aer__1.ome[linf - 1];
 /*<       betaa=ext(linf)*ome(linf)/(wlinf**(alphaa)) >*/
-    betaa = sixs_aer__1.ext[linf - 1] * sixs_aer__1.ome[linf - 1] / pow_dd(&
-	    wlinf, &alphaa);
+    betaa = sixs_aer__1.ext[lsup - 1] * sixs_aer__1.ome[lsup - 1];
 /*<       tsca=taer55*betaa*(wl**alphaa)/ext(8) >*/
-    *tsca = *taer55 * betaa * pow_dd(wl, &alphaa) / sixs_aer__1.ext[7];
+    *tsca = *taer55 * pow_dd(&alphaa, &rwl_1) * pow_dd(&betaa, &rwl) / sixs_aer__1.ext[7];
 /*<       alphaa=alog(ext(lsup)/ext(linf))/coef >*/
-    alphaa = log(sixs_aer__1.ext[lsup - 1] / sixs_aer__1.ext[linf - 1]) / 
-	    coef;
 /*<       betaa=ext(linf)/(wlinf**(alphaa)) >*/
-    betaa = sixs_aer__1.ext[linf - 1] / pow_dd(&wlinf, &alphaa);
 /*<       taerp=taer55p*betaa*(wl**alphaa)/ext(8) >*/
-    *taerp = *taer55p * betaa * pow_dd(wl, &alphaa) / sixs_aer__1.ext[7];
+    *taerp = *taer55p * pow_dd(sixs_aer__1.ext + linf - 1, &rwl_1) * pow_dd(sixs_aer__1.ext + lsup - 1, &rwl) / sixs_aer__1.ext[7];
 /*<       taer=taer55*betaa*(wl**alphaa)/ext(8) >*/
-    *taer = *taer55 * betaa * pow_dd(wl, &alphaa) / sixs_aer__1.ext[7];
+    *taer = *taer55 * pow_dd(sixs_aer__1.ext + linf - 1, &rwl_1) * pow_dd(sixs_aer__1.ext + lsup - 1, &rwl) / sixs_aer__1.ext[7];
 
 /*<  1235 drinf=dtdif(1,linf)+dtdir(1,linf) >*/
 L1235:
@@ -670,11 +609,9 @@ L1235:
     drsup = sixs_disc__1.dtdif[lsup * 3 - 3] + sixs_disc__1.dtdir[lsup * 3 - 
 	    3];
 /*<       alphar=alog(drsup/drinf)/coef >*/
-    alphar = log(drsup / drinf) / coef;
 /*<       betar=drinf/(wlinf**(alphar)) >*/
-    betar = drinf / pow_dd(&wlinf, &alphar);
 /*<       dtotr=betar*(wl**alphar) >*/
-    *dtotr = betar * pow_dd(wl, &alphar);
+    *dtotr = pow_dd(&drinf , &rwl_1) * pow_dd(&drsup, &rwl);
 /*<       dtinf=dtdif(2,linf)+dtdir(2,linf) >*/
     dtinf = sixs_disc__1.dtdif[linf * 3 - 2] + sixs_disc__1.dtdir[linf * 3 - 
 	    2];
@@ -682,11 +619,11 @@ L1235:
     dtsup = sixs_disc__1.dtdif[lsup * 3 - 2] + sixs_disc__1.dtdir[lsup * 3 - 
 	    2];
 /*<       alphac=alog((dtsup*drinf)/(dtinf*drsup))/coef >*/
-    alphac = log(dtsup * drinf / (dtinf * drsup)) / coef;
+    alphac = dtinf / drinf;
 /*<       betac=(dtinf/drinf)/(wlinf**(alphac)) >*/
-    betac = dtinf / drinf / pow_dd(&wlinf, &alphac);
+    betac = dtsup / drsup;
 /*<       dtotc=betac*(wl**alphac) >*/
-    dtotc = betac * pow_dd(wl, &alphac);
+    dtotc = pow_dd(&alphac , &rwl_1) * pow_dd(&betac , &rwl);
 /*<       dainf=dtdif(3,linf)+dtdir(3,linf) >*/
     dainf = sixs_disc__1.dtdif[linf * 3 - 1] + sixs_disc__1.dtdir[linf * 3 - 
 	    1];
@@ -698,11 +635,9 @@ L1235:
 	goto L1236;
     }
 /*<       alphaa=alog(dasup/dainf)/coef >*/
-    alphaa = log(dasup / dainf) / coef;
 /*<       betaa=dainf/(wlinf**(alphaa)) >*/
-    betaa = dainf / pow_dd(&wlinf, &alphaa);
 /*<       dtota=betaa*(wl**alphaa) >*/
-    *dtota = betaa * pow_dd(wl, &alphaa);
+    *dtota = pow_dd(&dainf, &rwl_1) * pow_dd(&dasup, &rwl);
 /*<  1236 dtott=dtotc*dtotr >*/
 L1236:
     *dtott = dtotc * *dtotr;
@@ -713,11 +648,9 @@ L1236:
     ursup = sixs_disc__1.utdif[lsup * 3 - 3] + sixs_disc__1.utdir[lsup * 3 - 
 	    3];
 /*<       alphar=alog(ursup/urinf)/ coef >*/
-    alphar = log(ursup / urinf) / coef;
 /*<       betar=urinf/(wlinf**(alphar)) >*/
-    betar = urinf / pow_dd(&wlinf, &alphar);
 /*<       utotr=betar*(wl**alphar) >*/
-    *utotr = betar * pow_dd(wl, &alphar);
+    *utotr = pow_dd(&urinf, &rwl_1) * pow_dd(&ursup, &rwl);
 /*<       utinf=utdif(2,linf)+utdir(2,linf) >*/
     utinf = sixs_disc__1.utdif[linf * 3 - 2] + sixs_disc__1.utdir[linf * 3 - 
 	    2];
@@ -725,11 +658,11 @@ L1236:
     utsup = sixs_disc__1.utdif[lsup * 3 - 2] + sixs_disc__1.utdir[lsup * 3 - 
 	    2];
 /*<       alphac=alog((utsup*urinf)/(utinf*ursup))/ coef >*/
-    alphac = log(utsup * urinf / (utinf * ursup)) / coef;
+    alphac = utinf / urinf;
 /*<       betac=(utinf/urinf)/(wlinf**(alphac)) >*/
-    betac = utinf / urinf / pow_dd(&wlinf, &alphac);
+    betac = utsup / ursup;
 /*<       utotc=betac*(wl**alphac) >*/
-    utotc = betac * pow_dd(wl, &alphac);
+    utotc = pow_dd(&alphac, &rwl_1) * pow_dd(&betac, &rwl);
 /*<       uainf=utdif(3,linf)+utdir(3,linf) >*/
     uainf = sixs_disc__1.utdif[linf * 3 - 1] + sixs_disc__1.utdir[linf * 3 - 
 	    1];
@@ -741,11 +674,9 @@ L1236:
 	goto L1237;
     }
 /*<       alphaa=alog(uasup/uainf)/ coef >*/
-    alphaa = log(uasup / uainf) / coef;
 /*<       betaa=uainf/(wlinf**(alphaa)) >*/
-    betaa = uainf / pow_dd(&wlinf, &alphaa);
 /*<       utota=betaa*(wl**alphaa) >*/
-    *utota = betaa * pow_dd(wl, &alphaa);
+    *utota = pow_dd(&uainf, &rwl_1) * pow_dd(&uasup, &rwl);
 /*<  1237 utott=utotc*utotr >*/
 L1237:
     *utott = utotc * *utotr;
@@ -754,21 +685,17 @@ L1237:
 /*<       arsup=sphal(1,lsup) >*/
     arsup = sixs_disc__1.sphal[lsup * 3 - 3];
 /*<       alphar=alog(arsup/arinf)/ coef >*/
-    alphar = log(arsup / arinf) / coef;
 /*<       betar=arinf/(wlinf**(alphar)) >*/
-    betar = arinf / pow_dd(&wlinf, &alphar);
 /*<       asray=betar*(wl**alphar) >*/
-    *asray = betar * pow_dd(wl, &alphar);
+    *asray = pow_dd(&arinf, &rwl_1) * pow_dd(&arsup, &rwl);
 /*<       atinf=sphal(2,linf) >*/
     atinf = sixs_disc__1.sphal[linf * 3 - 2];
 /*<       atsup=sphal(2,lsup) >*/
     atsup = sixs_disc__1.sphal[lsup * 3 - 2];
 /*<       alphac=alog(atsup/atinf)/coef >*/
-    alphac = log(atsup / atinf) / coef;
 /*<       betac=atinf/(wlinf**(alphac)) >*/
-    betac = atinf / pow_dd(&wlinf, &alphac);
 /*<       astot=betac*(wl**alphac) >*/
-    *astot = betac * pow_dd(wl, &alphac);
+    *astot = pow_dd(&atinf, &rwl_1) * pow_dd(&atsup, &rwl);
 /*<       aainf=sphal(3,linf) >*/
     aainf = sixs_disc__1.sphal[linf * 3 - 1];
 /*<       aasup=sphal(3,lsup) >*/
@@ -778,11 +705,9 @@ L1237:
 	goto L1239;
     }
 /*<       alphaa=alog(aasup/aainf)/coef >*/
-    alphaa = log(aasup / aainf) / coef;
 /*<       betaa=aainf/(wlinf**(alphaa)) >*/
-    betaa = aainf / pow_dd(&wlinf, &alphaa);
 /*<       asaer=betaa*(wl**alphaa) >*/
-    *asaer = betaa * pow_dd(wl, &alphaa);
+    *asaer = pow_dd(&aainf, &rwl_1) * pow_dd(&aasup, &rwl);
 /*<  1239 return >*/
 L1239:
     return 0;
diff --git a/Modules/ThirdParty/6S/src/6SV1.0B/INTERP.patch b/Modules/ThirdParty/6S/src/6SV1.0B/INTERP.patch
new file mode 100644
index 0000000000000000000000000000000000000000..b63bb1147c447ce81800f6e5682774bb33d44a13
--- /dev/null
+++ b/Modules/ThirdParty/6S/src/6SV1.0B/INTERP.patch
@@ -0,0 +1,432 @@
+diff --git a/Modules/ThirdParty/6S/src/6SV1.0B/INTERP.c b/Modules/ThirdParty/6S/src/6SV1.0B/INTERP.c
+index 30a9342..df2bb54 100644
+--- a/Modules/ThirdParty/6S/src/6SV1.0B/INTERP.c
++++ b/Modules/ThirdParty/6S/src/6SV1.0B/INTERP.c
+@@ -65,6 +65,7 @@ Extern struct {
+ 	    arinf, drinf, dtinf, uainf, atinf, dtotc, wlinf, dasup, urinf, 
+ 	    utinf, drsup, dtsup, utotc, uasup, arsup, atsup, aasup, ursup, 
+ 	    utsup, ruaer0, alphaa, alphac, alphar, depolar1, depolar2;
++    doublereal rwl, rwl_1;
+ 
+ /*<       include "paramdef.inc" >*/
+ /*<       real test1,test2,test3 >*/
+@@ -210,6 +211,11 @@ Extern struct {
+     coef = log(sixs_disc__1.wldis[lsup - 1] / sixs_disc__1.wldis[linf - 1]);
+ /*<       wlinf=wldis(linf) >*/
+     wlinf = sixs_disc__1.wldis[linf - 1];
++
++    // coefficients for logarithmic interpolation
++    rwl = log( *wl / sixs_disc__1.wldis[linf - 1]) / coef;
++    rwl_1 = 1. - rwl;
++
+ /* Here we spectrally interpolate phase functions and Stokes' */
+ /* parameters I, Q and U (all divided by cos(teta_sun)), both */
+ /* for Rayleigh, Aerosol, and a mixture Rayleigh+aerosol */
+@@ -230,12 +236,9 @@ Extern struct {
+ 	goto L2240;
+     }
+ /*<           alphaa=alog(phase(lsup)/phase(linf))/coef >*/
+-    alphaa = log(sixs_aer__1.phase[lsup - 1] / sixs_aer__1.phase[linf - 1]) / 
+-	    coef;
+ /*<           betaa=phase(linf)/(wlinf**(alphaa)) >*/
+-    betaa = sixs_aer__1.phase[linf - 1] / pow_dd(&wlinf, &alphaa);
+ /*<           phaa=betaa*(wl**alphaa) >*/
+-    *phaa = betaa * pow_dd(wl, &alphaa);
++    *phaa = pow_dd(sixs_aer__1.phase + linf - 1, &rwl_1) * pow_dd(sixs_aer__1.phase + lsup - 1, &rwl);
+ /*<  2240     continue >*/
+ L2240:
+ /*<           phar=depolar1*.75*(1.+xmud*xmud)+depolar2 >*/
+@@ -249,23 +252,16 @@ L2240:
+ /*     s       *(wl-wldis(linf))/(wldis(lsup)-wldis(linf)) */
+ /*          else */
+ /*<              alphar=alog(roatm(1,lsup)/roatm(1,linf))/ coef >*/
+-    alphar = log(sixs_disc__1.roatm[lsup * 3 - 3] / sixs_disc__1.roatm[linf * 
+-	    3 - 3]) / coef;
+ /*<              betar=roatm(1,linf)/(wlinf**(alphar)) >*/
+-    betar = sixs_disc__1.roatm[linf * 3 - 3] / pow_dd(&wlinf, &alphar);
+ /*<  	    rorayl=betar*(wl**alphar) >*/
+-    *rorayl = betar * pow_dd(wl, &alphar);
++    *rorayl = pow_dd(sixs_disc__1.roatm + linf * 3 - 3, &rwl_1) * pow_dd(sixs_disc__1.roatm + lsup * 3 - 3, &rwl);
+ /*< 	    do ifi=1,nfi >*/
+     i__1 = *nfi;
+     for (ifi = 1; ifi <= i__1; ++ifi) {
+ /*< 	    alphar=alog(roatm_fi(1,lsup,ifi)/roatm_fi(1,linf,ifi))/ coef >*/
+-	alphar = log(roatm_fi__[(lsup + ifi * 20) * 3 + 1] / roatm_fi__[(linf 
+-		+ ifi * 20) * 3 + 1]) / coef;
+ /*<             betar=roatm_fi(1,linf,ifi)/(wlinf**(alphar)) >*/
+-	betar = roatm_fi__[(linf + ifi * 20) * 3 + 1] / pow_dd(&wlinf, &
+-		alphar);
+ /*< 	    rorayl_fi(ifi)=betar*(wl**alphar) >*/
+-	rorayl_fi__[ifi] = betar * pow_dd(wl, &alphar);
++      rorayl_fi__[ifi] = pow_dd(roatm_fi__ + (linf + ifi * 20) * 3 + 1, &rwl_1) * pow_dd(roatm_fi__ + (lsup + ifi * 20) * 3 + 1, &rwl);
+ /*<             enddo >*/
+     }
+ /*          endif */
+@@ -282,23 +278,16 @@ L2240:
+ /*            enddo */
+ /*          else */
+ /*<             alphac=alog(roatm(2,lsup)/roatm(2,linf))/coef >*/
+-    alphac = log(sixs_disc__1.roatm[lsup * 3 - 2] / sixs_disc__1.roatm[linf * 
+-	    3 - 2]) / coef;
+ /*<             betac=roatm(2,linf)/(wlinf**(alphac)) >*/
+-    betac = sixs_disc__1.roatm[linf * 3 - 2] / pow_dd(&wlinf, &alphac);
+ /*< 	    romix=betac*(wl**alphac) >*/
+-    *romix = betac * pow_dd(wl, &alphac);
++    *romix = pow_dd(sixs_disc__1.roatm + linf * 3 - 2, &rwl_1) * pow_dd(sixs_disc__1.roatm + lsup * 3 - 2, &rwl);
+ /*<      	    do ifi=1,nfi >*/
+     i__1 = *nfi;
+     for (ifi = 1; ifi <= i__1; ++ifi) {
+ /*<             alphac=alog(roatm_fi(2,lsup,ifi)/roatm_fi(2,linf,ifi))/coef >*/
+-	alphac = log(roatm_fi__[(lsup + ifi * 20) * 3 + 2] / roatm_fi__[(linf 
+-		+ ifi * 20) * 3 + 2]) / coef;
+ /*<             betac=roatm_fi(2,linf,ifi)/(wlinf**(alphac)) >*/
+-	betac = roatm_fi__[(linf + ifi * 20) * 3 + 2] / pow_dd(&wlinf, &
+-		alphac);
+ /*< 	    romix_fi(ifi)=betac*(wl**alphac) >*/
+-	romix_fi__[ifi] = betac * pow_dd(wl, &alphac);
++      romix_fi__[ifi] = pow_dd(roatm_fi__ + (linf + ifi * 20) * 3 + 2, &rwl_1) * pow_dd(roatm_fi__ + (lsup + ifi * 20) * 3 + 2, &rwl);
+ /*< 	    enddo >*/
+     }
+ /*          endif */
+@@ -311,12 +300,9 @@ L2240:
+ /*     s       *(wl-wldis(linf))/(wldis(lsup)-wldis(linf)) */
+ /*          else */
+ /*<             alphaa=alog(roatm(3,lsup)/roatm(3,linf))/coef >*/
+-    alphaa = log(sixs_disc__1.roatm[lsup * 3 - 1] / sixs_disc__1.roatm[linf * 
+-	    3 - 1]) / coef;
+ /*<             betaa=roatm(3,linf)/(wlinf**(alphaa)) >*/
+-    betaa = sixs_disc__1.roatm[linf * 3 - 1] / pow_dd(&wlinf, &alphaa);
+ /*<             roaero=betaa*(wl**alphaa) >*/
+-    *roaero = betaa * pow_dd(wl, &alphaa);
++    *roaero = pow_dd(sixs_disc__1.roatm + linf * 3 - 1, &rwl_1) * pow_dd(sixs_disc__1.roatm + lsup * 3 - 1 , &rwl);
+ /*          endif */
+ /* Look up table update */
+ /*<         coefl=(wl-wldis(linf))/(wldis(lsup)-wldis(linf)) >*/
+@@ -331,13 +317,9 @@ L2240:
+ /* 	if ((roluts(lsup,i,j).gt.0.001).and.(roluts(linf,i,j).gt.0.001
+ )) then */
+ /*<            alphac=alog(roluts(lsup,i,j)/roluts(linf,i,j))/coef >*/
+-	    alphac = log(roluts[lsup + (i__ + j * 25) * 20] / roluts[linf + (
+-		    i__ + j * 25) * 20]) / coef;
+ /*<            betac=roluts(linf,i,j)/(wlinf**(alphac)) >*/
+-	    betac = roluts[linf + (i__ + j * 25) * 20] / pow_dd(&wlinf, &
+-		    alphac);
+ /*< 	   rolut(i,j)=betac*(wl**alphac) >*/
+-	    rolut[i__ + j * 25] = betac * pow_dd(wl, &alphac);
++      rolut[i__ + j * 25] = pow_dd(roluts + linf + (i__ + j * 25) * 20, &rwl_1) * pow_dd(roluts + lsup + (i__ + j * 25) * 20, &rwl);
+ /* 	   else */
+ /* 	   rolut(i,j)=roluts(linf,i,j) */
+ /*     &      +(roluts(lsup,i,j)-roluts(linf,i,j))*coefl */
+@@ -346,13 +328,9 @@ L2240:
+ 	    if (rolutsq[lsup + (i__ + j * 25) * 20] > .001 && rolutsq[linf + (
+ 		    i__ + j * 25) * 20] > .001) {
+ /*<            alphac=alog(rolutsq(lsup,i,j)/rolutsq(linf,i,j))/coef >*/
+-		alphac = log(rolutsq[lsup + (i__ + j * 25) * 20] / rolutsq[
+-			linf + (i__ + j * 25) * 20]) / coef;
+ /*<            betac=rolutsq(linf,i,j)/(wlinf**(alphac)) >*/
+-		betac = rolutsq[linf + (i__ + j * 25) * 20] / pow_dd(&wlinf, &
+-			alphac);
+ /*< 	   rolutq(i,j)=betac*(wl**alphac) >*/
+-		rolutq[i__ + j * 25] = betac * pow_dd(wl, &alphac);
++        rolutq[i__ + j * 25] = pow_dd(rolutsq + linf + (i__ + j * 25) * 20, &rwl_1) * pow_dd(rolutsq + lsup + (i__ + j * 25) * 20 , &rwl);
+ /*< 	   else >*/
+ 	    } else {
+ /*< 	  >*/
+@@ -365,13 +343,9 @@ L2240:
+ 	    if (rolutsu[lsup + (i__ + j * 25) * 20] > .001 && rolutsu[linf + (
+ 		    i__ + j * 25) * 20] > .001) {
+ /*<            alphac=alog(rolutsu(lsup,i,j)/rolutsu(linf,i,j))/coef >*/
+-		alphac = log(rolutsu[lsup + (i__ + j * 25) * 20] / rolutsu[
+-			linf + (i__ + j * 25) * 20]) / coef;
+ /*<            betac=rolutsu(linf,i,j)/(wlinf**(alphac)) >*/
+-		betac = rolutsu[linf + (i__ + j * 25) * 20] / pow_dd(&wlinf, &
+-			alphac);
+ /*< 	   rolutu(i,j)=betac*(wl**alphac) >*/
+-		rolutu[i__ + j * 25] = betac * pow_dd(wl, &alphac);
++    rolutu[i__ + j * 25] = pow_dd(rolutsu + linf + (i__ + j * 25) * 20, &rwl_1) * pow_dd(rolutsu + lsup + (i__ + j * 25) * 20, &rwl);
+ /*< 	   else >*/
+ 	    } else {
+ /*< 	  >*/
+@@ -396,12 +370,9 @@ L2234:
+     if (sixs_aer__1.qhase[lsup - 1] > .001 && sixs_aer__1.qhase[linf - 1] > 
+ 	    .001) {
+ /*<         alphaa=alog(qhase(lsup)/qhase(linf))/coef >*/
+-	alphaa = log(sixs_aer__1.qhase[lsup - 1] / sixs_aer__1.qhase[linf - 1]
+-		) / coef;
+ /*<         betaa=qhase(linf)/(wlinf**(alphaa)) >*/
+-	betaa = sixs_aer__1.qhase[linf - 1] / pow_dd(&wlinf, &alphaa);
+ /*<         qhaa=betaa*(wl**alphaa) >*/
+-	*qhaa = betaa * pow_dd(wl, &alphaa);
++	*qhaa = pow_dd(sixs_aer__1.qhase + linf - 1, &rwl_1) * pow_dd(sixs_aer__1.qhase + lsup - 1, &rwl);
+ /*< 	else >*/
+     } else {
+ /*< 	qhaa=qhase(linf)+(qhase(lsup)-qhase(linf))*coefl >*/
+@@ -434,12 +405,9 @@ L3240:
+ /*<         else >*/
+     } else {
+ /*<           alphar=alog(rqatm(1,lsup)/rqatm(1,linf))/ coef >*/
+-	alphar = log(sixs_disc__1.rqatm[lsup * 3 - 3] / sixs_disc__1.rqatm[
+-		linf * 3 - 3]) / coef;
+ /*<           betar=rqatm(1,linf)/(wlinf**(alphar)) >*/
+-	betar = sixs_disc__1.rqatm[linf * 3 - 3] / pow_dd(&wlinf, &alphar);
+ /*< 	  rqrayl=betar*(wl**alphar) >*/
+-	*rqrayl = betar * pow_dd(wl, &alphar);
++	*rqrayl = pow_dd(sixs_disc__1.rqatm + linf * 3 - 3, &rwl_1) * pow_dd(sixs_disc__1.rqatm + lsup * 3 - 3, &rwl);
+ /*< 	endif >*/
+     }
+ /*       write(6,*)'Q ',qhar,rqrayl,betar,alphar,rqatm(1,lsup), */
+@@ -461,12 +429,9 @@ L3240:
+ /*< 	else >*/
+     } else {
+ /*<           alphac=alog(rqatm(2,lsup)/rqatm(2,linf))/coef >*/
+-	alphac = log(sixs_disc__1.rqatm[lsup * 3 - 2] / sixs_disc__1.rqatm[
+-		linf * 3 - 2]) / coef;
+ /*<           betac=rqatm(2,linf)/(wlinf**(alphac)) >*/
+-	betac = sixs_disc__1.rqatm[linf * 3 - 2] / pow_dd(&wlinf, &alphac);
+ /*<           rqmix=betac*(wl**alphac) >*/
+-	*rqmix = betac * pow_dd(wl, &alphac);
++	*rqmix = pow_dd(sixs_disc__1.rqatm + linf * 3 - 2, &rwl_1) * pow_dd(sixs_disc__1.rqatm + lsup * 3 - 2, &rwl);
+ /*<         endif >*/
+     }
+ /*<         if(iaer.eq.0) goto 3234 >*/
+@@ -491,12 +456,9 @@ L3240:
+ /*< 	else >*/
+     } else {
+ /*<           alphaa=alog(rqatm(3,lsup)/rqatm(3,linf))/coef >*/
+-	alphaa = log(sixs_disc__1.rqatm[lsup * 3 - 1] / sixs_disc__1.rqatm[
+-		linf * 3 - 1]) / coef;
+ /*<           betaa=rqatm(3,linf)/(wlinf**(alphaa)) >*/
+-	betaa = sixs_disc__1.rqatm[linf * 3 - 1] / pow_dd(&wlinf, &alphaa);
+ /*<           rqaero=betaa*(wl**alphaa) >*/
+-	*rqaero = betaa * pow_dd(wl, &alphaa);
++	*rqaero = pow_dd(sixs_disc__1.rqatm + linf * 3 - 1, &rwl_1) * pow_dd(sixs_disc__1.rqatm + lsup * 3 - 1, &rwl);
+ /*< 	endif >*/
+     }
+ /*        write(6,*) "rqaero ",rqaero */
+@@ -511,12 +473,9 @@ L3234:
+     if (sixs_aer__1.uhase[lsup - 1] > .001 && sixs_aer__1.uhase[linf - 1] > 
+ 	    .001) {
+ /*<         alphaa=alog(uhase(lsup)/uhase(linf))/coef >*/
+-	alphaa = log(sixs_aer__1.uhase[lsup - 1] / sixs_aer__1.uhase[linf - 1]
+-		) / coef;
+ /*<         betaa=uhase(linf)/(wlinf**(alphaa)) >*/
+-	betaa = sixs_aer__1.uhase[linf - 1] / pow_dd(&wlinf, &alphaa);
+ /*<         uhaa=betaa*(wl**alphaa) >*/
+-	*uhaa = betaa * pow_dd(wl, &alphaa);
++	*uhaa = pow_dd(sixs_aer__1.uhase + linf - 1, &rwl_1) * pow_dd(sixs_aer__1.uhase + lsup - 1, &rwl);
+ /*< 	else >*/
+     } else {
+ /*< 	uhaa=uhase(linf)+(uhase(lsup)-uhase(linf))*coefl >*/
+@@ -549,12 +508,9 @@ L4242:
+ /*<         else >*/
+     } else {
+ /*<           alphar=alog(ruatm(1,lsup)/ruatm(1,linf))/ coef >*/
+-	alphar = log(sixs_disc__1.ruatm[lsup * 3 - 3] / sixs_disc__1.ruatm[
+-		linf * 3 - 3]) / coef;
+ /*<           betar=ruatm(1,linf)/(wlinf**(alphar)) >*/
+-	betar = sixs_disc__1.ruatm[linf * 3 - 3] / pow_dd(&wlinf, &alphar);
+ /*< 	  rurayl=betar*(wl**alphar) >*/
+-	*rurayl = betar * pow_dd(wl, &alphar);
++	*rurayl = pow_dd(sixs_disc__1.ruatm + linf * 3 - 3, &rwl_1) * pow_dd(sixs_disc__1.ruatm + lsup * 3 - 3, &rwl);
+ /*< 	endif >*/
+     }
+ /*       write(6,*)'U ',uhar,rurayl,betar,alphar,ruatm(1,lsup), */
+@@ -576,12 +532,9 @@ L4242:
+ /*< 	else >*/
+     } else {
+ /*<           alphac=alog(ruatm(2,lsup)/ruatm(2,linf))/coef >*/
+-	alphac = log(sixs_disc__1.ruatm[lsup * 3 - 2] / sixs_disc__1.ruatm[
+-		linf * 3 - 2]) / coef;
+ /*<           betac=ruatm(2,linf)/(wlinf**(alphac)) >*/
+-	betac = sixs_disc__1.ruatm[linf * 3 - 2] / pow_dd(&wlinf, &alphac);
+ /*<           rumix=betac*(wl**alphac) >*/
+-	*rumix = betac * pow_dd(wl, &alphac);
++	*rumix = pow_dd(sixs_disc__1.ruatm + linf * 3 - 2, &rwl_1) * pow_dd(sixs_disc__1.ruatm + lsup * 3 - 2, &rwl);
+ /*<         endif >*/
+     }
+ /*<         if(iaer.eq.0) goto 4234 >*/
+@@ -605,12 +558,9 @@ L4242:
+ /*< 	else >*/
+     } else {
+ /*<           alphaa=alog(ruatm(3,lsup)/ruatm(3,linf))/coef >*/
+-	alphaa = log(sixs_disc__1.ruatm[lsup * 3 - 1] / sixs_disc__1.ruatm[
+-		linf * 3 - 1]) / coef;
+ /*<           betaa=ruatm(3,linf)/(wlinf**(alphaa)) >*/
+-	betaa = sixs_disc__1.ruatm[linf * 3 - 1] / pow_dd(&wlinf, &alphaa);
+ /*<           ruaero=betaa*(wl**alphaa) >*/
+-	*ruaero = betaa * pow_dd(wl, &alphaa);
++	*ruaero = pow_dd(sixs_disc__1.ruatm + linf * 3 - 1, &rwl_1) * pow_dd(sixs_disc__1.ruatm + lsup * 3 - 1, &rwl);
+ /*<         endif >*/
+     }
+ /*<  4234  	continue >*/
+@@ -618,21 +568,15 @@ L4234:
+ 
+ 
+ /*<       alphar=alog(trayl(lsup)/trayl(linf))/coef >*/
+-    alphar = log(sixs_disc__1.trayl[lsup - 1] / sixs_disc__1.trayl[linf - 1]) 
+-	    / coef;
+ /*<       betar=trayl(linf)/(wlinf**(alphar)) >*/
+-    betar = sixs_disc__1.trayl[linf - 1] / pow_dd(&wlinf, &alphar);
+ /*<       tray=betar*(wl**alphar) >*/
+-    *tray = betar * pow_dd(wl, &alphar);
++    *tray = pow_dd(sixs_disc__1.trayl + linf - 1, &rwl_1) * pow_dd(sixs_disc__1.trayl + lsup - 1, &rwl);
+ /*<       if (idatmp.ne.0.) then >*/
+     if ((doublereal) (*idatmp) != 0.) {
+ /*<         alphar=alog(traypl(lsup)/traypl(linf))/coef >*/
+-	alphar = log(sixs_disc__1.traypl[lsup - 1] / sixs_disc__1.traypl[linf 
+-		- 1]) / coef;
+ /*<         betar=traypl(linf)/(wlinf**(alphar)) >*/
+-	betar = sixs_disc__1.traypl[linf - 1] / pow_dd(&wlinf, &alphar);
+ /*<         trayp=betar*(wl**alphar) >*/
+-	*trayp = betar * pow_dd(wl, &alphar);
++  *trayp = pow_dd(sixs_disc__1.traypl + linf - 1, &rwl_1) * pow_dd(sixs_disc__1.traypl + lsup - 1, &rwl);
+ /*<       else >*/
+     } else {
+ /*<         trayp=0. >*/
+@@ -645,22 +589,17 @@ L4234:
+ 	goto L1235;
+     }
+ /*<       alphaa=alog(ext(lsup)*ome(lsup)/(ext(linf)*ome(linf)))/coef >*/
+-    alphaa = log(sixs_aer__1.ext[lsup - 1] * sixs_aer__1.ome[lsup - 1] / (
+-	    sixs_aer__1.ext[linf - 1] * sixs_aer__1.ome[linf - 1])) / coef;
++    alphaa = sixs_aer__1.ext[linf - 1] * sixs_aer__1.ome[linf - 1];
+ /*<       betaa=ext(linf)*ome(linf)/(wlinf**(alphaa)) >*/
+-    betaa = sixs_aer__1.ext[linf - 1] * sixs_aer__1.ome[linf - 1] / pow_dd(&
+-	    wlinf, &alphaa);
++    betaa = sixs_aer__1.ext[lsup - 1] * sixs_aer__1.ome[lsup - 1];
+ /*<       tsca=taer55*betaa*(wl**alphaa)/ext(8) >*/
+-    *tsca = *taer55 * betaa * pow_dd(wl, &alphaa) / sixs_aer__1.ext[7];
++    *tsca = *taer55 * pow_dd(&alphaa, &rwl_1) * pow_dd(&betaa, &rwl) / sixs_aer__1.ext[7];
+ /*<       alphaa=alog(ext(lsup)/ext(linf))/coef >*/
+-    alphaa = log(sixs_aer__1.ext[lsup - 1] / sixs_aer__1.ext[linf - 1]) / 
+-	    coef;
+ /*<       betaa=ext(linf)/(wlinf**(alphaa)) >*/
+-    betaa = sixs_aer__1.ext[linf - 1] / pow_dd(&wlinf, &alphaa);
+ /*<       taerp=taer55p*betaa*(wl**alphaa)/ext(8) >*/
+-    *taerp = *taer55p * betaa * pow_dd(wl, &alphaa) / sixs_aer__1.ext[7];
++    *taerp = *taer55p * pow_dd(sixs_aer__1.ext + linf - 1, &rwl_1) * pow_dd(sixs_aer__1.ext + lsup - 1, &rwl) / sixs_aer__1.ext[7];
+ /*<       taer=taer55*betaa*(wl**alphaa)/ext(8) >*/
+-    *taer = *taer55 * betaa * pow_dd(wl, &alphaa) / sixs_aer__1.ext[7];
++    *taer = *taer55 * pow_dd(sixs_aer__1.ext + linf - 1, &rwl_1) * pow_dd(sixs_aer__1.ext + lsup - 1, &rwl) / sixs_aer__1.ext[7];
+ 
+ /*<  1235 drinf=dtdif(1,linf)+dtdir(1,linf) >*/
+ L1235:
+@@ -670,11 +609,9 @@ L1235:
+     drsup = sixs_disc__1.dtdif[lsup * 3 - 3] + sixs_disc__1.dtdir[lsup * 3 - 
+ 	    3];
+ /*<       alphar=alog(drsup/drinf)/coef >*/
+-    alphar = log(drsup / drinf) / coef;
+ /*<       betar=drinf/(wlinf**(alphar)) >*/
+-    betar = drinf / pow_dd(&wlinf, &alphar);
+ /*<       dtotr=betar*(wl**alphar) >*/
+-    *dtotr = betar * pow_dd(wl, &alphar);
++    *dtotr = pow_dd(&drinf , &rwl_1) * pow_dd(&drsup, &rwl);
+ /*<       dtinf=dtdif(2,linf)+dtdir(2,linf) >*/
+     dtinf = sixs_disc__1.dtdif[linf * 3 - 2] + sixs_disc__1.dtdir[linf * 3 - 
+ 	    2];
+@@ -682,11 +619,11 @@ L1235:
+     dtsup = sixs_disc__1.dtdif[lsup * 3 - 2] + sixs_disc__1.dtdir[lsup * 3 - 
+ 	    2];
+ /*<       alphac=alog((dtsup*drinf)/(dtinf*drsup))/coef >*/
+-    alphac = log(dtsup * drinf / (dtinf * drsup)) / coef;
++    alphac = dtinf / drinf;
+ /*<       betac=(dtinf/drinf)/(wlinf**(alphac)) >*/
+-    betac = dtinf / drinf / pow_dd(&wlinf, &alphac);
++    betac = dtsup / drsup;
+ /*<       dtotc=betac*(wl**alphac) >*/
+-    dtotc = betac * pow_dd(wl, &alphac);
++    dtotc = pow_dd(&alphac , &rwl_1) * pow_dd(&betac , &rwl);
+ /*<       dainf=dtdif(3,linf)+dtdir(3,linf) >*/
+     dainf = sixs_disc__1.dtdif[linf * 3 - 1] + sixs_disc__1.dtdir[linf * 3 - 
+ 	    1];
+@@ -698,11 +635,9 @@ L1235:
+ 	goto L1236;
+     }
+ /*<       alphaa=alog(dasup/dainf)/coef >*/
+-    alphaa = log(dasup / dainf) / coef;
+ /*<       betaa=dainf/(wlinf**(alphaa)) >*/
+-    betaa = dainf / pow_dd(&wlinf, &alphaa);
+ /*<       dtota=betaa*(wl**alphaa) >*/
+-    *dtota = betaa * pow_dd(wl, &alphaa);
++    *dtota = pow_dd(&dainf, &rwl_1) * pow_dd(&dasup, &rwl);
+ /*<  1236 dtott=dtotc*dtotr >*/
+ L1236:
+     *dtott = dtotc * *dtotr;
+@@ -713,11 +648,9 @@ L1236:
+     ursup = sixs_disc__1.utdif[lsup * 3 - 3] + sixs_disc__1.utdir[lsup * 3 - 
+ 	    3];
+ /*<       alphar=alog(ursup/urinf)/ coef >*/
+-    alphar = log(ursup / urinf) / coef;
+ /*<       betar=urinf/(wlinf**(alphar)) >*/
+-    betar = urinf / pow_dd(&wlinf, &alphar);
+ /*<       utotr=betar*(wl**alphar) >*/
+-    *utotr = betar * pow_dd(wl, &alphar);
++    *utotr = pow_dd(&urinf, &rwl_1) * pow_dd(&ursup, &rwl);
+ /*<       utinf=utdif(2,linf)+utdir(2,linf) >*/
+     utinf = sixs_disc__1.utdif[linf * 3 - 2] + sixs_disc__1.utdir[linf * 3 - 
+ 	    2];
+@@ -725,11 +658,11 @@ L1236:
+     utsup = sixs_disc__1.utdif[lsup * 3 - 2] + sixs_disc__1.utdir[lsup * 3 - 
+ 	    2];
+ /*<       alphac=alog((utsup*urinf)/(utinf*ursup))/ coef >*/
+-    alphac = log(utsup * urinf / (utinf * ursup)) / coef;
++    alphac = utinf / urinf;
+ /*<       betac=(utinf/urinf)/(wlinf**(alphac)) >*/
+-    betac = utinf / urinf / pow_dd(&wlinf, &alphac);
++    betac = utsup / ursup;
+ /*<       utotc=betac*(wl**alphac) >*/
+-    utotc = betac * pow_dd(wl, &alphac);
++    utotc = pow_dd(&alphac, &rwl_1) * pow_dd(&betac, &rwl);
+ /*<       uainf=utdif(3,linf)+utdir(3,linf) >*/
+     uainf = sixs_disc__1.utdif[linf * 3 - 1] + sixs_disc__1.utdir[linf * 3 - 
+ 	    1];
+@@ -741,11 +674,9 @@ L1236:
+ 	goto L1237;
+     }
+ /*<       alphaa=alog(uasup/uainf)/ coef >*/
+-    alphaa = log(uasup / uainf) / coef;
+ /*<       betaa=uainf/(wlinf**(alphaa)) >*/
+-    betaa = uainf / pow_dd(&wlinf, &alphaa);
+ /*<       utota=betaa*(wl**alphaa) >*/
+-    *utota = betaa * pow_dd(wl, &alphaa);
++    *utota = pow_dd(&uainf, &rwl_1) * pow_dd(&uasup, &rwl);
+ /*<  1237 utott=utotc*utotr >*/
+ L1237:
+     *utott = utotc * *utotr;
+@@ -754,21 +685,17 @@ L1237:
+ /*<       arsup=sphal(1,lsup) >*/
+     arsup = sixs_disc__1.sphal[lsup * 3 - 3];
+ /*<       alphar=alog(arsup/arinf)/ coef >*/
+-    alphar = log(arsup / arinf) / coef;
+ /*<       betar=arinf/(wlinf**(alphar)) >*/
+-    betar = arinf / pow_dd(&wlinf, &alphar);
+ /*<       asray=betar*(wl**alphar) >*/
+-    *asray = betar * pow_dd(wl, &alphar);
++    *asray = pow_dd(&arinf, &rwl_1) * pow_dd(&arsup, &rwl);
+ /*<       atinf=sphal(2,linf) >*/
+     atinf = sixs_disc__1.sphal[linf * 3 - 2];
+ /*<       atsup=sphal(2,lsup) >*/
+     atsup = sixs_disc__1.sphal[lsup * 3 - 2];
+ /*<       alphac=alog(atsup/atinf)/coef >*/
+-    alphac = log(atsup / atinf) / coef;
+ /*<       betac=atinf/(wlinf**(alphac)) >*/
+-    betac = atinf / pow_dd(&wlinf, &alphac);
+ /*<       astot=betac*(wl**alphac) >*/
+-    *astot = betac * pow_dd(wl, &alphac);
++    *astot = pow_dd(&atinf, &rwl_1) * pow_dd(&atsup, &rwl);
+ /*<       aainf=sphal(3,linf) >*/
+     aainf = sixs_disc__1.sphal[linf * 3 - 1];
+ /*<       aasup=sphal(3,lsup) >*/
+@@ -778,11 +705,9 @@ L1237:
+ 	goto L1239;
+     }
+ /*<       alphaa=alog(aasup/aainf)/coef >*/
+-    alphaa = log(aasup / aainf) / coef;
+ /*<       betaa=aainf/(wlinf**(alphaa)) >*/
+-    betaa = aainf / pow_dd(&wlinf, &alphaa);
+ /*<       asaer=betaa*(wl**alphaa) >*/
+-    *asaer = betaa * pow_dd(wl, &alphaa);
++    *asaer = pow_dd(&aainf, &rwl_1) * pow_dd(&aasup, &rwl);
+ /*<  1239 return >*/
+ L1239:
+     return 0;
diff --git a/Modules/Visualization/Monteverdi/src/mvdMainWindow.cxx b/Modules/Visualization/Monteverdi/src/mvdMainWindow.cxx
index 04a7f758574d15b3b78fc4f698788a4405f47ec4..6292eb8ceed1ccca730ef82c51c70669eb00ab03 100644
--- a/Modules/Visualization/Monteverdi/src/mvdMainWindow.cxx
+++ b/Modules/Visualization/Monteverdi/src/mvdMainWindow.cxx
@@ -1227,8 +1227,19 @@ MainWindow
   if( filenames.isEmpty() )
     return;
 
-  if( !BuildGDALOverviews( filenames ) )
-    return;
+  assert( I18nCoreApplication::Instance()!=NULL );
+
+  {
+    QVariant value(
+      I18nApplication::Instance()->RetrieveSettingsKey(
+	I18nCoreApplication::SETTINGS_KEY_OVERVIEWS_ENABLED
+      )
+    );
+
+    if( !( value.isValid() ? value.toBool() : OVERVIEWS_ENABLED_DEFAULT ) ||
+	!BuildGDALOverviews( filenames ) )
+      return;
+  }
 
   if( filenames.count()==1 )
     ImportImage( filenames.front(), 0 );
diff --git a/Modules/Visualization/Monteverdi/src/mvdPreferencesDialog.cxx b/Modules/Visualization/Monteverdi/src/mvdPreferencesDialog.cxx
index 77c2dad297863a7db32664c3a4f49f7d41ec361a..42033beac9df0469360dd2c2afa0d3f569a5a53e 100644
--- a/Modules/Visualization/Monteverdi/src/mvdPreferencesDialog.cxx
+++ b/Modules/Visualization/Monteverdi/src/mvdPreferencesDialog.cxx
@@ -38,6 +38,7 @@
 
 //
 // Monteverdi includes (sorted by alphabetic order)
+#include "mvdCore.h"
 #include "mvdGui.h"
 #include "mvdI18nApplication.h"
 #include "mvdI18nMainWindow.h"
@@ -129,6 +130,35 @@ PreferencesDialog
     .toString()
   );
 
+  //
+  // GDAL overviews.
+  {
+    QVariant value(
+      I18nApplication::Instance()->RetrieveSettingsKey(
+	I18nCoreApplication::SETTINGS_KEY_OVERVIEWS_ENABLED
+      )
+    );
+
+    m_UI->overviewsCheckBox->setChecked(
+      !value.isValid()
+      ? OVERVIEWS_ENABLED_DEFAULT
+      : value.toBool()
+    );
+  }
+  {
+    QVariant value(
+      I18nApplication::Instance()->RetrieveSettingsKey(
+	I18nCoreApplication::SETTINGS_KEY_OVERVIEWS_SIZE
+      )
+    );
+
+    m_UI->overviewsSpinBox->setValue(
+      !value.isValid()
+      ? OVERVIEWS_SIZE_DEFAULT
+      : value.toInt()
+    );
+  }
+
   //
   // Rendering settings.
   {
@@ -140,7 +170,7 @@ PreferencesDialog
 
     m_UI->resolutionComboBox->setCurrentIndex(
       !value.isValid()
-      ? RESOLUTION_LOWER
+      ? RESOLUTION_DEFAULT
       : value.toInt()
     );
   }
@@ -261,6 +291,17 @@ PreferencesDialog
     m_UI->geoidLineEdit->text()
   );
 
+  //
+  // Overview settings.
+  I18nApplication::Instance()->StoreSettingsKey(
+    I18nCoreApplication::SETTINGS_KEY_OVERVIEWS_ENABLED,
+    m_UI->overviewsCheckBox->isChecked()
+  );
+  I18nApplication::Instance()->StoreSettingsKey(
+    I18nCoreApplication::SETTINGS_KEY_OVERVIEWS_SIZE,
+    m_UI->overviewsSpinBox->value()
+  );
+
   //
   // Rendering settings.
   I18nApplication::Instance()->StoreSettingsKey(
diff --git a/Modules/Visualization/Monteverdi/src/mvdPreferencesDialog.ui b/Modules/Visualization/Monteverdi/src/mvdPreferencesDialog.ui
index de1cc256247ff11b79eeb3ae0d72be45c2cfefb3..300d4072f3c8cc439ba7bcb92f0403d416bb7901 100644
--- a/Modules/Visualization/Monteverdi/src/mvdPreferencesDialog.ui
+++ b/Modules/Visualization/Monteverdi/src/mvdPreferencesDialog.ui
@@ -112,6 +112,26 @@
         <string>GDAL Overviews</string>
        </property>
        <layout class="QGridLayout" name="gridLayout_5">
+        <item row="1" column="1">
+         <widget class="QLabel" name="overviewsLabel">
+          <property name="sizePolicy">
+           <sizepolicy hsizetype="Maximum" vsizetype="Preferred">
+            <horstretch>0</horstretch>
+            <verstretch>0</verstretch>
+           </sizepolicy>
+          </property>
+          <property name="text">
+           <string>Minimum size:</string>
+          </property>
+         </widget>
+        </item>
+        <item row="1" column="2">
+         <widget class="QSpinBox" name="overviewsSpinBox">
+          <property name="maximum">
+           <number>999999999</number>
+          </property>
+         </widget>
+        </item>
         <item row="1" column="0">
          <widget class="QCheckBox" name="overviewsCheckBox">
           <property name="sizePolicy">
@@ -128,8 +148,8 @@
           </property>
          </widget>
         </item>
-        <item row="1" column="1">
-         <widget class="QLabel" name="overviewsLabel">
+        <item row="1" column="3">
+         <widget class="QLabel" name="pixelLabel">
           <property name="sizePolicy">
            <sizepolicy hsizetype="Maximum" vsizetype="Preferred">
             <horstretch>0</horstretch>
@@ -137,13 +157,10 @@
            </sizepolicy>
           </property>
           <property name="text">
-           <string>Minimum size:</string>
+           <string>pixel(s)</string>
           </property>
          </widget>
         </item>
-        <item row="1" column="2">
-         <widget class="QSpinBox" name="overviewsSpinBox"/>
-        </item>
        </layout>
       </widget>
      </item>
diff --git a/Modules/Visualization/MonteverdiCore/include/mvdCore.h b/Modules/Visualization/MonteverdiCore/include/mvdCore.h
index 8b4550072d8dab39ef633e60eb720ea699ce82e0..d0e2582253a3d5d754d5d6feb6c456b716043e10 100644
--- a/Modules/Visualization/MonteverdiCore/include/mvdCore.h
+++ b/Modules/Visualization/MonteverdiCore/include/mvdCore.h
@@ -145,6 +145,20 @@ extern
 char const * const
 EFFECT_NAMES[ EFFECT_COUNT ];
 
+/**
+ */
+OTBMonteverdiCore_EXPORT
+extern
+bool
+OVERVIEWS_ENABLED_DEFAULT;
+
+/**
+ */
+OTBMonteverdiCore_EXPORT
+extern
+int
+OVERVIEWS_SIZE_DEFAULT;
+
 } // end of namespace mvd.
 
 
diff --git a/Modules/Visualization/MonteverdiCore/src/mvdCore.cxx b/Modules/Visualization/MonteverdiCore/src/mvdCore.cxx
index b726a4a897e0b37e2e87e59fb0d52d961b4766d6..c9d04afd901e5a7aa4b845122dd54d16d8caab24 100644
--- a/Modules/Visualization/MonteverdiCore/src/mvdCore.cxx
+++ b/Modules/Visualization/MonteverdiCore/src/mvdCore.cxx
@@ -92,6 +92,12 @@ EFFECT_NAMES[ EFFECT_COUNT ] =
   QT_TRANSLATE_NOOP( "mvd", "Swipe (vertical)" ),
 };
 
+bool
+OVERVIEWS_ENABLED_DEFAULT = true;
+
+int
+OVERVIEWS_SIZE_DEFAULT = 512;
+
 
 /*****************************************************************************/
 /* STATIC IMPLEMENTATION SECTION                                             */
diff --git a/Modules/Visualization/MonteverdiCore/src/mvdHistogramModel.cxx b/Modules/Visualization/MonteverdiCore/src/mvdHistogramModel.cxx
index 2b59b02b7dcaa7a2afa5e3dd0ceb2d86a2e6e8fc..b23a57c236078aa529382a8dbc54769e168e35e6 100644
--- a/Modules/Visualization/MonteverdiCore/src/mvdHistogramModel.cxx
+++ b/Modules/Visualization/MonteverdiCore/src/mvdHistogramModel.cxx
@@ -67,12 +67,8 @@ HistogramModel
 {
   if( boost::is_floating_point< DefaultImageType::PixelType::ValueType >::value )
     return
-      std::pow(
-	10.0,
-	static_cast< DefaultImageType::PixelType::ValueType >(
-	  -HistogramModel::PRECISION - 1
-	)
-      );
+      std::pow( 10.0, -HistogramModel::PRECISION - 1 );
+
   else
     return 1;
 }
diff --git a/Modules/Visualization/MonteverdiGui/include/mvdGui.h b/Modules/Visualization/MonteverdiGui/include/mvdGui.h
index bc941cd67563c45f2b9599deb1f745e744be76fd..821e20268296728050e1afe7ee6a581dbd789427 100644
--- a/Modules/Visualization/MonteverdiGui/include/mvdGui.h
+++ b/Modules/Visualization/MonteverdiGui/include/mvdGui.h
@@ -97,7 +97,9 @@ enum Resolution
   RESOLUTION_LOWER,
   RESOLUTION_UPPER,
   //
-  RESOLUTION_COUNT
+  RESOLUTION_COUNT,
+  //
+  RESOLUTION_DEFAULT = RESOLUTION_NEAREST,
 };
 
 /**
diff --git a/Modules/Visualization/MonteverdiGui/src/mvdImageViewRenderer.cxx b/Modules/Visualization/MonteverdiGui/src/mvdImageViewRenderer.cxx
index 25ddb127a3ab7700d3c36a74e04217a6657d13b3..fa1d9366c3ef51412b175aadc24d2db47ae2d789 100644
--- a/Modules/Visualization/MonteverdiGui/src/mvdImageViewRenderer.cxx
+++ b/Modules/Visualization/MonteverdiGui/src/mvdImageViewRenderer.cxx
@@ -93,7 +93,7 @@ ImageViewRenderer::RenderingContext
 
   m_Resolution =
     !value.isValid()
-    ? RESOLUTION_NEAREST
+    ? RESOLUTION_DEFAULT
     : static_cast< Resolution >( value.toInt() );
   }
 
@@ -106,7 +106,7 @@ ImageViewRenderer::RenderingContext
 
   m_TileSize =
     !value.isValid()
-    ? 256
+    ? TILE_SIZE_VALUE[ TILE_SIZE_DEFAULT ]
     : value.toInt();
   }
 }
diff --git a/Modules/Visualization/MonteverdiGui/src/mvdImportImagesDialog.cxx b/Modules/Visualization/MonteverdiGui/src/mvdImportImagesDialog.cxx
index 98a2970b878b6a83a4dedd7e04ece7f3efd11519..73b848ba0e894d9d3c03a1887d53a654ea2fbadf 100644
--- a/Modules/Visualization/MonteverdiGui/src/mvdImportImagesDialog.cxx
+++ b/Modules/Visualization/MonteverdiGui/src/mvdImportImagesDialog.cxx
@@ -40,6 +40,8 @@
 //
 // Monteverdi includes (sorted by alphabetic order)
 #include "mvdAlgorithm.h"
+#include "mvdCore.h"
+#include "mvdI18nCoreApplication.h"
 
 namespace mvd
 {
@@ -210,7 +212,25 @@ ImportImagesDialog
 
 	flags |= Qt::ItemIsSelectable;
 
-	unsigned int count = builder->CountResolutions( 2, 256 );
+	unsigned int count = 0;
+
+	{
+	  assert( I18nCoreApplication::Instance()!=NULL );
+
+	  QVariant value(
+	    I18nCoreApplication::Instance()->RetrieveSettingsKey(
+	      I18nCoreApplication::SETTINGS_KEY_OVERVIEWS_SIZE
+	    )
+	  );
+
+	  count =
+	    builder->CountResolutions(
+	      2,
+	      value.isValid()
+	      ? value.toInt()
+	      : OVERVIEWS_SIZE_DEFAULT
+	    );
+	}
 
 	if( builder->GetOverviewsCount()>0 )
 	  builder->SetBypassEnabled( true );
diff --git a/Modules/Visualization/MonteverdiGui/src/mvdMultiResolutionPyramidWidget.cxx b/Modules/Visualization/MonteverdiGui/src/mvdMultiResolutionPyramidWidget.cxx
index 267d4f5075ecb3a3cc492577c6bae8c2815e9d04..b8f530d5a954e1a412d8cfc0af0929adc32487c7 100644
--- a/Modules/Visualization/MonteverdiGui/src/mvdMultiResolutionPyramidWidget.cxx
+++ b/Modules/Visualization/MonteverdiGui/src/mvdMultiResolutionPyramidWidget.cxx
@@ -40,7 +40,9 @@
 
 //
 // Monteverdi includes (sorted by alphabetic order)
+#include "mvdCore.h"
 #include "mvdGui.h"
+#include "mvdI18nCoreApplication.h"
 
 namespace mvd
 {
@@ -237,13 +239,15 @@ MultiResolutionPyramidWidget
   m_UI->baseSpinBox->blockSignals( prevSignalsBlocked );
   }
 
+  unsigned int maxResolutions = m_GDALOverviewsBuilder->CountResolutions();
+
   {
-  bool prevSignalsBlocked = m_UI->levelsSpinBox->blockSignals( true );
+    bool prevSignalsBlocked = m_UI->levelsSpinBox->blockSignals( true );
 
-  m_UI->levelsSpinBox->setRange( 0, m_GDALOverviewsBuilder->CountResolutions() );
-  m_UI->levelsSpinBox->setValue( m_GDALOverviewsBuilder->GetNbResolutions() );
+    m_UI->levelsSpinBox->setRange( 0, maxResolutions );
+    m_UI->levelsSpinBox->setValue( m_GDALOverviewsBuilder->GetNbResolutions() );
 
-  m_UI->levelsSpinBox->blockSignals( prevSignalsBlocked );
+    m_UI->levelsSpinBox->blockSignals( prevSignalsBlocked );
   }
 
   {
@@ -251,7 +255,8 @@ MultiResolutionPyramidWidget
 
   m_UI->sizeSpinBox->setRange( 1, minSize );
 
-  assert(m_GDALOverviewsBuilder->CountResolutions() >= m_GDALOverviewsBuilder->GetNbResolutions() );
+  assert( maxResolutions >=
+	  m_GDALOverviewsBuilder->GetNbResolutions() );
 
   // Force C++ implicit cast by declaring local variables to force compiler
   // to find correct std::pow() signature.
@@ -261,7 +266,7 @@ MultiResolutionPyramidWidget
   double rf = m_GDALOverviewsBuilder->GetResolutionFactor();
 
   int m = 
-    m_GDALOverviewsBuilder->CountResolutions() -
+    maxResolutions -
     m_GDALOverviewsBuilder->GetNbResolutions();
 
   m_UI->sizeSpinBox->setValue(
diff --git a/Modules/Visualization/MonteverdiGui/src/mvdMultiResolutionPyramidWidget.ui b/Modules/Visualization/MonteverdiGui/src/mvdMultiResolutionPyramidWidget.ui
index 88bf04e178a88c5a9a0ab6971659d38be45979e0..b9c1dd7722a3d1a823793bfbaa58be1478d48e1e 100644
--- a/Modules/Visualization/MonteverdiGui/src/mvdMultiResolutionPyramidWidget.ui
+++ b/Modules/Visualization/MonteverdiGui/src/mvdMultiResolutionPyramidWidget.ui
@@ -169,6 +169,9 @@
      <property name="toolTip">
       <string>Minimal size (in pixels) of smallest overview level</string>
      </property>
+     <property name="minimum">
+      <number>1</number>
+     </property>
     </widget>
    </item>
    <item row="3" column="0" colspan="4">
diff --git a/SuperBuild/CMake/External_glut.cmake b/SuperBuild/CMake/External_glut.cmake
index cdc8cfc17876b3c0d3976cc33245d9fe02abf095..6bc341299b6cb20ee083d3da6301e733f42a4188 100644
--- a/SuperBuild/CMake/External_glut.cmake
+++ b/SuperBuild/CMake/External_glut.cmake
@@ -2,11 +2,28 @@ INCLUDE_ONCE_MACRO(GLUT)
 
 if(APPLE)
   message(FATAL_ERROR "Cannot activate GLUT on OSX. See manits issue #1194")
-  retunr()
+  return()
 endif()
 
 SETUP_SUPERBUILD(GLUT)
 
+if(UNIX)
+
+  set(GLUT_PATCH_COMMAND)
+
+  set(GLUT_CONFIGURE_COMMAND  "${SB_ENV_CONFIGURE_CMD};${GLUT_SB_SRC}/configure" ${SB_CONFIGURE_ARGS})
+
+else(MSVC)
+
+  set(GLUT_PATCH_COMMAND ${CMAKE_COMMAND}
+  -E copy
+  ${CMAKE_SOURCE_DIR}/patches/GLUT/CMakeLists.txt
+  ${GLUT_SB_SRC}
+  )
+  
+  set(GLUT_CONFIGURE_COMMAND ${SB_CMAKE_COMMAND} ${SB_CMAKE_CACHE_ARGS} ${GLUT_SB_SRC} )
+endif()
+
 ExternalProject_Add(GLUT
   PREFIX GLUT
   URL "http://downloads.sourceforge.net/project/freeglut/freeglut/2.8.1/freeglut-2.8.1.tar.gz"
@@ -14,11 +31,8 @@ ExternalProject_Add(GLUT
   BINARY_DIR ${GLUT_SB_BUILD_DIR}
   INSTALL_DIR ${SB_INSTALL_PREFIX}
   DOWNLOAD_DIR ${DOWNLOAD_LOCATION}
-  PATCH_COMMAND ${CMAKE_COMMAND} -E copy
-  ${CMAKE_SOURCE_DIR}/patches/GLUT/CMakeLists.txt
-  ${GLUT_SB_SRC}
-  CMAKE_CACHE_ARGS ${SB_CMAKE_CACHE_ARGS}
-  CMAKE_COMMAND ${SB_CMAKE_COMMAND}
+  PATCH_COMMAND ${GLUT_PATCH_COMMAND}
+  CONFIGURE_COMMAND ${GLUT_CONFIGURE_COMMAND}
   )
 
 set(_SB_GLUT_INCLUDE_DIR ${SB_INSTALL_PREFIX}/include)
diff --git a/SuperBuild/CMake/External_otb.cmake b/SuperBuild/CMake/External_otb.cmake
index fed28a3bd54854b54b04a760a948233893716a29..80876e74daadce0fb7f5aecc285860cf366fd725 100644
--- a/SuperBuild/CMake/External_otb.cmake
+++ b/SuperBuild/CMake/External_otb.cmake
@@ -116,7 +116,7 @@ ADD_SUPERBUILD_CMAKE_VAR(OTB Boost_LIBRARY_DIR)
 if(MSVC)
   ADD_SUPERBUILD_CMAKE_VAR(OTB JPEG_LIBRARY)
 endif()
-
+  
 # forward compilation flags
 set(OTB_SB_C_FLAGS "${SB_PRIOR_INCLUDE_FLAGS} ${CMAKE_C_FLAGS} ")
 set(OTB_SB_CXX_FLAGS "${SB_PRIOR_INCLUDE_FLAGS} ${CMAKE_CXX_FLAGS}")
@@ -171,8 +171,6 @@ ExternalProject_Add(OTB
   -DOTB_USE_GLFW:BOOL=${OTB_USE_GLFW}
   -DOTB_USE_GLUT:BOOL=${OTB_USE_GLUT}
   -DOTB_USE_QWT:BOOL=${OTB_USE_QWT}
-  -DModule_OTBMapla:BOOL=${ENABLE_MONTEVERDI}
-  -DModule_OTBMonteverdi:BOOL=${ENABLE_MONTEVERDI}
   -DOTB_WRAP_PYTHON:BOOL=${OTB_WRAP_PYTHON}
   -DOTB_WRAP_JAVA:BOOL=${OTB_WRAP_JAVA}
   ${OTB_SB_CONFIG}
diff --git a/SuperBuild/CMake/External_package.cmake b/SuperBuild/CMake/External_package.cmake
index 09732f9793f4b12324fe4a8006f588c8df68b759..7194c131a898355b0cefe6271dec843dc61383af 100644
--- a/SuperBuild/CMake/External_package.cmake
+++ b/SuperBuild/CMake/External_package.cmake
@@ -22,10 +22,6 @@ endif()
 set(PACKAGE_NAME OTB)
 set(PACKAGE_LONG_NAME OrfeoToolBox)
 
-if(ENABLE_MONTEVERDI)
-  set(PACKAGE_OTB_configure_EXTRA_DEPENDS MVD)
-endif()
-
 if(UNIX)
   if(APPLE)
     set(PACKAGE_PLATFORM_NAME "Darwin")
@@ -68,8 +64,7 @@ file(WRITE "${CMAKE_BINARY_DIR}/PACKAGE-OTB/src/PACKAGE-OTB/CMakeLists.txt"
     COMMAND ${CMAKE_COMMAND}
     "${CMAKE_BINARY_DIR}/PACKAGE-OTB/src/PACKAGE-OTB"
     WORKING_DIRECTORY "${CMAKE_BINARY_DIR}/PACKAGE-OTB/build"
-    DEPENDS PACKAGE_TOOLS OTB
-    ${PACKAGE_OTB_configure_EXTRA_DEPENDS})
+    DEPENDS PACKAGE_TOOLS OTB)
 
   add_custom_target(PACKAGE-OTB-build
     COMMAND ${CMAKE_COMMAND}
diff --git a/SuperBuild/CMakeLists.txt b/SuperBuild/CMakeLists.txt
index b2db55e6d43574e926d3f48548c4a5ce47a93887..4a5593e774e6aec007c924de9fff709d5da4fabb 100644
--- a/SuperBuild/CMakeLists.txt
+++ b/SuperBuild/CMakeLists.txt
@@ -52,7 +52,6 @@ mark_as_advanced(DOWNLOAD_LOCATION)
 # General options
 option(ENABLE_OTB_LARGE_INPUTS " Use the OTB-LargeInputs for testing" OFF)
 option(BUILD_EXAMPLES " Build the OTB Examples directory" OFF)
-option(ENABLE_MONTEVERDI " Build Monteverdi on top of OTB" OFF)
 
 if(EXISTS "${CMAKE_SOURCE_DIR}/../CMakeLists.txt")
   file(STRINGS "${CMAKE_SOURCE_DIR}/../CMakeLists.txt" _CONTENT_CMAKELIST
@@ -68,6 +67,16 @@ if(EXISTS "${CMAKE_SOURCE_DIR}/../CMakeLists.txt")
   endif()
 endif()
 
+get_filename_component(PARENT_OF_BINARY_DIR ${CMAKE_BINARY_DIR} PATH)
+if (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
+  set (CMAKE_INSTALL_PREFIX
+    "${PARENT_OF_BINARY_DIR}/superbuild_install"
+    CACHE
+    PATH
+    "default install path for superbuild"
+    FORCE )
+endif()
+
 set(SB_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX})
 
 file(TO_NATIVE_PATH "${SB_INSTALL_PREFIX}" SB_INSTALL_PREFIX_NATIVE)
@@ -119,6 +128,8 @@ else()
   set(SB_CMAKE_PREFIX_PATH "${SB_INSTALL_PREFIX}")
 endif()
 
+list(REMOVE_DUPLICATES SB_CMAKE_PREFIX_PATH)
+
 set(SB_CMAKE_CACHE_ARGS)
 list(APPEND SB_CMAKE_CACHE_ARGS "-DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE}")
 list(APPEND SB_CMAKE_CACHE_ARGS "-DCMAKE_INSTALL_PREFIX:PATH=${SB_INSTALL_PREFIX}")
@@ -229,9 +240,11 @@ option(OTB_USE_GLFW "Enable module GLFW in OTB" OFF)
 option(OTB_USE_GLUT "Enable module GLUT in OTB" OFF)
 option(OTB_USE_QWT "Enable module QWT in OTB" OFF)
 
-set(OTB_USE_OPENGL ${ENABLE_MONTEVERDI})
-set(OTB_USE_GLEW ${ENABLE_MONTEVERDI})
-set(OTB_USE_QWT ${ENABLE_MONTEVERDI})
+#Problem: below cmake setting will fail!
+#-DOTB_USE_OPENGL=ON -DOTB_USE_GLEW=ON -DOTB_USE_QWT=ON
+#This is because ENABLE_MONTEVERDI is OFF by default
+# This brings a lot of twisted logic. so taking out this option
+
 
 # set OTB_DATA_ROOT to run test
 find_path(OTB_DATA_ROOT README-OTB-Data PATHS $ENV{OTB_DATA_ROOT} ${OTB-SuperBuild_SOURCE_DIR}/../../OTB-Data)
@@ -279,14 +292,17 @@ endif()
 
 if(FROM_SYSTEM_LIST)
   list(SORT FROM_SYSTEM_LIST)
-foreach( item ${FROM_SYSTEM_LIST})
-  message(STATUS "  Using system version of ${item}")
-endforeach()
+  foreach( item ${FROM_SYSTEM_LIST})
+    message(STATUS "  Using system version of ${item}")
+  endforeach()
 endif()
 
 if(FROM_SUPERBUILD_LIST)
   list(SORT FROM_SUPERBUILD_LIST)
-foreach( item ${FROM_SUPERBUILD_LIST})
-  message(STATUS "  Using SuperBuild version of ${item}")
-endforeach()
-endif()
\ No newline at end of file
+  foreach( item ${FROM_SUPERBUILD_LIST})
+    message(STATUS "  Using SuperBuild version of ${item}")
+  endforeach()
+endif()
+
+message(STATUS "SuperBuild will be installed to ${CMAKE_INSTALL_PREFIX}")
+message(STATUS "To install to a different directory, re-run cmake -DCMAKE_INSTALL_PREFIX=/your/preferred/path")
\ No newline at end of file
diff --git a/SuperBuild/Packaging/CMakeLists.txt b/SuperBuild/Packaging/CMakeLists.txt
index c017994eac00924a2d07acbd3b6fca6898b2aee0..79cb2cd1ef9751ff6b9d3ce3c83aef8914e59d7d 100644
--- a/SuperBuild/Packaging/CMakeLists.txt
+++ b/SuperBuild/Packaging/CMakeLists.txt
@@ -57,7 +57,6 @@ if(OUT_OF_SOURCE_BUILD)
   else()
     set(SUPERBUILD_BINARY_DIR "" CACHE PATH "path to superbuild binary directory")
     set(SUPERBUILD_INSTALL_DIR "" CACHE PATH "path to superbuild install directory")
-    option(ENABLE_MONTEVERDI "enable monteverdi" ON)
     set(DOWNLOAD_LOCATION "" CACHE PATH "path to superbuild binary directory")
   endif()
 else(OUT_OF_SOURCE_BUILD)
@@ -75,8 +74,6 @@ else(OUT_OF_SOURCE_BUILD)
   #endif()
 endif(OUT_OF_SOURCE_BUILD)
 
-
-
 if(WIN32)
   set(ZIP_EXE_NAMES 7z 7za)
   find_program(ZIP_EXECUTABLE NAMES ${ZIP_EXE_NAMES})