Index: XIOS/trunk/src/generate_interface_impl.hpp
===================================================================
--- XIOS/trunk/src/generate_interface_impl.hpp	(revision 671)
+++ XIOS/trunk/src/generate_interface_impl.hpp	(revision 672)
@@ -64,5 +64,4 @@
     oss << "  CTimer::get(\"XIOS\").resume();" << iendl;
     oss << "  " << className << "_hdl->" << name << ".setValue(" << name << ");" << iendl;
-//  oss << "  " << className << "_hdl->sendAttributToServer(" << className << "_hdl->" << name << ");" << iendl;
     oss << "  CTimer::get(\"XIOS\").suspend();" << iendl;
     oss << "}" << std::endl;
@@ -86,5 +85,4 @@
     oss << "  CTimer::get(\"XIOS\").resume();" << iendl;
     oss << "  " << className << "_hdl->" << name << ".setValue(" << name << "_str);" << iendl;
-//  oss << "  " << className << "_hdl->sendAttributToServer(" << className << "_hdl->" << name << ");" << iendl;
     oss << "  CTimer::get(\"XIOS\").suspend();" << iendl;
     oss << "}" << std::endl;
@@ -97,5 +95,5 @@
     oss << "  if (!string_copy(" << className << "_hdl->" << name << ".getInheritedValue(), " << name << ", " << name << "_size))" << iendl;
     oss << "    ERROR(\"void cxios_get_" << className << "_" << name << "(" << className << "_Ptr " << className << "_hdl, char * " << name << ", int "
-       << name << "_size)\", << \"Input string is too short\");" << iendl;
+        << name << "_size)\", << \"Input string is too short\");" << iendl;
     oss << "  CTimer::get(\"XIOS\").suspend();" << iendl;
     oss << "}" << std::endl;
@@ -111,5 +109,4 @@
     oss << "  CTimer::get(\"XIOS\").resume();" << iendl;
     oss << "  " << className << "_hdl->" << name << ".fromString(" << name << "_str);" << iendl;
-//  oss << "  " << className << "_hdl->sendAttributToServer(" << className << "_hdl->" << name << ");" << iendl;
     oss << "  CTimer::get(\"XIOS\").suspend();" << iendl;
     oss << "}" << std::endl;
@@ -122,5 +119,5 @@
     oss << "  if (!string_copy(" << className << "_hdl->" << name << ".getInheritedStringValue(), " << name << ", " << name << "_size))" << iendl;
     oss << "    ERROR(\"void cxios_get_" << className << "_" << name << "(" << className << "_Ptr " << className << "_hdl, char * " << name << ", int "
-       << name << "_size)\", << \"Input string is too short\");" << iendl;
+        << name << "_size)\", << \"Input string is too short\");" << iendl;
     oss << "  CTimer::get(\"XIOS\").suspend();" << iendl;
     oss << "}" << std::endl;
@@ -197,80 +194,4 @@
   }
 
-/*
-#define macro(T) \
-  template <> \
-  void CInterface::AttributeCInterface<ARRAY(T,1)>(ostream& oss, const string& className, const string& name) \
-  { \
-    string typeName=getStrType<T>(); \
-\
-    oss << "void cxios_set_" << className << "_" << name << "(" << className << "_Ptr " << className << "_hdl, " << typeName << "* " << name << ", int extent1)" << iendl; \
-    oss << "{" << iendl; \
-    oss << "   CTimer::get(\"XIOS\").resume();" << iendl; \
-    oss << "  ARRAY(" << typeName << ",1) array_tmp(new CArray<" << typeName << ",1>(boost::extents[extent1]));" << iendl; \
-    oss << "  std::copy(" << name << ", &(" << name << "[array_tmp->num_elements()]), array_tmp->data());" << iendl; \
-    oss << "  " << className << "_hdl->" << name << ".setValue(array_tmp);" << iendl; \
-//  oss << "  " << className << "_hdl->sendAttributToServer(" << className << "_hdl->" << name << ");" << iendl; \
-    oss << "}" << std::endl; \
-    oss << iendl; \
-    oss << "void cxios_get_" << className << "_" << name << "(" << className << "_Ptr " << className << "_hdl, " << typeName << "* " << name << ", int extent1)" << iendl; \
-    oss << "{" << iendl; \
-    oss << "  if (!array_copy(" << className << "_hdl->" << name << ".getValue(), " << name << ", extent1))" << iendl; \
-    oss << "   ERROR(\"void cxios_set_" << className << "_" << name << "(" << className << "_Ptr " << className << "_hdl, " << typeName << "* " << name << ", int extent1)\", << " \
-       << "\"Output array size is not conform to array size attribute\");" << iendl; \
-    oss << "   CTimer::get(\"XIOS\").suspend();" << iendl; \
-    oss << "}" << std::endl; \
-  } \
-\
-  template <> \
-  void CInterface::AttributeCInterface<ARRAY(T,2)>(ostream& oss, const string& className, const string& name) \
-  { \
-    string typeName=getStrType<T>(); \
-\
-    oss << "void cxios_set_" << className << "_" << name << "(" << className << "_Ptr " << className << "_hdl, " << typeName << "* " << name << ", int extent1, int extent2)" << iendl; \
-    oss << "{" << iendl; \
-    oss << "   CTimer::get(\"XIOS\").resume();" << iendl; \
-    oss << "  ARRAY(" << typeName << ",2) array_tmp(new CArray<" << typeName << ",2>(boost::extents[extent1][extent2]));" << iendl; \
-    oss << "  std::copy(" << name << ", &(" << name << "[array_tmp->num_elements()]), array_tmp->data());" << iendl; \
-    oss << "  " << className << "_hdl->" << name << ".setValue(array_tmp);" << iendl; \
-//  oss << "  " << className << "_hdl->sendAttributToServer(" << className << "_hdl->" << name << ");" << iendl; \
-    oss << "}" << std::endl; \
-    oss << iendl; \
-    oss << "void cxios_get_" << className << "_" << name << "(" << className << "_Ptr " << className << "_hdl, " << typeName << "* " << name << ", int extent1, int extent2)" << iendl; \
-    oss << "{" << iendl; \
-    oss << "  if (!array_copy(" << className << "_hdl->" << name << ".getValue(), " << name << ", extent1, extent2))" << iendl; \
-    oss << "   ERROR(\"void cxios_set_" << className << "_" << name << "(" << className << "_Ptr " << className << "_hdl, " << typeName << "* " << name << ", int extent1, int extent2)\", << " \
-       << "\"Output array size is not conform to array size attribute\");" << iendl; \
-    oss << "   CTimer::get(\"XIOS\").suspend();" << iendl; \
-    oss << "}" << std::endl; \
-  } \
-\
-  template <> \
-  void CInterface::AttributeCInterface<ARRAY(T,3)>(ostream& oss, const string& className, const string& name) \
-  { \
-    string typeName=getStrType<T>(); \
-\
-    oss << "void cxios_set_" << className << "_" << name << "(" << className << "_Ptr " << className << "_hdl, " << typeName << "* " << name << ", int extent1, int extent2, int extent3)" << iendl; \
-    oss << "{" << iendl; \
-    oss << "   CTimer::get(\"XIOS\").resume();" << iendl; \
-    oss << "  ARRAY(" << typeName << ",3) array_tmp(new CArray<" << typeName << ",3>(boost::extents[extent1][extent2][extent3]));" << iendl; \
-    oss << "  std::copy(" << name << ", &(" << name << "[array_tmp->num_elements()]), array_tmp->data());" << iendl; \
-    oss << "  " << className << "_hdl->" << name << ".setValue(array_tmp);" << iendl; \
-//  oss << "  " << className << "_hdl->sendAttributToServer(" << className << "_hdl->" << name << ");" << iendl; \
-    oss << "}" << std::endl; \
-    oss << iendl; \
-    oss << "void cxios_get_" << className << "_" << name << "(" << className << "_Ptr " << className << "_hdl, " << typeName << "* " << name << ", int extent1, int extent2, int extent3)" << iendl; \
-    oss << "{" << iendl; \
-    oss << "  if (!array_copy(" << className << "_hdl->" << name << ".getValue(), " << name << ", extent1))" << iendl; \
-    oss << "   ERROR(\"void cxios_set_" << className << "_" << name << "(" << className << "_Ptr " << className << "_hdl, " << typeName << "* " << name << ", int extent1, int extent2, int extent3)\", << " \
-       << "\"Output array size is not conform to array size attribute\");" << iendl; \
-    oss << "   CTimer::get(\"XIOS\").suspend();" << iendl; \
-    oss << "}" << std::endl; \
-  }
-
-macro(bool)
-macro(double)
-macro(int)
-*/
-
 #undef macro
 
@@ -278,49 +199,50 @@
 // //          Fortran 2003 Interface             //
 // /////////////////////////////////////////////////
-   void CInterface::AttributeIsDefinedFortran2003Interface(ostream& oss, const string& className, const string& name)
-   {
-     oss << "FUNCTION cxios_is_defined_" << className << "_" << name << "(" << className << "_hdl) BIND(C)" << iendl;
-     oss << "  USE ISO_C_BINDING" << iendl;
-     oss << "  LOGICAL(kind=C_BOOL) :: cxios_is_defined_" << className << "_" << name << iendl;
-     oss << "  INTEGER (kind = C_INTPTR_T), VALUE :: " << className << "_hdl" << iendl;
-     oss << "END FUNCTION cxios_is_defined_" << className << "_" << name << std::endl;
-   }
-
-   template <class T>
-   void CInterface::AttributeFortran2003Interface(ostream& oss, const string& className, const string& name)
-   {
-     string fortranType=getStrFortranType<T>();
-     string fortranKindC=getStrFortranKindC<T>();
-
-     oss << "SUBROUTINE cxios_set_" << className << "_" << name << "(" << className << "_hdl, " << name << ") BIND(C)" << iendl;
-     oss << "  USE ISO_C_BINDING" << iendl;
-     oss << "  INTEGER (kind = C_INTPTR_T), VALUE :: " << className << "_hdl" << iendl;
-     oss << "  " << fortranType << " " << fortranKindC << "      , VALUE :: " << name << iendl;
-     oss << "END SUBROUTINE cxios_set_" << className << "_" << name << std::endl;
-     oss << iendl;
-     oss << "SUBROUTINE cxios_get_" << className << "_" << name << "(" << className << "_hdl, " << name << ") BIND(C)" << iendl;
-     oss << "  USE ISO_C_BINDING" << iendl;
-     oss << "  INTEGER (kind = C_INTPTR_T), VALUE :: " << className << "_hdl" << iendl;
-     oss << "  " << fortranType << " " << fortranKindC << "             :: " << name << iendl;
-     oss << "END SUBROUTINE cxios_get_" << className << "_" << name << std::endl;
-   }
-
-   template <>
-   void CInterface::AttributeFortran2003Interface<string>(ostream& oss, const string& className, const string& name)
-   {
-     oss << "SUBROUTINE cxios_set_" << className << "_" << name << "(" << className << "_hdl, " << name << ", " << name << "_size) BIND(C)" << iendl;
-     oss << "  USE ISO_C_BINDING" << iendl;
-     oss << "  INTEGER (kind = C_INTPTR_T), VALUE :: " << className << "_hdl" << iendl;
-     oss << "  CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: " << name << iendl;
-     oss << "  INTEGER  (kind = C_INT)     , VALUE        :: " << name << "_size" << iendl;
-     oss << "END SUBROUTINE cxios_set_" << className << "_" << name << std::endl;
-     oss << iendl;
-     oss << "SUBROUTINE cxios_get_" << className << "_" << name << "(" << className << "_hdl, " << name << ", " << name << "_size) BIND(C)" << iendl;
-     oss << "  USE ISO_C_BINDING" << iendl;
-     oss << "  INTEGER (kind = C_INTPTR_T), VALUE :: " << className << "_hdl" << iendl;
-     oss << "  CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: " << name << iendl;
-     oss << "  INTEGER  (kind = C_INT)     , VALUE        :: " << name << "_size" << iendl;
-     oss << "END SUBROUTINE cxios_get_" << className << "_" << name << std::endl;
-   }
+
+  void CInterface::AttributeIsDefinedFortran2003Interface(ostream& oss, const string& className, const string& name)
+  {
+    oss << "FUNCTION cxios_is_defined_" << className << "_" << name << "(" << className << "_hdl) BIND(C)" << iendl;
+    oss << "  USE ISO_C_BINDING" << iendl;
+    oss << "  LOGICAL(kind=C_BOOL) :: cxios_is_defined_" << className << "_" << name << iendl;
+    oss << "  INTEGER (kind = C_INTPTR_T), VALUE :: " << className << "_hdl" << iendl;
+    oss << "END FUNCTION cxios_is_defined_" << className << "_" << name << std::endl;
+  }
+
+  template <class T>
+  void CInterface::AttributeFortran2003Interface(ostream& oss, const string& className, const string& name)
+  {
+    string fortranType=getStrFortranType<T>();
+    string fortranKindC=getStrFortranKindC<T>();
+
+    oss << "SUBROUTINE cxios_set_" << className << "_" << name << "(" << className << "_hdl, " << name << ") BIND(C)" << iendl;
+    oss << "  USE ISO_C_BINDING" << iendl;
+    oss << "  INTEGER (kind = C_INTPTR_T), VALUE :: " << className << "_hdl" << iendl;
+    oss << "  " << fortranType << " " << fortranKindC << "      , VALUE :: " << name << iendl;
+    oss << "END SUBROUTINE cxios_set_" << className << "_" << name << std::endl;
+    oss << iendl;
+    oss << "SUBROUTINE cxios_get_" << className << "_" << name << "(" << className << "_hdl, " << name << ") BIND(C)" << iendl;
+    oss << "  USE ISO_C_BINDING" << iendl;
+    oss << "  INTEGER (kind = C_INTPTR_T), VALUE :: " << className << "_hdl" << iendl;
+    oss << "  " << fortranType << " " << fortranKindC << "             :: " << name << iendl;
+    oss << "END SUBROUTINE cxios_get_" << className << "_" << name << std::endl;
+  }
+
+  template <>
+  void CInterface::AttributeFortran2003Interface<string>(ostream& oss, const string& className, const string& name)
+  {
+    oss << "SUBROUTINE cxios_set_" << className << "_" << name << "(" << className << "_hdl, " << name << ", " << name << "_size) BIND(C)" << iendl;
+    oss << "  USE ISO_C_BINDING" << iendl;
+    oss << "  INTEGER (kind = C_INTPTR_T), VALUE :: " << className << "_hdl" << iendl;
+    oss << "  CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: " << name << iendl;
+    oss << "  INTEGER  (kind = C_INT)     , VALUE        :: " << name << "_size" << iendl;
+    oss << "END SUBROUTINE cxios_set_" << className << "_" << name << std::endl;
+    oss << iendl;
+    oss << "SUBROUTINE cxios_get_" << className << "_" << name << "(" << className << "_hdl, " << name << ", " << name << "_size) BIND(C)" << iendl;
+    oss << "  USE ISO_C_BINDING" << iendl;
+    oss << "  INTEGER (kind = C_INTPTR_T), VALUE :: " << className << "_hdl" << iendl;
+    oss << "  CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: " << name << iendl;
+    oss << "  INTEGER  (kind = C_INT)     , VALUE        :: " << name << "_size" << iendl;
+    oss << "END SUBROUTINE cxios_get_" << className << "_" << name << std::endl;
+  }
 
   template <>
@@ -360,332 +282,91 @@
   }
 
-/*
-#define macro(T) \
-   template <> \
-   void CInterface::AttributeFortran2003Interface<ARRAY(T,1)>(ostream& oss, const string& className, const string& name) \
-   { \
-     string fortranType=getStrFortranType<T>(); \
-     string fortranKindC=getStrFortranKindC<T>(); \
-      \
-     oss << "SUBROUTINE cxios_set_" << className << "_" << name << "(" << className << "_hdl, " << name << ", extent1) BIND(C)" << iendl; \
-     oss << "  USE ISO_C_BINDING" << iendl; \
-     oss << "  INTEGER (kind = C_INTPTR_T), VALUE       :: " << className << "_hdl" << iendl; \
-     oss << "  " << fortranType << " " << fortranKindC << "     , DIMENSION(*) :: " << name << iendl; \
-     oss << "  INTEGER (kind = C_INT), VALUE  :: extent1" << iendl; \
-     oss << "END SUBROUTINE cxios_set_" << className << "_" << name << std::endl; \
-     oss << iendl; \
-     oss << "SUBROUTINE cxios_get_" << className << "_" << name << "(" << className << "_hdl, " << name << ", extent1) BIND(C)" << iendl; \
-     oss << "  USE ISO_C_BINDING" << iendl; \
-     oss << "  INTEGER (kind = C_INTPTR_T), VALUE       :: " << className << "_hdl" << iendl; \
-     oss << "  " << fortranType << " " << fortranKindC << "     , DIMENSION(*) :: " << name << iendl; \
-     oss << "  INTEGER (kind = C_INT), VALUE  :: extent1" << iendl; \
-     oss << "END SUBROUTINE cxios_get_" << className << "_" << name << std::endl; \
-   } \
- \
-   template <> \
-   void CInterface::AttributeFortran2003Interface<ARRAY(T,2)>(ostream& oss, const string& className, const string& name) \
-   { \
-     string fortranType=getStrFortranType<T>(); \
-     string fortranKindC=getStrFortranKindC<T>(); \
-      \
-     oss << "SUBROUTINE cxios_set_" << className << "_" << name << "(" << className << "_hdl, " << name << ", extent1, extent2) BIND(C)" << iendl; \
-     oss << "  USE ISO_C_BINDING" << iendl; \
-     oss << "  INTEGER (kind = C_INTPTR_T), VALUE       :: " << className << "_hdl" << iendl; \
-     oss << "  " << fortranType << " " << fortranKindC << "     , DIMENSION(*) :: " << name << iendl; \
-     oss << "  INTEGER (kind = C_INT), VALUE  :: extent1" << iendl; \
-     oss << "  INTEGER (kind = C_INT), VALUE  :: extent2" << iendl; \
-     oss << "END SUBROUTINE cxios_set_" << className << "_" << name << std::endl; \
-     oss << iendl; \
-     oss << "SUBROUTINE cxios_get_" << className << "_" << name << "(" << className << "_hdl, " << name << ", extent1, extent2) BIND(C)" << iendl; \
-     oss << "  USE ISO_C_BINDING" << iendl; \
-     oss << "  INTEGER (kind = C_INTPTR_T), VALUE       :: " << className << "_hdl" << iendl; \
-     oss << "  " << fortranType << " " << fortranKindC << "     , DIMENSION(*) :: " << name << iendl; \
-     oss << "  INTEGER (kind = C_INT), VALUE  :: extent1" << iendl; \
-     oss << "  INTEGER (kind = C_INT), VALUE  :: extent2" << iendl; \
-     oss << "END SUBROUTINE cxios_get_" << className << "_" << name << std::endl; \
-   } \
-     \
-   template <> \
-   void CInterface::AttributeFortran2003Interface<ARRAY(T,3)>(ostream& oss, const string& className, const string& name) \
-   { \
-     string fortranType=getStrFortranType<T>(); \
-     string fortranKindC=getStrFortranKindC<T>(); \
-      \
-     oss << "SUBROUTINE cxios_set_" << className << "_" << name << "(" << className << "_hdl, " << name << ", extent1, extent2, extent3) BIND(C)" << iendl; \
-     oss << "  USE ISO_C_BINDING" << iendl; \
-     oss << "  INTEGER (kind = C_INTPTR_T), VALUE       :: " << className << "_hdl" << iendl; \
-     oss << "  " << fortranType << " " << fortranKindC << "     , DIMENSION(*) :: " << name << iendl; \
-     oss << "  INTEGER (kind = C_INT), VALUE  :: extent1" << iendl; \
-     oss << "  INTEGER (kind = C_INT), VALUE  :: extent2" << iendl; \
-     oss << "  INTEGER (kind = C_INT), VALUE  :: extent3" << iendl; \
-     oss << "END SUBROUTINE cxios_set_" << className << "_" << name << std::endl; \
-     oss << iendl; \
-     oss << "SUBROUTINE cxios_get_" << className << "_" << name << "(" << className << "_hdl, " << name << ", extent1, extent2, extent3) BIND(C)" << iendl; \
-     oss << "  USE ISO_C_BINDING" << iendl; \
-     oss << "  INTEGER (kind = C_INTPTR_T), VALUE       :: " << className << "_hdl" << iendl; \
-     oss << "  " << fortranType << " " << fortranKindC << "     , DIMENSION(*) :: " << name << iendl; \
-     oss << "  INTEGER (kind = C_INT), VALUE  :: extent1" << iendl; \
-     oss << "  INTEGER (kind = C_INT), VALUE  :: extent2" << iendl; \
-     oss << "  INTEGER (kind = C_INT), VALUE  :: extent3" << iendl; \
-     oss << "END SUBROUTINE cxios_get_" << className << "_" << name << std::endl; \
-   }
-
-  macro(bool)
-  macro(double)
-  macro(int)
-
-  #undef macro
-*/
-   template <class T>
-   void CInterface::AttributeFortranInterfaceDeclaration(ostream& oss, const string& className, const string& name)
-   {
-     oss << getStrFortranType<T>() << " " << getStrFortranKind<T>() << " , OPTIONAL, INTENT(IN) :: " << name;
-     if (!matchingTypeCFortran<T>()) oss << iendl << getStrFortranType<T>() << " " << getStrFortranKindC<T>() << " :: " << name << "_tmp";
-   }
-
-   template <class T>
-   void CInterface::AttributeFortranInterfaceGetDeclaration(ostream& oss, const string& className, const string& name)
-   {
-     oss << getStrFortranType<T>() << " " << getStrFortranKind<T>() << " , OPTIONAL, INTENT(OUT) :: " << name;
-     if (!matchingTypeCFortran<T>()) oss << iendl << getStrFortranType<T>() << " " << getStrFortranKindC<T>() << " :: " << name << "_tmp";
-   }
-
-   void CInterface::AttributeFortranInterfaceIsDefinedDeclaration(ostream& oss, const string& className, const string& name)
-   {
-     oss << "LOGICAL, OPTIONAL, INTENT(OUT) :: " << name << iendl;
-     oss << "LOGICAL(KIND=C_BOOL) :: " << name << "_tmp";
-   }
-
-   template <>
-   void CInterface::AttributeFortranInterfaceDeclaration<string>(ostream& oss, const string& className, const string& name)
-   {
-     oss << "CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: " << name;
-   }
-
-   template <>
-   void CInterface::AttributeFortranInterfaceGetDeclaration<string>(ostream& oss, const string& className, const string& name)
-   {
-     oss << "CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: " << name;
-   }
-
-/*
-#define macro(T) \
-   template <> \
-   void CInterface::AttributeFortranInterfaceDeclaration<ARRAY(T,1)>(ostream& oss, const string& className, const string& name) \
-   { \
-     oss << getStrFortranType<T>() << " " << getStrFortranKind<T>() << " , OPTIONAL, INTENT(IN) :: " << name << "(:)"; \
-     if (!matchingTypeCFortran<T>()) oss << iendl << getStrFortranType<T>() << " " << getStrFortranKindC<T>() << " , ALLOCATABLE :: " << name << "_tmp(:)"; \
-   } \
-   template <> \
-   void CInterface::AttributeFortranInterfaceGetDeclaration<ARRAY(T,1)>(ostream& oss, const string& className, const string& name) \
-   { \
-     oss << getStrFortranType<T>() << " " << getStrFortranKind<T>() << " , OPTIONAL, INTENT(OUT) :: " << name << "(:)"; \
-     if (!matchingTypeCFortran<T>()) oss << iendl << getStrFortranType<T>() << " " << getStrFortranKindC<T>() << " , ALLOCATABLE :: " << name << "_tmp(:)"; \
-   } \
- \
-   template <> \
-   void CInterface::AttributeFortranInterfaceDeclaration<ARRAY(T,2)>(ostream& oss, const string& className, const string& name) \
-   { \
-     oss << getStrFortranType<T>() << " " << getStrFortranKind<T>() << " , OPTIONAL, INTENT(IN) :: " << name << "(:,:)"; \
-     if (!matchingTypeCFortran<T>()) oss << iendl << getStrFortranType<T>() << " " << getStrFortranKindC<T>() << " , ALLOCATABLE :: " << name << "_tmp(:,:)"; \
-   } \
- \
-   template <> \
-   void CInterface::AttributeFortranInterfaceGetDeclaration<ARRAY(T,2)>(ostream& oss, const string& className, const string& name) \
-   { \
-     oss << getStrFortranType<T>() << " " << getStrFortranKind<T>() << " , OPTIONAL, INTENT(OUT) :: " << name << "(:,:)"; \
-     if (!matchingTypeCFortran<T>()) oss << iendl << getStrFortranType<T>() << " " << getStrFortranKindC<T>() << " , ALLOCATABLE :: " << name << "_tmp(:,:)"; \
-   } \
- \
-   template <> \
-   void CInterface::AttributeFortranInterfaceDeclaration<ARRAY(T,3)>(ostream& oss, const string& className, const string& name) \
-   { \
-     oss << getStrFortranType<T>() << " " << getStrFortranKind<T>() << " , OPTIONAL, INTENT(IN) :: " << name << "(:,:,:)"; \
-     if (!matchingTypeCFortran<T>()) oss << iendl << getStrFortranType<T>() << " " << getStrFortranKindC<T>() << " , ALLOCATABLE :: " << name << "_tmp(:,:,:)"; \
-   } \
- \
-   template <> \
-   void CInterface::AttributeFortranInterfaceGetDeclaration<ARRAY(T,3)>(ostream& oss, const string& className, const string& name) \
-   { \
-     oss << getStrFortranType<T>() << " " << getStrFortranKind<T>() << " , OPTIONAL, INTENT(OUT) :: " << name << "(:,:,:)"; \
-     if (!matchingTypeCFortran<T>()) oss << iendl << getStrFortranType<T>() << " " << getStrFortranKindC<T>() << " , ALLOCATABLE :: " << name << "_tmp(:,:,:)"; \
-   }
-
-  macro(bool)
-  macro(double)
-  macro(int)
-
-#undef macro
-*/
-
-   template <class T>
-   void CInterface::AttributeFortranInterfaceBody(ostream& oss, const string& className, const string& name)
-   {
-     string name_tmp=name+"__tmp";
-
-     oss << "IF (PRESENT(" << name << "_)) THEN" << iendl;
-     if (!matchingTypeCFortran<T>())
-     {
-       oss << "  " << name_tmp << " = " << name << "_" << iendl;
-       oss << "  CALL cxios_set_" << className << "_" << name << "(" << className << "_hdl%daddr, " << name_tmp << ")" << iendl;
-     }
-     else oss << "  CALL cxios_set_" << className << "_" << name << "(" << className << "_hdl%daddr, " << name << "_)" << iendl;
-     oss << "ENDIF";
-   }
-
-   template <class T>
-   void CInterface::AttributeFortranInterfaceGetBody(ostream& oss, const string& className, const string& name)
-   {
-     string name_tmp=name+"__tmp";
-
-     oss << "IF (PRESENT(" << name << "_)) THEN" << iendl;
-     if (!matchingTypeCFortran<T>())
-     {
-       oss << "  CALL cxios_get_" << className << "_" << name << "(" << className << "_hdl%daddr, " << name_tmp << ")" << iendl;
-       oss << "  " << name << "_ = " << name_tmp << iendl;
-     }
-     else oss << "  CALL cxios_get_" << className << "_" << name << "(" << className << "_hdl%daddr, " << name << "_)" << iendl;
-     oss << "ENDIF";
-   }
-
-   void CInterface::AttributeFortranInterfaceIsDefinedBody(ostream& oss, const string& className, const string& name)
-   {
-     string name_tmp=name+"__tmp";
-
-     oss << "IF (PRESENT(" << name << "_)) THEN" << iendl;
-     oss << "  " << name << "__tmp = cxios_is_defined_" << className << "_" << name << "(" << className << "_hdl%daddr)" << iendl;
-     oss << "  " << name << "_ = " << name_tmp << iendl;
-     oss << "ENDIF";
-   }
-
-   template <>
-   void CInterface::AttributeFortranInterfaceBody<string>(ostream& oss, const string& className, const string& name)
-   {
-      oss << "IF (PRESENT(" << name << "_)) THEN" << iendl;
-      oss << "  CALL cxios_set_" << className << "_" << name << "(" << className << "_hdl%daddr, " << name << "_, len(" << name << "_))" << iendl;
-      oss << "ENDIF";
-   }
-
-   template <>
-   void CInterface::AttributeFortranInterfaceGetBody<string>(ostream& oss, const string& className, const string& name)
-   {
-      oss << "IF (PRESENT(" << name << "_)) THEN" << iendl;
-      oss << "  CALL cxios_get_" << className << "_" << name << "(" << className << "_hdl%daddr, " << name << "_, len(" << name << "_))" << iendl;
-      oss << "ENDIF";
-   }
-
-/*
-#define macro(T) \
-   template <>  \
-   void CInterface::AttributeFortranInterfaceBody< ARRAY(T,1) >(ostream& oss, const string& className, const string& name) \
-   {  \
-     string name_tmp=name+"__tmp"; \
-      \
-     oss << "IF (PRESENT(" << name << "_)) THEN" << iendl; \
-     if (!matchingTypeCFortran<T>())  \
-     { \
-       oss << "  ALLOCATE(" << name_tmp << "(size(" << name << "_,1)))" << iendl; \
-       oss << "  " << name_tmp << " = " << name << "_" << iendl; \
-       oss << "  CALL cxios_set_" << className << "_" << name << "(" << className << "_hdl%daddr, " << name_tmp << ", size(" << name << "_,1))" << iendl; \
-     } \
-     else oss << "  CALL cxios_set_" << className << "_" << name << "(" << className << "_hdl%daddr, " << name << "_, size(" << name << "_,1))" << iendl; \
-     oss << "ENDIF"; \
-   } \
- \
-   template <>  \
-   void CInterface::AttributeFortranInterfaceBody< ARRAY(T,2) >(ostream& oss, const string& className, const string& name) \
-   {  \
-     string name_tmp=name+"__tmp"; \
-      \
-     oss << "IF (PRESENT(" << name << "_)) THEN" << iendl; \
-     if (!matchingTypeCFortran<T>())  \
-     { \
-       oss << "  ALLOCATE(" << name_tmp << "(size(" << name << "_,1), size(" << name << "_,2)))" << iendl; \
-       oss << "  " << name_tmp << " = " << name << "_" << iendl; \
-       oss << "  CALL cxios_set_" << className << "_" << name << "(" << className << "_hdl%daddr, " << name_tmp << ", size(" << name << "_,1), size(" << name << "_,2))" << iendl; \
-     } \
-     else oss << "  CALL cxios_set_" << className << "_" << name << "(" << className << "_hdl%daddr, " << name << "_, size(" << name << "_,1), size(" << name << "_,2))" << iendl; \
-     oss << "ENDIF"; \
-   } \
-    \
-   template <>  \
-   void CInterface::AttributeFortranInterfaceBody< ARRAY(T,3) >(ostream& oss, const string& className, const string& name) \
-   {  \
-     string name_tmp=name+"__tmp"; \
-      \
-     oss << "IF (PRESENT(" << name << "_)) THEN" << iendl; \
-     if (!matchingTypeCFortran<T>())  \
-     { \
-       oss << "  ALLOCATE(" << name_tmp << "(size(" << name << "_,1), size(" << name << "_,2), size(" << name << "_,3)))" << iendl; \
-       oss << "  " << name_tmp << " = " << name << "_" << iendl; \
-       oss << "  CALL cxios_set_" << className << "_" << name << "(" << className << "_hdl%daddr, " << name_tmp << ", size(" << name << "_,1), size(" << name << "_,2), size(" << name << "_,3))" << iendl; \
-     } \
-     else oss << "  CALL cxios_set_" << className << "_" << name << "(" << className << "_hdl%daddr, " << name << "_, size(" << name << "_,1), size(" << name << "_,2), size(" << name << "_,3))" << iendl; \
-     oss << "ENDIF"; \
-   }
-
-  macro(bool)
-  macro(double)
-  macro(int)
-
-#undef macro
-*/
-
-/*
-#define macro(T) \
-   template <>  \
-   void CInterface::AttributeFortranInterfaceGetBody< ARRAY(T,1) >(ostream& oss, const string& className, const string& name) \
-   {  \
-     string name_tmp=name+"__tmp"; \
-      \
-     oss << "IF (PRESENT(" << name << "_)) THEN" << iendl; \
-     if (!matchingTypeCFortran<T>())  \
-     { \
-       oss << "  ALLOCATE(" << name_tmp << "(size(" << name << "_,1)))" << iendl; \
-       oss << "  CALL cxios_get_" << className << "_" << name << "(" << className << "_hdl%daddr, " << name_tmp << ", size(" << name << "_,1))" << iendl; \
-       oss << "  " << name << "_ = " << name_tmp << iendl; \
-     } \
-     else oss << "  CALL cxios_get_" << className << "_" << name << "(" << className << "_hdl%daddr, " << name << "_, size(" << name << "_,1))" << iendl; \
-     oss << "ENDIF"; \
-   } \
- \
-   template <>  \
-   void CInterface::AttributeFortranInterfaceGetBody< ARRAY(T,2) >(ostream& oss, const string& className, const string& name) \
-   {  \
-     string name_tmp=name+"__tmp"; \
-      \
-     oss << "IF (PRESENT(" << name << "_)) THEN" << iendl; \
-     if (!matchingTypeCFortran<T>())  \
-     { \
-       oss << "  ALLOCATE(" << name_tmp << "(size(" << name << "_,1), size(" << name << "_,2)))" << iendl; \
-       oss << "  CALL cxios_get_" << className << "_" << name << "(" << className << "_hdl%daddr, " << name_tmp << ", size(" << name << "_,1), size(" << name << "_,2))" << iendl; \
-       oss << "  " << name << "_ = " << name_tmp << iendl; \
-     } \
-     else oss << "  CALL cxios_get_" << className << "_" << name << "(" << className << "_hdl%daddr, " << name << "_, size(" << name << "_,1), size(" << name << "_,2))" << iendl; \
-     oss << "ENDIF"; \
-   } \
-    \
-   template <>  \
-   void CInterface::AttributeFortranInterfaceGetBody< ARRAY(T,3) >(ostream& oss, const string& className, const string& name) \
-   {  \
-     string name_tmp=name+"__tmp"; \
-      \
-     oss << "IF (PRESENT(" << name << "_)) THEN" << iendl; \
-     if (!matchingTypeCFortran<T>())  \
-     { \
-       oss << "  ALLOCATE(" << name_tmp << "(size(" << name << "_,1), size(" << name << "_,2), size(" << name << "_,3)))" << iendl; \
-       oss << "  CALL cxios_get_" << className << "_" << name << "(" << className << "_hdl%daddr, " << name_tmp << ", size(" << name << "_,1), size(" << name << "_,2), size(" << name << "_,3))" << iendl; \
-       oss << "  " << name << "_ = " << name_tmp << iendl; \
-      } \
-     else oss << "  CALL cxios_get_" << className << "_" << name << "(" << className << "_hdl%daddr, " << name << "_, size(" << name << "_,1), size(" << name << "_,2), size(" << name << "_,3))" << iendl; \
-     oss << "ENDIF"; \
-   }
-
-  macro(bool)
-  macro(double)
-  macro(int)
-
-#undef macro
-*/
+  template <class T>
+  void CInterface::AttributeFortranInterfaceDeclaration(ostream& oss, const string& className, const string& name)
+  {
+    oss << getStrFortranType<T>() << " " << getStrFortranKind<T>() << " , OPTIONAL, INTENT(IN) :: " << name;
+    if (!matchingTypeCFortran<T>()) oss << iendl << getStrFortranType<T>() << " " << getStrFortranKindC<T>() << " :: " << name << "_tmp";
+  }
+
+  template <class T>
+  void CInterface::AttributeFortranInterfaceGetDeclaration(ostream& oss, const string& className, const string& name)
+  {
+    oss << getStrFortranType<T>() << " " << getStrFortranKind<T>() << " , OPTIONAL, INTENT(OUT) :: " << name;
+    if (!matchingTypeCFortran<T>()) oss << iendl << getStrFortranType<T>() << " " << getStrFortranKindC<T>() << " :: " << name << "_tmp";
+  }
+
+  void CInterface::AttributeFortranInterfaceIsDefinedDeclaration(ostream& oss, const string& className, const string& name)
+  {
+    oss << "LOGICAL, OPTIONAL, INTENT(OUT) :: " << name << iendl;
+    oss << "LOGICAL(KIND=C_BOOL) :: " << name << "_tmp";
+  }
+
+  template <>
+  void CInterface::AttributeFortranInterfaceDeclaration<string>(ostream& oss, const string& className, const string& name)
+  {
+    oss << "CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: " << name;
+  }
+
+  template <>
+  void CInterface::AttributeFortranInterfaceGetDeclaration<string>(ostream& oss, const string& className, const string& name)
+  {
+    oss << "CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: " << name;
+  }
+
+  template <class T>
+  void CInterface::AttributeFortranInterfaceBody(ostream& oss, const string& className, const string& name)
+  {
+    string name_tmp=name+"__tmp";
+
+    oss << "IF (PRESENT(" << name << "_)) THEN" << iendl;
+    if (!matchingTypeCFortran<T>())
+    {
+      oss << "  " << name_tmp << " = " << name << "_" << iendl;
+      oss << "  CALL cxios_set_" << className << "_" << name << "(" << className << "_hdl%daddr, " << name_tmp << ")" << iendl;
+    }
+    else oss << "  CALL cxios_set_" << className << "_" << name << "(" << className << "_hdl%daddr, " << name << "_)" << iendl;
+    oss << "ENDIF";
+  }
+
+  template <class T>
+  void CInterface::AttributeFortranInterfaceGetBody(ostream& oss, const string& className, const string& name)
+  {
+    string name_tmp=name+"__tmp";
+
+    oss << "IF (PRESENT(" << name << "_)) THEN" << iendl;
+    if (!matchingTypeCFortran<T>())
+    {
+      oss << "  CALL cxios_get_" << className << "_" << name << "(" << className << "_hdl%daddr, " << name_tmp << ")" << iendl;
+      oss << "  " << name << "_ = " << name_tmp << iendl;
+    }
+    else oss << "  CALL cxios_get_" << className << "_" << name << "(" << className << "_hdl%daddr, " << name << "_)" << iendl;
+    oss << "ENDIF";
+  }
+
+  void CInterface::AttributeFortranInterfaceIsDefinedBody(ostream& oss, const string& className, const string& name)
+  {
+    string name_tmp=name+"__tmp";
+
+    oss << "IF (PRESENT(" << name << "_)) THEN" << iendl;
+    oss << "  " << name << "__tmp = cxios_is_defined_" << className << "_" << name << "(" << className << "_hdl%daddr)" << iendl;
+    oss << "  " << name << "_ = " << name_tmp << iendl;
+    oss << "ENDIF";
+  }
+
+  template <>
+  void CInterface::AttributeFortranInterfaceBody<string>(ostream& oss, const string& className, const string& name)
+  {
+    oss << "IF (PRESENT(" << name << "_)) THEN" << iendl;
+    oss << "  CALL cxios_set_" << className << "_" << name << "(" << className << "_hdl%daddr, " << name << "_, len(" << name << "_))" << iendl;
+    oss << "ENDIF";
+  }
+
+  template <>
+  void CInterface::AttributeFortranInterfaceGetBody<string>(ostream& oss, const string& className, const string& name)
+  {
+    oss << "IF (PRESENT(" << name << "_)) THEN" << iendl;
+    oss << "  CALL cxios_get_" << className << "_" << name << "(" << className << "_hdl%daddr, " << name << "_, len(" << name << "_))" << iendl;
+    oss << "ENDIF";
+  }
 
 // declaration for CArray
@@ -772,72 +453,72 @@
 
 #define macro(T) \
-   template <> \
-   void CInterface::AttributeFortran2003Interface<CArray<T,1> >(ostream& oss, const string& className, const string& name) \
-   { \
-     string fortranType=getStrFortranType<T>(); \
-     string fortranKindC=getStrFortranKindC<T>(); \
-      \
-     oss << "SUBROUTINE cxios_set_" << className << "_" << name << "(" << className << "_hdl, " << name << ", extent1) BIND(C)" << iendl; \
-     oss << "  USE ISO_C_BINDING" << iendl; \
-     oss << "  INTEGER (kind = C_INTPTR_T), VALUE       :: " << className << "_hdl" << iendl; \
-     oss << "  " << fortranType << " " << fortranKindC << "     , DIMENSION(*) :: " << name << iendl; \
-     oss << "  INTEGER (kind = C_INT), VALUE  :: extent1" << iendl; \
-     oss << "END SUBROUTINE cxios_set_" << className << "_" << name << std::endl; \
-     oss << iendl; \
-     oss << "SUBROUTINE cxios_get_" << className << "_" << name << "(" << className << "_hdl, " << name << ", extent1) BIND(C)" << iendl; \
-     oss << "  USE ISO_C_BINDING" << iendl; \
-     oss << "  INTEGER (kind = C_INTPTR_T), VALUE       :: " << className << "_hdl" << iendl; \
-     oss << "  " << fortranType << " " << fortranKindC << "     , DIMENSION(*) :: " << name << iendl; \
-     oss << "  INTEGER (kind = C_INT), VALUE  :: extent1" << iendl; \
-     oss << "END SUBROUTINE cxios_get_" << className << "_" << name << std::endl; \
-   } \
+  template <> \
+  void CInterface::AttributeFortran2003Interface<CArray<T,1> >(ostream& oss, const string& className, const string& name) \
+  { \
+    string fortranType=getStrFortranType<T>(); \
+    string fortranKindC=getStrFortranKindC<T>(); \
+      \
+    oss << "SUBROUTINE cxios_set_" << className << "_" << name << "(" << className << "_hdl, " << name << ", extent1) BIND(C)" << iendl; \
+    oss << "  USE ISO_C_BINDING" << iendl; \
+    oss << "  INTEGER (kind = C_INTPTR_T), VALUE       :: " << className << "_hdl" << iendl; \
+    oss << "  " << fortranType << " " << fortranKindC << "     , DIMENSION(*) :: " << name << iendl; \
+    oss << "  INTEGER (kind = C_INT), VALUE  :: extent1" << iendl; \
+    oss << "END SUBROUTINE cxios_set_" << className << "_" << name << std::endl; \
+    oss << iendl; \
+    oss << "SUBROUTINE cxios_get_" << className << "_" << name << "(" << className << "_hdl, " << name << ", extent1) BIND(C)" << iendl; \
+    oss << "  USE ISO_C_BINDING" << iendl; \
+    oss << "  INTEGER (kind = C_INTPTR_T), VALUE       :: " << className << "_hdl" << iendl; \
+    oss << "  " << fortranType << " " << fortranKindC << "     , DIMENSION(*) :: " << name << iendl; \
+    oss << "  INTEGER (kind = C_INT), VALUE  :: extent1" << iendl; \
+    oss << "END SUBROUTINE cxios_get_" << className << "_" << name << std::endl; \
+  } \
  \
-   template <> \
-   void CInterface::AttributeFortran2003Interface<CArray<T,2> >(ostream& oss, const string& className, const string& name) \
-   { \
-     string fortranType=getStrFortranType<T>(); \
-     string fortranKindC=getStrFortranKindC<T>(); \
-      \
-     oss << "SUBROUTINE cxios_set_" << className << "_" << name << "(" << className << "_hdl, " << name << ", extent1, extent2) BIND(C)" << iendl; \
-     oss << "  USE ISO_C_BINDING" << iendl; \
-     oss << "  INTEGER (kind = C_INTPTR_T), VALUE       :: " << className << "_hdl" << iendl; \
-     oss << "  " << fortranType << " " << fortranKindC << "     , DIMENSION(*) :: " << name << iendl; \
-     oss << "  INTEGER (kind = C_INT), VALUE  :: extent1" << iendl; \
-     oss << "  INTEGER (kind = C_INT), VALUE  :: extent2" << iendl; \
-     oss << "END SUBROUTINE cxios_set_" << className << "_" << name << std::endl; \
-     oss << iendl; \
-     oss << "SUBROUTINE cxios_get_" << className << "_" << name << "(" << className << "_hdl, " << name << ", extent1, extent2) BIND(C)" << iendl; \
-     oss << "  USE ISO_C_BINDING" << iendl; \
-     oss << "  INTEGER (kind = C_INTPTR_T), VALUE       :: " << className << "_hdl" << iendl; \
-     oss << "  " << fortranType << " " << fortranKindC << "     , DIMENSION(*) :: " << name << iendl; \
-     oss << "  INTEGER (kind = C_INT), VALUE  :: extent1" << iendl; \
-     oss << "  INTEGER (kind = C_INT), VALUE  :: extent2" << iendl; \
-     oss << "END SUBROUTINE cxios_get_" << className << "_" << name << std::endl; \
-   } \
-     \
-   template <> \
-   void CInterface::AttributeFortran2003Interface<CArray<T,3> >(ostream& oss, const string& className, const string& name) \
-   { \
-     string fortranType=getStrFortranType<T>(); \
-     string fortranKindC=getStrFortranKindC<T>(); \
-      \
-     oss << "SUBROUTINE cxios_set_" << className << "_" << name << "(" << className << "_hdl, " << name << ", extent1, extent2, extent3) BIND(C)" << iendl; \
-     oss << "  USE ISO_C_BINDING" << iendl; \
-     oss << "  INTEGER (kind = C_INTPTR_T), VALUE       :: " << className << "_hdl" << iendl; \
-     oss << "  " << fortranType << " " << fortranKindC << "     , DIMENSION(*) :: " << name << iendl; \
-     oss << "  INTEGER (kind = C_INT), VALUE  :: extent1" << iendl; \
-     oss << "  INTEGER (kind = C_INT), VALUE  :: extent2" << iendl; \
-     oss << "  INTEGER (kind = C_INT), VALUE  :: extent3" << iendl; \
-     oss << "END SUBROUTINE cxios_set_" << className << "_" << name << std::endl; \
-     oss << iendl; \
-     oss << "SUBROUTINE cxios_get_" << className << "_" << name << "(" << className << "_hdl, " << name << ", extent1, extent2, extent3) BIND(C)" << iendl; \
-     oss << "  USE ISO_C_BINDING" << iendl; \
-     oss << "  INTEGER (kind = C_INTPTR_T), VALUE       :: " << className << "_hdl" << iendl; \
-     oss << "  " << fortranType << " " << fortranKindC << "     , DIMENSION(*) :: " << name << iendl; \
-     oss << "  INTEGER (kind = C_INT), VALUE  :: extent1" << iendl; \
-     oss << "  INTEGER (kind = C_INT), VALUE  :: extent2" << iendl; \
-     oss << "  INTEGER (kind = C_INT), VALUE  :: extent3" << iendl; \
-     oss << "END SUBROUTINE cxios_get_" << className << "_" << name << std::endl; \
-   }
+  template <> \
+  void CInterface::AttributeFortran2003Interface<CArray<T,2> >(ostream& oss, const string& className, const string& name) \
+  { \
+    string fortranType=getStrFortranType<T>(); \
+    string fortranKindC=getStrFortranKindC<T>(); \
+      \
+    oss << "SUBROUTINE cxios_set_" << className << "_" << name << "(" << className << "_hdl, " << name << ", extent1, extent2) BIND(C)" << iendl; \
+    oss << "  USE ISO_C_BINDING" << iendl; \
+    oss << "  INTEGER (kind = C_INTPTR_T), VALUE       :: " << className << "_hdl" << iendl; \
+    oss << "  " << fortranType << " " << fortranKindC << "     , DIMENSION(*) :: " << name << iendl; \
+    oss << "  INTEGER (kind = C_INT), VALUE  :: extent1" << iendl; \
+    oss << "  INTEGER (kind = C_INT), VALUE  :: extent2" << iendl; \
+    oss << "END SUBROUTINE cxios_set_" << className << "_" << name << std::endl; \
+    oss << iendl; \
+    oss << "SUBROUTINE cxios_get_" << className << "_" << name << "(" << className << "_hdl, " << name << ", extent1, extent2) BIND(C)" << iendl; \
+    oss << "  USE ISO_C_BINDING" << iendl; \
+    oss << "  INTEGER (kind = C_INTPTR_T), VALUE       :: " << className << "_hdl" << iendl; \
+    oss << "  " << fortranType << " " << fortranKindC << "     , DIMENSION(*) :: " << name << iendl; \
+    oss << "  INTEGER (kind = C_INT), VALUE  :: extent1" << iendl; \
+    oss << "  INTEGER (kind = C_INT), VALUE  :: extent2" << iendl; \
+    oss << "END SUBROUTINE cxios_get_" << className << "_" << name << std::endl; \
+  } \
+    \
+  template <> \
+  void CInterface::AttributeFortran2003Interface<CArray<T,3> >(ostream& oss, const string& className, const string& name) \
+  { \
+    string fortranType=getStrFortranType<T>(); \
+    string fortranKindC=getStrFortranKindC<T>(); \
+      \
+    oss << "SUBROUTINE cxios_set_" << className << "_" << name << "(" << className << "_hdl, " << name << ", extent1, extent2, extent3) BIND(C)" << iendl; \
+    oss << "  USE ISO_C_BINDING" << iendl; \
+    oss << "  INTEGER (kind = C_INTPTR_T), VALUE       :: " << className << "_hdl" << iendl; \
+    oss << "  " << fortranType << " " << fortranKindC << "     , DIMENSION(*) :: " << name << iendl; \
+    oss << "  INTEGER (kind = C_INT), VALUE  :: extent1" << iendl; \
+    oss << "  INTEGER (kind = C_INT), VALUE  :: extent2" << iendl; \
+    oss << "  INTEGER (kind = C_INT), VALUE  :: extent3" << iendl; \
+    oss << "END SUBROUTINE cxios_set_" << className << "_" << name << std::endl; \
+    oss << iendl; \
+    oss << "SUBROUTINE cxios_get_" << className << "_" << name << "(" << className << "_hdl, " << name << ", extent1, extent2, extent3) BIND(C)" << iendl; \
+    oss << "  USE ISO_C_BINDING" << iendl; \
+    oss << "  INTEGER (kind = C_INTPTR_T), VALUE       :: " << className << "_hdl" << iendl; \
+    oss << "  " << fortranType << " " << fortranKindC << "     , DIMENSION(*) :: " << name << iendl; \
+    oss << "  INTEGER (kind = C_INT), VALUE  :: extent1" << iendl; \
+    oss << "  INTEGER (kind = C_INT), VALUE  :: extent2" << iendl; \
+    oss << "  INTEGER (kind = C_INT), VALUE  :: extent3" << iendl; \
+    oss << "END SUBROUTINE cxios_get_" << className << "_" << name << std::endl; \
+  }
 
   macro(bool)
@@ -848,44 +529,44 @@
 
 #define macro(T) \
-   template <> \
-   void CInterface::AttributeFortranInterfaceDeclaration<CArray<T,1> >(ostream& oss, const string& className, const string& name) \
-   { \
-     oss << getStrFortranType<T>() << " " << getStrFortranKind<T>() << " , OPTIONAL, INTENT(IN) :: " << name << "(:)"; \
-     if (!matchingTypeCFortran<T>()) oss << iendl << getStrFortranType<T>() << " " << getStrFortranKindC<T>() << " , ALLOCATABLE :: " << name << "_tmp(:)"; \
-   } \
-   template <> \
-   void CInterface::AttributeFortranInterfaceGetDeclaration<CArray<T,1> >(ostream& oss, const string& className, const string& name) \
-   { \
-     oss << getStrFortranType<T>() << " " << getStrFortranKind<T>() << " , OPTIONAL, INTENT(OUT) :: " << name << "(:)"; \
-     if (!matchingTypeCFortran<T>()) oss << iendl << getStrFortranType<T>() << " " << getStrFortranKindC<T>() << " , ALLOCATABLE :: " << name << "_tmp(:)"; \
-   } \
+  template <> \
+  void CInterface::AttributeFortranInterfaceDeclaration<CArray<T,1> >(ostream& oss, const string& className, const string& name) \
+  { \
+    oss << getStrFortranType<T>() << " " << getStrFortranKind<T>() << " , OPTIONAL, INTENT(IN) :: " << name << "(:)"; \
+    if (!matchingTypeCFortran<T>()) oss << iendl << getStrFortranType<T>() << " " << getStrFortranKindC<T>() << " , ALLOCATABLE :: " << name << "_tmp(:)"; \
+  } \
+  template <> \
+  void CInterface::AttributeFortranInterfaceGetDeclaration<CArray<T,1> >(ostream& oss, const string& className, const string& name) \
+  { \
+    oss << getStrFortranType<T>() << " " << getStrFortranKind<T>() << " , OPTIONAL, INTENT(OUT) :: " << name << "(:)"; \
+    if (!matchingTypeCFortran<T>()) oss << iendl << getStrFortranType<T>() << " " << getStrFortranKindC<T>() << " , ALLOCATABLE :: " << name << "_tmp(:)"; \
+  } \
  \
-   template <> \
-   void CInterface::AttributeFortranInterfaceDeclaration<CArray<T,2> >(ostream& oss, const string& className, const string& name) \
-   { \
-     oss << getStrFortranType<T>() << " " << getStrFortranKind<T>() << " , OPTIONAL, INTENT(IN) :: " << name << "(:,:)"; \
-     if (!matchingTypeCFortran<T>()) oss << iendl << getStrFortranType<T>() << " " << getStrFortranKindC<T>() << " , ALLOCATABLE :: " << name << "_tmp(:,:)"; \
-   } \
+  template <> \
+  void CInterface::AttributeFortranInterfaceDeclaration<CArray<T,2> >(ostream& oss, const string& className, const string& name) \
+  { \
+    oss << getStrFortranType<T>() << " " << getStrFortranKind<T>() << " , OPTIONAL, INTENT(IN) :: " << name << "(:,:)"; \
+    if (!matchingTypeCFortran<T>()) oss << iendl << getStrFortranType<T>() << " " << getStrFortranKindC<T>() << " , ALLOCATABLE :: " << name << "_tmp(:,:)"; \
+  } \
  \
-   template <> \
-   void CInterface::AttributeFortranInterfaceGetDeclaration<CArray<T,2> >(ostream& oss, const string& className, const string& name) \
-   { \
-     oss << getStrFortranType<T>() << " " << getStrFortranKind<T>() << " , OPTIONAL, INTENT(OUT) :: " << name << "(:,:)"; \
-     if (!matchingTypeCFortran<T>()) oss << iendl << getStrFortranType<T>() << " " << getStrFortranKindC<T>() << " , ALLOCATABLE :: " << name << "_tmp(:,:)"; \
-   } \
+  template <> \
+  void CInterface::AttributeFortranInterfaceGetDeclaration<CArray<T,2> >(ostream& oss, const string& className, const string& name) \
+  { \
+    oss << getStrFortranType<T>() << " " << getStrFortranKind<T>() << " , OPTIONAL, INTENT(OUT) :: " << name << "(:,:)"; \
+    if (!matchingTypeCFortran<T>()) oss << iendl << getStrFortranType<T>() << " " << getStrFortranKindC<T>() << " , ALLOCATABLE :: " << name << "_tmp(:,:)"; \
+  } \
  \
-   template <> \
-   void CInterface::AttributeFortranInterfaceDeclaration<CArray<T,3> >(ostream& oss, const string& className, const string& name) \
-   { \
-     oss << getStrFortranType<T>() << " " << getStrFortranKind<T>() << " , OPTIONAL, INTENT(IN) :: " << name << "(:,:,:)"; \
-     if (!matchingTypeCFortran<T>()) oss << iendl << getStrFortranType<T>() << " " << getStrFortranKindC<T>() << " , ALLOCATABLE :: " << name << "_tmp(:,:,:)"; \
-   } \
+  template <> \
+  void CInterface::AttributeFortranInterfaceDeclaration<CArray<T,3> >(ostream& oss, const string& className, const string& name) \
+  { \
+    oss << getStrFortranType<T>() << " " << getStrFortranKind<T>() << " , OPTIONAL, INTENT(IN) :: " << name << "(:,:,:)"; \
+    if (!matchingTypeCFortran<T>()) oss << iendl << getStrFortranType<T>() << " " << getStrFortranKindC<T>() << " , ALLOCATABLE :: " << name << "_tmp(:,:,:)"; \
+  } \
  \
-   template <> \
-   void CInterface::AttributeFortranInterfaceGetDeclaration<CArray<T,3> >(ostream& oss, const string& className, const string& name) \
-   { \
-     oss << getStrFortranType<T>() << " " << getStrFortranKind<T>() << " , OPTIONAL, INTENT(OUT) :: " << name << "(:,:,:)"; \
-     if (!matchingTypeCFortran<T>()) oss << iendl << getStrFortranType<T>() << " " << getStrFortranKindC<T>() << " , ALLOCATABLE :: " << name << "_tmp(:,:,:)"; \
-   }
+  template <> \
+  void CInterface::AttributeFortranInterfaceGetDeclaration<CArray<T,3> >(ostream& oss, const string& className, const string& name) \
+  { \
+    oss << getStrFortranType<T>() << " " << getStrFortranKind<T>() << " , OPTIONAL, INTENT(OUT) :: " << name << "(:,:,:)"; \
+    if (!matchingTypeCFortran<T>()) oss << iendl << getStrFortranType<T>() << " " << getStrFortranKindC<T>() << " , ALLOCATABLE :: " << name << "_tmp(:,:,:)"; \
+  }
 
   macro(bool)
@@ -896,51 +577,51 @@
 
 #define macro(T) \
-   template <>  \
-   void CInterface::AttributeFortranInterfaceBody< CArray<T,1> >(ostream& oss, const string& className, const string& name) \
-   {  \
-     string name_tmp=name+"__tmp"; \
-      \
-     oss << "IF (PRESENT(" << name << "_)) THEN" << iendl; \
-     if (!matchingTypeCFortran<T>())  \
-     { \
-       oss << "  ALLOCATE(" << name_tmp << "(size(" << name << "_,1)))" << iendl; \
-       oss << "  " << name_tmp << " = " << name << "_" << iendl; \
-       oss << "  CALL cxios_set_" << className << "_" << name << "(" << className << "_hdl%daddr, " << name_tmp << ", size(" << name << "_,1))" << iendl; \
-     } \
-     else oss << "  CALL cxios_set_" << className << "_" << name << "(" << className << "_hdl%daddr, " << name << "_, size(" << name << "_,1))" << iendl; \
-     oss << "ENDIF"; \
-   } \
+  template <>  \
+  void CInterface::AttributeFortranInterfaceBody< CArray<T,1> >(ostream& oss, const string& className, const string& name) \
+  {  \
+    string name_tmp=name+"__tmp"; \
+      \
+    oss << "IF (PRESENT(" << name << "_)) THEN" << iendl; \
+    if (!matchingTypeCFortran<T>())  \
+    { \
+      oss << "  ALLOCATE(" << name_tmp << "(size(" << name << "_,1)))" << iendl; \
+      oss << "  " << name_tmp << " = " << name << "_" << iendl; \
+      oss << "  CALL cxios_set_" << className << "_" << name << "(" << className << "_hdl%daddr, " << name_tmp << ", size(" << name << "_,1))" << iendl; \
+    } \
+    else oss << "  CALL cxios_set_" << className << "_" << name << "(" << className << "_hdl%daddr, " << name << "_, size(" << name << "_,1))" << iendl; \
+    oss << "ENDIF"; \
+  } \
  \
-   template <>  \
-   void CInterface::AttributeFortranInterfaceBody< CArray<T,2> >(ostream& oss, const string& className, const string& name) \
-   {  \
-     string name_tmp=name+"__tmp"; \
-      \
-     oss << "IF (PRESENT(" << name << "_)) THEN" << iendl; \
-     if (!matchingTypeCFortran<T>())  \
-     { \
-       oss << "  ALLOCATE(" << name_tmp << "(size(" << name << "_,1), size(" << name << "_,2)))" << iendl; \
-       oss << "  " << name_tmp << " = " << name << "_" << iendl; \
-       oss << "  CALL cxios_set_" << className << "_" << name << "(" << className << "_hdl%daddr, " << name_tmp << ", size(" << name << "_,1), size(" << name << "_,2))" << iendl; \
-     } \
-     else oss << "  CALL cxios_set_" << className << "_" << name << "(" << className << "_hdl%daddr, " << name << "_, size(" << name << "_,1), size(" << name << "_,2))" << iendl; \
-     oss << "ENDIF"; \
-   } \
+  template <>  \
+  void CInterface::AttributeFortranInterfaceBody< CArray<T,2> >(ostream& oss, const string& className, const string& name) \
+  {  \
+    string name_tmp=name+"__tmp"; \
+      \
+    oss << "IF (PRESENT(" << name << "_)) THEN" << iendl; \
+    if (!matchingTypeCFortran<T>())  \
+    { \
+      oss << "  ALLOCATE(" << name_tmp << "(size(" << name << "_,1), size(" << name << "_,2)))" << iendl; \
+      oss << "  " << name_tmp << " = " << name << "_" << iendl; \
+      oss << "  CALL cxios_set_" << className << "_" << name << "(" << className << "_hdl%daddr, " << name_tmp << ", size(" << name << "_,1), size(" << name << "_,2))" << iendl; \
+    } \
+    else oss << "  CALL cxios_set_" << className << "_" << name << "(" << className << "_hdl%daddr, " << name << "_, size(" << name << "_,1), size(" << name << "_,2))" << iendl; \
+    oss << "ENDIF"; \
+  } \
     \
-   template <>  \
-   void CInterface::AttributeFortranInterfaceBody< CArray<T,3> >(ostream& oss, const string& className, const string& name) \
-   {  \
-     string name_tmp=name+"__tmp"; \
-      \
-     oss << "IF (PRESENT(" << name << "_)) THEN" << iendl; \
-     if (!matchingTypeCFortran<T>())  \
-     { \
-       oss << "  ALLOCATE(" << name_tmp << "(size(" << name << "_,1), size(" << name << "_,2), size(" << name << "_,3)))" << iendl; \
-       oss << "  " << name_tmp << " = " << name << "_" << iendl; \
-       oss << "  CALL cxios_set_" << className << "_" << name << "(" << className << "_hdl%daddr, " << name_tmp << ", size(" << name << "_,1), size(" << name << "_,2), size(" << name << "_,3))" << iendl; \
-     } \
-     else oss << "  CALL cxios_set_" << className << "_" << name << "(" << className << "_hdl%daddr, " << name << "_, size(" << name << "_,1), size(" << name << "_,2), size(" << name << "_,3))" << iendl; \
-     oss << "ENDIF"; \
-   }
+  template <>  \
+  void CInterface::AttributeFortranInterfaceBody< CArray<T,3> >(ostream& oss, const string& className, const string& name) \
+  {  \
+    string name_tmp=name+"__tmp"; \
+      \
+    oss << "IF (PRESENT(" << name << "_)) THEN" << iendl; \
+    if (!matchingTypeCFortran<T>())  \
+    { \
+      oss << "  ALLOCATE(" << name_tmp << "(size(" << name << "_,1), size(" << name << "_,2), size(" << name << "_,3)))" << iendl; \
+      oss << "  " << name_tmp << " = " << name << "_" << iendl; \
+      oss << "  CALL cxios_set_" << className << "_" << name << "(" << className << "_hdl%daddr, " << name_tmp << ", size(" << name << "_,1), size(" << name << "_,2), size(" << name << "_,3))" << iendl; \
+    } \
+    else oss << "  CALL cxios_set_" << className << "_" << name << "(" << className << "_hdl%daddr, " << name << "_, size(" << name << "_,1), size(" << name << "_,2), size(" << name << "_,3))" << iendl; \
+    oss << "ENDIF"; \
+  }
 
   macro(bool)
@@ -951,51 +632,51 @@
 
 #define macro(T) \
-   template <>  \
-   void CInterface::AttributeFortranInterfaceGetBody< CArray<T,1> >(ostream& oss, const string& className, const string& name) \
-   {  \
-     string name_tmp=name+"__tmp"; \
-      \
-     oss << "IF (PRESENT(" << name << "_)) THEN" << iendl; \
-     if (!matchingTypeCFortran<T>())  \
-     { \
-       oss << "  ALLOCATE(" << name_tmp << "(size(" << name << "_,1)))" << iendl; \
-       oss << "  CALL cxios_get_" << className << "_" << name << "(" << className << "_hdl%daddr, " << name_tmp << ", size(" << name << "_,1))" << iendl; \
-       oss << "  " << name << "_ = " << name_tmp << iendl; \
-     } \
-     else oss << "  CALL cxios_get_" << className << "_" << name << "(" << className << "_hdl%daddr, " << name << "_, size(" << name << "_,1))" << iendl; \
-     oss << "ENDIF"; \
-   } \
+  template <>  \
+  void CInterface::AttributeFortranInterfaceGetBody< CArray<T,1> >(ostream& oss, const string& className, const string& name) \
+  {  \
+    string name_tmp=name+"__tmp"; \
+      \
+    oss << "IF (PRESENT(" << name << "_)) THEN" << iendl; \
+    if (!matchingTypeCFortran<T>())  \
+    { \
+      oss << "  ALLOCATE(" << name_tmp << "(size(" << name << "_,1)))" << iendl; \
+      oss << "  CALL cxios_get_" << className << "_" << name << "(" << className << "_hdl%daddr, " << name_tmp << ", size(" << name << "_,1))" << iendl; \
+      oss << "  " << name << "_ = " << name_tmp << iendl; \
+    } \
+    else oss << "  CALL cxios_get_" << className << "_" << name << "(" << className << "_hdl%daddr, " << name << "_, size(" << name << "_,1))" << iendl; \
+    oss << "ENDIF"; \
+  } \
  \
-   template <>  \
-   void CInterface::AttributeFortranInterfaceGetBody< CArray<T,2> >(ostream& oss, const string& className, const string& name) \
-   {  \
-     string name_tmp=name+"__tmp"; \
-      \
-     oss << "IF (PRESENT(" << name << "_)) THEN" << iendl; \
-     if (!matchingTypeCFortran<T>())  \
-     { \
-       oss << "  ALLOCATE(" << name_tmp << "(size(" << name << "_,1), size(" << name << "_,2)))" << iendl; \
-       oss << "  CALL cxios_get_" << className << "_" << name << "(" << className << "_hdl%daddr, " << name_tmp << ", size(" << name << "_,1), size(" << name << "_,2))" << iendl; \
-       oss << "  " << name << "_ = " << name_tmp << iendl; \
-     } \
-     else oss << "  CALL cxios_get_" << className << "_" << name << "(" << className << "_hdl%daddr, " << name << "_, size(" << name << "_,1), size(" << name << "_,2))" << iendl; \
-     oss << "ENDIF"; \
-   } \
+  template <>  \
+  void CInterface::AttributeFortranInterfaceGetBody< CArray<T,2> >(ostream& oss, const string& className, const string& name) \
+  {  \
+    string name_tmp=name+"__tmp"; \
+      \
+    oss << "IF (PRESENT(" << name << "_)) THEN" << iendl; \
+    if (!matchingTypeCFortran<T>())  \
+    { \
+      oss << "  ALLOCATE(" << name_tmp << "(size(" << name << "_,1), size(" << name << "_,2)))" << iendl; \
+      oss << "  CALL cxios_get_" << className << "_" << name << "(" << className << "_hdl%daddr, " << name_tmp << ", size(" << name << "_,1), size(" << name << "_,2))" << iendl; \
+      oss << "  " << name << "_ = " << name_tmp << iendl; \
+    } \
+    else oss << "  CALL cxios_get_" << className << "_" << name << "(" << className << "_hdl%daddr, " << name << "_, size(" << name << "_,1), size(" << name << "_,2))" << iendl; \
+    oss << "ENDIF"; \
+  } \
     \
-   template <>  \
-   void CInterface::AttributeFortranInterfaceGetBody< CArray<T,3> >(ostream& oss, const string& className, const string& name) \
-   {  \
-     string name_tmp=name+"__tmp"; \
-      \
-     oss << "IF (PRESENT(" << name << "_)) THEN" << iendl; \
-     if (!matchingTypeCFortran<T>())  \
-     { \
-       oss << "  ALLOCATE(" << name_tmp << "(size(" << name << "_,1), size(" << name << "_,2), size(" << name << "_,3)))" << iendl; \
-       oss << "  CALL cxios_get_" << className << "_" << name << "(" << className << "_hdl%daddr, " << name_tmp << ", size(" << name << "_,1), size(" << name << "_,2), size(" << name << "_,3))" << iendl; \
-       oss << "  " << name << "_ = " << name_tmp << iendl; \
+  template <>  \
+  void CInterface::AttributeFortranInterfaceGetBody< CArray<T,3> >(ostream& oss, const string& className, const string& name) \
+  {  \
+    string name_tmp=name+"__tmp"; \
+      \
+    oss << "IF (PRESENT(" << name << "_)) THEN" << iendl; \
+    if (!matchingTypeCFortran<T>())  \
+    { \
+      oss << "  ALLOCATE(" << name_tmp << "(size(" << name << "_,1), size(" << name << "_,2), size(" << name << "_,3)))" << iendl; \
+      oss << "  CALL cxios_get_" << className << "_" << name << "(" << className << "_hdl%daddr, " << name_tmp << ", size(" << name << "_,1), size(" << name << "_,2), size(" << name << "_,3))" << iendl; \
+      oss << "  " << name << "_ = " << name_tmp << iendl; \
       } \
-     else oss << "  CALL cxios_get_" << className << "_" << name << "(" << className << "_hdl%daddr, " << name << "_, size(" << name << "_,1), size(" << name << "_,2), size(" << name << "_,3))" << iendl; \
-     oss << "ENDIF"; \
-   }
+    else oss << "  CALL cxios_get_" << className << "_" << name << "(" << className << "_hdl%daddr, " << name << "_, size(" << name << "_,1), size(" << name << "_,2), size(" << name << "_,3))" << iendl; \
+    oss << "ENDIF"; \
+  }
 
   macro(bool)
