Index: ../trunk-jpl/src/m/contrib/gravity/vfsa.cpp
===================================================================
--- ../trunk-jpl/src/m/contrib/gravity/vfsa.cpp	(revision 18438)
+++ ../trunk-jpl/src/m/contrib/gravity/vfsa.cpp	(revision 18439)
@@ -132,6 +132,7 @@
 void GSLsquarefit(Matrix** pX,Matrix* A,Matrix* B);
 double signe(double a);
 void filtergrav(Matrix* A,Matrix* Ain,double ctr,double sd,int mx,int my);
+void newmodelgen(Matrix* m0,Matrix* m1,Matrix* bathy,Matrix* icethick,int mx,int my,double T,double ptval,double mmax,double mmax2,double ctr,double sd);
 /*}}}*/
 
 int main(){/*{{{*/
@@ -258,9 +259,9 @@
 //	mesh_ini->Echo();
                            /*}}}*/
 	double q=0;
- q=misfit(mesh_ini,evalid,gobs,dlevel,Pobs,xobs,yobs,Pp,rho1,rho2,dx,dy,dn,nx,ny,mx,my);
+/* q=misfit(mesh_ini,evalid,gobs,dlevel,Pobs,xobs,yobs,Pp,rho1,rho2,dx,dy,dn,nx,ny,mx,my);
      cout<< q;
-/*	Matrix* G=new Matrix(4,3);
+Matrix* G=new Matrix(4,3);
 	Matrix* df=new Matrix(4,1);
 	Matrix* o=new Matrix(4,1);
 	for(int i= 0;i<4;i++){
@@ -282,9 +283,9 @@
 	df->Echo();
 	M->Echo();
 	o->Echo();*/
-double a;
-a=signe(-9);
-cout<<a;
+	Matrix* m1=new Matrix(mx*my,3);
+	double T=100;
+newmodelgen(mesh_ini,m1,bathy,icethick,mx,my,T,ptval,mmax,mmax2,ctr,sd);
 	return 0;
 }/*}}}*/
 
@@ -516,6 +517,7 @@
 	}
 	m1->ExtractColumn(m1col,1);
 	vec2gridsimple(m1col,m1gr,mx,my);
+	cout<<endl<<endl;
 	filtergrav(m1grsm,m1gr,ctr,sd,mx,my);
 	reshape(m1grsm,m1col,mx,my);
 	for (int i=0;i<mx*my;i++){
@@ -567,6 +569,7 @@
 	else{return 1;}
 }/*}}}*/
 void filtergrav(Matrix* A,Matrix* Ain,double ctr,double sd,int mx,int my){/*{{{*/
+	A->MatrixEqual(Ain);
 	for (int i=1;i<my-1;i++){
 		for(int j=1;j<mx-1;j++){
 			A->SetValue(i,j,(ctr*Ain->GetValue(i,j)+sd*(Ain->GetValue(i-1,j)+Ain->GetValue(i+1,j)+Ain->GetValue(i,j-1)+Ain->GetValue(i,j+1)))/(ctr+4*sd));
