diff -crN oommf12a3/app/mmdisp/scripts/avf2ovf.tcl oommf/app/mmdisp/scripts/avf2ovf.tcl
*** oommf12a3/app/mmdisp/scripts/avf2ovf.tcl	Mon Oct 28 13:39:00 2002
--- oommf/app/mmdisp/scripts/avf2ovf.tcl	Fri Oct 22 20:26:38 2004
***************
*** 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	Wed Oct 30 17:49:23 2002
--- oommf/app/oxs/base/mesh.cc	Fri Oct 22 20:26:38 2004
***************
*** 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	Tue Oct 29 16:09:00 2002
--- oommf/app/oxs/base/mif.tcl	Fri Oct 22 20:26:38 2004
***************
*** 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	Wed Jan 30 21:40:15 2002
--- oommf/app/oxs/base/oxs.cc	Fri Oct 22 20:26:52 2004
***************
*** 6,11 ****
--- 6,12 ----
  
  #include "oc.h"
  #include "nb.h"
+ #include "vf.h"
  #include "oxs.h"
  
  #include "director.h"
***************
*** 125,130 ****
--- 126,141 ----
          Tcl_DStringFree(&buf);
      }
      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);
diff -crN oommf12a3/app/oxs/base/util.cc oommf/app/oxs/base/util.cc
*** oommf12a3/app/oxs/base/util.cc	Fri Apr  5 19:29:23 2002
--- oommf/app/oxs/base/util.cc	Fri Oct 22 20:26:38 2004
***************
*** 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	Mon Jul  8 20:51:30 2002
--- oommf/app/oxs/base/util.h	Fri Oct 22 20:26:38 2004
***************
*** 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	Tue Oct 29 16:32:05 2002
--- oommf/app/oxs/boxsi.tcl	Fri Oct 22 20:26:38 2004
***************
*** 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	Wed Mar 20 19:21:44 2002
--- oommf/app/oxs/ext/atlasscalarfield.cc	Fri Oct 22 20:26:38 2004
***************
*** 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	Thu Mar 21 15:05:10 2002
--- oommf/app/oxs/ext/atlasscalarfield.h	Fri Oct 22 20:26:38 2004
***************
*** 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	Wed Mar 20 19:21:44 2002
--- oommf/app/oxs/ext/atlasvectorfield.cc	Fri Oct 22 20:26:38 2004
***************
*** 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	Thu Mar 21 15:05:10 2002
--- oommf/app/oxs/ext/atlasvectorfield.h	Fri Oct 22 20:26:38 2004
***************
*** 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	Thu Sep 12 01:52:08 2002
--- oommf/app/oxs/ext/rectangularmesh.cc	Fri Oct 22 20:26:38 2004
***************
*** 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	Tue Jun 18 23:36:00 2002
--- oommf/app/oxs/ext/uzeeman.cc	Fri Oct 22 20:26:38 2004
***************
*** 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/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	Fri Oct 22 20:25:49 2004
***************
*** 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	Fri Oct 25 16:49:02 2002
--- oommf/pkg/nb/evoc.cc	Fri Oct 22 20:26:38 2004
***************
*** 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	Wed Oct 17 22:12:37 2001
--- oommf/pkg/oc/custom.tcl	Fri Oct 22 20:26:38 2004
***************
*** 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	Wed Sep 11 21:01:05 2002
--- oommf/pkg/oc/main.tcl	Fri Oct 22 20:26:38 2004
***************
*** 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	Fri Aug 25 13:01:25 2000
--- oommf/pkg/oc/tempfile.tcl	Fri Oct 22 20:26:38 2004
***************
*** 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	Wed Oct 23 17:52:18 2002
--- oommf/pkg/ow/entryscale.tcl	Fri Oct 22 20:26:38 2004
***************
*** 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	Mon Jul  2 03:36:40 2001
--- oommf/pkg/ow/procs.tcl	Fri Oct 22 20:26:38 2004
***************
*** 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 {} {
