Index: /XIOS/dev/branch_yushan/arch/arch-X64_ADA.fcm
===================================================================
--- /XIOS/dev/branch_yushan/arch/arch-X64_ADA.fcm	(revision 1100)
+++ /XIOS/dev/branch_yushan/arch/arch-X64_ADA.fcm	(revision 1101)
@@ -3,7 +3,7 @@
 ################################################################################
 
-%CCOMPILER      mpiicc
-%FCOMPILER      mpiifort 
-%LINKER         mpiifort  -nofor-main
+%CCOMPILER      mpiicc -qopenmp -D_usingEP -D_intelmpi
+%FCOMPILER      mpiifort -qopenmp -D_usingEP -D_intelmpi
+%LINKER         mpiifort  -nofor-main -qopenmp -D_usingEP -D_intelmpi
 
 %BASE_CFLAGS    -diag-disable 1125 -diag-disable 279
Index: /XIOS/dev/branch_yushan/src/attribute_template_impl.hpp
===================================================================
--- /XIOS/dev/branch_yushan/src/attribute_template_impl.hpp	(revision 1100)
+++ /XIOS/dev/branch_yushan/src/attribute_template_impl.hpp	(revision 1101)
@@ -39,5 +39,9 @@
          : CAttribute(id)
       {
-         umap.insert(umap.end(), std::make_pair(id, this));
+         xios_map<StdString, CAttribute*>::iterator it;
+         printf("umap size = %lu, add = %p\n", umap.size(), &umap);
+         it = umap.find(id);
+         if(it == umap.end())
+           umap.insert(umap.end(), std::make_pair(id, this));
       }
 
Index: /XIOS/dev/branch_yushan/src/calendar.cpp
===================================================================
--- /XIOS/dev/branch_yushan/src/calendar.cpp	(revision 1100)
+++ /XIOS/dev/branch_yushan/src/calendar.cpp	(revision 1101)
@@ -117,5 +117,5 @@
       const CDate& CCalendar::update(int step)
       {
-        info(20) << "update step : " << step << " timestep " << this->timestep << std::endl;
+        //info(20) << "update step : " << step << " timestep " << this->timestep << std::endl;
         return (this->currentDate = this->getInitDate() + step * this->timestep);
       }
Index: /XIOS/dev/branch_yushan/src/group_factory_impl.hpp
===================================================================
--- /XIOS/dev/branch_yushan/src/group_factory_impl.hpp	(revision 1100)
+++ /XIOS/dev/branch_yushan/src/group_factory_impl.hpp	(revision 1101)
@@ -70,20 +70,28 @@
       CObjectFactory::SetCurrentContextId
       (CGroupFactory::GetCurrentContextId());
+      printf("SetCurrentContextId OK %d , %d, %s\n", id.size(), CGroupFactory::HasChild(group, id), id);
       if (id.size() == 0)
       {
-         boost::shared_ptr<typename U::RelChild> value =
-               CObjectFactory::CreateObject<typename U::RelChild>();
+         boost::shared_ptr<typename U::RelChild> value = CObjectFactory::CreateObject<typename U::RelChild>();
+         printf("boost::shared_ptr<typename U::RelChild> value OK\n");
          group->childList.insert(group->childList.end(), value.get());
+         printf("group->childList.insert OK\n");
          group->childMap.insert(std::make_pair(value->getId(), value.get()));
+         printf("group->childMap.insert OK\n");
          return (value);
       }
       else if (CGroupFactory::HasChild(group, id))
+      {
+         printf("has child\n");
          return (CGroupFactory::GetChild(group, id));
+      }
       else
       {
-         boost::shared_ptr<typename U::RelChild> value =
-               CObjectFactory::CreateObject<typename U::RelChild>(id);
+         boost::shared_ptr<typename U::RelChild> value = CObjectFactory::CreateObject<typename U::RelChild>(id);
+         printf("shared_ptr OK\n");
          group->childList.insert(group->childList.end(), value.get());
+         printf("childList.insert OK\n");
          group->childMap.insert(std::make_pair(id, value.get()));
+         printf("childMap.insert OK\n");
          return (value);
       }
Index: /XIOS/dev/branch_yushan/src/group_template_impl.hpp
===================================================================
--- /XIOS/dev/branch_yushan/src/group_template_impl.hpp	(revision 1100)
+++ /XIOS/dev/branch_yushan/src/group_template_impl.hpp	(revision 1101)
@@ -348,4 +348,5 @@
    U* CGroupTemplate<U, V, W>::createChild(const string& id) 
   {
+    printf("U* CGroupTemplate<U, V, W>::createChild(const string& id) %p\n", this->getShared());
     return CGroupFactory::CreateChild<V>(this->getShared(), id).get() ;
   }
Index: /XIOS/dev/branch_yushan/src/interface/c/icfield.cpp
===================================================================
--- /XIOS/dev/branch_yushan/src/interface/c/icfield.cpp	(revision 1100)
+++ /XIOS/dev/branch_yushan/src/interface/c/icfield.cpp	(revision 1101)
@@ -39,4 +39,5 @@
       CTimer::get("XIOS").resume() ;
       *_ret = CField::get(id);
+      printf("cxios_field_handle_create\n");
       CTimer::get("XIOS").suspend() ;
    }
@@ -48,4 +49,5 @@
       CTimer::get("XIOS").resume() ;
       *_ret = CFieldGroup::get(id);
+      printf("cxios_fieldgroup_handle_create\n");
       CTimer::get("XIOS").suspend() ;
    }
Index: /XIOS/dev/branch_yushan/src/object_factory_impl.hpp
===================================================================
--- /XIOS/dev/branch_yushan/src/object_factory_impl.hpp	(revision 1100)
+++ /XIOS/dev/branch_yushan/src/object_factory_impl.hpp	(revision 1101)
@@ -122,4 +122,6 @@
       if(U::AllVectObj == NULL) U::AllVectObj = new xios_map<StdString, std::vector<boost::shared_ptr<U> > >;
       if(U::AllMapObj  == NULL) U::AllMapObj  = new xios_map<StdString, xios_map<StdString, boost::shared_ptr<U> > >;
+
+      printf("so far so good : %d %d %d\n", CurrContext_ptr->empty(), CObjectFactory::HasObject<U>(id), id.empty());
       
       if (CurrContext_ptr->empty())
@@ -134,7 +136,9 @@
       {
          boost::shared_ptr<U> value(new U(id.empty() ? CObjectFactory::GenUId<U>() : id));
-
+         printf("in CreateObject, value OK\n");  
          (* U::AllVectObj)[*CObjectFactory::CurrContext_ptr].insert((*U::AllVectObj)[*CObjectFactory::CurrContext_ptr].end(), value);
+         printf("AllVectObj insert OK\n");
          (* U::AllMapObj) [*CObjectFactory::CurrContext_ptr].insert(std::make_pair(value->getId(), value));
+         printf("AllMapObj insert OK\n");
 
          return value;
Index: /XIOS/dev/branch_yushan/src/object_template.hpp
===================================================================
--- /XIOS/dev/branch_yushan/src/object_template.hpp	(revision 1100)
+++ /XIOS/dev/branch_yushan/src/object_template.hpp	(revision 1101)
@@ -106,12 +106,8 @@
          // static xios_map< StdString, long int > GenId ;
 
-         // xios_map<StdString, xios_map<StdString, boost::shared_ptr<DerivedType> > > AllMapObj;
-         // xios_map<StdString, std::vector<boost::shared_ptr<DerivedType> > > AllVectObj;
-         // xios_map< StdString, long int > GenId ;
 
          static xios_map<StdString, xios_map<StdString, boost::shared_ptr<DerivedType> > > *AllMapObj;
          static xios_map<StdString, std::vector<boost::shared_ptr<DerivedType> > > *AllVectObj;
          static xios_map< StdString, long int > *GenId;
-
          #pragma omp threadprivate(AllMapObj, AllVectObj, GenId)
 
Index: /XIOS/dev/branch_yushan/src/test/test_omp.f90
===================================================================
--- /XIOS/dev/branch_yushan/src/test/test_omp.f90	(revision 1100)
+++ /XIOS/dev/branch_yushan/src/test/test_omp.f90	(revision 1101)
@@ -88,17 +88,69 @@
     print*, "xios_context_initialize OK", rank, size
 
-!     CALL xios_get_handle("test",ctx_hdl)
-!     CALL xios_set_current_context(ctx_hdl)
-  
-  
-!     CALL xios_get_calendar_type(calendar_type)
-!     print*, "xios_get_calendar_type OK", rank, size
-
-!     CALL xios_set_axis_attr("axis_A",n_glo=llm ,value=lval) ;
-!     CALL xios_set_domain_attr("domain_A",ni_glo=ni_glo, nj_glo=nj_glo, ibegin=ibegin, ni=ni,jbegin=jbegin,nj=nj,type='curvilinear')
-!     CALL xios_set_domain_attr("domain_A",data_dim=2, data_ibegin=-1, data_ni=ni+2, data_jbegin=-2, data_nj=nj+4)
-!     CALL xios_set_domain_attr("domain_A",lonvalue_2D=lon,latvalue_2D=lat)
-!     CALL xios_set_fieldgroup_attr("field_definition",enabled=.TRUE.)
-!     print*, "test block OK", rank, size
+    CALL xios_get_handle("test",ctx_hdl)
+    CALL xios_set_current_context(ctx_hdl)
+  
+  
+    CALL xios_get_calendar_type(calendar_type)
+    print*, "xios_get_calendar_type OK", rank, size
+
+    CALL xios_set_axis_attr("axis_A",n_glo=llm ,value=lval) ;
+    CALL xios_set_domain_attr("domain_A",ni_glo=ni_glo, nj_glo=nj_glo, ibegin=ibegin, ni=ni,jbegin=jbegin,nj=nj,type='curvilinear')
+    CALL xios_set_domain_attr("domain_A",data_dim=2, data_ibegin=-1, data_ni=ni+2, data_jbegin=-2, data_nj=nj+4)
+    CALL xios_set_domain_attr("domain_A",lonvalue_2D=lon,latvalue_2D=lat)
+    CALL xios_set_fieldgroup_attr("field_definition",enabled=.TRUE.)
+    print*, "test block OK", rank, size
+
+!     CALL xios_get_handle("field_definition",fieldgroup_hdl) 
+!     print*, "test block II get_handle OK", rank, size
+!     CALL xios_add_child(fieldgroup_hdl,field_hdl,"field_B")
+!     print*, "test block II add_child OK", rank, size
+!     CALL xios_set_attr(field_hdl,field_ref="field_A",name="field_B")
+!     print*, "test block II set_attr OK", rank, size
+
+    dtime%second = 3600
+    CALL xios_set_timestep(dtime)
+    print*, "xios_set_timestep OK", rank, size    
+
+   ! The calendar is created as soon as the calendar type is defined. This way
+   ! calendar operations can be used before the context definition is closed
+   CALL xios_get_time_origin(date)
+   PRINT *, "--> year length = ", xios_get_year_length_in_seconds(date%year)
+   PRINT *, "--> day length = ", xios_get_day_length_in_seconds()
+   CALL xios_date_convert_to_string(date, date_str)
+   PRINT *, "time_origin = ", date_str
+   PRINT *, "xios_date_get_second_of_year(time_origin) = ", xios_date_get_second_of_year(date)
+   PRINT *, "xios_date_get_day_of_year(time_origin) = ", xios_date_get_day_of_year(date)
+   PRINT *, "xios_date_get_fraction_of_year(time_origin) = ", xios_date_get_fraction_of_year(date)
+   PRINT *, "xios_date_get_second_of_day(time_origin) = ", xios_date_get_second_of_day(date)
+   PRINT *, "xios_date_get_fraction_of_day(time_origin) = ", xios_date_get_fraction_of_day(date)
+   dtime%timestep = 1
+   dtime = 0.5 * dtime
+   CALL xios_duration_convert_to_string(dtime, dtime_str)
+   PRINT *, "duration = ", dtime_str
+   date = date + 3 * (dtime + dtime)
+   CALL xios_date_convert_to_string(date, date_str)
+   PRINT *, "date = time_origin + 3 * (duration + duration) = ", date_str
+   PRINT *, "xios_date_convert_to_seconds(date) = ", xios_date_convert_to_seconds(date)
+   PRINT *, "xios_date_convert_to_seconds(date - 2.5h) = ", xios_date_convert_to_seconds(date - 2.5 * xios_hour)
+
+   ni=0 ; lonvalue(:,:)=0;
+   CALL xios_get_domain_attr("domain_A",ni=ni,lonvalue_2D=lonvalue)
+   print *,"ni",ni
+   !print *,"lonvalue",lonvalue;
+
+   CALL xios_is_defined_field_attr("field_A",enabled=ok)
+   PRINT *,"field_A : attribute enabled is defined ? ",ok 
+
+   CALL xios_close_context_definition()
+   print*, "xios_close_context_definition OK"  
+
+   PRINT*,"field field_A is active ? ",xios_field_is_active("field_A")
+
+   DO ts=1,6
+    CALL xios_update_calendar(ts)
+    CALL xios_send_field("field_A",field_A)
+    CALL wait_us(5000)
+   ENDDO
 
     CALL xios_context_finalize()
@@ -116,4 +168,6 @@
     CALL xios_finalize()
     print*, "xios finalize OK", rank, size
+
+    DEALLOCATE(lon, lat, field_A, lonvalue)
 
 
Index: /XIOS/dev/branch_yushan/src/transformation/grid_transformation_factory_impl.hpp
===================================================================
--- /XIOS/dev/branch_yushan/src/transformation/grid_transformation_factory_impl.hpp	(revision 1100)
+++ /XIOS/dev/branch_yushan/src/transformation/grid_transformation_factory_impl.hpp	(revision 1101)
@@ -62,5 +62,5 @@
   static bool unregisterTransformation(ETranformationType transType);
   static bool initializeTransformation_;
-  //#pragma omp threadprivate(initializeTransformation_)
+  #pragma omp threadprivate(initializeTransformation_)
 };
 
@@ -87,5 +87,5 @@
      ERROR("CGridTransformationFactory::createTransformation(ETranformationType transType)",
            << "Transformation type " << transType
-           << "doesn't exist. Please define.");
+           << " doesn't exist. Please define.");
   }
   return (it->second)(gridDst, gridSrc, transformation, elementPositionInGrid,
