Index: XIOS/trunk/src/interface/c_attr/icdomain_attr.cpp
===================================================================
--- XIOS/trunk/src/interface/c_attr/icdomain_attr.cpp	(revision 352)
+++ XIOS/trunk/src/interface/c_attr/icdomain_attr.cpp	(revision 369)
@@ -11,5 +11,5 @@
 #include "icutil.hpp"
 #include "timer.hpp"
-#include "domain.hpp"
+#include "node_type.hpp"
 
 extern "C"
@@ -33,8 +33,7 @@
   void cxios_set_domain_data_i_index(domain_Ptr domain_hdl, int* data_i_index, int extent1)
   {
-     CTimer::get("XIOS").resume();
-    ARRAY(int,1) array_tmp(new CArray<int,1>(boost::extents[extent1]));
-    std::copy(data_i_index, &(data_i_index[array_tmp->num_elements()]), array_tmp->data());
-    domain_hdl->data_i_index.setValue(array_tmp);
+    CTimer::get("XIOS").resume();
+    CArray<int,1> tmp(data_i_index,shape(extent1),neverDeleteData) ;
+    domain_hdl->data_i_index.reference(tmp.copy());
     domain_hdl->sendAttributToServer(domain_hdl->data_i_index);
   }
@@ -42,6 +41,6 @@
   void cxios_get_domain_data_i_index(domain_Ptr domain_hdl, int* data_i_index, int extent1)
   {
-    if (!array_copy(domain_hdl->data_i_index.getValue(), data_i_index, extent1))
-     ERROR("void cxios_set_domain_data_i_index(domain_Ptr domain_hdl, int* data_i_index, int extent1)",<<"Output array size is not conform to array size attribute") ;
+    CArray<int,1> tmp(data_i_index,shape(extent1),neverDeleteData) ;
+    tmp=domain_hdl->data_i_index ;
      CTimer::get("XIOS").suspend();
   }
@@ -64,8 +63,7 @@
   void cxios_set_domain_data_j_index(domain_Ptr domain_hdl, int* data_j_index, int extent1)
   {
-     CTimer::get("XIOS").resume();
-    ARRAY(int,1) array_tmp(new CArray<int,1>(boost::extents[extent1]));
-    std::copy(data_j_index, &(data_j_index[array_tmp->num_elements()]), array_tmp->data());
-    domain_hdl->data_j_index.setValue(array_tmp);
+    CTimer::get("XIOS").resume();
+    CArray<int,1> tmp(data_j_index,shape(extent1),neverDeleteData) ;
+    domain_hdl->data_j_index.reference(tmp.copy());
     domain_hdl->sendAttributToServer(domain_hdl->data_j_index);
   }
@@ -73,6 +71,6 @@
   void cxios_get_domain_data_j_index(domain_Ptr domain_hdl, int* data_j_index, int extent1)
   {
-    if (!array_copy(domain_hdl->data_j_index.getValue(), data_j_index, extent1))
-     ERROR("void cxios_set_domain_data_j_index(domain_Ptr domain_hdl, int* data_j_index, int extent1)",<<"Output array size is not conform to array size attribute") ;
+    CArray<int,1> tmp(data_j_index,shape(extent1),neverDeleteData) ;
+    tmp=domain_hdl->data_j_index ;
      CTimer::get("XIOS").suspend();
   }
@@ -212,8 +210,7 @@
   void cxios_set_domain_latvalue(domain_Ptr domain_hdl, double* latvalue, int extent1)
   {
-     CTimer::get("XIOS").resume();
-    ARRAY(double,1) array_tmp(new CArray<double,1>(boost::extents[extent1]));
-    std::copy(latvalue, &(latvalue[array_tmp->num_elements()]), array_tmp->data());
-    domain_hdl->latvalue.setValue(array_tmp);
+    CTimer::get("XIOS").resume();
+    CArray<double,1> tmp(latvalue,shape(extent1),neverDeleteData) ;
+    domain_hdl->latvalue.reference(tmp.copy());
     domain_hdl->sendAttributToServer(domain_hdl->latvalue);
   }
@@ -221,6 +218,6 @@
   void cxios_get_domain_latvalue(domain_Ptr domain_hdl, double* latvalue, int extent1)
   {
-    if (!array_copy(domain_hdl->latvalue.getValue(), latvalue, extent1))
-     ERROR("void cxios_set_domain_latvalue(domain_Ptr domain_hdl, double* latvalue, int extent1)",<<"Output array size is not conform to array size attribute") ;
+    CArray<double,1> tmp(latvalue,shape(extent1),neverDeleteData) ;
+    tmp=domain_hdl->latvalue ;
      CTimer::get("XIOS").suspend();
   }
@@ -248,8 +245,7 @@
   void cxios_set_domain_lonvalue(domain_Ptr domain_hdl, double* lonvalue, int extent1)
   {
-     CTimer::get("XIOS").resume();
-    ARRAY(double,1) array_tmp(new CArray<double,1>(boost::extents[extent1]));
-    std::copy(lonvalue, &(lonvalue[array_tmp->num_elements()]), array_tmp->data());
-    domain_hdl->lonvalue.setValue(array_tmp);
+    CTimer::get("XIOS").resume();
+    CArray<double,1> tmp(lonvalue,shape(extent1),neverDeleteData) ;
+    domain_hdl->lonvalue.reference(tmp.copy());
     domain_hdl->sendAttributToServer(domain_hdl->lonvalue);
   }
@@ -257,6 +253,6 @@
   void cxios_get_domain_lonvalue(domain_Ptr domain_hdl, double* lonvalue, int extent1)
   {
-    if (!array_copy(domain_hdl->lonvalue.getValue(), lonvalue, extent1))
-     ERROR("void cxios_set_domain_lonvalue(domain_Ptr domain_hdl, double* lonvalue, int extent1)",<<"Output array size is not conform to array size attribute") ;
+    CArray<double,1> tmp(lonvalue,shape(extent1),neverDeleteData) ;
+    tmp=domain_hdl->lonvalue ;
      CTimer::get("XIOS").suspend();
   }
@@ -265,8 +261,7 @@
   void cxios_set_domain_mask(domain_Ptr domain_hdl, bool* mask, int extent1, int extent2)
   {
-     CTimer::get("XIOS").resume();
-    ARRAY(bool,2) array_tmp(new CArray<bool,2>(boost::extents[extent1][extent2]));
-    std::copy(mask, &(mask[array_tmp->num_elements()]), array_tmp->data());
-    domain_hdl->mask.setValue(array_tmp);
+    CTimer::get("XIOS").resume();
+    CArray<bool,2> tmp(mask,shape(extent1,extent2),neverDeleteData) ;
+    domain_hdl->mask.reference(tmp.copy());
     domain_hdl->sendAttributToServer(domain_hdl->mask);
   }
@@ -274,6 +269,6 @@
   void cxios_get_domain_mask(domain_Ptr domain_hdl, bool* mask, int extent1, int extent2)
   {
-    if (!array_copy(domain_hdl->mask.getValue(), mask, extent1, extent2))
-     ERROR("void cxios_set_domain_mask(domain_Ptr domain_hdl, bool* mask, int extent1, int extent2)",<<"Output array size is not conform to array size attribute") ;
+    CArray<bool,2> tmp(mask,shape(extent1,extent2),neverDeleteData) ;
+    tmp=domain_hdl->mask ;
      CTimer::get("XIOS").suspend();
   }
