Index: issm/trunk-jpl/src/c/classes/FemModel.cpp
===================================================================
--- issm/trunk-jpl/src/c/classes/FemModel.cpp	(revision 22294)
+++ issm/trunk-jpl/src/c/classes/FemModel.cpp	(revision 22326)
@@ -1042,5 +1042,5 @@
 
 }/*}}}*/
-void FemModel::FloatingAreax(IssmDouble* pV){/*{{{*/
+void FemModel::FloatingAreax(IssmDouble* pV, bool scaled){/*{{{*/
 
 	IssmDouble local_floating_area= 0;
@@ -1049,5 +1049,5 @@
 	for(int i=0;i<this->elements->Size();i++){
 		Element* element=xDynamicCast<Element*>(this->elements->GetObjectByOffset(i));
-		local_floating_area+=element->FloatingArea();
+		local_floating_area+=element->FloatingArea(scaled);
 	}
 	ISSM_MPI_Reduce(&local_floating_area,&total_floating_area,1,ISSM_MPI_DOUBLE,ISSM_MPI_SUM,0,IssmComm::GetComm() );
@@ -1091,5 +1091,5 @@
 
 }/*}}}*/
-void FemModel::GroundedAreax(IssmDouble* pV){/*{{{*/
+void FemModel::GroundedAreax(IssmDouble* pV, bool scaled){/*{{{*/
 
 	IssmDouble local_grounded_area= 0;
@@ -1098,5 +1098,5 @@
 	for(int i=0;i<this->elements->Size();i++){
 		Element* element=xDynamicCast<Element*>(this->elements->GetObjectByOffset(i));
-		local_grounded_area+=element->GroundedArea();
+		local_grounded_area+=element->GroundedArea(scaled);
 	}
 	ISSM_MPI_Reduce(&local_grounded_area,&total_grounded_area,1,ISSM_MPI_DOUBLE,ISSM_MPI_SUM,0,IssmComm::GetComm() );
@@ -1107,5 +1107,5 @@
 
 }/*}}}*/
-void FemModel::IceMassx(IssmDouble* pM){/*{{{*/
+void FemModel::IceMassx(IssmDouble* pM, bool scaled){/*{{{*/
 
 	IssmDouble local_ice_mass = 0;
@@ -1114,5 +1114,5 @@
 	for(int i=0;i<this->elements->Size();i++){
 		Element* element=xDynamicCast<Element*>(this->elements->GetObjectByOffset(i));
-		local_ice_mass+=element->IceMass();
+		local_ice_mass+=element->IceMass(scaled);
 	}
 	ISSM_MPI_Reduce(&local_ice_mass,&total_ice_mass,1,ISSM_MPI_DOUBLE,ISSM_MPI_SUM,0,IssmComm::GetComm() );
@@ -1123,5 +1123,5 @@
 
 }/*}}}*/
-void FemModel::IceVolumeAboveFloatationx(IssmDouble* pV){/*{{{*/
+void FemModel::IceVolumeAboveFloatationx(IssmDouble* pV, bool scaled){/*{{{*/
 
 	IssmDouble local_ice_volume_af = 0;
@@ -1130,5 +1130,5 @@
 	for(int i=0;i<this->elements->Size();i++){
 		Element* element=xDynamicCast<Element*>(this->elements->GetObjectByOffset(i));
-		local_ice_volume_af+=element->IceVolumeAboveFloatation();
+		local_ice_volume_af+=element->IceVolumeAboveFloatation(scaled);
 	}
 	ISSM_MPI_Reduce(&local_ice_volume_af,&total_ice_volume_af,1,ISSM_MPI_DOUBLE,ISSM_MPI_SUM,0,IssmComm::GetComm() );
@@ -1139,5 +1139,5 @@
 
 }/*}}}*/
-void FemModel::IceVolumex(IssmDouble* pV){/*{{{*/
+void FemModel::IceVolumex(IssmDouble* pV, bool scaled){/*{{{*/
 
 	IssmDouble local_ice_volume = 0;
@@ -1146,5 +1146,5 @@
 	for(int i=0;i<this->elements->Size();i++){
 		Element* element=xDynamicCast<Element*>(this->elements->GetObjectByOffset(i));
-		local_ice_volume+=element->IceVolume();
+		local_ice_volume+=element->IceVolume(scaled);
 	}
 	ISSM_MPI_Reduce(&local_ice_volume,&total_ice_volume,1,ISSM_MPI_DOUBLE,ISSM_MPI_SUM,0,IssmComm::GetComm() );
@@ -1744,26 +1744,34 @@
 
 					/*Scalar output*/
-					case DivergenceEnum:               this->Divergencex(&double_result);               break;
-					case MaxDivergenceEnum:            this->MaxDivergencex(&double_result);            break;
-					case IceMassEnum:                  this->IceMassx(&double_result);                  break;
-					case IceVolumeEnum:                this->IceVolumex(&double_result);                break;
-					case IceVolumeAboveFloatationEnum: this->IceVolumeAboveFloatationx(&double_result); break;
-					case GroundedAreaEnum:             this->GroundedAreax(&double_result);             break;
-					case FloatingAreaEnum:             this->FloatingAreax(&double_result);             break;
-					case MinVelEnum:                   this->MinVelx(&double_result);                   break;
-					case MaxVelEnum:                   this->MaxVelx(&double_result);                   break;
-					case MinVxEnum:                    this->MinVxx(&double_result);                    break;
-					case MaxVxEnum:                    this->MaxVxx(&double_result);                    break;
-					case MaxAbsVxEnum:                 this->MaxAbsVxx(&double_result);                 break;
-					case MinVyEnum:                    this->MinVyx(&double_result);                    break;
-					case MaxVyEnum:                    this->MaxVyx(&double_result);                    break;
-					case MaxAbsVyEnum:                 this->MaxAbsVyx(&double_result);                 break;
-					case MinVzEnum:                    this->MinVzx(&double_result);                    break;
-					case MaxVzEnum:                    this->MaxVzx(&double_result);                    break;
-					case MaxAbsVzEnum:                 this->MaxAbsVzx(&double_result);                 break;
-					case MassFluxEnum:                 this->MassFluxx(&double_result);                 break;
-					case TotalFloatingBmbEnum:         this->TotalFloatingBmbx(&double_result);         break;
-					case TotalGroundedBmbEnum:         this->TotalGroundedBmbx(&double_result);         break;
-					case TotalSmbEnum:                 this->TotalSmbx(&double_result);                 break;
+					case DivergenceEnum:                     this->Divergencex(&double_result);                     break;
+					case MaxDivergenceEnum:                  this->MaxDivergencex(&double_result);                  break;
+					case IceMassEnum:                        this->IceMassx(&double_result,false);                  break;
+					case IceMassScaledEnum:                  this->IceMassx(&double_result,true);                   break;
+					case IceVolumeEnum:                      this->IceVolumex(&double_result,false);                break;
+					case IceVolumeScaledEnum:                this->IceVolumex(&double_result,true);                 break;
+					case IceVolumeAboveFloatationEnum:       this->IceVolumeAboveFloatationx(&double_result,false); break;
+					case IceVolumeAboveFloatationScaledEnum: this->IceVolumeAboveFloatationx(&double_result,true);  break;
+					case GroundedAreaEnum:                   this->GroundedAreax(&double_result,false);             break;
+					case GroundedAreaScaledEnum:             this->GroundedAreax(&double_result,true);              break;
+					case FloatingAreaEnum:                   this->FloatingAreax(&double_result,false);             break;
+					case FloatingAreaScaledEnum:             this->FloatingAreax(&double_result,true);              break;
+					case MinVelEnum:                         this->MinVelx(&double_result);                         break;
+					case MaxVelEnum:                         this->MaxVelx(&double_result);                         break;
+					case MinVxEnum:                          this->MinVxx(&double_result);                          break;
+					case MaxVxEnum:                          this->MaxVxx(&double_result);                          break;
+					case MaxAbsVxEnum:                       this->MaxAbsVxx(&double_result);                       break;
+					case MinVyEnum:                          this->MinVyx(&double_result);                          break;
+					case MaxVyEnum:                          this->MaxVyx(&double_result);                          break;
+					case MaxAbsVyEnum:                       this->MaxAbsVyx(&double_result);                       break;
+					case MinVzEnum:                          this->MinVzx(&double_result);                          break;
+					case MaxVzEnum:                          this->MaxVzx(&double_result);                          break;
+					case MaxAbsVzEnum:                       this->MaxAbsVzx(&double_result);                       break;
+					case MassFluxEnum:                       this->MassFluxx(&double_result);                       break;
+					case TotalFloatingBmbEnum:               this->TotalFloatingBmbx(&double_result,false);         break;
+					case TotalFloatingBmbScaledEnum:         this->TotalFloatingBmbx(&double_result,true);          break;
+					case TotalGroundedBmbEnum:               this->TotalGroundedBmbx(&double_result,false);         break;
+					case TotalGroundedBmbScaledEnum:         this->TotalGroundedBmbx(&double_result,true);          break;
+					case TotalSmbEnum:                       this->TotalSmbx(&double_result,false);                 break;
+					case TotalSmbScaledEnum:                 this->TotalSmbx(&double_result,true);                  break;
 
 			   /*Scalar control output*/
@@ -1994,41 +2002,49 @@
 	switch (response_descriptor_enum){
 
-		case DivergenceEnum:               this->Divergencex(responses); break;
-		case MaxDivergenceEnum:            this->MaxDivergencex(responses); break;
-		case IceMassEnum:                  this->IceMassx(responses); break;
-		case IceVolumeEnum:                this->IceVolumex(responses); break;
-		case IceVolumeAboveFloatationEnum: this->IceVolumeAboveFloatationx(responses); break;
-		case GroundedAreaEnum:             this->GroundedAreax(responses); break;
-		case FloatingAreaEnum:             this->FloatingAreax(responses); break;
-		case MinVelEnum:                   this->MinVelx(responses); break;
-		case MaxVelEnum:                   this->MaxVelx(responses); break;
-		case MinVxEnum:                    this->MinVxx(responses); break;
-		case MaxVxEnum:                    this->MaxVxx(responses); break;
-		case MaxAbsVxEnum:                 this->MaxAbsVxx(responses); break;
-		case MinVyEnum:                    this->MinVyx(responses); break;
-		case MaxVyEnum:                    this->MaxVyx(responses); break;
-		case MaxAbsVyEnum:                 this->MaxAbsVyx(responses); break;
-		case MinVzEnum:                    this->MinVzx(responses); break;
-		case MaxVzEnum:                    this->MaxVzx(responses); break;
-		case MaxAbsVzEnum:                 this->MaxAbsVzx(responses); break;
-		case MassFluxEnum:                 this->MassFluxx(responses); break;
-		case SurfaceAbsVelMisfitEnum:      SurfaceAbsVelMisfitx(responses, elements,nodes, vertices, loads, materials,parameters); break;
-		case SurfaceRelVelMisfitEnum:      SurfaceRelVelMisfitx(responses, elements,nodes, vertices, loads, materials,parameters); break;
-		case SurfaceLogVelMisfitEnum:      SurfaceLogVelMisfitx(responses, elements,nodes, vertices, loads, materials,parameters); break;
-		case SurfaceLogVxVyMisfitEnum:     SurfaceLogVxVyMisfitx(responses, elements,nodes, vertices, loads, materials,parameters); break;
-		case SurfaceAverageVelMisfitEnum:  SurfaceAverageVelMisfitx(responses,this); break;
-		case ThicknessAbsMisfitEnum:       ThicknessAbsMisfitx(responses, elements,nodes, vertices, loads, materials, parameters); break;
-		case ThicknessAbsGradientEnum:     this->ThicknessAbsGradientx(responses); break;
-		case ThicknessAlongGradientEnum:   ThicknessAlongGradientx(responses, elements,nodes, vertices, loads, materials, parameters); break;
-		case ThicknessAcrossGradientEnum:  ThicknessAcrossGradientx(responses, elements,nodes, vertices, loads, materials, parameters); break;
-		case RheologyBbarAbsGradientEnum:  RheologyBbarAbsGradientx(responses, elements,nodes, vertices, loads, materials, parameters); break;
-		case DragCoefficientAbsGradientEnum:DragCoefficientAbsGradientx(responses, elements,nodes, vertices, loads, materials, parameters); break;
-		case BalancethicknessMisfitEnum:   BalancethicknessMisfitx(responses); break;
-		case TotalFloatingBmbEnum:			  this->TotalFloatingBmbx(responses); break;
-		case TotalGroundedBmbEnum:			  this->TotalGroundedBmbx(responses); break;
-		case TotalSmbEnum:					  this->TotalSmbx(responses); break;
-		case MaterialsRheologyBbarEnum:    this->ElementResponsex(responses,MaterialsRheologyBbarEnum); break;
-		case VelEnum:                      this->ElementResponsex(responses,VelEnum); break;
-		case FrictionCoefficientEnum:      NodalValuex(responses, FrictionCoefficientEnum,elements,nodes, vertices, loads, materials, parameters); break;
+		case DivergenceEnum:                     this->Divergencex(responses); break;
+		case MaxDivergenceEnum:                  this->MaxDivergencex(responses); break;
+		case IceMassEnum:                        this->IceMassx(responses, false); break;
+		case IceMassScaledEnum:                  this->IceMassx(responses, true); break;
+		case IceVolumeEnum:                      this->IceVolumex(responses, false); break;
+		case IceVolumeScaledEnum:                this->IceVolumex(responses, true); break;
+		case IceVolumeAboveFloatationEnum:       this->IceVolumeAboveFloatationx(responses, false); break;
+		case IceVolumeAboveFloatationScaledEnum: this->IceVolumeAboveFloatationx(responses, true); break;
+		case GroundedAreaEnum:                   this->GroundedAreax(responses, false); break;
+		case GroundedAreaScaledEnum:             this->GroundedAreax(responses, true); break;
+		case FloatingAreaEnum:                   this->FloatingAreax(responses, false); break;
+		case FloatingAreaScaledEnum:             this->FloatingAreax(responses, true); break;
+		case MinVelEnum:                         this->MinVelx(responses); break;
+		case MaxVelEnum:                         this->MaxVelx(responses); break;
+		case MinVxEnum:                          this->MinVxx(responses); break;
+		case MaxVxEnum:                          this->MaxVxx(responses); break;
+		case MaxAbsVxEnum:                       this->MaxAbsVxx(responses); break;
+		case MinVyEnum:                          this->MinVyx(responses); break;
+		case MaxVyEnum:                          this->MaxVyx(responses); break;
+		case MaxAbsVyEnum:                       this->MaxAbsVyx(responses); break;
+		case MinVzEnum:                          this->MinVzx(responses); break;
+		case MaxVzEnum:                          this->MaxVzx(responses); break;
+		case MaxAbsVzEnum:                       this->MaxAbsVzx(responses); break;
+		case MassFluxEnum:                       this->MassFluxx(responses); break;
+		case SurfaceAbsVelMisfitEnum:            SurfaceAbsVelMisfitx(responses, elements,nodes, vertices, loads, materials,parameters); break;
+		case SurfaceRelVelMisfitEnum:            SurfaceRelVelMisfitx(responses, elements,nodes, vertices, loads, materials,parameters); break;
+		case SurfaceLogVelMisfitEnum:            SurfaceLogVelMisfitx(responses, elements,nodes, vertices, loads, materials,parameters); break;
+		case SurfaceLogVxVyMisfitEnum:           SurfaceLogVxVyMisfitx(responses, elements,nodes, vertices, loads, materials,parameters); break;
+		case SurfaceAverageVelMisfitEnum:        SurfaceAverageVelMisfitx(responses,this); break;
+		case ThicknessAbsMisfitEnum:             ThicknessAbsMisfitx(responses, elements,nodes, vertices, loads, materials, parameters); break;
+		case ThicknessAbsGradientEnum:           this->ThicknessAbsGradientx(responses); break;
+		case ThicknessAlongGradientEnum:         ThicknessAlongGradientx(responses, elements,nodes, vertices, loads, materials, parameters); break;
+		case ThicknessAcrossGradientEnum:        ThicknessAcrossGradientx(responses, elements,nodes, vertices, loads, materials, parameters); break;
+		case RheologyBbarAbsGradientEnum:        RheologyBbarAbsGradientx(responses, elements,nodes, vertices, loads, materials, parameters); break;
+		case DragCoefficientAbsGradientEnum:     DragCoefficientAbsGradientx(responses, elements,nodes, vertices, loads, materials, parameters); break;
+		case BalancethicknessMisfitEnum:         BalancethicknessMisfitx(responses); break;
+		case TotalFloatingBmbEnum:			        this->TotalFloatingBmbx(responses, false); break;
+		case TotalFloatingBmbScaledEnum:			  this->TotalFloatingBmbx(responses, true); break;
+		case TotalGroundedBmbEnum:			        this->TotalGroundedBmbx(responses, false); break;
+		case TotalGroundedBmbScaledEnum:			  this->TotalGroundedBmbx(responses, true); break;
+		case TotalSmbEnum:					        this->TotalSmbx(responses, false); break;
+		case TotalSmbScaledEnum:					  this->TotalSmbx(responses, true); break;
+		case MaterialsRheologyBbarEnum:          this->ElementResponsex(responses,MaterialsRheologyBbarEnum); break;
+		case VelEnum:                            this->ElementResponsex(responses,VelEnum); break;
+		case FrictionCoefficientEnum:            NodalValuex(responses, FrictionCoefficientEnum,elements,nodes, vertices, loads, materials, parameters); break;
 		default: 
 			if(response_descriptor_enum>=Outputdefinition1Enum && response_descriptor_enum <=Outputdefinition100Enum){
@@ -2278,5 +2294,5 @@
 }
 /*}}}*/
-void FemModel::TotalFloatingBmbx(IssmDouble* pFbmb){/*{{{*/
+void FemModel::TotalFloatingBmbx(IssmDouble* pFbmb, bool scaled){/*{{{*/
 
 	IssmDouble local_fbmb = 0;
@@ -2285,5 +2301,5 @@
 	for(int i=0;i<this->elements->Size();i++){
 		Element* element=xDynamicCast<Element*>(this->elements->GetObjectByOffset(i));
-		local_fbmb+=element->TotalFloatingBmb();
+		local_fbmb+=element->TotalFloatingBmb(scaled);
 	}
 	ISSM_MPI_Reduce(&local_fbmb,&total_fbmb,1,ISSM_MPI_DOUBLE,ISSM_MPI_SUM,0,IssmComm::GetComm() );
@@ -2294,5 +2310,5 @@
 
 }/*}}}*/
-void FemModel::TotalGroundedBmbx(IssmDouble* pGbmb){/*{{{*/
+void FemModel::TotalGroundedBmbx(IssmDouble* pGbmb, bool scaled){/*{{{*/
 
 	IssmDouble local_gbmb = 0;
@@ -2301,5 +2317,5 @@
 	for(int i=0;i<this->elements->Size();i++){
 		Element* element=xDynamicCast<Element*>(this->elements->GetObjectByOffset(i));
-		local_gbmb+=element->TotalGroundedBmb();
+		local_gbmb+=element->TotalGroundedBmb(scaled);
 	}
 	ISSM_MPI_Reduce(&local_gbmb,&total_gbmb,1,ISSM_MPI_DOUBLE,ISSM_MPI_SUM,0,IssmComm::GetComm() );
@@ -2310,5 +2326,5 @@
 
 }/*}}}*/
-void FemModel::TotalSmbx(IssmDouble* pSmb){/*{{{*/
+void FemModel::TotalSmbx(IssmDouble* pSmb, bool scaled){/*{{{*/
 
 	IssmDouble local_smb = 0;
@@ -2317,5 +2333,5 @@
 	for(int i=0;i<this->elements->Size();i++){
 		Element* element=xDynamicCast<Element*>(this->elements->GetObjectByOffset(i));
-		local_smb+=element->TotalSmb();
+		local_smb+=element->TotalSmb(scaled);
 	}
 	ISSM_MPI_Reduce(&local_smb,&total_smb,1,ISSM_MPI_DOUBLE,ISSM_MPI_SUM,0,IssmComm::GetComm() );
