Index: /issm/trunk-jpl/src/c/Container/Observations.cpp
===================================================================
--- /issm/trunk-jpl/src/c/Container/Observations.cpp	(revision 12229)
+++ /issm/trunk-jpl/src/c/Container/Observations.cpp	(revision 12230)
@@ -150,2 +150,43 @@
 
 }/*}}}*/
+/*FUNCTION Observations::Variomap{{{*/
+void Observations::Variomap(double* gamma,double *x,int n){
+
+	/*Output and Intermediaries*/
+	int          nobs,i,j,k;
+	double       range;
+	Observation *observation1 = NULL;
+	Observation *observation2 = NULL;
+	int         *indices      = NULL;
+
+	int *counter= (int*)xmalloc(n*sizeof(int));
+	for(j=0;j<n;j++) counter[j] = 0;
+	for(j=0;j<n;j++) gamma[j]   = 0.0;
+
+	for(i=0;i<this->Size();i++){
+		observation1=(Observation*)this->GetObjectByOffset(i);
+
+		for(j=0;j<n;j++){
+			range=x[j]; _assert_(range>=0.);
+
+			/*Find all observations that are in range*/
+			this->quadtree->RangeSearch(&indices,&nobs,observation1->x,observation1->y,range);
+
+			for (k=0;k<nobs;k++){
+				observation2 = (Observation*)this->GetObjectByOffset(indices[k]);
+				gamma[j]    += 1./2.*pow(observation1->value - observation2->value,2.);
+			}
+
+			counter[j] += nobs;
+			xfree((void**)&indices);
+		}
+	}
+
+	/*Normalize semivariogram*/
+	for(j=0;j<n;j++){
+		if(counter[j]) gamma[j] = gamma[j]/double(counter[j]);
+	}
+
+	/*Assign output pointer*/
+	xfree((void**)&counter);
+}/*}}}*/
Index: /issm/trunk-jpl/src/c/Container/Observations.h
===================================================================
--- /issm/trunk-jpl/src/c/Container/Observations.h	(revision 12229)
+++ /issm/trunk-jpl/src/c/Container/Observations.h	(revision 12230)
@@ -25,4 +25,5 @@
 		void ObservationList(double **px,double **py,double **pobs,int* pnobs,double x_interp,double y_interp,double range);
 		void QuadtreeColoring(double* A,double *x,double *y,int n);
+		void Variomap(double* gamma,double *x,int n);
 
 };
Index: /issm/trunk-jpl/src/c/Makefile.am
===================================================================
--- /issm/trunk-jpl/src/c/Makefile.am	(revision 12229)
+++ /issm/trunk-jpl/src/c/Makefile.am	(revision 12230)
@@ -619,4 +619,6 @@
 						./objects/Kriging/SphericalVariogram.h\
 						./objects/Kriging/SphericalVariogram.cpp\
+						./objects/Kriging/PowerVariogram.h\
+						./objects/Kriging/PowerVariogram.cpp\
 						./objects/Kriging/Quadtree.h\
 						./objects/Kriging/Quadtree.cpp\
Index: /issm/trunk-jpl/src/c/modules/Krigingx/Krigingx.cpp
===================================================================
--- /issm/trunk-jpl/src/c/modules/Krigingx/Krigingx.cpp	(revision 12229)
+++ /issm/trunk-jpl/src/c/modules/Krigingx/Krigingx.cpp	(revision 12230)
@@ -54,4 +54,9 @@
 	if(strcmp(output,"quadtree")==0){
 		observations->QuadtreeColoring(predictions,x_interp,y_interp,n_interp);
+		*ppredictions=predictions;
+		return 1;
+	}
+	if(strcmp(output,"variomap")==0){
+		observations->Variomap(predictions,x_interp,n_interp);
 		*ppredictions=predictions;
 		return 1;
@@ -129,5 +134,6 @@
 		else if(strcmp(model,"exponential")==0) variogram = new ExponentialVariogram(options);
 		else if(strcmp(model,"spherical")==0)   variogram = new SphericalVariogram(options);
-		else _error_("variogram %s not supported yet (list of supported variogram: gaussian, exponential and spherical)",model);
+		else if(strcmp(model,"power")==0)       variogram = new PowerVariogram(options);
+		else _error_("variogram %s not supported yet (list of supported variogram: gaussian, exponential, spherical and power)",model);
 	}
 	else variogram = new GaussianVariogram(options);
Index: /issm/trunk-jpl/src/c/objects/Kriging/PowerVariogram.cpp
===================================================================
--- /issm/trunk-jpl/src/c/objects/Kriging/PowerVariogram.cpp	(revision 12230)
+++ /issm/trunk-jpl/src/c/objects/Kriging/PowerVariogram.cpp	(revision 12230)
@@ -0,0 +1,75 @@
+/*!\file PowerVariogram.c
+ * \brief: implementation of the PowerVariogram object
+ */
+
+#ifdef HAVE_CONFIG_H
+	#include <config.h>
+#else
+#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+#endif
+
+#include <stdio.h>
+#include <string.h>
+#include "../objects.h"
+#include "../../EnumDefinitions/EnumDefinitions.h"
+#include "../../shared/shared.h"
+#include "../../include/include.h"
+
+/*PowerVariogram constructors and destructor*/
+/*FUNCTION PowerVariogram::PowerVariogram(){{{1*/
+PowerVariogram::PowerVariogram(){
+	this->nugget = 0.2;
+	this->slope  = 1.;
+	this->power  = 1.;
+	return;
+}
+/*}}}*/
+/*FUNCTION PowerVariogram::PowerVariogram(Options* options){{{1*/
+PowerVariogram::PowerVariogram(Options* options){
+
+	/*Defaults*/
+	this->nugget = 0.2;
+	this->slope  = 1.;
+	this->power  = 1.;
+
+	/*Overwrite from options*/
+	if(options->GetOption("nugget")) options->Get(&this->nugget,"nugget");
+	if(options->GetOption("slope"))  options->Get(&this->slope,"slope");
+	if(options->GetOption("power"))  options->Get(&this->power,"power");
+
+	/*Checks*/
+	if(power<=0 || power>=2) _error_("power must be betwwen 0 and 2 (0 < power < 2)");
+	if(slope<=0) _error_("slope must be positive");
+}
+/*}}}*/
+/*FUNCTION PowerVariogram::~PowerVariogram(){{{1*/
+PowerVariogram::~PowerVariogram(){
+	return;
+}
+/*}}}*/
+
+/*Object virtual functions definitions:*/
+/*FUNCTION PowerVariogram::Echo {{{1*/
+void PowerVariogram::Echo(void){
+	printf("PowerVariogram\n");
+	printf("   nugget: %g\n",this->nugget);
+	printf("   slope : %g\n",this->slope);
+	printf("   power : %g\n",this->power);
+}
+/*}}}*/
+
+/*Variogram function*/
+/*FUNCTION PowerVariogram::SemiVariogram{{{1*/
+double PowerVariogram::SemiVariogram(double deltax,double deltay){
+	/*http://en.wikipedia.org/wiki/Variogram*/
+	double h,gamma;
+
+	/*Calculate length square*/
+	h=sqrt(pow(deltax,2.)+pow(deltay,2.));
+
+	/*return semi-variogram*/
+	gamma = this->nugget + this->slope*pow(h,this->power);
+
+	return gamma;
+}
+/*}}}*/
Index: /issm/trunk-jpl/src/c/objects/Kriging/PowerVariogram.h
===================================================================
--- /issm/trunk-jpl/src/c/objects/Kriging/PowerVariogram.h	(revision 12230)
+++ /issm/trunk-jpl/src/c/objects/Kriging/PowerVariogram.h	(revision 12230)
@@ -0,0 +1,34 @@
+/*! \file PowerVariogram.h 
+ *  \brief: header file for triavertexinput object
+ */
+
+#ifndef _POWERVARIOGRAM_H_
+#define _POWERVARIOGRAM_H_
+
+/*Headers:*/
+#include "./Variogram.h"
+
+class PowerVariogram: public Variogram{
+
+	public:
+		double nugget; //The height of the jump of the semivariogram at the discontinuity at the origin
+		double slope;  
+		double power; 
+
+		/*PowerVariogram constructors, destructors*/
+		PowerVariogram();
+		PowerVariogram(Options* options);
+		~PowerVariogram();
+
+		/*Object virtual functions definitions*/
+		void  Echo();
+		void  DeepEcho(){_error_("Not implemented yet");};
+		int   Id(){_error_("Not implemented yet");}; 
+		int   MyRank(){_error_("Not implemented yet");};
+		int   ObjectEnum(){_error_("Not implemented yet");};
+		Object* copy(){_error_("Not implemented yet");};
+
+		/*Variogram functions*/
+		double SemiVariogram(double deltax,double deltay);
+};
+#endif  /* _POWERVARIOGRAM_H */
Index: /issm/trunk-jpl/src/c/objects/Kriging/Quadtree.cpp
===================================================================
--- /issm/trunk-jpl/src/c/objects/Kriging/Quadtree.cpp	(revision 12229)
+++ /issm/trunk-jpl/src/c/objects/Kriging/Quadtree.cpp	(revision 12230)
@@ -433,10 +433,8 @@
 
 	/*Return 2 if the this box is included in the range*/
-	if(
-				this->xcenter+this->length/2 <= x+range &&
-				this->ycenter+this->length/2 <= y+range &&
-				this->xcenter-this->length/2 >= x-range &&
-				this->ycenter-this->length/2 >= y-range
-	  ) return 2;
+	if(this->xcenter+this->length/2 <= x+range &&
+		this->ycenter+this->length/2 <= y+range &&
+		this->xcenter-this->length/2 >= x-range &&
+		this->ycenter-this->length/2 >= y-range) return 2;
 
 	/*This is a simple overlap*/
Index: /issm/trunk-jpl/src/c/objects/objects.h
===================================================================
--- /issm/trunk-jpl/src/c/objects/objects.h	(revision 12229)
+++ /issm/trunk-jpl/src/c/objects/objects.h	(revision 12230)
@@ -178,4 +178,5 @@
 #include "./Kriging/ExponentialVariogram.h"
 #include "./Kriging/SphericalVariogram.h"
+#include "./Kriging/PowerVariogram.h"
 #include "./Kriging/Quadtree.h"
 #include "./Kriging/Observation.h"
