diff -crN oommf12a3/app/mmdisp/scripts/avf2ovf.tcl oommf/app/mmdisp/scripts/avf2ovf.tcl
*** oommf12a3/app/mmdisp/scripts/avf2ovf.tcl	2002-10-28 13:39:00.000000000 -0500
--- oommf/app/mmdisp/scripts/avf2ovf.tcl	2004-12-17 18:58:00.000000000 -0500
***************
*** 56,63 ****
  		}
  	    }
  	    # Relative order check
! 	    if {$args[0]>$args[3] || $args[1]>$args[4] \
! 		    || $args[2]>$args[5]} {
  		    set okaystr 0
  	    }
  	}
--- 56,64 ----
  		}
  	    }
  	    # Relative order check
! 	    if {[lindex $args 0]>[lindex $args 3] \
! 		    || [lindex $args 1]>[lindex $args 4] \
! 		    || [lindex $args 2]>[lindex $args 5]} {
  		    set okaystr 0
  	    }
  	}
***************
*** 74,81 ****
      {zmax { ClipStringCheck $xmin $ymin $zmin $xmax $ymax $zmax}
        {is maximum z}}
  } {
!     upvar #0 clipstr globalclipstr
!     set globalclipstr $clipstr
  } "\n\tClipping box (optional)"
  set clipstr {}
  
--- 75,82 ----
      {zmax { ClipStringCheck $xmin $ymin $zmin $xmax $ymax $zmax}
        {is maximum z}}
  } {
!     global clipstr
!     set clipstr [list $xmin $ymin $zmin $xmax $ymax $zmax]
  } "\n\tClipping box (optional)"
  set clipstr {}
  
diff -crN oommf12a3/app/oxs/base/mesh.cc oommf/app/oxs/base/mesh.cc
*** oommf12a3/app/oxs/base/mesh.cc	2002-10-30 17:49:23.000000000 -0500
--- oommf/app/oxs/base/mesh.cc	2004-12-17 18:58:00.000000000 -0500
***************
*** 183,201 ****
        INT4m size=Size();
        for(INT4m i=0 ; i<size ; ++i) {
  	ThreeVector loc;   Center(i,loc);
!         buf[0] = REAL4(loc.x);
! 	buf[1] = REAL4(loc.y);
! 	buf[2] = REAL4(loc.z);
  	const ThreeVector& v = (*vec)[i];
  	if(scale==NULL) {
! 	  buf[3] = REAL4(v.x);
! 	  buf[4] = REAL4(v.y);
! 	  buf[5] = REAL4(v.z);
  	} else {
  	  REAL8m tempscale=(*scale)[i];
! 	  buf[3] = REAL4(tempscale*v.x);
! 	  buf[4] = REAL4(tempscale*v.y);
! 	  buf[5] = REAL4(tempscale*v.z);
  	}
          Vf_OvfFileFormatSpecs::WriteBinary(channel,buf,6);
  	// Vf_OvfFileFormatSpecs::WriteBinary performs
--- 183,201 ----
        INT4m size=Size();
        for(INT4m i=0 ; i<size ; ++i) {
  	ThreeVector loc;   Center(i,loc);
!         buf[0] = static_cast<REAL4>(loc.x);
! 	buf[1] = static_cast<REAL4>(loc.y);
! 	buf[2] = static_cast<REAL4>(loc.z);
  	const ThreeVector& v = (*vec)[i];
  	if(scale==NULL) {
! 	  buf[3] = static_cast<REAL4>(v.x);
! 	  buf[4] = static_cast<REAL4>(v.y);
! 	  buf[5] = static_cast<REAL4>(v.z);
  	} else {
  	  REAL8m tempscale=(*scale)[i];
! 	  buf[3] = static_cast<REAL4>(tempscale*v.x);
! 	  buf[4] = static_cast<REAL4>(tempscale*v.y);
! 	  buf[5] = static_cast<REAL4>(tempscale*v.z);
  	}
          Vf_OvfFileFormatSpecs::WriteBinary(channel,buf,6);
  	// Vf_OvfFileFormatSpecs::WriteBinary performs
***************
*** 210,228 ****
        INT4m size=Size();
        for(INT4m i=0 ; i<size ; ++i) {
  	ThreeVector loc;   Center(i,loc);
!         buf[0] = REAL4(loc.x);
! 	buf[1] = REAL4(loc.y);
! 	buf[2] = REAL4(loc.z);
  	const ThreeVector& v = (*vec)[i];
  	if(scale==NULL) {
! 	  buf[3] = REAL4(v.x);
! 	  buf[4] = REAL4(v.y);
! 	  buf[5] = REAL4(v.z);
  	} else {
  	  REAL8m tempscale=(*scale)[i];
! 	  buf[3] = REAL4(tempscale*v.x);
! 	  buf[4] = REAL4(tempscale*v.y);
! 	  buf[5] = REAL4(tempscale*v.z);
  	}
          Vf_OvfFileFormatSpecs::WriteBinary(channel,buf,6);
  	// Vf_OvfFileFormatSpecs::WriteBinary performs
--- 210,228 ----
        INT4m size=Size();
        for(INT4m i=0 ; i<size ; ++i) {
  	ThreeVector loc;   Center(i,loc);
!         buf[0] = static_cast<REAL8>(loc.x);
! 	buf[1] = static_cast<REAL8>(loc.y);
! 	buf[2] = static_cast<REAL8>(loc.z);
  	const ThreeVector& v = (*vec)[i];
  	if(scale==NULL) {
! 	  buf[3] = static_cast<REAL8>(v.x);
! 	  buf[4] = static_cast<REAL8>(v.y);
! 	  buf[5] = static_cast<REAL8>(v.z);
  	} else {
  	  REAL8m tempscale=(*scale)[i];
! 	  buf[3] = static_cast<REAL8>(tempscale*v.x);
! 	  buf[4] = static_cast<REAL8>(tempscale*v.y);
! 	  buf[5] = static_cast<REAL8>(tempscale*v.z);
  	}
          Vf_OvfFileFormatSpecs::WriteBinary(channel,buf,6);
  	// Vf_OvfFileFormatSpecs::WriteBinary performs
diff -crN oommf12a3/app/oxs/base/mif.tcl oommf/app/oxs/base/mif.tcl
*** oommf12a3/app/oxs/base/mif.tcl	2002-10-29 16:09:00.000000000 -0500
--- oommf/app/oxs/base/mif.tcl	2004-12-17 18:58:00.000000000 -0500
***************
*** 201,208 ****
  	
  	    # Set up the schedule
  append script "
! 	    Oxs_Schedule Set $o $d Frequency $e $f
! 	    Oxs_Schedule Set $o $d Active $e 1
  "
  	}
  eval $script
--- 201,208 ----
  	
  	    # Set up the schedule
  append script "
!             [list Oxs_Schedule Set $o $d Frequency $e $f]
!             [list Oxs_Schedule Set $o $d Active $e 1]
  "
  	}
  eval $script
diff -crN oommf12a3/app/oxs/base/oxs.cc oommf/app/oxs/base/oxs.cc
*** oommf12a3/app/oxs/base/oxs.cc	2002-01-30 21:40:15.000000000 -0500
--- oommf/app/oxs/base/oxs.cc	2004-12-17 18:58:00.000000000 -0500
***************
*** 6,11 ****
--- 6,12 ----
  
  #include "oc.h"
  #include "nb.h"
+ #include "vf.h"
  #include "oxs.h"
  
  #include "director.h"
***************
*** 126,131 ****
--- 127,142 ----
      }
      Tcl_StaticPackage(interp, ab("Nb"), Nb_Init, NULL);
  
+     if (Vf_Init(interp) == TCL_ERROR) {
+         Tcl_DStringInit(&buf);
+         Tcl_DStringAppend(&buf, ab("Oc_Log Log"), -1);
+         Tcl_DStringAppendElement(&buf, Tcl_GetStringResult(interp));
+         Tcl_DStringAppendElement(&buf, ab("error"));
+         Tcl_Eval(interp, Tcl_DStringValue(&buf));
+         Tcl_DStringFree(&buf);
+     }
+     Tcl_StaticPackage(interp, ab("Vf"), Vf_Init, NULL);
+ 
      if (Oxs_Init(interp) != TCL_OK) {
          Tcl_DStringInit(&buf);
          Tcl_DStringAppend(&buf,Oc_AutoBuf("Oc_Log Log"),-1);
diff -crN oommf12a3/app/oxs/base/util.cc oommf/app/oxs/base/util.cc
*** oommf12a3/app/oxs/base/util.cc	2002-04-05 19:29:23.000000000 -0500
--- oommf/app/oxs/base/util.cc	2004-12-17 18:58:00.000000000 -0500
***************
*** 81,113 ****
    delete[] arr;
  }
  
! OxsTclObjConstPtrConstRef Oxs_TclObjArray::operator[](int index) const
  {
  #ifndef NDEBUG
    if(index>=size || index<0) {
      char buf[512];
      Oc_Snprintf(buf,sizeof(buf),
! 		"const Tcl_Obj*& Oxs_TclObjArray::operator[] const: "
  		"Array out-of-bounds; index=%d, size=%d",
  		index,size);
      OXS_THROW(Oxs_BadIndex,buf);
    }
  #endif
!   return static_cast<OxsTclObjConstPtrConstRef>(arr[index]);
!   /// Brute-force the cast, which assumes that there is no storage
!   /// difference between TclObj* and const TclObj*, at least in
!   /// the indicated direction.  This cast is needed by some compilers,
!   /// which otherwise return a reference to a temporary, which is
!   /// definitely *not* what we want!
  }
  
! OxsTclObjPtrRef Oxs_TclObjArray::operator[](int index)
  {
  #ifndef NDEBUG
    if(index>=size || index<0) {
      char buf[512];
      Oc_Snprintf(buf,sizeof(buf),
! 		"Tcl_Obj*& Oxs_TclObjArray::operator[]: "
  		"Array out-of-bounds; index=%d, size=%d",
  		index,size);
      OXS_THROW(Oxs_BadIndex,buf);
--- 81,108 ----
    delete[] arr;
  }
  
! OxsTclObjPtr& Oxs_TclObjArray::operator[](int index)
  {
  #ifndef NDEBUG
    if(index>=size || index<0) {
      char buf[512];
      Oc_Snprintf(buf,sizeof(buf),
! 		"Tcl_Obj*& Oxs_TclObjArray::operator[]: "
  		"Array out-of-bounds; index=%d, size=%d",
  		index,size);
      OXS_THROW(Oxs_BadIndex,buf);
    }
  #endif
!   return arr[index];
  }
  
! const OxsTclObjPtr& Oxs_TclObjArray::operator[](int index) const
  {
  #ifndef NDEBUG
    if(index>=size || index<0) {
      char buf[512];
      Oc_Snprintf(buf,sizeof(buf),
! 		"const Tcl_Obj*& Oxs_TclObjArray::operator[] const: "
  		"Array out-of-bounds; index=%d, size=%d",
  		index,size);
      OXS_THROW(Oxs_BadIndex,buf);
***************
*** 136,142 ****
    Tcl_Obj* obj = arr[index];
    if (Tcl_IsShared(obj)) {
      Tcl_Obj* tmp = obj;
!     obj = Tcl_DuplicateObj(obj); // Create copy to write on
      Tcl_IncrRefCount(obj);
      Tcl_DecrRefCount(tmp);
    }
--- 131,137 ----
    Tcl_Obj* obj = arr[index];
    if (Tcl_IsShared(obj)) {
      Tcl_Obj* tmp = obj;
!     arr[index] = obj = Tcl_DuplicateObj(obj); // Create copy to write on
      Tcl_IncrRefCount(obj);
      Tcl_DecrRefCount(tmp);
    }
***************
*** 167,173 ****
    Tcl_Obj* obj = arr[index];
    if (Tcl_IsShared(obj)) {
      Tcl_Obj* tmp = obj;
!     obj = Tcl_DuplicateObj(obj); // Create copy to write on
      Tcl_IncrRefCount(obj);
      Tcl_DecrRefCount(tmp);
    }
--- 162,168 ----
    Tcl_Obj* obj = arr[index];
    if (Tcl_IsShared(obj)) {
      Tcl_Obj* tmp = obj;
!     arr[index] = obj = Tcl_DuplicateObj(obj); // Create copy to write on
      Tcl_IncrRefCount(obj);
      Tcl_DecrRefCount(tmp);
    }
***************
*** 190,196 ****
    Tcl_Obj* obj = arr[index];
    if (Tcl_IsShared(obj)) {
      Tcl_Obj* tmp = obj;
!     obj = Tcl_DuplicateObj(obj); // Create copy to write on
      Tcl_IncrRefCount(obj);
      Tcl_DecrRefCount(tmp);
    }
--- 185,191 ----
    Tcl_Obj* obj = arr[index];
    if (Tcl_IsShared(obj)) {
      Tcl_Obj* tmp = obj;
!     arr[index] = obj = Tcl_DuplicateObj(obj); // Create copy to write on
      Tcl_IncrRefCount(obj);
      Tcl_DecrRefCount(tmp);
    }
***************
*** 213,219 ****
    Tcl_Obj* obj = arr[index];
    if (Tcl_IsShared(obj)) {
      Tcl_Obj* tmp = obj;
!     obj = Tcl_DuplicateObj(obj); // Create copy to write on
      Tcl_IncrRefCount(obj);
      Tcl_DecrRefCount(tmp);
    }
--- 208,214 ----
    Tcl_Obj* obj = arr[index];
    if (Tcl_IsShared(obj)) {
      Tcl_Obj* tmp = obj;
!     arr[index] = obj = Tcl_DuplicateObj(obj); // Create copy to write on
      Tcl_IncrRefCount(obj);
      Tcl_DecrRefCount(tmp);
    }
diff -crN oommf12a3/app/oxs/base/util.h oommf/app/oxs/base/util.h
*** oommf12a3/app/oxs/base/util.h	2002-07-08 20:51:30.000000000 -0400
--- oommf/app/oxs/base/util.h	2004-12-17 18:58:00.000000000 -0500
***************
*** 48,56 ****
  ////////////////////////////////////////////////////////////////////////
  // Wrapper for Tcl_Obj**
  typedef Tcl_Obj* OxsTclObjPtr;
- typedef OxsTclObjPtr& OxsTclObjPtrRef;
- typedef const Tcl_Obj* OxsTclObjConstPtr;
- typedef OxsTclObjConstPtr const & OxsTclObjConstPtrConstRef;
  class Oxs_TclObjArray
  {
  private:
--- 48,53 ----
***************
*** 60,71 ****
    Oxs_TclObjArray(int arrsize);
    ~Oxs_TclObjArray();
  
!   OxsTclObjPtrRef operator[](int index);
!   OxsTclObjConstPtrConstRef operator[](int index) const;
!   /// It is not entirely clear to me whether the latter should return a
!   /// constant reference to a constant pointer, or a constant reference
!   /// to a non-constant pointer.  We'll try the more restrictive
!   /// approach first. -mjd, 19-Feb-2002.
  
    int Size() const { return size; }
    Tcl_Obj** Array() { return arr; }
--- 57,64 ----
    Oxs_TclObjArray(int arrsize);
    ~Oxs_TclObjArray();
  
!   OxsTclObjPtr& operator[](int index);
!   const OxsTclObjPtr& operator[](int index) const;
  
    int Size() const { return size; }
    Tcl_Obj** Array() { return arr; }
diff -crN oommf12a3/app/oxs/boxsi.tcl oommf/app/oxs/boxsi.tcl
*** oommf12a3/app/oxs/boxsi.tcl	2002-10-29 16:32:05.000000000 -0500
--- oommf/app/oxs/boxsi.tcl	2004-12-17 18:58:00.000000000 -0500
***************
*** 797,802 ****
--- 797,803 ----
      # Now that connections to servers are established, it's safe
      # to process options and possibly start computing.
      uplevel #0 {Oc_CommandLine Parse $argv}
+     global nice
      if {$nice} {
  	Oc_MakeNice
      }
diff -crN oommf12a3/app/oxs/ext/atlasscalarfield.cc oommf/app/oxs/ext/atlasscalarfield.cc
*** oommf12a3/app/oxs/ext/atlasscalarfield.cc	2002-03-20 19:21:44.000000000 -0500
--- oommf/app/oxs/ext/atlasscalarfield.cc	2004-12-17 18:58:00.000000000 -0500
***************
*** 40,50 ****
    OxsASFSpecifiedValue default_value;
    if(HasInitValue("default_value")) {
      default_value.value=GetRealInitValue("default_value");
!     default_value.isset=1;
    }
  
    // Fill out value vector with default_value.  This is essentially
!   // an empty padding if default.isset==0.
    unsigned int i;
    for(i=0;i<atlas_obj->GetRegionCount();i++) {
      values.push_back(default_value);
--- 40,50 ----
    OxsASFSpecifiedValue default_value;
    if(HasInitValue("default_value")) {
      default_value.value=GetRealInitValue("default_value");
!     default_value.value_is_set=1;
    }
  
    // Fill out value vector with default_value.  This is essentially
!   // an empty padding if default.value_is_set==0.
    unsigned int i;
    for(i=0;i<atlas_obj->GetRegionCount();i++) {
      values.push_back(default_value);
***************
*** 86,92 ****
  		  value.c_str(),name.c_str());
        throw Oxs_Ext::Error(this,buf);
      } else {
!       values[region_id].isset = 1;
      }
    }
    DeleteInitValue("values");
--- 86,92 ----
  		  value.c_str(),name.c_str());
        throw Oxs_Ext::Error(this,buf);
      } else {
!       values[region_id].value_is_set = 1;
      }
    }
    DeleteInitValue("values");
***************
*** 102,108 ****
  {
    const Oxs_Atlas* atlas = atlas_key.GetPtr();
    INT4m id = atlas->GetRegionId(pt);
!   if(!values[id].isset) {
      char buf[1024];
      string regionname;
      atlas->GetRegionName(id,regionname);
--- 102,108 ----
  {
    const Oxs_Atlas* atlas = atlas_key.GetPtr();
    INT4m id = atlas->GetRegionId(pt);
!   if(!values[id].value_is_set) {
      char buf[1024];
      string regionname;
      atlas->GetRegionName(id,regionname);
diff -crN oommf12a3/app/oxs/ext/atlasscalarfield.h oommf/app/oxs/ext/atlasscalarfield.h
*** oommf12a3/app/oxs/ext/atlasscalarfield.h	2002-03-21 15:05:10.000000000 -0500
--- oommf/app/oxs/ext/atlasscalarfield.h	2004-12-17 18:58:00.000000000 -0500
***************
*** 21,29 ****
  // Struct for use inside Oxs_AtlasScalarField class only.
  // Defined outside that class to please MSVC++ 5.0.
  struct OxsASFSpecifiedValue {
!   BOOL isset;
    REAL8m value;
!   OxsASFSpecifiedValue() : isset(0), value(0.) {}
  };
  // The next 3 operators are defined so MSVC++ 5.0 will accept
  // vector<OxsASFSpecifiedValue>, but are left undefined because
--- 21,29 ----
  // Struct for use inside Oxs_AtlasScalarField class only.
  // Defined outside that class to please MSVC++ 5.0.
  struct OxsASFSpecifiedValue {
!   BOOL value_is_set;
    REAL8m value;
!   OxsASFSpecifiedValue() : value_is_set(0), value(0.) {}
  };
  // The next 3 operators are defined so MSVC++ 5.0 will accept
  // vector<OxsASFSpecifiedValue>, but are left undefined because
diff -crN oommf12a3/app/oxs/ext/atlasvectorfield.cc oommf/app/oxs/ext/atlasvectorfield.cc
*** oommf12a3/app/oxs/ext/atlasvectorfield.cc	2002-03-20 19:21:44.000000000 -0500
--- oommf/app/oxs/ext/atlasvectorfield.cc	2004-12-17 18:58:00.000000000 -0500
***************
*** 47,58 ****
    OxsAVFSpecifiedValue default_value;
    if(HasInitValue("default_value")) {
      default_value.value = GetThreeVectorInitValue("default_value");
!     default_value.isset = 1;
      if(set_norm) default_value.value.SetMag(norm);
    }
  
    // Fill out value vector with default_value.  This is essentially
!   // an empty padding if default.isset==0.
    unsigned int i;
    for(i=0;i<atlas_obj->GetRegionCount();i++) {
      values.push_back(default_value);
--- 47,58 ----
    OxsAVFSpecifiedValue default_value;
    if(HasInitValue("default_value")) {
      default_value.value = GetThreeVectorInitValue("default_value");
!     default_value.value_is_set = 1;
      if(set_norm) default_value.value.SetMag(norm);
    }
  
    // Fill out value vector with default_value.  This is essentially
!   // an empty padding if default.value_is_set==0.
    unsigned int i;
    for(i=0;i<atlas_obj->GetRegionCount();i++) {
      values.push_back(default_value);
***************
*** 98,104 ****
  		  name.c_str(),atlas_obj->InstanceName());
        throw Oxs_Ext::Error(this,buf);
      } else {
!       values[region_id].isset = 1;
      }
    }
    DeleteInitValue("values");
--- 98,104 ----
  		  name.c_str(),atlas_obj->InstanceName());
        throw Oxs_Ext::Error(this,buf);
      } else {
!       values[region_id].value_is_set = 1;
      }
    }
    DeleteInitValue("values");
***************
*** 116,122 ****
  {
    const Oxs_Atlas* atlas = atlas_key.GetPtr();
    INT4m id = atlas->GetRegionId(pt);
!   if(!values[id].isset) {
      char buf[1024];
      string regionname;
      atlas->GetRegionName(id,regionname);
--- 116,122 ----
  {
    const Oxs_Atlas* atlas = atlas_key.GetPtr();
    INT4m id = atlas->GetRegionId(pt);
!   if(!values[id].value_is_set) {
      char buf[1024];
      string regionname;
      atlas->GetRegionName(id,regionname);
diff -crN oommf12a3/app/oxs/ext/atlasvectorfield.h oommf/app/oxs/ext/atlasvectorfield.h
*** oommf12a3/app/oxs/ext/atlasvectorfield.h	2002-03-21 15:05:10.000000000 -0500
--- oommf/app/oxs/ext/atlasvectorfield.h	2004-12-17 18:58:00.000000000 -0500
***************
*** 21,29 ****
  // Struct for use inside Oxs_AtlasVectorField class only.
  // Defined outside that class to please MSVC++ 5.0.
  struct OxsAVFSpecifiedValue {
!   BOOL isset;
    ThreeVector value;
!   OxsAVFSpecifiedValue() : isset(0), value(0.,0.,0.) {}
  };
  // The next 3 operators are defined so MSVC++ 5.0 will accept
  // vector<OxsAVFSpecifiedValue>, but are left undefined because
--- 21,29 ----
  // Struct for use inside Oxs_AtlasVectorField class only.
  // Defined outside that class to please MSVC++ 5.0.
  struct OxsAVFSpecifiedValue {
!   BOOL value_is_set;
    ThreeVector value;
!   OxsAVFSpecifiedValue() : value_is_set(0), value(0.,0.,0.) {}
  };
  // The next 3 operators are defined so MSVC++ 5.0 will accept
  // vector<OxsAVFSpecifiedValue>, but are left undefined because
diff -crN oommf12a3/app/oxs/ext/rectangularmesh.cc oommf/app/oxs/ext/rectangularmesh.cc
*** oommf12a3/app/oxs/ext/rectangularmesh.cc	2002-09-12 01:52:08.000000000 -0400
--- oommf/app/oxs/ext/rectangularmesh.cc	2004-12-17 18:58:00.000000000 -0500
***************
*** 383,396 ****
        for(INT4m i=0 ; i<size ; ++i) {
          const ThreeVector& v = (*vec)[i];
          if(scale==NULL) {
!           buf[0] = REAL4(v.x);
!           buf[1] = REAL4(v.y);
!           buf[2] = REAL4(v.z);
          } else {
            REAL8m tempscale=(*scale)[i];
!           buf[0] = REAL4(tempscale*v.x);
!           buf[1] = REAL4(tempscale*v.y);
!           buf[2] = REAL4(tempscale*v.z);
          }
          Vf_OvfFileFormatSpecs::WriteBinary(channel,buf,3);
          // Vf_OvfFileFormatSpecs::WriteBinary performs
--- 383,396 ----
        for(INT4m i=0 ; i<size ; ++i) {
          const ThreeVector& v = (*vec)[i];
          if(scale==NULL) {
!           buf[0] = static_cast<REAL4>(v.x);
!           buf[1] = static_cast<REAL4>(v.y);
!           buf[2] = static_cast<REAL4>(v.z);
          } else {
            REAL8m tempscale=(*scale)[i];
!           buf[0] = static_cast<REAL4>(tempscale*v.x);
!           buf[1] = static_cast<REAL4>(tempscale*v.y);
!           buf[2] = static_cast<REAL4>(tempscale*v.z);
          }
          Vf_OvfFileFormatSpecs::WriteBinary(channel,buf,3);
          // Vf_OvfFileFormatSpecs::WriteBinary performs
***************
*** 406,419 ****
        for(INT4m i=0 ; i<size ; ++i) {
          const ThreeVector& v = (*vec)[i];
          if(scale==NULL) {
!           buf[0] = REAL4(v.x);
!           buf[1] = REAL4(v.y);
!           buf[2] = REAL4(v.z);
          } else {
            REAL8m tempscale=(*scale)[i];
!           buf[0] = REAL4(tempscale*v.x);
!           buf[1] = REAL4(tempscale*v.y);
!           buf[2] = REAL4(tempscale*v.z);
          }
          Vf_OvfFileFormatSpecs::WriteBinary(channel,buf,3);
          // Vf_OvfFileFormatSpecs::WriteBinary performs
--- 406,419 ----
        for(INT4m i=0 ; i<size ; ++i) {
          const ThreeVector& v = (*vec)[i];
          if(scale==NULL) {
!           buf[0] = static_cast<REAL8>(v.x);
!           buf[1] = static_cast<REAL8>(v.y);
!           buf[2] = static_cast<REAL8>(v.z);
          } else {
            REAL8m tempscale=(*scale)[i];
!           buf[0] = static_cast<REAL8>(tempscale*v.x);
!           buf[1] = static_cast<REAL8>(tempscale*v.y);
!           buf[2] = static_cast<REAL8>(tempscale*v.z);
          }
          Vf_OvfFileFormatSpecs::WriteBinary(channel,buf,3);
          // Vf_OvfFileFormatSpecs::WriteBinary performs
diff -crN oommf12a3/app/oxs/ext/uzeeman.cc oommf/app/oxs/ext/uzeeman.cc
*** oommf12a3/app/oxs/ext/uzeeman.cc	2002-06-18 23:36:00.000000000 -0400
--- oommf/app/oxs/ext/uzeeman.cc	2004-12-17 18:58:00.000000000 -0500
***************
*** 65,79 ****
  		  i,hrange[i].c_str());
        throw Oxs_Ext::Error(this,buf);
      }
!     h0*=hmult;
!     h1*=hmult;
!     if(step_count==0 || Happ.size()==0 || Happ.back()!=h0 ) {
        Happ.push_back(h0);
      }
!     for(UINT4m j=1;j<=step_count;j++) {
!       REAL8m t = REAL8m(j)/REAL8m(step_count);
        Happ.push_back(((1-t)*h0) + (t*h1));
      }
    }
    DeleteInitValue("Hrange");
    VerifyAllInitArgsUsed();
--- 65,98 ----
  		  i,hrange[i].c_str());
        throw Oxs_Ext::Error(this,buf);
      }
!     // Note: There is a potential problem comparing Happ.back() to h0 if
!     //  any floating point operations have occured on either.  If those
!     //  operations are not exactly the same, there may be differences in
!     //  round-off error.  Even if they are written the same in the source
!     //  code, if the compiler is given license to re-order floating point
!     //  ops, then the results may differ.  Also, there may be differences
!     //  between values loaded from memory and those stored in registers.
!     //  The code below attempts to work around these issues.
!     if(step_count==0 || Happ.size()==0) {
        Happ.push_back(h0);
+     } else {
+       ThreeVector last_h1 = Happ.back();
+       if(fabs(last_h1.x-h0.x)>fabs(h0.x)*REAL8_EPSILON*2
+ 	 || fabs(last_h1.y-h0.y)>fabs(h0.y)*REAL8_EPSILON*2
+ 	 || fabs(last_h1.z-h0.z)>fabs(h0.z)*REAL8_EPSILON*2) {
+ 	Happ.push_back(h0);
+       }
      }
!     for(UINT4m j=1;j<step_count;j++) {
!       REAL8m t = static_cast<REAL8m>(j)/static_cast<REAL8m>(step_count);
        Happ.push_back(((1-t)*h0) + (t*h1));
      }
+     if(step_count>0) Happ.push_back(h1);
+   }
+   vector<ThreeVector>::iterator it = Happ.begin();
+   while(it!=Happ.end()) {
+     *it *= hmult;
+     ++it;
    }
    DeleteInitValue("Hrange");
    VerifyAllInitArgsUsed();
diff -crN oommf12a3/app/pimake/platform.tcl oommf/app/pimake/platform.tcl
*** oommf12a3/app/pimake/platform.tcl	2001-01-23 15:21:33.000000000 -0500
--- oommf/app/pimake/platform.tcl	2004-12-17 18:51:36.000000000 -0500
***************
*** 247,252 ****
--- 247,256 ----
          if {[llength $args]} {
              return -code error "Expected option, but saw '[lindex $args 0]'"
          }
+         # Workaround for ${DBGX} values sprinkled in old broken
+         # tclConfig.sh and tkConfig.sh files.
+         regsub -all {\${DBGX}} $linkcmd {} linkcmd
+         #
          if {[catch {eval Oc_Exec Foreground $linkcmd} msg]} {
              global errorCode
              set ec $errorCode
diff -crN oommf12a3/config/cache/wintel.tcl oommf/config/cache/wintel.tcl
*** oommf12a3/config/cache/wintel.tcl	2002-10-30 20:31:44.000000000 -0500
--- oommf/config/cache/wintel.tcl	2004-12-17 18:58:00.000000000 -0500
***************
*** 134,145 ****
      # The program to run on this platform to create a single library file out
      # of many object files.
      # Microsoft Visual C++'s library maker
!     $config SetValue program_libmaker {lib}
  
      # The program to run on this platform to link together object files and
      # library files to create an executable binary.
      # Microsoft Visual C++'s linker
!     $config SetValue program_linker {link /DEBUG}
  
  } elseif {[string match icl $ccbasename]} {
      # ... for Intel C++
--- 134,147 ----
      # The program to run on this platform to create a single library file out
      # of many object files.
      # Microsoft Visual C++'s library maker
!     $config SetValue program_libmaker {link /lib}
!     # If your link doesn't accept the /lib option, try this instead:
!     # $config SetValue program_libmaker {lib}
  
      # The program to run on this platform to link together object files and
      # library files to create an executable binary.
      # Microsoft Visual C++'s linker
!     $config SetValue program_linker {link}
  
  } elseif {[string match icl $ccbasename]} {
      # ... for Intel C++
***************
*** 245,253 ****
  unset ccbasename
  
  # Library making option processing...
! set libbasename [file tail [lindex [$config GetValue program_libmaker] 0]]
! if {[string match lib $libbasename]} {
!     # ...for Microsoft VC++ lib
      $config SetValue program_libmaker_option_obj {format \"%s\"}
      $config SetValue program_libmaker_option_out {format "\"/OUT:%s\""}
  } elseif {[string match xilib $libbasename]} {
--- 247,259 ----
  unset ccbasename
  
  # Library making option processing...
! if {[catch {$config GetValue program_libmaker} libbasename]} {
!     set libbasename {}  ;# No librarian specified
! } else {
!     set libbasename [file tail [lindex $libbasename 0]]
! }
! if {[string match lib $libbasename] || [string match link $libbasename]} {
!     # ...for Microsoft VC++ lib or "link /lib"
      $config SetValue program_libmaker_option_obj {format \"%s\"}
      $config SetValue program_libmaker_option_out {format "\"/OUT:%s\""}
  } elseif {[string match xilib $libbasename]} {
diff -crN oommf12a3/pkg/nb/evoc.cc oommf/pkg/nb/evoc.cc
*** oommf12a3/pkg/nb/evoc.cc	2002-10-25 16:49:02.000000000 -0400
--- oommf/pkg/nb/evoc.cc	2004-12-17 18:58:00.000000000 -0500
***************
*** 4,10 ****
   *
   * NOTICE: Please see the file ../../LICENSE
   *
!  * Last modified on: $Date: 2002/10/25 20:49:02 $
   * Last modified by: $Author: donahue $
   */
  
--- 4,10 ----
   *
   * NOTICE: Please see the file ../../LICENSE
   *
!  * Last modified on: $Date: 2002/11/18 19:44:17 $
   * Last modified by: $Author: donahue $
   */
  
***************
*** 437,447 ****
  // smaller than the last then a wrap-around of 1 period is assumed.
  // This will not work properly if the time between calls to this
  // function is larger than the wrap-around period.  For an 4-byte wide
! // clock_t with CLOCKS_PER_SECOND at 1024, the time to overflow is
! // about 48.5 days (Windows NT).  With CLOCKS_PER_SECOND at 1000000
  // overflow time is just over 71 minutes (Linux/x86).  OTOH, an 8-byte
  // wide clock_t with a nanosecond tick rate takes over 584 years to
! // overflow.  NOTE 1: Even though CLOCKS_PER_SECOND is 1e6 on
  // Linux/x86, the granularity of all user-accessible clocks appears to
  // be only 1/100 seconds (=1/CLK_TCK).  On Linux/AXP, CLK_TCK is 1000
  // (and clock_t is 8 bytes wide). NOTE 2: The wrap around periods are
--- 437,447 ----
  // smaller than the last then a wrap-around of 1 period is assumed.
  // This will not work properly if the time between calls to this
  // function is larger than the wrap-around period.  For an 4-byte wide
! // clock_t with CLOCKS_PER_SEC at 1024, the time to overflow is
! // about 48.5 days (Windows NT).  With CLOCKS_PER_SEC at 1000000
  // overflow time is just over 71 minutes (Linux/x86).  OTOH, an 8-byte
  // wide clock_t with a nanosecond tick rate takes over 584 years to
! // overflow.  NOTE 1: Even though CLOCKS_PER_SEC is 1e6 on
  // Linux/x86, the granularity of all user-accessible clocks appears to
  // be only 1/100 seconds (=1/CLK_TCK).  On Linux/AXP, CLK_TCK is 1000
  // (and clock_t is 8 bytes wide). NOTE 2: The wrap around periods are
***************
*** 467,474 ****
  
  ///// TEMPORARY MACROS, TO BE FIXED UP BY DGP ////////////////////
  #if !defined(NO_CLOCKS) && (SYSTEM_TYPE != WINDOWS)
! #  if !defined(CLK_TCK) && defined(HZ)
! #    define CLK_TCK HZ
  #  endif
  #  ifdef CLK_TCK
  #    define HAS_TIMES
--- 467,478 ----
  
  ///// TEMPORARY MACROS, TO BE FIXED UP BY DGP ////////////////////
  #if !defined(NO_CLOCKS) && (SYSTEM_TYPE != WINDOWS)
! #  ifndef CLK_TCK
! #    ifdef _SC_CLK_TCK
!        static const long CLK_TCK = sysconf(_SC_CLK_TCK);
! #    elif defined(HZ)
! #      define CLK_TCK HZ
! #    endif
  #  endif
  #  ifdef CLK_TCK
  #    define HAS_TIMES
***************
*** 526,532 ****
  # ifdef HAS_CLOCK
    static Oc_TimeVal cpu_accum(CLOCKS_PER_SEC,(unsigned long)clock_t(-1));
    static Oc_TimeVal cpu_last(CLOCKS_PER_SEC,(unsigned long)clock_t(-1));
!   static Oc_TimeVal cpu_now(CLK_TCK,(unsigned long)clock_t(-1));
    cpu_now.ticks=clock();
    cpu_now.overflow=cpu_last.overflow;
    if(cpu_now.ticks<cpu_last.ticks) cpu_now.overflow++;
--- 530,536 ----
  # ifdef HAS_CLOCK
    static Oc_TimeVal cpu_accum(CLOCKS_PER_SEC,(unsigned long)clock_t(-1));
    static Oc_TimeVal cpu_last(CLOCKS_PER_SEC,(unsigned long)clock_t(-1));
!   static Oc_TimeVal cpu_now(CLOCKS_PER_SEC,(unsigned long)clock_t(-1));
    cpu_now.ticks=clock();
    cpu_now.overflow=cpu_last.overflow;
    if(cpu_now.ticks<cpu_last.ticks) cpu_now.overflow++;
diff -crN oommf12a3/pkg/oc/custom.tcl oommf/pkg/oc/custom.tcl
*** oommf12a3/pkg/oc/custom.tcl	2001-10-17 22:12:37.000000000 -0400
--- oommf/pkg/oc/custom.tcl	2004-12-17 18:58:00.000000000 -0500
***************
*** 2,9 ****
  #
  #	OOMMF core provided customizations to Tcl/Tk
  #
! # Last modified on: $Date: 2001/10/18 02:12:37 $
! # Last modified by: $Author: donahue $
  #
  # This file provides some customization/extensions to Tcl/Tk that
  # are common across the OOMMF project.
--- 2,9 ----
  #
  #	OOMMF core provided customizations to Tcl/Tk
  #
! # Last modified on: $Date: 2003/03/19 16:05:35 $
! # Last modified by: $Author: dgp $
  #
  # This file provides some customization/extensions to Tcl/Tk that
  # are common across the OOMMF project.
***************
*** 147,158 ****
  		    foreach {_ pkg} $pair {break}
  		    set ver [package provide $pkg]
  		    if {[catch {package vcompare $ver $ver}]} {
! 			# Attempt to work around broken [info loaded] that
! 			# doesn't return proper package names
  			set ver [package provide [string tolower $pkg]]
  			if {[catch {package vcompare $ver $ver}]} {
- 			    Oc_Log Log "Bad package $pkg: loaded, but not\
- 				    provided." warning
  			    continue
  			}
  		    }
--- 147,157 ----
  		    foreach {_ pkg} $pair {break}
  		    set ver [package provide $pkg]
  		    if {[catch {package vcompare $ver $ver}]} {
! 			# Attempt to work around [info loaded] misfeature that
! 			# "package" names returned are not [package] names.
! 			# Grrrrr......
  			set ver [package provide [string tolower $pkg]]
  			if {[catch {package vcompare $ver $ver}]} {
  			    continue
  			}
  		    }
diff -crN oommf12a3/pkg/oc/main.tcl oommf/pkg/oc/main.tcl
*** oommf12a3/pkg/oc/main.tcl	2002-09-11 21:01:05.000000000 -0400
--- oommf/pkg/oc/main.tcl	2004-12-17 18:58:00.000000000 -0500
***************
*** 41,47 ****
              proc exit args "[list eval $class Exit] \$args"
  	}
  	global argv0 env auto_path
! 	if {[info exists env(OOMMF_ROOT)]} {
  	    set appPath [Oc_DirectPathname [file join [pwd] $argv0]]
  	    set root [Oc_DirectPathname $env(OOMMF_ROOT)]
  	    foreach re [file split $root] ape [file split $appPath] {
--- 41,47 ----
              proc exit args "[list eval $class Exit] \$args"
  	}
  	global argv0 env auto_path
! 	if {[info exists env(OOMMF_ROOT)] && [info exists argv0]} {
  	    set appPath [Oc_DirectPathname [file join [pwd] $argv0]]
  	    set root [Oc_DirectPathname $env(OOMMF_ROOT)]
  	    foreach re [file split $root] ape [file split $appPath] {
diff -crN oommf12a3/pkg/oc/tempfile.tcl oommf/pkg/oc/tempfile.tcl
*** oommf12a3/pkg/oc/tempfile.tcl	2000-08-25 13:01:25.000000000 -0400
--- oommf/pkg/oc/tempfile.tcl	2004-12-17 18:58:00.000000000 -0500
***************
*** 12,18 ****
      # This proc is now unused -- its contents should be migrated into
      # suitable configuration feature rules.
      private proc DefaultDirectory {} {
!         global tcl_platform
          set result "."       ;# In case all else fails
          if {[string match windows $tcl_platform(platform)]} {
              if {[info exists env(TEMP)] && [file isdirectory $env(TEMP)] \
--- 12,18 ----
      # This proc is now unused -- its contents should be migrated into
      # suitable configuration feature rules.
      private proc DefaultDirectory {} {
!         global tcl_platform env
          set result "."       ;# In case all else fails
          if {[string match windows $tcl_platform(platform)]} {
              if {[info exists env(TEMP)] && [file isdirectory $env(TEMP)] \
diff -crN oommf12a3/pkg/ow/entryscale.tcl oommf/pkg/ow/entryscale.tcl
*** oommf12a3/pkg/ow/entryscale.tcl	2002-10-23 17:52:18.000000000 -0400
--- oommf/pkg/ow/entryscale.tcl	2004-12-17 18:58:00.000000000 -0500
***************
*** 491,503 ****
      private method UpdateMarkList {} {
  	if {[string match {} $winscale]} { return }
  
- 	# First hide all markwindows
- 	set markwindows [winfo children $winscale]
- 	foreach win $markwindows {
- 	    place forget $win
- 	}
- 
  	# Delete any excess mark windows
  	if {[llength $markwindows] > [llength $marklist]} {
  	    # Remove extra windows from end.  We have to disable
  	    # <Configure> bindings on $winscale because otherwise Tk
--- 491,498 ----
      private method UpdateMarkList {} {
  	if {[string match {} $winscale]} { return }
  
  	# Delete any excess mark windows
+ 	set markwindows [winfo children $winscale]
  	if {[llength $markwindows] > [llength $marklist]} {
  	    # Remove extra windows from end.  We have to disable
  	    # <Configure> bindings on $winscale because otherwise Tk
***************
*** 543,552 ****
  	}
  	set id 0
  	foreach mark $slist {
! 	    if {$mark<$scalemin || $mark>$scalemax} { continue }
! 	    set xpos [lindex [$winscale coords $mark] 0]
! 	    place $winscale.mark$id \
! 		    -x $xpos -y 0 -relheight 1 -anchor $anchor
  	    incr id
  	}
      }
--- 538,550 ----
  	}
  	set id 0
  	foreach mark $slist {
! 	    if {$mark<$scalemin || $mark>$scalemax} {
! 		place forget $winscale.mark$id
! 	    } else {
! 		set xpos [lindex [$winscale coords $mark] 0]
! 		place $winscale.mark$id \
! 			-x $xpos -y 0 -relheight 1 -anchor $anchor
! 	    }
  	    incr id
  	}
      }
diff -crN oommf12a3/pkg/ow/procs.tcl oommf/pkg/ow/procs.tcl
*** oommf12a3/pkg/ow/procs.tcl	2001-07-02 03:36:40.000000000 -0400
--- oommf/pkg/ow/procs.tcl	2004-12-17 18:58:00.000000000 -0500
***************
*** 459,464 ****
--- 459,467 ----
  # Routines to push/pop watch cursor onto all currently
  # existing toplevel windows.
  #
+ frame .owhiddencursorframe -cursor watch ;# Leave this unmapped;
+ ## the purpose is just to hold a reference to the watch cursor
+ ## as a workaround to an apparent X memory leak.
  set _watch_cursor_count 0
  set _watch_cursor_safetyid {}
  proc Ow_PushWatchCursor {} {
diff -crN oommf12a3/pkg/oc/commandline.tcl oommf/pkg/oc/commandline.tcl
*** oommf12a3/pkg/oc/commandline.tcl	Mon Oct 28 20:25:00 2002
--- oommf/pkg/oc/commandline.tcl	Thu Jun  1 14:34:45 2006
***************
*** 319,325 ****
  	    set code [catch {eval _${class}_HandleOption $save($opt)} result]
  	    rename _${class}_HandleOption {}
  	    if {$code} {
! 		error $result "\n$result\n   \
  			(command line option '$sswitch$opt')"
  	    }
  	}
--- 319,326 ----
  	    set code [catch {eval _${class}_HandleOption $save($opt)} result]
  	    rename _${class}_HandleOption {}
  	    if {$code} {
! 		global errorInfo
! 		error $result "$errorInfo\n   \
  			(command line option '$sswitch$opt')"
  	    }
  	}
***************
*** 404,410 ****
  	set code [catch {eval _${class}_Process $rest} result]
  	rename _${class}_Process {}
  	if {$code} {
! 	    error $result "\n$result\n    (command line arguments\
  		    '$arg($sswitch)')"
  	}
      }
--- 405,412 ----
  	set code [catch {eval _${class}_Process $rest} result]
  	rename _${class}_Process {}
  	if {$code} {
! 	    global errorInfo
! 	    error $result "$errorInfo\n    (command line arguments\
  		    '$arg($sswitch)')"
  	}
      }
diff -crN oommf12a3/pkg/oc/oc.cc oommf/pkg/oc/oc.cc
*** oommf12a3/pkg/oc/oc.cc	Wed Oct 23 02:43:45 2002
--- oommf/pkg/oc/oc.cc	Tue Dec 12 04:05:11 2006
***************
*** 260,268 ****
--- 260,273 ----
  #endif // DEBUG_DISABLESTDIO
  
    // Disable future SIGHUP, SIGTIN and SIGTOU signals
+ #if 1 && (SYSTEM_TYPE==WINDOWS)
+   signal(SIGBREAK,SIG_IGN);
+   signal(SIGABRT,SIG_IGN);
+ #else
    signal(SIGHUP,SIG_IGN);
    signal(SIGTTIN,SIG_IGN);
    signal(SIGTTOU,SIG_IGN);
+ #endif
  }
  
  static int
***************
*** 284,290 ****
    // a value outside this set.  Note that signal() will correctly
    // return a TCL_ERROR if the value is outside the known set of
    // signals.
! #if 0 && (SYSTEM_TYPE==WINDOWS)
    if(signo!=SIGINT && signo!=SIGILL && signo!=SIGFPE
       && signo!=SIGSEGV && signo!=SIGTERM && signo!=SIGBREAK
       && signo!=SIGABRT)
--- 289,295 ----
    // a value outside this set.  Note that signal() will correctly
    // return a TCL_ERROR if the value is outside the known set of
    // signals.
! #if 1 && (SYSTEM_TYPE==WINDOWS)
    if(signo!=SIGINT && signo!=SIGILL && signo!=SIGFPE
       && signo!=SIGSEGV && signo!=SIGTERM && signo!=SIGBREAK
       && signo!=SIGABRT)
diff -crN oommf12a3/config/cache/wintel.tcl oommf/config/cache/wintel.tcl
*** oommf12a3/config/cache/wintel.tcl	Wed Oct 30 20:31:44 2002
--- oommf/config/cache/wintel.tcl	Tue Dec 12 20:02:31 2006
***************
*** 60,69 ****
  #
  # Microsoft Visual C++
  # <URL:http://msdn.microsoft.com/visualc/>
! $config SetValue program_compiler_c++ {cl /nologo /c /GX /GR}
  #
  # Intel C++
! #$config SetValue program_compiler_c++ {icl /nologo /c /GX /GR}
  #
  # Borland C++ 5.5 Win32 command line tools.
  # <URL:http://www.inprise.com/>
--- 60,69 ----
  #
  # Microsoft Visual C++
  # <URL:http://msdn.microsoft.com/visualc/>
! #$config SetValue program_compiler_c++ {cl /nologo /c /GX /GR}
  #
  # Intel C++
! $config SetValue program_compiler_c++ {icl /nologo /c /GX /GR}
  #
  # Borland C++ 5.5 Win32 command line tools.
  # <URL:http://www.inprise.com/>
diff -crN oommf12a3/config/cache/wintel.tcl oommf12a3-patched/config/cache/wintel.tcl
*** oommf12a3/config/cache/wintel.tcl	Wed Oct 30 22:01:12 2002
--- oommf12a3-patched/config/cache/wintel.tcl	Tue Dec 12 18:04:25 2006
***************
*** 60,69 ****
  #
  # Microsoft Visual C++
  # <URL:http://msdn.microsoft.com/visualc/>
! #$config SetValue program_compiler_c++ {cl /nologo /c /GX /GR}
  #
  # Intel C++
! $config SetValue program_compiler_c++ {icl /nologo /c /GX /GR}
  #
  # Borland C++ 5.5 Win32 command line tools.
  # <URL:http://www.inprise.com/>
--- 60,69 ----
  #
  # Microsoft Visual C++
  # <URL:http://msdn.microsoft.com/visualc/>
! $config SetValue program_compiler_c++ {cl /nologo /c /GR}
  #
  # Intel C++
! #$config SetValue program_compiler_c++ {icl /nologo /c /GX /GR}
  #
  # Borland C++ 5.5 Win32 command line tools.
  # <URL:http://www.inprise.com/>
***************
*** 98,118 ****
  # $config SetValue path_directory_temporary {C:\}
  
  ########################################################################
  # ADVANCED CONFIGURATION
  
  # Compiler option processing...
  set ccbasename [file tail [lindex [$config GetValue program_compiler_c++] 0]]
  if {[string match cl $ccbasename]} {
      # ... for Microsoft Visual C++
!     # Default optimization
!     # $config SetValue program_compiler_c++_option_opt {}
!     # Options:
      #             Maximum optimization: /Ox
      #      Enable runtime debug checks: /GZ
      #   Optimize for Pentium processor: /G5
      #         Optimize for Pentium Pro: /G6
!     #$config SetValue program_compiler_c++_option_opt {format "/GZ"}
!     $config SetValue program_compiler_c++_option_opt {format "/Ox"}
      # NOTE: If you want good performance, be sure to edit ../options.tcl
      #  or ../local/options.tcl to include the line
      #    Oc_Option Add * Platform cflags {-def NDEBUG}
--- 98,173 ----
  # $config SetValue path_directory_temporary {C:\}
  
  ########################################################################
+ # SUPPORT PROCEDURES
+ #
+ # Routine to guess the cl version
+ proc GuessClVersion { cl } {
+     set guess {}
+     catch {exec $cl} usage_str
+     if {[regexp -- {Version ([0-9]+)[.][0-9]+[.][0-9]+} \
+              $usage_str dummy version]} {
+         set guess [expr {$version - 6}]
+     }
+     return $guess
+ }
+ 
+ ########################################################################
  # ADVANCED CONFIGURATION
  
  # Compiler option processing...
  set ccbasename [file tail [lindex [$config GetValue program_compiler_c++] 0]]
  if {[string match cl $ccbasename]} {
      # ... for Microsoft Visual C++
!     if {![info exists mvcpp_version]} {
!        set compilestr [$config GetValue program_compiler_c++]
!        set mvcpp_version [GuessClVersion [lindex $compilestr 0]]
!        unset compilestr
!     }
!     set opts {}
!     # Exception handling
!     if {![string match {} $mvcpp_version] && $mvcpp_version>7} {
! 	# The exception handling specification switch "/GX"
! 	# is deprecated in version 8.
! 	# lappend opts /EHsc
! 	lappend opts /EHac
!     } else {
! 	lappend opts /GX
!     }
! 
!     # Optimizations
!     #
!     # Options for VC++ 7 and earlier:
!     #            Disable optimizations: /Od
      #             Maximum optimization: /Ox
      #      Enable runtime debug checks: /GZ
      #   Optimize for Pentium processor: /G5
      #         Optimize for Pentium Pro: /G6
!     #
!     # Options for VC++ 8:
!     #                  Disable optimizations: /Od
!     #                   Maximum optimization: /Ox
!     #                    Enable stack checks: /GZ
!     #                   Require SSE2 support: /arch:SSE2
!     # Fast (less predictable) floating point: /fp:fast
!     #     Use portable but insecure lib fcns: /D_CRT_SECURE_NO_DEPRECATE
!     #
!     if {![string match {} $mvcpp_version] && $mvcpp_version<=7} {
!        #lappend opts /GZ
!        if {$mvcpp_version<6} {
!           lappend opts /Od /G6
!        } else {
!           lappend opts /Ox /G6
!        }
!     } else {
!        #lappend opts /GZ /fp:strict /D_CRT_SECURE_NO_DEPRECATE
!        lappend opts /Ox /fp:fast /D_CRT_SECURE_NO_DEPRECATE
!        lappend opts /wd4996
!        # /wd4996 disables warnings about deprecated function calls
!     }
!     $config SetValue program_compiler_c++_option_opt "format \"$opts\""
!     # OR, default optimization:
!     # $config SetValue program_compiler_c++_option_opt {}
! 
      # NOTE: If you want good performance, be sure to edit ../options.tcl
      #  or ../local/options.tcl to include the line
      #    Oc_Option Add * Platform cflags {-def NDEBUG}
diff -crN oommf12a3/app/oxs/base/output.tcl oommf/app/oxs/base/output.tcl
*** oommf12a3/app/oxs/base/output.tcl	Tue Aug  6 12:40:09 2002
--- oommf/app/oxs/base/output.tcl	Wed Mar 18 19:14:15 2009
***************
*** 121,127 ****
              set n [$o Cget -name]
              set u [$o Cget -units]
              set h [$o Cget -handle]
!             lappend triples [list $n $u [Oxs_OutputGet $h]]
          }
          # We're sending DataTable data.  Set up an event to guarantee
          # the table gets closed when the problem ends.
--- 121,134 ----
              set n [$o Cget -name]
              set u [$o Cget -units]
              set h [$o Cget -handle]
!             set data [Oxs_OutputGet $h]
!             ### KLUDGE KLUDGE KLUDGE ###
!             if {[catch {expr {1.0*$data}}]} {
!                 # Assume this is an underflow bug
!                 set data 0.0
!             }
!             ### KLUDGE KLUDGE KLUDGE ###
!             lappend triples [list $n $u $data]
          }
          # We're sending DataTable data.  Set up an event to guarantee
          # the table gets closed when the problem ends.
diff -urN oommf-old/pkg/vf/mesh.cc oommf-new/pkg/vf/mesh.cc
--- oommf-old/pkg/vf/mesh.cc	2002-09-12 22:03:31.000000000 -0400
+++ oommf-new/pkg/vf/mesh.cc	2010-05-08 01:06:33.839244900 -0400
@@ -714,30 +714,34 @@
 
   Nb_Vec3<REAL8> wv;
   Nb_Vec3<REAL4> v;
-  REAL8m wvscale=GetDisplayValueScale();
-  if(MaxMagHint>1.0 && wvscale>FLT_MAX/MaxMagHint) {
-    NonFatalError(STDDOC,"Value scale range error (too big): %g",
-		  GetDisplayValueScale());
+  REAL8m datascale=GetDisplayValueScale();
+  REAL8m wvscale=MaxMagHint;
+  if(fabs(ValueMultiplier)<1.0 && wvscale>FLT_MAX*ValueMultiplier) {
+    NonFatalError(STDDOC,"Value multiplier range error (too small): %g",
+		  ValueMultiplier);
     return display_list.GetSize(); // Empty grid
   }
-  wvscale*=MaxMagHint;
-  if(fabs(ValueMultiplier)<1.0 && wvscale>FLT_MAX*ValueMultiplier) {
+  wvscale/=ValueMultiplier;
+
+  // minmagsq is used for excluding small vectors.  Transform
+  // this to raw data scale, so we can do this check before
+  // scaling the data vectors.  Note: minmagsq is independent
+  // of datascale.
+  minmagsq *= wvscale; // NB: (wvscale*wvscale) might overflow,
+  minmagsq *= wvscale; //  but (magsq*wvscale)*wvscale shouldn't.
+
+  if(datascale>1.0 && wvscale>FLT_MAX/datascale) {
     NonFatalError(STDDOC,"Value scale range error (too big): %g",
-		  GetDisplayValueScale());
+		  datascale);
     return display_list.GetSize(); // Empty grid
   }
-  wvscale/=ValueMultiplier;
+  wvscale*=datascale;
 
   if(wvscale==0.0) wvscale=1.0; // Safety
   REAL8m wvtest= ( fabs(wvscale)<1.0 ? 1.0 : wvscale );
   wvtest=1.0/wvtest;
   REAL8m wvmult=1.0/wvscale;
 
-  // minmagsq is used for excluding small vectors.  Transform
-  // this to raw data scale, so we can do this check before
-  // scaling the data vectors.
-  minmagsq *= wvscale; // NB: (wvscale*wvscale) might overflow,
-  minmagsq *= wvscale; //  but (magsq*wvscale)*wvscale shouldn't.
 
   // Determine scaling for divergence calculation
   REAL8m xdivscale=0., ydivscale=0.,  zdivscale=0.;
@@ -1253,32 +1257,34 @@
     minmagsq=1e-16;  // Pretend MaxMagHint=1.0, and MinMagHint=1e-8
   }
 
-  REAL8m wvscale=GetDisplayValueScale();
-  if(MaxMagHint>1.0 && wvscale>FLT_MAX/MaxMagHint) {
-    NonFatalError(STDDOC,"Value scale range error (too big): %g",
-		  GetDisplayValueScale());
-    return display_list.GetSize(); // Empty grid
-  }
-  wvscale*=MaxMagHint;
+  REAL8m datascale=GetDisplayValueScale();
+  REAL8m wvscale=MaxMagHint;
   if(fabs(ValueMultiplier)<1.0 && wvscale>FLT_MAX*ValueMultiplier) {
-    NonFatalError(STDDOC,"Value scale range error (too big): %g",
-		  GetDisplayValueScale());
+    NonFatalError(STDDOC,"Value multiplier range error (too small): %g",
+		  ValueMultiplier);
     return display_list.GetSize(); // Empty grid
   }
   wvscale/=ValueMultiplier;
 
+  // minmagsq is used for excluding small vectors.  Transform
+  // this to raw data scale, so we can do this check before
+  // scaling the data vectors.  Note: minmagsq is independent
+  // of datascale.
+  minmagsq *= wvscale; // NB: (wvscale*wvscale) might overflow,
+  minmagsq *= wvscale; //  but (magsq*wvscale)*wvscale shouldn't.
+
+  if(datascale>1.0 && wvscale>FLT_MAX/datascale) {
+    NonFatalError(STDDOC,"Value scale range error (too big): %g",
+		  datascale);
+    return display_list.GetSize(); // Empty grid
+  }
+  wvscale*=datascale;
 
   if(wvscale==0.0) wvscale=1.0; // Safety
   REAL8m wvtest= ( fabs(wvscale)<1.0 ? 1.0 : wvscale );
   wvtest=1.0/wvtest;
   REAL8m wvmult=1.0/wvscale;
 
-  // minmagsq is used for excluding small vectors.  Transform
-  // this to raw data scale, so we can do this check before
-  // scaling the data vectors.
-  minmagsq *= wvscale; // NB: (wvscale*wvscale) might overflow,
-  minmagsq *= wvscale; //  but (magsq*wvscale)*wvscale shouldn't.
-
   // Extract z-range for use by zslice coloring
   INT4m zslice;
   REAL8m zrangemid=0.,zrangemult=1.0,zrangemin=0.,zrangespanrecip=1.0;
diff -crN oommf12a3/config/cache/linux-x86_64.tcl oommf12a3-patched/config/cache/linux-x86_64.tcl
*** oommf12a3/config/cache/linux-x86_64.tcl	Wed Dec 31 19:00:00 1969
--- oommf12a3-patched/config/cache/linux-x86_64.tcl	Wed May 11 17:23:11 2011
***************
*** 0 ****
--- 1,179 ----
+ # FILE: linux-x86_64.tcl
+ #
+ # Configuration feature definitions for the configuration 'linux-x86_64'
+ #
+ # Editing instructions begin at "START EDIT HERE" below.
+ 
+ set config [Oc_Config RunPlatform]
+ 
+ if {![string match [string tolower [file rootname [file tail [info script]]]] \
+         [$config GetValue platform_name]]} {
+     error "Configuration cache file '[info script]' 
+ sourced by '[$config GetValue platform_name]'"
+ }
+ 
+ ########################################################################
+ # START EDIT HERE
+ # In order to properly build, install, and run on your computing 
+ # platform, the OOMMF software must know certain features of your
+ # computing environment.  In this file are lines which set the value of 
+ # certain features of your computing environment.  Each line looks like:
+ #
+ # $config SetValue <feature> {<value>}
+ #
+ # where each <feature> is the name of some feature of interest,
+ # and <value> is the value which is assigned to that feature in a
+ # description of your computing environment.  Your task is to edit
+ # the values as necessary to properly describe your computing 
+ # environment.
+ #
+ # The character '#' at the beginning of a line is a comment character.
+ # It causes the contents of that line to be ignored.  To select
+ # among lines providing alternative values for a feature, uncomment the
+ # line containing the proper value.
+ #
+ # The features in this file are divided into three sections.  The first
+ # section (REQUIRED CONFIGURATION) includes features which require you 
+ # to provide a value.  The second section (OPTIONAL CONFIGURATION)
+ # includes features which have usable default values, but which you
+ # may wish to customize.  The third section (ADVANCED CONFIGURATION)
+ # contains features which you probably do not need or want to change
+ # without a good reason.
+ ########################################################################
+ # REQUIRED CONFIGURATION
+ 
+ # Set the feature 'program_compiler_c++' to the program to run on this 
+ # platform to compile source code files written in the language C++ into 
+ # object files.  Select from the choices below.  If the compiler is not 
+ # in your path, be sure to use the whole pathname.  Also include any 
+ # options required to instruct your compiler to only compile, not link.  
+ #
+ # If your compiler is not listed below, additional features will
+ # have to be added in the ADVANCED CONFIGURATION section below to 
+ # describe to the OOMMF software how to operate your compiler.  Send
+ # e-mail to the OOMMF developers for assistance.
+ #
+ # The GNU C++ compiler 'g++'
+ # <URL:http://www.gnu.org/software/gcc/gcc.html>
+ # <URL:http://egcs.cygnus.com/>
+ $config SetValue program_compiler_c++ {g++ -c}
+ 
+ ########################################################################
+ # OPTIONAL CONFIGURATION
+ 
+ # Set the feature 'path_directory_temporary' to the name of an existing 
+ # directory on your computer in which OOMMF software should write 
+ # temporary files.  All OOMMF users must have write access to this 
+ # directory.
+ #
+ # $config SetValue path_directory_temporary {/tmp}
+ 
+ ########################################################################
+ # ADVANCED CONFIGURATION
+ 
+ # Compiler option processing...
+ set ccbasename [file tail [lindex [$config GetValue program_compiler_c++] 0]]
+ if {[string match g++ $ccbasename]} {
+     # ...for GNU g++ C++ compiler
+ #    $config SetValue program_compiler_c++_option_opt {format "\"-O%s\""}
+ #    $config SetValue program_compiler_c++_option_opt {format "-O0 -ffloat-store"}
+ $config SetValue program_compiler_c++_option_opt {format "-O3 -ffast-math -fomit-frame-pointer"}
+ # The following alternative optimization option comes from
+ # Hin-Tak Leung <htl10@cus.cam.ac.uk>.  It reportedly provides better
+ # optimized code on Pentium systems, but may be incompatible with
+ # i486/i386 systems, and may complicate debugging.  Uncomment the
+ # following line to enable the Pentium-specific optimizations.
+ #    $config SetValue program_compiler_c++_option_opt {format "-O3 -malign-double -fomit-frame-pointer"}
+ # Or try this for PentiumPro systems.  Try it both with and without
+ # -malign-double.
+ #    $config SetValue program_compiler_c++_option_opt {format "-O4 -ffast-math -fomit-frame-pointer -march=pentiumpro -malign-double"}
+     # NOTE: If you want good performance, be sure to edit ../options.tcl
+     #  or ../local/options.tcl to include the line
+     #    Oc_Option Add * Platform cflags {-def NDEBUG}
+     #  so that the NDEBUG symbol is defined during compile.
+     $config SetValue program_compiler_c++_option_out {format "-o \"%s\""}
+     $config SetValue program_compiler_c++_option_src {format \"%s\"}
+     $config SetValue program_compiler_c++_option_inc {format "\"-I%s\""}
+  
+     # Compiler warnings:
+     # Omitted: -Wredundant-decls -Wshadow -Wcast-align
+     # I would also like to use -Wcast-qual, but casting away const is
+     # needed on some occasions to provide "conceptual const" functions in
+     # place of "bitwise const"; cf. p76-78 of Meyer's book, "Effective C++."
+     #
+     # NOTE: -Wno-uninitialized is required after -Wall by gcc 2.8+ because
+     # of an apparent bug.  -Winline is out because of failures in the STL.
+     # Depending on the gcc version, the following options may also be
+     # available:     -Wbad-function-cast     -Wstrict-prototypes
+     #                -Wmissing-declarations  -Wnested-externs
+     $config SetValue program_compiler_c++_option_warn {format "-Wall \
+         -W -Wpointer-arith -Wwrite-strings -Wmissing-prototypes \
+         -Woverloaded-virtual -Wsynth -Werror"}
+     $config SetValue program_compiler_c++_option_debug {format "-g"}
+     $config SetValue program_compiler_c++_option_def {format "\"-D%s\""}
+ 
+     # Widest natively support floating point type.
+     # NOTE: On the Linux/x86+gcc platform, "long double" provides somewhat
+     # better precision than "double", but at a cost of increased memory
+     # usage and likely some decrease in speed.  (At this writing,
+     # long double takes 12 bytes of storage as opposed to 8 for double,
+     # but provides the x86 native floating point format having approx.
+     # 19 decimal digits precision as opposed to 16 for double.)
+     $config SetValue program_compiler_c++_typedef_realwide "long double"
+ 
+     # Other compiler properties
+     $config SetValue \
+             program_compiler_c++_property_optimization_breaks_varargs 0
+ }
+ unset ccbasename
+ 
+ # The program to run on this platform to link together object files and
+ # library files to create an executable binary.
+ #
+ # Use the selected compiler to control the linking.
+ $config SetValue program_linker [lindex \
+         [$config GetValue program_compiler_c++] 0]
+ 
+ # Linker option processing...
+ set lbasename [file tail [lindex [$config GetValue program_linker] 0]]
+ if {[string match g++ $lbasename]} {
+     # ...for GNU g++ as linker
+     $config SetValue program_linker_option_obj {format \"%s\"}
+     $config SetValue program_linker_option_out {format "-o \"%s\""}
+     $config SetValue program_linker_option_lib {format \"%s\"}
+     $config SetValue program_linker_uses_-L-l {1}
+ }
+ unset lbasename
+ 
+ # The program to run on this platform to create a single library file out
+ # of many object files.
+ $config SetValue program_libmaker {ar cr}
+ 
+ if {[string match ar [file tail [lindex \
+         [$config GetValue program_libmaker] 0]]]} {
+     # Option processing for ar
+     $config SetValue program_libmaker_option_obj {format \"%s\"}
+     $config SetValue program_libmaker_option_out {format \"%s\"}
+ }
+ 
+ # The absolute, native filename of the null device
+ $config SetValue path_device_null {/dev/null}
+ 
+ # A partial Tcl command (or script) which when completed by lappending
+ # a file name stem and evaluated returns the corresponding file name for
+ # an executable on this platform
+ $config SetValue script_filename_executable {format %s}
+ 
+ # A partial Tcl command (or script) which when completed by lappending
+ # a file name stem and evaluated returns the corresponding file name for
+ # an object file on this platform
+ $config SetValue script_filename_object {format %s.o}
+ 
+ # A partial Tcl command (or script) which when completed by lappending
+ # a file name stem and evaluated returns the corresponding file name for
+ # a static library on this platform
+ $config SetValue script_filename_static_library {format lib%s.a}
+ 
+ ########################################################################
+ unset config
+ 
diff -crN oommf12a3/config/names/linux-x86_64.tcl oommf12a3-patched/config/names/linux-x86_64.tcl
*** oommf12a3/config/names/linux-x86_64.tcl	Wed Dec 31 19:00:00 1969
--- oommf12a3-patched/config/names/linux-x86_64.tcl	Wed May 11 17:21:46 2011
***************
*** 0 ****
--- 1,15 ----
+ # linux-x86_64.tcl
+ #
+ # Defines the Oc_Config name 'linux-x86_64' to indicate the Linux
+ # operating system running on the x86_64 architecture.
+ 
+ Oc_Config New _ [string tolower [file rootname [file tail [info script]]]] {
+     global tcl_platform env
+     if {![regexp -nocase -- linux $tcl_platform(os)]} {
+         return 0
+     }
+     if {![string match x86_64 $tcl_platform(machine)]} {
+ 	return 0
+     }
+     return 1
+ }
diff -crN oommf12a3/pkg/oc/config.tcl oommf12a3-patched/pkg/oc/config.tcl
*** oommf12a3/pkg/oc/config.tcl	Wed Sep 19 15:34:03 2001
--- oommf12a3-patched/pkg/oc/config.tcl	Wed May 11 17:44:57 2011
***************
*** 55,61 ****
  	if {[string length $ret]} {
  	    return $ret
  	}
! 	set ret [package provide Tcl]
  	if {[package vcompare $ret 8] >= 0} {
  	    return $ret
  	}
--- 55,61 ----
  	if {[string length $ret]} {
  	    return $ret
  	}
! 	set ret [info tclversion]
  	if {[package vcompare $ret 8] >= 0} {
  	    return $ret
  	}
***************
*** 324,332 ****
  	$this SetValue TK_EXEC_PREFIX $root
  	$this SetValue TK_PREFIX $root
  	$this SetValue TK_XINCLUDES [file join $root include X11]
! 	foreach {tlma tlmi} [split [package provide Tcl] .] {break}
! 	foreach {tkma tkmi} [split [$class TkVersion] .] {break}
! 	$this SetValue TCL_VERSION [package provide Tcl]
  	$this SetValue TCL_MAJOR_VERSION $tlma
  	$this SetValue TCL_MINOR_VERSION $tlmi
  	regsub {^[0-9]+\.[0-9]+} [info patchlevel] {} pl
--- 324,332 ----
  	$this SetValue TK_EXEC_PREFIX $root
  	$this SetValue TK_PREFIX $root
  	$this SetValue TK_XINCLUDES [file join $root include X11]
! 	regexp {^([0-9]+)\.([0-9]+)} [package provide Tcl] dummy tlma tlmi
! 	regexp {^([0-9]+)\.([0-9]+)} [$class TkVersion] dummy tkma tkmi
! 	$this SetValue TCL_VERSION [info tclversion]
  	$this SetValue TCL_MAJOR_VERSION $tlma
  	$this SetValue TCL_MINOR_VERSION $tlmi
  	regsub {^[0-9]+\.[0-9]+} [info patchlevel] {} pl
diff -bcrN oommf12a3/pkg/oc/procs.tcl oommf/pkg/oc/procs.tcl
*** oommf12a3/pkg/oc/procs.tcl	Sat Oct 26 02:09:21 2002
--- oommf/pkg/oc/procs.tcl	Fri Jun  3 01:26:31 2011
***************
*** 709,715 ****
      set f ""
      set error [catch {
          set f [open tclIndex a]
!         puts $f $index nonewline
          close $f
          cd $oldDir
      } msg]
--- 709,715 ----
      set f ""
      set error [catch {
          set f [open tclIndex a]
!         puts -nonewline $f $index
          close $f
          cd $oldDir
      } msg]
