Ignore:
Timestamp:
03/24/15 11:21:45 (9 years ago)
Author:
rlacroix
Message:

Fix the Fortran interface generation to avoid generating dead code that caused a timer not to be stopped.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • XIOS/trunk/src/generate_interface_impl.hpp

    r556 r581  
    1212namespace xios 
    1313{ 
    14   template<> string CInterface::getStrFortranType<int>(void) {return string("INTEGER") ;} 
    15   template<> string CInterface::getStrFortranType<bool>(void) {return string("LOGICAL") ;} 
    16   template<> string CInterface::getStrFortranType<double>(void) {return string("REAL") ;} 
    17   template<> string CInterface::getStrFortranType<float>(void) {return string("REAL") ;} 
    18   template<> string CInterface::getStrFortranType<CDate>(void) {return string("TYPE(txios(date))") ;} 
    19   template<> string CInterface::getStrFortranType<CDuration>(void) {return string("TYPE(txios(duration))") ;} 
    20  
    21   template<> string CInterface::getStrFortranKind<int>(void) {return string("") ;} 
    22   template<> string CInterface::getStrFortranKind<bool>(void) {return string("") ;} 
    23   template<> string CInterface::getStrFortranKind<double>(void) {return string("(KIND=8)") ;} 
    24   template<> string CInterface::getStrFortranKind<float>(void) {return string("(KIND=4)") ;} 
    25   template<> string CInterface::getStrFortranKind<CDate>(void) {return string("") ;} 
    26   template<> string CInterface::getStrFortranKind<CDuration>(void) {return string("") ;} 
    27  
    28   template<> string CInterface::getStrFortranKindC<int>(void) {return string("(KIND=C_INT)") ;} 
    29   template<> string CInterface::getStrFortranKindC<bool>(void) {return string("(KIND=C_BOOL)") ;} 
    30   template<> string CInterface::getStrFortranKindC<double>(void) {return string("(KIND=C_DOUBLE)") ;} 
    31   template<> string CInterface::getStrFortranKindC<float>(void) {return string("(KIND=C_FLOAT)") ;} 
    32   template<> string CInterface::getStrFortranKindC<CDate>(void) {return string("") ;} 
    33   template<> string CInterface::getStrFortranKindC<CDuration>(void) {return string("") ;} 
    34  
    35   template<> bool CInterface::matchingTypeCFortran<int>(void) { return true ; } 
    36   template<> bool CInterface::matchingTypeCFortran<bool>(void) { return false ;} 
     14  template<> string CInterface::getStrFortranType<int>(void) { return string("INTEGER"); } 
     15  template<> string CInterface::getStrFortranType<bool>(void) { return string("LOGICAL"); } 
     16  template<> string CInterface::getStrFortranType<double>(void) { return string("REAL"); } 
     17  template<> string CInterface::getStrFortranType<float>(void) { return string("REAL"); } 
     18  template<> string CInterface::getStrFortranType<CDate>(void) { return string("TYPE(txios(date))"); } 
     19  template<> string CInterface::getStrFortranType<CDuration>(void) { return string("TYPE(txios(duration))"); } 
     20 
     21  template<> string CInterface::getStrFortranKind<int>(void) { return string(""); } 
     22  template<> string CInterface::getStrFortranKind<bool>(void) { return string(""); } 
     23  template<> string CInterface::getStrFortranKind<double>(void) { return string("(KIND=8)"); } 
     24  template<> string CInterface::getStrFortranKind<float>(void) { return string("(KIND=4)"); } 
     25  template<> string CInterface::getStrFortranKind<CDate>(void) { return string(""); } 
     26  template<> string CInterface::getStrFortranKind<CDuration>(void) { return string(""); } 
     27 
     28  template<> string CInterface::getStrFortranKindC<int>(void) { return string("(KIND=C_INT)"); } 
     29  template<> string CInterface::getStrFortranKindC<bool>(void) { return string("(KIND=C_BOOL)"); } 
     30  template<> string CInterface::getStrFortranKindC<double>(void) { return string("(KIND=C_DOUBLE)"); } 
     31  template<> string CInterface::getStrFortranKindC<float>(void) { return string("(KIND=C_FLOAT)"); } 
     32  template<> string CInterface::getStrFortranKindC<CDate>(void) { return string(""); } 
     33  template<> string CInterface::getStrFortranKindC<CDuration>(void) { return string(""); } 
     34 
     35  template<> bool CInterface::matchingTypeCFortran<int>(void) { return true; } 
     36  template<> bool CInterface::matchingTypeCFortran<bool>(void) { return false; } 
    3737  template<> bool CInterface::matchingTypeCFortran<double>(void) { return true; } 
    3838  template<> bool CInterface::matchingTypeCFortran<float>(void) { return true; } 
     
    4040  template<> bool CInterface::matchingTypeCFortran<CDuration>(void) { return true; } 
    4141 
    42  
    4342// ///////////////////////////////////////////////// 
    4443// //                 C Interface                 // 
    4544// ///////////////////////////////////////////////// 
    4645 
    47  
    48   void CInterface::AttributeIsDefinedCInterface(ostream& oss, const string& className,const string& name) 
     46  void CInterface::AttributeIsDefinedCInterface(ostream& oss, const string& className, const string& name) 
    4947  { 
    50     oss<<"bool cxios_is_defined_"<<className<<"_"<<name<<"("<<className<<"_Ptr "<<className<<"_hdl )"<<iendl ; 
    51     oss<<"{"<<iendl ; 
    52     oss<<"   CTimer::get(\"XIOS\").resume();"<<iendl ; 
    53     oss<<"  return "<<className<<"_hdl->"<<name<<".hasInheritedValue();"<<iendl ; 
    54     oss<<"   CTimer::get(\"XIOS\").suspend();"<<iendl ; 
    55     oss<<"}"<<iendl ; 
    56     oss<<iendl ; 
     48    oss << "bool cxios_is_defined_" << className << "_" << name << "(" << className << "_Ptr " << className << "_hdl)" << iendl; 
     49    oss << "{" << iendl; 
     50    oss << "   CTimer::get(\"XIOS\").resume();" << iendl; 
     51    oss << "   bool isDefined = " << className << "_hdl->" << name << ".hasInheritedValue();" << iendl; 
     52    oss << "   CTimer::get(\"XIOS\").suspend();" << iendl; 
     53    oss << "   return isDefined;" << iendl; 
     54    oss << "}" << std::endl; 
    5755  } 
    5856 
    5957  template <class T> 
    60   void CInterface::AttributeCInterface(ostream& oss, const string& className,const string& name) 
     58  void CInterface::AttributeCInterface(ostream& oss, const string& className, const string& name) 
    6159  { 
    62     string typeName=getStrType<T>() ; 
    63  
    64     oss<<"void cxios_set_"<<className<<"_"<<name<<"("<<className<<"_Ptr "<<className<<"_hdl, "<< typeName<<" "<<name<<")"<<iendl ; 
    65     oss<<"{"<<iendl ; 
    66     oss<<"   CTimer::get(\"XIOS\").resume();"<<iendl ; 
    67     oss<<"  "<<className<<"_hdl->"<<name<<".setValue("<<name<<");"<<iendl ; 
    68 //    oss<<"  "<<className<<"_hdl->sendAttributToServer("<<className<<"_hdl->"<<name<<");"<<iendl ; 
    69     oss<<"   CTimer::get(\"XIOS\").suspend();"<<iendl ; 
    70     oss<<"}"<<iendl ; 
    71  
    72     oss<<iendl ; 
    73     oss<<"void cxios_get_"<<className<<"_"<<name<<"("<<className<<"_Ptr "<<className<<"_hdl, "<< typeName<<"* "<<name<<")"<<iendl ; 
    74     oss<<"{"<<iendl; 
    75     oss<<"  *"<<name<<" = "<<className<<"_hdl->"<<name<<".getInheritedValue();"<<iendl ; 
    76     oss<<"}"<<iendl ; 
    77     oss<<iendl ; 
     60    string typeName = getStrType<T>(); 
     61 
     62    oss << "void cxios_set_" << className << "_" << name << "(" << className << "_Ptr " << className << "_hdl, " << typeName << " " << name << ")" << iendl; 
     63    oss << "{" << iendl; 
     64    oss << "  CTimer::get(\"XIOS\").resume();" << iendl; 
     65    oss << "  " << className << "_hdl->" << name << ".setValue(" << name << ");" << iendl; 
     66//  oss << "  " << className << "_hdl->sendAttributToServer(" << className << "_hdl->" << name << ");" << iendl; 
     67    oss << "  CTimer::get(\"XIOS\").suspend();" << iendl; 
     68    oss << "}" << std::endl; 
     69 
     70    oss << iendl; 
     71    oss << "void cxios_get_" << className << "_" << name << "(" << className << "_Ptr " << className << "_hdl, " << typeName << "* " << name << ")" << iendl; 
     72    oss << "{" << iendl; 
     73    oss << "  CTimer::get(\"XIOS\").resume();" << iendl; 
     74    oss << "  *" << name << " = " << className << "_hdl->" << name << ".getInheritedValue();" << iendl; 
     75    oss << "  CTimer::get(\"XIOS\").suspend();" << iendl; 
     76    oss << "}" << std::endl; 
    7877  } 
    7978 
    80  
    8179  template<> 
    82   void CInterface::AttributeCInterface<string>(ostream& oss, const string& className,const string& name) 
     80  void CInterface::AttributeCInterface<string>(ostream& oss, const string& className, const string& name) 
    8381  { 
    84     oss<<"void cxios_set_"<<className<<"_"<<name<<"("<<className<<"_Ptr "<<className<<"_hdl, const char * "<<name<<", int "<<name<<"_size)"<<iendl ; 
    85     oss<<"{"<<iendl ; 
    86     oss<<"  std::string "<<name<<"_str;"<<iendl; 
    87     oss<<"  if(!cstr2string("<<name<<", "<<name<<"_size, "<<name<<"_str)) return;"<<iendl ; 
    88     oss<<"   CTimer::get(\"XIOS\").resume();"<<iendl ; 
    89     oss<<"  "<<className<<"_hdl->"<<name<<".setValue("<<name<<"_str);"<<iendl ; 
    90 //    oss<<"  "<<className<<"_hdl->sendAttributToServer("<<className<<"_hdl->"<<name<<");"<<iendl ; 
    91     oss<<"   CTimer::get(\"XIOS\").suspend();"<<iendl ; 
    92     oss<<"}"<<iendl ; 
    93  
    94     oss<<iendl ; 
    95  
    96     oss<<"void cxios_get_"<<className<<"_"<<name<<"("<<className<<"_Ptr "<<className<<"_hdl, char * "<<name<<", int "<<name<<"_size)"<<iendl ; 
    97     oss<<"{"<<iendl ; 
    98     oss<<"   CTimer::get(\"XIOS\").resume();"<<iendl ; 
    99     oss<<"  if(!string_copy("<<className<<"_hdl->"<<name<<".getInheritedValue(),"<<name<<" , "<<name<<"_size))"<<iendl ; 
    100     oss<<"    ERROR(\"void cxios_get_"<<className<<"_"<<name<<"("<<className<<"_Ptr "<<className<<"_hdl, char * "<<name<<", int " 
    101        <<name<<"_size)\", <<\"Input string is to short\");"<<iendl ; 
    102     oss<<"   CTimer::get(\"XIOS\").suspend();"<<iendl ; 
    103     oss<<"}"<<iendl ; 
    104     oss<<iendl ; 
    105  
     82    oss << "void cxios_set_" << className << "_" << name << "(" << className << "_Ptr " << className << "_hdl, const char * " << name << ", int " << name << "_size)" << iendl; 
     83    oss << "{" << iendl; 
     84    oss << "  std::string " << name << "_str;" << iendl; 
     85    oss << "  if (!cstr2string(" << name << ", " << name << "_size, " << name << "_str)) return;" << iendl; 
     86    oss << "  CTimer::get(\"XIOS\").resume();" << iendl; 
     87    oss << "  " << className << "_hdl->" << name << ".setValue(" << name << "_str);" << iendl; 
     88//  oss << "  " << className << "_hdl->sendAttributToServer(" << className << "_hdl->" << name << ");" << iendl; 
     89    oss << "  CTimer::get(\"XIOS\").suspend();" << iendl; 
     90    oss << "}" << std::endl; 
     91 
     92    oss << iendl; 
     93 
     94    oss << "void cxios_get_" << className << "_" << name << "(" << className << "_Ptr " << className << "_hdl, char * " << name << ", int " << name << "_size)" << iendl; 
     95    oss << "{" << iendl; 
     96    oss << "  CTimer::get(\"XIOS\").resume();" << iendl; 
     97    oss << "  if (!string_copy(" << className << "_hdl->" << name << ".getInheritedValue(), " << name << ", " << name << "_size))" << iendl; 
     98    oss << "    ERROR(\"void cxios_get_" << className << "_" << name << "(" << className << "_Ptr " << className << "_hdl, char * " << name << ", int " 
     99       << name << "_size)\", << \"Input string is too short\");" << iendl; 
     100    oss << "  CTimer::get(\"XIOS\").suspend();" << iendl; 
     101    oss << "}" << std::endl; 
    106102  } 
    107103 
    108104  template<> 
    109   void CInterface::AttributeCInterface<CEnumBase>(ostream& oss, const string& className,const string& name) 
     105  void CInterface::AttributeCInterface<CEnumBase>(ostream& oss, const string& className, const string& name) 
    110106  { 
    111     oss<<"void cxios_set_"<<className<<"_"<<name<<"("<<className<<"_Ptr "<<className<<"_hdl, const char * "<<name<<", int "<<name<<"_size)"<<iendl ; 
    112     oss<<"{"<<iendl ; 
    113     oss<<"  std::string "<<name<<"_str;"<<iendl; 
    114     oss<<"  if(!cstr2string("<<name<<", "<<name<<"_size, "<<name<<"_str)) return;"<<iendl ; 
    115     oss<<"   CTimer::get(\"XIOS\").resume();"<<iendl ; 
    116     oss<<"  "<<className<<"_hdl->"<<name<<".fromString("<<name<<"_str);"<<iendl ; 
    117 //    oss<<"  "<<className<<"_hdl->sendAttributToServer("<<className<<"_hdl->"<<name<<");"<<iendl ; 
    118     oss<<"   CTimer::get(\"XIOS\").suspend();"<<iendl ; 
    119     oss<<"}"<<iendl ; 
    120  
    121     oss<<iendl ; 
    122  
    123     oss<<"void cxios_get_"<<className<<"_"<<name<<"("<<className<<"_Ptr "<<className<<"_hdl, char * "<<name<<", int "<<name<<"_size)"<<iendl ; 
    124     oss<<"{"<<iendl ; 
    125     oss<<"   CTimer::get(\"XIOS\").resume();"<<iendl ; 
    126     oss<<"  if(!string_copy("<<className<<"_hdl->"<<name<<".getInheritedStringValue(),"<<name<<" , "<<name<<"_size))"<<iendl ; 
    127     oss<<"    ERROR(\"void cxios_get_"<<className<<"_"<<name<<"("<<className<<"_Ptr "<<className<<"_hdl, char * "<<name<<", int " 
    128        <<name<<"_size)\", <<\"Input string is to short\");"<<iendl ; 
    129     oss<<"   CTimer::get(\"XIOS\").suspend();"<<iendl ; 
    130     oss<<"}"<<iendl ; 
    131     oss<<iendl ; 
    132  
     107    oss << "void cxios_set_" << className << "_" << name << "(" << className << "_Ptr " << className << "_hdl, const char * " << name << ", int " << name << "_size)" << iendl; 
     108    oss << "{" << iendl; 
     109    oss << "  std::string " << name << "_str;" << iendl; 
     110    oss << "  if (!cstr2string(" << name << ", " << name << "_size, " << name << "_str)) return;" << iendl; 
     111    oss << "  CTimer::get(\"XIOS\").resume();" << iendl; 
     112    oss << "  " << className << "_hdl->" << name << ".fromString(" << name << "_str);" << iendl; 
     113//  oss << "  " << className << "_hdl->sendAttributToServer(" << className << "_hdl->" << name << ");" << iendl; 
     114    oss << "  CTimer::get(\"XIOS\").suspend();" << iendl; 
     115    oss << "}" << std::endl; 
     116 
     117    oss << iendl; 
     118 
     119    oss << "void cxios_get_" << className << "_" << name << "(" << className << "_Ptr " << className << "_hdl, char * " << name << ", int " << name << "_size)" << iendl; 
     120    oss << "{" << iendl; 
     121    oss << "  CTimer::get(\"XIOS\").resume();" << iendl; 
     122    oss << "  if (!string_copy(" << className << "_hdl->" << name << ".getInheritedStringValue(), " << name << ", " << name << "_size))" << iendl; 
     123    oss << "    ERROR(\"void cxios_get_" << className << "_" << name << "(" << className << "_Ptr " << className << "_hdl, char * " << name << ", int " 
     124       << name << "_size)\", << \"Input string is too short\");" << iendl; 
     125    oss << "  CTimer::get(\"XIOS\").suspend();" << iendl; 
     126    oss << "}" << std::endl; 
    133127  } 
    134 //     if (!array_copy(domain_hdl->mask.getValue(), mask, extent1, extent2)) 
    135 //        ERROR("cxios_get_domain_mask(XDomainPtr domain_hdl, bool * mask, int extent1, int extent2)",<<"Output array size is not conform to array size attribut") ; 
    136128 
    137129  template<> 
    138   void CInterface::AttributeCInterface<CDate>(ostream& oss, const string& className,const string& name) 
     130  void CInterface::AttributeCInterface<CDate>(ostream& oss, const string& className, const string& name) 
    139131  { 
    140132    oss << "void cxios_set_" << className << "_" << name << "(" << className << "_Ptr " << className << "_hdl, cxios_date " << name << "_c)" << iendl; 
     
    142134    oss << "  CTimer::get(\"XIOS\").resume();" << iendl; 
    143135    oss << "  " << className << "_hdl->" << name << ".allocate();" << iendl; 
    144     oss << "  CDate& " << name <<" = " << className << "_hdl->" << name << ".get();" << iendl; 
     136    oss << "  CDate& " << name << " = " << className << "_hdl->" << name << ".get();" << iendl; 
    145137    oss << "  " << name << ".setDate(" << name << "_c.year," << iendl; 
    146138    oss << "                         " << name << "_c.month," << iendl; 
     
    152144    oss << "    " << name << ".checkDate();" << iendl; 
    153145    oss << "  CTimer::get(\"XIOS\").suspend();" << iendl; 
    154     oss << "}" << iendl; 
     146    oss << "}" << std::endl; 
    155147 
    156148    oss << iendl; 
     
    159151    oss << "{" << iendl; 
    160152    oss << "  CTimer::get(\"XIOS\").resume();" << iendl; 
    161     oss << "  CDate " << name <<" = " << className << "_hdl->" << name << ".getInheritedValue();" << iendl; 
     153    oss << "  CDate " << name << " = " << className << "_hdl->" << name << ".getInheritedValue();" << iendl; 
    162154    oss << "  " << name << "_c->year = " << name << ".getYear();" << iendl; 
    163155    oss << "  " << name << "_c->month = " << name << ".getMonth();" << iendl; 
     
    167159    oss << "  " << name << "_c->second = " << name << ".getSecond();" << iendl; 
    168160    oss << "  CTimer::get(\"XIOS\").suspend();" << iendl; 
    169     oss << "}" << iendl; 
    170     oss << iendl; 
     161    oss << "}" << std::endl; 
    171162  } 
    172163 
    173164  template<> 
    174   void CInterface::AttributeCInterface<CDuration>(ostream& oss, const string& className,const string& name) 
     165  void CInterface::AttributeCInterface<CDuration>(ostream& oss, const string& className, const string& name) 
    175166  { 
    176167    oss << "void cxios_set_" << className << "_" << name << "(" << className << "_Ptr " << className << "_hdl, cxios_duration " << name << "_c)" << iendl; 
     
    178169    oss << "  CTimer::get(\"XIOS\").resume();" << iendl; 
    179170    oss << "  " << className << "_hdl->" << name << ".allocate();" << iendl; 
    180     oss << "  CDuration& " << name <<" = " << className << "_hdl->" << name << ".get();" << iendl; 
     171    oss << "  CDuration& " << name << " = " << className << "_hdl->" << name << ".get();" << iendl; 
    181172    oss << "  " << name << ".year = " << name << "_c.year;" << iendl; 
    182173    oss << "  " << name << ".month = " << name << "_c.month;" << iendl; 
     
    187178    oss << "  " << name << ".timestep = " << name << "_c.timestep;" << iendl; 
    188179    oss << "  CTimer::get(\"XIOS\").suspend();" << iendl; 
    189     oss << "}" << iendl; 
     180    oss << "}" << std::endl; 
    190181 
    191182    oss << iendl; 
     
    194185    oss << "{" << iendl; 
    195186    oss << "  CTimer::get(\"XIOS\").resume();" << iendl; 
    196     oss << "  CDuration " << name <<" = " << className << "_hdl->" << name << ".getInheritedValue();" << iendl; 
     187    oss << "  CDuration " << name << " = " << className << "_hdl->" << name << ".getInheritedValue();" << iendl; 
    197188    oss << "  " << name << "_c->year = " << name << ".year;" << iendl; 
    198189    oss << "  " << name << "_c->month = " << name << ".month;" << iendl; 
     
    203194    oss << "  " << name << "_c->timestep = " << name << ".timestep;" << iendl; 
    204195    oss << "  CTimer::get(\"XIOS\").suspend();" << iendl; 
    205     oss << "}" << iendl; 
    206     oss << iendl; 
     196    oss << "}" << std::endl; 
    207197  } 
    208198 
    209199/* 
    210200#define macro(T) \ 
    211   template <>\ 
    212   void CInterface::AttributeCInterface<ARRAY(T,1)>(ostream& oss, const string& className,const string& name)\ 
    213   {\ 
    214     string typeName=getStrType<T>() ;\ 
     201  template <> \ 
     202  void CInterface::AttributeCInterface<ARRAY(T,1)>(ostream& oss, const string& className, const string& name) \ 
     203  { \ 
     204    string typeName=getStrType<T>(); \ 
    215205\ 
    216     oss<<"void cxios_set_"<<className<<"_"<<name<<"("<<className<<"_Ptr "<<className<<"_hdl, "<< typeName<<"* "<<name<<", int extent1)"<<iendl ;\ 
    217     oss<<"{"<<iendl ;\ 
    218     oss<<"   CTimer::get(\"XIOS\").resume();"<<iendl ; \ 
    219     oss<<"  ARRAY("<<typeName<<",1) array_tmp(new CArray<"<<typeName<<",1>(boost::extents[extent1]));"<<iendl ;\ 
    220     oss<<"  std::copy("<<name<<", &("<<name<<"[array_tmp->num_elements()]), array_tmp->data());"<<iendl ;\ 
    221     oss<<"  "<<className<<"_hdl->"<<name<<".setValue(array_tmp);"<<iendl ;\ 
    222 //    oss<<"  "<<className<<"_hdl->sendAttributToServer("<<className<<"_hdl->"<<name<<");"<<iendl ;\ 
    223     oss<<"}"<<iendl ;\ 
    224     oss<<iendl; \ 
    225     oss<<"void cxios_get_"<<className<<"_"<<name<<"("<<className<<"_Ptr "<<className<<"_hdl, "<< typeName<<"* "<<name<<", int extent1)"<<iendl ;\ 
    226     oss<<"{"<<iendl; \ 
    227     oss<<"  if (!array_copy("<<className<<"_hdl->"<<name<<".getValue(), "<<name<<", extent1))"<<iendl ; \ 
    228     oss<<"   ERROR(\"void cxios_set_"<<className<<"_"<<name<<"("<<className<<"_Ptr "<<className<<"_hdl, "<< typeName<<"* "<<name<<", int extent1)\",<<" \ 
    229        <<"\"Output array size is not conform to array size attribute\") ;"<<iendl; \ 
    230     oss<<"   CTimer::get(\"XIOS\").suspend();"<<iendl ;\ 
    231     oss<<"}"<<iendl ;\ 
    232   }\ 
     206    oss << "void cxios_set_" << className << "_" << name << "(" << className << "_Ptr " << className << "_hdl, " << typeName << "* " << name << ", int extent1)" << iendl; \ 
     207    oss << "{" << iendl; \ 
     208    oss << "   CTimer::get(\"XIOS\").resume();" << iendl; \ 
     209    oss << "  ARRAY(" << typeName << ",1) array_tmp(new CArray<" << typeName << ",1>(boost::extents[extent1]));" << iendl; \ 
     210    oss << "  std::copy(" << name << ", &(" << name << "[array_tmp->num_elements()]), array_tmp->data());" << iendl; \ 
     211    oss << "  " << className << "_hdl->" << name << ".setValue(array_tmp);" << iendl; \ 
     212//  oss << "  " << className << "_hdl->sendAttributToServer(" << className << "_hdl->" << name << ");" << iendl; \ 
     213    oss << "}" << std::endl; \ 
     214    oss << iendl; \ 
     215    oss << "void cxios_get_" << className << "_" << name << "(" << className << "_Ptr " << className << "_hdl, " << typeName << "* " << name << ", int extent1)" << iendl; \ 
     216    oss << "{" << iendl; \ 
     217    oss << "  if (!array_copy(" << className << "_hdl->" << name << ".getValue(), " << name << ", extent1))" << iendl; \ 
     218    oss << "   ERROR(\"void cxios_set_" << className << "_" << name << "(" << className << "_Ptr " << className << "_hdl, " << typeName << "* " << name << ", int extent1)\", << " \ 
     219       << "\"Output array size is not conform to array size attribute\");" << iendl; \ 
     220    oss << "   CTimer::get(\"XIOS\").suspend();" << iendl; \ 
     221    oss << "}" << std::endl; \ 
     222  } \ 
    233223\ 
    234224  template <> \ 
    235   void CInterface::AttributeCInterface<ARRAY(T,2)>(ostream& oss, const string& className,const string& name)\ 
    236   {\ 
    237     string typeName=getStrType<T>() ;\ 
     225  void CInterface::AttributeCInterface<ARRAY(T,2)>(ostream& oss, const string& className, const string& name) \ 
     226  { \ 
     227    string typeName=getStrType<T>(); \ 
    238228\ 
    239     oss<<"void cxios_set_"<<className<<"_"<<name<<"("<<className<<"_Ptr "<<className<<"_hdl, "<< typeName<<"* "<<name<<", int extent1, int extent2)"<<iendl ;\ 
    240     oss<<"{"<<iendl ;\ 
    241     oss<<"   CTimer::get(\"XIOS\").resume();"<<iendl ; \ 
    242     oss<<"  ARRAY("<<typeName<<",2) array_tmp(new CArray<"<<typeName<<",2>(boost::extents[extent1][extent2]));"<<iendl ;\ 
    243     oss<<"  std::copy("<<name<<", &("<<name<<"[array_tmp->num_elements()]), array_tmp->data());"<<iendl ;\ 
    244     oss<<"  "<<className<<"_hdl->"<<name<<".setValue(array_tmp);"<<iendl ;\ 
    245 //    oss<<"  "<<className<<"_hdl->sendAttributToServer("<<className<<"_hdl->"<<name<<");"<<iendl ;\ 
    246     oss<<"}"<<iendl ;\ 
    247     oss<<iendl; \ 
    248     oss<<"void cxios_get_"<<className<<"_"<<name<<"("<<className<<"_Ptr "<<className<<"_hdl, "<< typeName<<"* "<<name<<", int extent1, int extent2)"<<iendl ;\ 
    249     oss<<"{"<<iendl; \ 
    250     oss<<"  if (!array_copy("<<className<<"_hdl->"<<name<<".getValue(), "<<name<<", extent1, extent2))"<<iendl ; \ 
    251     oss<<"   ERROR(\"void cxios_set_"<<className<<"_"<<name<<"("<<className<<"_Ptr "<<className<<"_hdl, "<< typeName<<"* "<<name<<", int extent1, int extent2)\",<<" \ 
    252        <<"\"Output array size is not conform to array size attribute\") ;"<<iendl; \ 
    253     oss<<"   CTimer::get(\"XIOS\").suspend();"<<iendl ;\ 
    254     oss<<"}"<<iendl ;\ 
    255   }\ 
     229    oss << "void cxios_set_" << className << "_" << name << "(" << className << "_Ptr " << className << "_hdl, " << typeName << "* " << name << ", int extent1, int extent2)" << iendl; \ 
     230    oss << "{" << iendl; \ 
     231    oss << "   CTimer::get(\"XIOS\").resume();" << iendl; \ 
     232    oss << "  ARRAY(" << typeName << ",2) array_tmp(new CArray<" << typeName << ",2>(boost::extents[extent1][extent2]));" << iendl; \ 
     233    oss << "  std::copy(" << name << ", &(" << name << "[array_tmp->num_elements()]), array_tmp->data());" << iendl; \ 
     234    oss << "  " << className << "_hdl->" << name << ".setValue(array_tmp);" << iendl; \ 
     235//  oss << "  " << className << "_hdl->sendAttributToServer(" << className << "_hdl->" << name << ");" << iendl; \ 
     236    oss << "}" << std::endl; \ 
     237    oss << iendl; \ 
     238    oss << "void cxios_get_" << className << "_" << name << "(" << className << "_Ptr " << className << "_hdl, " << typeName << "* " << name << ", int extent1, int extent2)" << iendl; \ 
     239    oss << "{" << iendl; \ 
     240    oss << "  if (!array_copy(" << className << "_hdl->" << name << ".getValue(), " << name << ", extent1, extent2))" << iendl; \ 
     241    oss << "   ERROR(\"void cxios_set_" << className << "_" << name << "(" << className << "_Ptr " << className << "_hdl, " << typeName << "* " << name << ", int extent1, int extent2)\", << " \ 
     242       << "\"Output array size is not conform to array size attribute\");" << iendl; \ 
     243    oss << "   CTimer::get(\"XIOS\").suspend();" << iendl; \ 
     244    oss << "}" << std::endl; \ 
     245  } \ 
    256246\ 
    257   template <>\ 
    258   void CInterface::AttributeCInterface<ARRAY(T,3)>(ostream& oss, const string& className,const string& name)\ 
    259   {\ 
    260     string typeName=getStrType<T>() ;\ 
     247  template <> \ 
     248  void CInterface::AttributeCInterface<ARRAY(T,3)>(ostream& oss, const string& className, const string& name) \ 
     249  { \ 
     250    string typeName=getStrType<T>(); \ 
    261251\ 
    262     oss<<"void cxios_set_"<<className<<"_"<<name<<"("<<className<<"_Ptr "<<className<<"_hdl, "<< typeName<<"* "<<name<<", int extent1, int extent2, int extent3)"<<iendl ;\ 
    263     oss<<"{"<<iendl ;\ 
    264     oss<<"   CTimer::get(\"XIOS\").resume();"<<iendl ; \ 
    265     oss<<"  ARRAY("<<typeName<<",3) array_tmp(new CArray<"<<typeName<<",3>(boost::extents[extent1][extent2][extent3]));"<<iendl ;\ 
    266     oss<<"  std::copy("<<name<<", &("<<name<<"[array_tmp->num_elements()]), array_tmp->data());"<<iendl ;\ 
    267     oss<<"  "<<className<<"_hdl->"<<name<<".setValue(array_tmp);"<<iendl ;\ 
    268 //    oss<<"  "<<className<<"_hdl->sendAttributToServer("<<className<<"_hdl->"<<name<<");"<<iendl ;\ 
    269     oss<<"}"<<iendl ;\ 
    270     oss<<iendl; \ 
    271     oss<<"void cxios_get_"<<className<<"_"<<name<<"("<<className<<"_Ptr "<<className<<"_hdl, "<< typeName<<"* "<<name<<", int extent1, int extent2, int extent3)"<<iendl ;\ 
    272     oss<<"{"<<iendl; \ 
    273     oss<<"  if (!array_copy("<<className<<"_hdl->"<<name<<".getValue(), "<<name<<", extent1))"<<iendl ; \ 
    274     oss<<"   ERROR(\"void cxios_set_"<<className<<"_"<<name<<"("<<className<<"_Ptr "<<className<<"_hdl, "<< typeName<<"* "<<name<<", int extent1, int extent2, int extent3)\",<<" \ 
    275        <<"\"Output array size is not conform to array size attribute\") ;"<<iendl; \ 
    276     oss<<"   CTimer::get(\"XIOS\").suspend();"<<iendl ;\ 
    277     oss<<"}"<<iendl ;\ 
     252    oss << "void cxios_set_" << className << "_" << name << "(" << className << "_Ptr " << className << "_hdl, " << typeName << "* " << name << ", int extent1, int extent2, int extent3)" << iendl; \ 
     253    oss << "{" << iendl; \ 
     254    oss << "   CTimer::get(\"XIOS\").resume();" << iendl; \ 
     255    oss << "  ARRAY(" << typeName << ",3) array_tmp(new CArray<" << typeName << ",3>(boost::extents[extent1][extent2][extent3]));" << iendl; \ 
     256    oss << "  std::copy(" << name << ", &(" << name << "[array_tmp->num_elements()]), array_tmp->data());" << iendl; \ 
     257    oss << "  " << className << "_hdl->" << name << ".setValue(array_tmp);" << iendl; \ 
     258//  oss << "  " << className << "_hdl->sendAttributToServer(" << className << "_hdl->" << name << ");" << iendl; \ 
     259    oss << "}" << std::endl; \ 
     260    oss << iendl; \ 
     261    oss << "void cxios_get_" << className << "_" << name << "(" << className << "_Ptr " << className << "_hdl, " << typeName << "* " << name << ", int extent1, int extent2, int extent3)" << iendl; \ 
     262    oss << "{" << iendl; \ 
     263    oss << "  if (!array_copy(" << className << "_hdl->" << name << ".getValue(), " << name << ", extent1))" << iendl; \ 
     264    oss << "   ERROR(\"void cxios_set_" << className << "_" << name << "(" << className << "_Ptr " << className << "_hdl, " << typeName << "* " << name << ", int extent1, int extent2, int extent3)\", << " \ 
     265       << "\"Output array size is not conform to array size attribute\");" << iendl; \ 
     266    oss << "   CTimer::get(\"XIOS\").suspend();" << iendl; \ 
     267    oss << "}" << std::endl; \ 
    278268  } 
    279269 
     
    288278// //          Fortran 2003 Interface             // 
    289279// ///////////////////////////////////////////////// 
    290    void CInterface::AttributeIsDefinedFortran2003Interface(ostream& oss,const string& className,const string& name) 
    291    { 
    292      oss<<"FUNCTION cxios_is_defined_"<<className<<"_"<<name<<"("<<className<<"_hdl ) BIND(C)"<<iendl ; 
    293      oss<<"  USE ISO_C_BINDING"<<iendl ; 
    294      oss<<"  LOGICAL(kind=C_BOOL) :: cxios_is_defined_"<<className<<"_"<<name<<iendl; 
    295      oss<<"  INTEGER (kind = C_INTPTR_T), VALUE :: "<<className<<"_hdl"<<iendl ; 
    296      oss<<"END FUNCTION cxios_is_defined_"<<className<<"_"<<name<<iendl ; 
     280   void CInterface::AttributeIsDefinedFortran2003Interface(ostream& oss, const string& className, const string& name) 
     281   { 
     282     oss << "FUNCTION cxios_is_defined_" << className << "_" << name << "(" << className << "_hdl) BIND(C)" << iendl; 
     283     oss << "  USE ISO_C_BINDING" << iendl; 
     284     oss << "  LOGICAL(kind=C_BOOL) :: cxios_is_defined_" << className << "_" << name << iendl; 
     285     oss << "  INTEGER (kind = C_INTPTR_T), VALUE :: " << className << "_hdl" << iendl; 
     286     oss << "END FUNCTION cxios_is_defined_" << className << "_" << name << std::endl; 
    297287   } 
    298288 
    299289   template <class T> 
    300    void CInterface::AttributeFortran2003Interface(ostream& oss,const string& className,const string& name) 
    301    { 
    302      string fortranType=getStrFortranType<T>() ; 
    303      string fortranKindC=getStrFortranKindC<T>() ; 
    304  
    305      oss<<"SUBROUTINE cxios_set_"<<className<<"_"<<name<<"("<<className<<"_hdl, "<<name<<") BIND(C)"<<iendl ; 
    306      oss<<"  USE ISO_C_BINDING"<<iendl ; 
    307      oss<<"  INTEGER (kind = C_INTPTR_T), VALUE :: "<<className<<"_hdl"<<iendl ; 
    308      oss<<"  "<<fortranType<<" "<<fortranKindC<<"      , VALUE :: "<<name<<iendl ; 
    309      oss<<"END SUBROUTINE cxios_set_"<<className<<"_"<<name<<iendl ; 
    310      oss<<iendl ; 
    311      oss<<"SUBROUTINE cxios_get_"<<className<<"_"<<name<<"("<<className<<"_hdl, "<<name<<") BIND(C)"<<iendl ; 
    312      oss<<"  USE ISO_C_BINDING"<<iendl ; 
    313      oss<<"  INTEGER (kind = C_INTPTR_T), VALUE :: "<<className<<"_hdl"<<iendl ; 
    314      oss<<"  "<<fortranType<<" "<<fortranKindC<<"             :: "<<name<<iendl ; 
    315      oss<<"END SUBROUTINE cxios_get_"<<className<<"_"<<name<<iendl ; 
    316      oss<<iendl ; 
    317    } 
    318  
     290   void CInterface::AttributeFortran2003Interface(ostream& oss, const string& className, const string& name) 
     291   { 
     292     string fortranType=getStrFortranType<T>(); 
     293     string fortranKindC=getStrFortranKindC<T>(); 
     294 
     295     oss << "SUBROUTINE cxios_set_" << className << "_" << name << "(" << className << "_hdl, " << name << ") BIND(C)" << iendl; 
     296     oss << "  USE ISO_C_BINDING" << iendl; 
     297     oss << "  INTEGER (kind = C_INTPTR_T), VALUE :: " << className << "_hdl" << iendl; 
     298     oss << "  " << fortranType << " " << fortranKindC << "      , VALUE :: " << name << iendl; 
     299     oss << "END SUBROUTINE cxios_set_" << className << "_" << name << std::endl; 
     300     oss << iendl; 
     301     oss << "SUBROUTINE cxios_get_" << className << "_" << name << "(" << className << "_hdl, " << name << ") BIND(C)" << iendl; 
     302     oss << "  USE ISO_C_BINDING" << iendl; 
     303     oss << "  INTEGER (kind = C_INTPTR_T), VALUE :: " << className << "_hdl" << iendl; 
     304     oss << "  " << fortranType << " " << fortranKindC << "             :: " << name << iendl; 
     305     oss << "END SUBROUTINE cxios_get_" << className << "_" << name << std::endl; 
     306   } 
    319307 
    320308   template <> 
    321    void CInterface::AttributeFortran2003Interface<string>(ostream& oss,const string& className,const string& name) 
    322    { 
    323  
    324      oss<<"SUBROUTINE cxios_set_"<<className<<"_"<<name<<"("<<className<<"_hdl, "<<name<<", "<<name<<"_size) BIND(C)"<<iendl ; 
    325      oss<<"  USE ISO_C_BINDING"<<iendl ; 
    326      oss<<"  INTEGER (kind = C_INTPTR_T), VALUE :: "<<className<<"_hdl"<<iendl ; 
    327      oss<<"  CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: "<<name<<iendl ; 
    328      oss<<"  INTEGER  (kind = C_INT)     , VALUE        :: "<<name<<"_size"<<iendl ; 
    329      oss<<"END SUBROUTINE cxios_set_"<<className<<"_"<<name<<iendl ; 
    330      oss<<iendl ; 
    331      oss<<"SUBROUTINE cxios_get_"<<className<<"_"<<name<<"("<<className<<"_hdl, "<<name<<", "<<name<<"_size) BIND(C)"<<iendl ; 
    332      oss<<"  USE ISO_C_BINDING"<<iendl ; 
    333      oss<<"  INTEGER (kind = C_INTPTR_T), VALUE :: "<<className<<"_hdl"<<iendl ; 
    334      oss<<"  CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: "<<name<<iendl ; 
    335      oss<<"  INTEGER  (kind = C_INT)     , VALUE        :: "<<name<<"_size"<<iendl ; 
    336      oss<<"END SUBROUTINE cxios_get_"<<className<<"_"<<name<<iendl ; 
    337      oss<<iendl ; 
     309   void CInterface::AttributeFortran2003Interface<string>(ostream& oss, const string& className, const string& name) 
     310   { 
     311     oss << "SUBROUTINE cxios_set_" << className << "_" << name << "(" << className << "_hdl, " << name << ", " << name << "_size) BIND(C)" << iendl; 
     312     oss << "  USE ISO_C_BINDING" << iendl; 
     313     oss << "  INTEGER (kind = C_INTPTR_T), VALUE :: " << className << "_hdl" << iendl; 
     314     oss << "  CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: " << name << iendl; 
     315     oss << "  INTEGER  (kind = C_INT)     , VALUE        :: " << name << "_size" << iendl; 
     316     oss << "END SUBROUTINE cxios_set_" << className << "_" << name << std::endl; 
     317     oss << iendl; 
     318     oss << "SUBROUTINE cxios_get_" << className << "_" << name << "(" << className << "_hdl, " << name << ", " << name << "_size) BIND(C)" << iendl; 
     319     oss << "  USE ISO_C_BINDING" << iendl; 
     320     oss << "  INTEGER (kind = C_INTPTR_T), VALUE :: " << className << "_hdl" << iendl; 
     321     oss << "  CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: " << name << iendl; 
     322     oss << "  INTEGER  (kind = C_INT)     , VALUE        :: " << name << "_size" << iendl; 
     323     oss << "END SUBROUTINE cxios_get_" << className << "_" << name << std::endl; 
    338324   } 
    339325 
     
    346332    oss << "  INTEGER (kind = C_INTPTR_T), VALUE :: " << className << "_hdl" << iendl; 
    347333    oss << "  TYPE(txios(date)), VALUE :: " << name << iendl; 
    348     oss << "END SUBROUTINE cxios_set_" << className << "_" << name << iendl; 
     334    oss << "END SUBROUTINE cxios_set_" << className << "_" << name << std::endl; 
    349335    oss << iendl; 
    350336    oss << "SUBROUTINE cxios_get_" << className << "_" << name << "(" << className << "_hdl, " << name << ") BIND(C)" << iendl; 
     
    353339    oss << "  INTEGER (kind = C_INTPTR_T), VALUE :: " << className << "_hdl" << iendl; 
    354340    oss << "  TYPE(txios(date)) :: " << name << iendl; 
    355     oss << "END SUBROUTINE cxios_get_" << className << "_" << name << iendl; 
    356     oss << iendl; 
     341    oss << "END SUBROUTINE cxios_get_" << className << "_" << name << std::endl; 
    357342  } 
    358343 
     
    365350    oss << "  INTEGER (kind = C_INTPTR_T), VALUE :: " << className << "_hdl" << iendl; 
    366351    oss << "  TYPE(txios(duration)), VALUE :: " << name << iendl; 
    367     oss << "END SUBROUTINE cxios_set_" << className << "_" << name << iendl; 
     352    oss << "END SUBROUTINE cxios_set_" << className << "_" << name << std::endl; 
    368353    oss << iendl; 
    369354    oss << "SUBROUTINE cxios_get_" << className << "_" << name << "(" << className << "_hdl, " << name << ") BIND(C)" << iendl; 
     
    372357    oss << "  INTEGER (kind = C_INTPTR_T), VALUE :: " << className << "_hdl" << iendl; 
    373358    oss << "  TYPE(txios(duration)) :: " << name << iendl; 
    374     oss << "END SUBROUTINE cxios_get_" << className << "_" << name << iendl; 
    375     oss << iendl; 
     359    oss << "END SUBROUTINE cxios_get_" << className << "_" << name << std::endl; 
    376360  } 
    377361 
    378362/* 
    379 #define macro(T)\ 
    380    template <>\ 
    381    void CInterface::AttributeFortran2003Interface<ARRAY(T,1)>(ostream& oss,const string& className,const string& name) \ 
    382    { \ 
    383      string fortranType=getStrFortranType<T>() ; \ 
    384      string fortranKindC=getStrFortranKindC<T>() ; \ 
    385       \ 
    386      oss<<"SUBROUTINE cxios_set_"<<className<<"_"<<name<<"("<<className<<"_hdl, "<<name<<", extent1) BIND(C)"<<iendl ; \ 
    387      oss<<"  USE ISO_C_BINDING"<<iendl ; \ 
    388      oss<<"  INTEGER (kind = C_INTPTR_T), VALUE       :: "<<className<<"_hdl"<<iendl ; \ 
    389      oss<<"  "<<fortranType<<" "<<fortranKindC<<"     , DIMENSION(*) :: "<<name<<iendl ; \ 
    390      oss<<"  INTEGER (kind = C_INT), VALUE  :: extent1"<<iendl ; \ 
    391      oss<<"END SUBROUTINE cxios_set_"<<className<<"_"<<name<<iendl ; \ 
    392      oss<<iendl; \ 
    393      oss<<"SUBROUTINE cxios_get_"<<className<<"_"<<name<<"("<<className<<"_hdl, "<<name<<", extent1) BIND(C)"<<iendl ; \ 
    394      oss<<"  USE ISO_C_BINDING"<<iendl ; \ 
    395      oss<<"  INTEGER (kind = C_INTPTR_T), VALUE       :: "<<className<<"_hdl"<<iendl ; \ 
    396      oss<<"  "<<fortranType<<" "<<fortranKindC<<"     , DIMENSION(*) :: "<<name<<iendl ; \ 
    397      oss<<"  INTEGER (kind = C_INT), VALUE  :: extent1"<<iendl ; \ 
    398      oss<<"END SUBROUTINE cxios_get_"<<className<<"_"<<name<<iendl ; \ 
    399    } \ 
    400  \ 
    401    template <> \ 
    402    void CInterface::AttributeFortran2003Interface<ARRAY(T,2)>(ostream& oss,const string& className,const string& name) \ 
    403    { \ 
    404      string fortranType=getStrFortranType<T>() ; \ 
    405      string fortranKindC=getStrFortranKindC<T>() ; \ 
    406       \ 
    407      oss<<"SUBROUTINE cxios_set_"<<className<<"_"<<name<<"("<<className<<"_hdl, "<<name<<", extent1, extent2) BIND(C)"<<iendl ; \ 
    408      oss<<"  USE ISO_C_BINDING"<<iendl ; \ 
    409      oss<<"  INTEGER (kind = C_INTPTR_T), VALUE       :: "<<className<<"_hdl"<<iendl ; \ 
    410      oss<<"  "<<fortranType<<" "<<fortranKindC<<"     , DIMENSION(*) :: "<<name<<iendl ; \ 
    411      oss<<"  INTEGER (kind = C_INT), VALUE  :: extent1"<<iendl ; \ 
    412      oss<<"  INTEGER (kind = C_INT), VALUE  :: extent2"<<iendl ; \ 
    413      oss<<"END SUBROUTINE cxios_set_"<<className<<"_"<<name<<iendl ; \ 
    414      oss<<iendl ; \ 
    415      oss<<"SUBROUTINE cxios_get_"<<className<<"_"<<name<<"("<<className<<"_hdl, "<<name<<", extent1, extent2) BIND(C)"<<iendl ; \ 
    416      oss<<"  USE ISO_C_BINDING"<<iendl ; \ 
    417      oss<<"  INTEGER (kind = C_INTPTR_T), VALUE       :: "<<className<<"_hdl"<<iendl ; \ 
    418      oss<<"  "<<fortranType<<" "<<fortranKindC<<"     , DIMENSION(*) :: "<<name<<iendl ; \ 
    419      oss<<"  INTEGER (kind = C_INT), VALUE  :: extent1"<<iendl ; \ 
    420      oss<<"  INTEGER (kind = C_INT), VALUE  :: extent2"<<iendl ; \ 
    421      oss<<"END SUBROUTINE cxios_get_"<<className<<"_"<<name<<iendl ; \ 
     363#define macro(T) \ 
     364   template <> \ 
     365   void CInterface::AttributeFortran2003Interface<ARRAY(T,1)>(ostream& oss, const string& className, const string& name) \ 
     366   { \ 
     367     string fortranType=getStrFortranType<T>(); \ 
     368     string fortranKindC=getStrFortranKindC<T>(); \ 
     369      \ 
     370     oss << "SUBROUTINE cxios_set_" << className << "_" << name << "(" << className << "_hdl, " << name << ", extent1) BIND(C)" << iendl; \ 
     371     oss << "  USE ISO_C_BINDING" << iendl; \ 
     372     oss << "  INTEGER (kind = C_INTPTR_T), VALUE       :: " << className << "_hdl" << iendl; \ 
     373     oss << "  " << fortranType << " " << fortranKindC << "     , DIMENSION(*) :: " << name << iendl; \ 
     374     oss << "  INTEGER (kind = C_INT), VALUE  :: extent1" << iendl; \ 
     375     oss << "END SUBROUTINE cxios_set_" << className << "_" << name << std::endl; \ 
     376     oss << iendl; \ 
     377     oss << "SUBROUTINE cxios_get_" << className << "_" << name << "(" << className << "_hdl, " << name << ", extent1) BIND(C)" << iendl; \ 
     378     oss << "  USE ISO_C_BINDING" << iendl; \ 
     379     oss << "  INTEGER (kind = C_INTPTR_T), VALUE       :: " << className << "_hdl" << iendl; \ 
     380     oss << "  " << fortranType << " " << fortranKindC << "     , DIMENSION(*) :: " << name << iendl; \ 
     381     oss << "  INTEGER (kind = C_INT), VALUE  :: extent1" << iendl; \ 
     382     oss << "END SUBROUTINE cxios_get_" << className << "_" << name << std::endl; \ 
     383   } \ 
     384 \ 
     385   template <> \ 
     386   void CInterface::AttributeFortran2003Interface<ARRAY(T,2)>(ostream& oss, const string& className, const string& name) \ 
     387   { \ 
     388     string fortranType=getStrFortranType<T>(); \ 
     389     string fortranKindC=getStrFortranKindC<T>(); \ 
     390      \ 
     391     oss << "SUBROUTINE cxios_set_" << className << "_" << name << "(" << className << "_hdl, " << name << ", extent1, extent2) BIND(C)" << iendl; \ 
     392     oss << "  USE ISO_C_BINDING" << iendl; \ 
     393     oss << "  INTEGER (kind = C_INTPTR_T), VALUE       :: " << className << "_hdl" << iendl; \ 
     394     oss << "  " << fortranType << " " << fortranKindC << "     , DIMENSION(*) :: " << name << iendl; \ 
     395     oss << "  INTEGER (kind = C_INT), VALUE  :: extent1" << iendl; \ 
     396     oss << "  INTEGER (kind = C_INT), VALUE  :: extent2" << iendl; \ 
     397     oss << "END SUBROUTINE cxios_set_" << className << "_" << name << std::endl; \ 
     398     oss << iendl; \ 
     399     oss << "SUBROUTINE cxios_get_" << className << "_" << name << "(" << className << "_hdl, " << name << ", extent1, extent2) BIND(C)" << iendl; \ 
     400     oss << "  USE ISO_C_BINDING" << iendl; \ 
     401     oss << "  INTEGER (kind = C_INTPTR_T), VALUE       :: " << className << "_hdl" << iendl; \ 
     402     oss << "  " << fortranType << " " << fortranKindC << "     , DIMENSION(*) :: " << name << iendl; \ 
     403     oss << "  INTEGER (kind = C_INT), VALUE  :: extent1" << iendl; \ 
     404     oss << "  INTEGER (kind = C_INT), VALUE  :: extent2" << iendl; \ 
     405     oss << "END SUBROUTINE cxios_get_" << className << "_" << name << std::endl; \ 
    422406   } \ 
    423407     \ 
    424408   template <> \ 
    425    void CInterface::AttributeFortran2003Interface<ARRAY(T,3)>(ostream& oss,const string& className,const string& name) \ 
    426    { \ 
    427      string fortranType=getStrFortranType<T>() ; \ 
    428      string fortranKindC=getStrFortranKindC<T>() ; \ 
    429       \ 
    430      oss<<"SUBROUTINE cxios_set_"<<className<<"_"<<name<<"("<<className<<"_hdl, "<<name<<", extent1, extent2, extent3) BIND(C)"<<iendl ; \ 
    431      oss<<"  USE ISO_C_BINDING"<<iendl ; \ 
    432      oss<<"  INTEGER (kind = C_INTPTR_T), VALUE       :: "<<className<<"_hdl"<<iendl ; \ 
    433      oss<<"  "<<fortranType<<" "<<fortranKindC<<"     , DIMENSION(*) :: "<<name<<iendl ; \ 
    434      oss<<"  INTEGER (kind = C_INT), VALUE  :: extent1"<<iendl ; \ 
    435      oss<<"  INTEGER (kind = C_INT), VALUE  :: extent2"<<iendl ; \ 
    436      oss<<"  INTEGER (kind = C_INT), VALUE  :: extent3"<<iendl ; \ 
    437      oss<<"END SUBROUTINE cxios_set_"<<className<<"_"<<name<<iendl ; \ 
    438      oss<<iendl ;\ 
    439      oss<<"SUBROUTINE cxios_get_"<<className<<"_"<<name<<"("<<className<<"_hdl, "<<name<<", extent1, extent2, extent3) BIND(C)"<<iendl ; \ 
    440      oss<<"  USE ISO_C_BINDING"<<iendl ; \ 
    441      oss<<"  INTEGER (kind = C_INTPTR_T), VALUE       :: "<<className<<"_hdl"<<iendl ; \ 
    442      oss<<"  "<<fortranType<<" "<<fortranKindC<<"     , DIMENSION(*) :: "<<name<<iendl ; \ 
    443      oss<<"  INTEGER (kind = C_INT), VALUE  :: extent1"<<iendl ; \ 
    444      oss<<"  INTEGER (kind = C_INT), VALUE  :: extent2"<<iendl ; \ 
    445      oss<<"  INTEGER (kind = C_INT), VALUE  :: extent3"<<iendl ; \ 
    446      oss<<"END SUBROUTINE cxios_get_"<<className<<"_"<<name<<iendl ; \ 
     409   void CInterface::AttributeFortran2003Interface<ARRAY(T,3)>(ostream& oss, const string& className, const string& name) \ 
     410   { \ 
     411     string fortranType=getStrFortranType<T>(); \ 
     412     string fortranKindC=getStrFortranKindC<T>(); \ 
     413      \ 
     414     oss << "SUBROUTINE cxios_set_" << className << "_" << name << "(" << className << "_hdl, " << name << ", extent1, extent2, extent3) BIND(C)" << iendl; \ 
     415     oss << "  USE ISO_C_BINDING" << iendl; \ 
     416     oss << "  INTEGER (kind = C_INTPTR_T), VALUE       :: " << className << "_hdl" << iendl; \ 
     417     oss << "  " << fortranType << " " << fortranKindC << "     , DIMENSION(*) :: " << name << iendl; \ 
     418     oss << "  INTEGER (kind = C_INT), VALUE  :: extent1" << iendl; \ 
     419     oss << "  INTEGER (kind = C_INT), VALUE  :: extent2" << iendl; \ 
     420     oss << "  INTEGER (kind = C_INT), VALUE  :: extent3" << iendl; \ 
     421     oss << "END SUBROUTINE cxios_set_" << className << "_" << name << std::endl; \ 
     422     oss << iendl; \ 
     423     oss << "SUBROUTINE cxios_get_" << className << "_" << name << "(" << className << "_hdl, " << name << ", extent1, extent2, extent3) BIND(C)" << iendl; \ 
     424     oss << "  USE ISO_C_BINDING" << iendl; \ 
     425     oss << "  INTEGER (kind = C_INTPTR_T), VALUE       :: " << className << "_hdl" << iendl; \ 
     426     oss << "  " << fortranType << " " << fortranKindC << "     , DIMENSION(*) :: " << name << iendl; \ 
     427     oss << "  INTEGER (kind = C_INT), VALUE  :: extent1" << iendl; \ 
     428     oss << "  INTEGER (kind = C_INT), VALUE  :: extent2" << iendl; \ 
     429     oss << "  INTEGER (kind = C_INT), VALUE  :: extent3" << iendl; \ 
     430     oss << "END SUBROUTINE cxios_get_" << className << "_" << name << std::endl; \ 
    447431   } 
    448432 
     
    454438*/ 
    455439   template <class T> 
    456    void CInterface::AttributeFortranInterfaceDeclaration(ostream& oss,const string& className,const string& name) 
    457    { 
    458      oss<<getStrFortranType<T>()<<" "<< getStrFortranKind<T>() <<" , OPTIONAL, INTENT(IN) :: "<<name<<iendl ; 
    459      if (!matchingTypeCFortran<T>()) oss<<getStrFortranType<T>()<<" "<<getStrFortranKindC<T>()<<" :: "<<name<<"_tmp"<<iendl ; 
     440   void CInterface::AttributeFortranInterfaceDeclaration(ostream& oss, const string& className, const string& name) 
     441   { 
     442     oss << getStrFortranType<T>() << " " << getStrFortranKind<T>() << " , OPTIONAL, INTENT(IN) :: " << name; 
     443     if (!matchingTypeCFortran<T>()) oss << iendl << getStrFortranType<T>() << " " << getStrFortranKindC<T>() << " :: " << name << "_tmp"; 
    460444   } 
    461445 
    462446   template <class T> 
    463    void CInterface::AttributeFortranInterfaceGetDeclaration(ostream& oss,const string& className,const string& name) 
    464    { 
    465      oss<<getStrFortranType<T>()<<" "<< getStrFortranKind<T>() <<" , OPTIONAL, INTENT(OUT) :: "<<name<<iendl ; 
    466      if (!matchingTypeCFortran<T>()) oss<<getStrFortranType<T>()<<" "<<getStrFortranKindC<T>()<<" :: "<<name<<"_tmp"<<iendl ; 
    467    } 
    468  
    469    void CInterface::AttributeFortranInterfaceIsDefinedDeclaration(ostream& oss,const string& className,const string& name) 
    470    { 
    471      oss<<"LOGICAL, OPTIONAL, INTENT(OUT) :: "<<name<<iendl ; 
    472      oss<<"LOGICAL(KIND=C_BOOL) :: "<<name<<"_tmp"<<iendl ; 
     447   void CInterface::AttributeFortranInterfaceGetDeclaration(ostream& oss, const string& className, const string& name) 
     448   { 
     449     oss << getStrFortranType<T>() << " " << getStrFortranKind<T>() << " , OPTIONAL, INTENT(OUT) :: " << name; 
     450     if (!matchingTypeCFortran<T>()) oss << iendl << getStrFortranType<T>() << " " << getStrFortranKindC<T>() << " :: " << name << "_tmp"; 
     451   } 
     452 
     453   void CInterface::AttributeFortranInterfaceIsDefinedDeclaration(ostream& oss, const string& className, const string& name) 
     454   { 
     455     oss << "LOGICAL, OPTIONAL, INTENT(OUT) :: " << name << iendl; 
     456     oss << "LOGICAL(KIND=C_BOOL) :: " << name << "_tmp"; 
    473457   } 
    474458 
    475459   template <> 
    476    void CInterface::AttributeFortranInterfaceDeclaration<string>(ostream& oss,const string& className,const string& name) 
    477    { 
    478      oss<<"CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: "<<name<<iendl ; 
     460   void CInterface::AttributeFortranInterfaceDeclaration<string>(ostream& oss, const string& className, const string& name) 
     461   { 
     462     oss << "CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: " << name; 
    479463   } 
    480464 
    481465   template <> 
    482    void CInterface::AttributeFortranInterfaceGetDeclaration<string>(ostream& oss,const string& className,const string& name) 
    483    { 
    484      oss<<"CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: "<<name<<iendl ; 
     466   void CInterface::AttributeFortranInterfaceGetDeclaration<string>(ostream& oss, const string& className, const string& name) 
     467   { 
     468     oss << "CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: " << name; 
    485469   } 
    486470 
    487471/* 
    488 #define macro(T)\ 
    489    template <> \ 
    490    void CInterface::AttributeFortranInterfaceDeclaration<ARRAY(T,1)>(ostream& oss,const string& className,const string& name) \ 
    491    { \ 
    492      oss<<getStrFortranType<T>()<<" "<<getStrFortranKind<T>() <<" , OPTIONAL, INTENT(IN) :: "<<name<<"(:)"<<iendl ; \ 
    493      if (!matchingTypeCFortran<T>()) oss<<getStrFortranType<T>()<<" "<<getStrFortranKindC<T>() <<" , ALLOCATABLE :: "<<name<<"_tmp(:)"<<iendl ; \ 
    494    } \ 
    495    template <> \ 
    496    void CInterface::AttributeFortranInterfaceGetDeclaration<ARRAY(T,1)>(ostream& oss,const string& className,const string& name) \ 
    497    { \ 
    498      oss<<getStrFortranType<T>()<<" "<<getStrFortranKind<T>() <<" , OPTIONAL, INTENT(OUT) :: "<<name<<"(:)"<<iendl ; \ 
    499      if (!matchingTypeCFortran<T>()) oss<<getStrFortranType<T>()<<" "<<getStrFortranKindC<T>() <<" , ALLOCATABLE :: "<<name<<"_tmp(:)"<<iendl ; \ 
    500    } \ 
    501  \ 
    502    template <> \ 
    503    void CInterface::AttributeFortranInterfaceDeclaration<ARRAY(T,2)>(ostream& oss,const string& className,const string& name) \ 
    504    { \ 
    505      oss<<getStrFortranType<T>()<<" "<<getStrFortranKind<T>() <<" , OPTIONAL, INTENT(IN) :: "<<name<<"(:,:)"<<iendl ; \ 
    506      if (!matchingTypeCFortran<T>()) oss<<getStrFortranType<T>()<<" "<<getStrFortranKindC<T>() <<" , ALLOCATABLE :: "<<name<<"_tmp(:,:)"<<iendl ; \ 
    507    } \ 
    508  \ 
    509    template <> \ 
    510    void CInterface::AttributeFortranInterfaceGetDeclaration<ARRAY(T,2)>(ostream& oss,const string& className,const string& name) \ 
    511    { \ 
    512      oss<<getStrFortranType<T>()<<" "<<getStrFortranKind<T>() <<" , OPTIONAL, INTENT(OUT) :: "<<name<<"(:,:)"<<iendl ; \ 
    513      if (!matchingTypeCFortran<T>()) oss<<getStrFortranType<T>()<<" "<<getStrFortranKindC<T>() <<" , ALLOCATABLE :: "<<name<<"_tmp(:,:)"<<iendl ; \ 
    514    } \ 
    515  \ 
    516    template <> \ 
    517    void CInterface::AttributeFortranInterfaceDeclaration<ARRAY(T,3)>(ostream& oss,const string& className,const string& name) \ 
    518    { \ 
    519      oss<<getStrFortranType<T>()<<" "<<getStrFortranKind<T>() <<" , OPTIONAL, INTENT(IN) :: "<<name<<"(:,:,:)"<<iendl ; \ 
    520      if (!matchingTypeCFortran<T>()) oss<<getStrFortranType<T>()<<" "<<getStrFortranKindC<T>() <<" , ALLOCATABLE :: "<<name<<"_tmp(:,:,:)"<<iendl ; \ 
    521    }\ 
    522  \ 
    523    template <> \ 
    524    void CInterface::AttributeFortranInterfaceGetDeclaration<ARRAY(T,3)>(ostream& oss,const string& className,const string& name) \ 
    525    { \ 
    526      oss<<getStrFortranType<T>()<<" "<<getStrFortranKind<T>() <<" , OPTIONAL, INTENT(OUT) :: "<<name<<"(:,:,:)"<<iendl ; \ 
    527      if (!matchingTypeCFortran<T>()) oss<<getStrFortranType<T>()<<" "<<getStrFortranKindC<T>() <<" , ALLOCATABLE :: "<<name<<"_tmp(:,:,:)"<<iendl ; \ 
     472#define macro(T) \ 
     473   template <> \ 
     474   void CInterface::AttributeFortranInterfaceDeclaration<ARRAY(T,1)>(ostream& oss, const string& className, const string& name) \ 
     475   { \ 
     476     oss << getStrFortranType<T>() << " " << getStrFortranKind<T>() << " , OPTIONAL, INTENT(IN) :: " << name << "(:)"; \ 
     477     if (!matchingTypeCFortran<T>()) oss << iendl << getStrFortranType<T>() << " " << getStrFortranKindC<T>() << " , ALLOCATABLE :: " << name << "_tmp(:)"; \ 
     478   } \ 
     479   template <> \ 
     480   void CInterface::AttributeFortranInterfaceGetDeclaration<ARRAY(T,1)>(ostream& oss, const string& className, const string& name) \ 
     481   { \ 
     482     oss << getStrFortranType<T>() << " " << getStrFortranKind<T>() << " , OPTIONAL, INTENT(OUT) :: " << name << "(:)"; \ 
     483     if (!matchingTypeCFortran<T>()) oss << iendl << getStrFortranType<T>() << " " << getStrFortranKindC<T>() << " , ALLOCATABLE :: " << name << "_tmp(:)"; \ 
     484   } \ 
     485 \ 
     486   template <> \ 
     487   void CInterface::AttributeFortranInterfaceDeclaration<ARRAY(T,2)>(ostream& oss, const string& className, const string& name) \ 
     488   { \ 
     489     oss << getStrFortranType<T>() << " " << getStrFortranKind<T>() << " , OPTIONAL, INTENT(IN) :: " << name << "(:,:)"; \ 
     490     if (!matchingTypeCFortran<T>()) oss << iendl << getStrFortranType<T>() << " " << getStrFortranKindC<T>() << " , ALLOCATABLE :: " << name << "_tmp(:,:)"; \ 
     491   } \ 
     492 \ 
     493   template <> \ 
     494   void CInterface::AttributeFortranInterfaceGetDeclaration<ARRAY(T,2)>(ostream& oss, const string& className, const string& name) \ 
     495   { \ 
     496     oss << getStrFortranType<T>() << " " << getStrFortranKind<T>() << " , OPTIONAL, INTENT(OUT) :: " << name << "(:,:)"; \ 
     497     if (!matchingTypeCFortran<T>()) oss << iendl << getStrFortranType<T>() << " " << getStrFortranKindC<T>() << " , ALLOCATABLE :: " << name << "_tmp(:,:)"; \ 
     498   } \ 
     499 \ 
     500   template <> \ 
     501   void CInterface::AttributeFortranInterfaceDeclaration<ARRAY(T,3)>(ostream& oss, const string& className, const string& name) \ 
     502   { \ 
     503     oss << getStrFortranType<T>() << " " << getStrFortranKind<T>() << " , OPTIONAL, INTENT(IN) :: " << name << "(:,:,:)"; \ 
     504     if (!matchingTypeCFortran<T>()) oss << iendl << getStrFortranType<T>() << " " << getStrFortranKindC<T>() << " , ALLOCATABLE :: " << name << "_tmp(:,:,:)"; \ 
     505   } \ 
     506 \ 
     507   template <> \ 
     508   void CInterface::AttributeFortranInterfaceGetDeclaration<ARRAY(T,3)>(ostream& oss, const string& className, const string& name) \ 
     509   { \ 
     510     oss << getStrFortranType<T>() << " " << getStrFortranKind<T>() << " , OPTIONAL, INTENT(OUT) :: " << name << "(:,:,:)"; \ 
     511     if (!matchingTypeCFortran<T>()) oss << iendl << getStrFortranType<T>() << " " << getStrFortranKindC<T>() << " , ALLOCATABLE :: " << name << "_tmp(:,:,:)"; \ 
    528512   } 
    529513 
     
    536520 
    537521   template <class T> 
    538    void CInterface::AttributeFortranInterfaceBody(ostream& oss,const string& className,const string& name) 
    539    { 
    540      string name_tmp=name+"__tmp" ; 
    541  
    542      oss<<"IF (PRESENT("<<name<<"_)) THEN"<<iendl ; 
     522   void CInterface::AttributeFortranInterfaceBody(ostream& oss, const string& className, const string& name) 
     523   { 
     524     string name_tmp=name+"__tmp"; 
     525 
     526     oss << "IF (PRESENT(" << name << "_)) THEN" << iendl; 
    543527     if (!matchingTypeCFortran<T>()) 
    544528     { 
    545        oss<<"  "<<name_tmp<<"="<<name<<"_"<<iendl ; 
    546        oss<<"  CALL cxios_set_"<<className<<"_"<<name<<"("<<className<<"_hdl%daddr, "<<name_tmp<<")"<<iendl ; 
     529       oss << "  " << name_tmp << " = " << name << "_" << iendl; 
     530       oss << "  CALL cxios_set_" << className << "_" << name << "(" << className << "_hdl%daddr, " << name_tmp << ")" << iendl; 
    547531     } 
    548      else oss<<"  CALL cxios_set_"<<className<<"_"<<name<<"("<<className<<"_hdl%daddr, "<<name<<"_)"<<iendl ; 
    549      oss<<"ENDIF"<<iendl ; 
     532     else oss << "  CALL cxios_set_" << className << "_" << name << "(" << className << "_hdl%daddr, " << name << "_)" << iendl; 
     533     oss << "ENDIF"; 
    550534   } 
    551535 
    552536   template <class T> 
    553    void CInterface::AttributeFortranInterfaceGetBody(ostream& oss,const string& className,const string& name) 
    554    { 
    555      string name_tmp=name+"__tmp" ; 
    556  
    557      oss<<"IF (PRESENT("<<name<<"_)) THEN"<<iendl ; 
     537   void CInterface::AttributeFortranInterfaceGetBody(ostream& oss, const string& className, const string& name) 
     538   { 
     539     string name_tmp=name+"__tmp"; 
     540 
     541     oss << "IF (PRESENT(" << name << "_)) THEN" << iendl; 
    558542     if (!matchingTypeCFortran<T>()) 
    559543     { 
    560        oss<<"  CALL cxios_get_"<<className<<"_"<<name<<"("<<className<<"_hdl%daddr, "<<name_tmp<<")"<<iendl ; 
    561        oss<<"  "<<name<<"_="<<name_tmp<<iendl ; 
     544       oss << "  CALL cxios_get_" << className << "_" << name << "(" << className << "_hdl%daddr, " << name_tmp << ")" << iendl; 
     545       oss << "  " << name << "_ = " << name_tmp << iendl; 
    562546     } 
    563      else oss<<"  CALL cxios_get_"<<className<<"_"<<name<<"("<<className<<"_hdl%daddr, "<<name<<"_)"<<iendl ; 
    564      oss<<"ENDIF"<<iendl ; 
    565    } 
    566  
    567    void CInterface::AttributeFortranInterfaceIsDefinedBody(ostream& oss,const string& className,const string& name) 
    568    { 
    569      string name_tmp=name+"__tmp" ; 
    570  
    571      oss<<"IF (PRESENT("<<name<<"_)) THEN"<<iendl ; 
    572      oss<<"  "<<name<<"__tmp=cxios_is_defined_"<<className<<"_"<<name<<"("<<className<<"_hdl%daddr)"<<iendl ; 
    573      oss<<"  "<<name<<"_="<<name_tmp<<iendl ; 
    574      oss<<"ENDIF"<<iendl ; 
     547     else oss << "  CALL cxios_get_" << className << "_" << name << "(" << className << "_hdl%daddr, " << name << "_)" << iendl; 
     548     oss << "ENDIF"; 
     549   } 
     550 
     551   void CInterface::AttributeFortranInterfaceIsDefinedBody(ostream& oss, const string& className, const string& name) 
     552   { 
     553     string name_tmp=name+"__tmp"; 
     554 
     555     oss << "IF (PRESENT(" << name << "_)) THEN" << iendl; 
     556     oss << "  " << name << "__tmp = cxios_is_defined_" << className << "_" << name << "(" << className << "_hdl%daddr)" << iendl; 
     557     oss << "  " << name << "_ = " << name_tmp << iendl; 
     558     oss << "ENDIF"; 
    575559   } 
    576560 
    577561   template <> 
    578    void CInterface::AttributeFortranInterfaceBody<string>(ostream& oss,const string& className,const string& name) 
    579    { 
    580       oss<<"IF (PRESENT("<<name<<"_)) THEN"<<iendl ; 
    581       oss<<"  CALL cxios_set_"<<className<<"_"<<name<<"("<<className<<"_hdl%daddr, "<<name<<"_, len("<<name<<"_))"<<iendl ; 
    582       oss<<"ENDIF"<<iendl ; 
     562   void CInterface::AttributeFortranInterfaceBody<string>(ostream& oss, const string& className, const string& name) 
     563   { 
     564      oss << "IF (PRESENT(" << name << "_)) THEN" << iendl; 
     565      oss << "  CALL cxios_set_" << className << "_" << name << "(" << className << "_hdl%daddr, " << name << "_, len(" << name << "_))" << iendl; 
     566      oss << "ENDIF"; 
    583567   } 
    584568 
    585569   template <> 
    586    void CInterface::AttributeFortranInterfaceGetBody<string>(ostream& oss,const string& className,const string& name) 
    587    { 
    588       oss<<"IF (PRESENT("<<name<<"_)) THEN"<<iendl ; 
    589       oss<<"  CALL cxios_get_"<<className<<"_"<<name<<"("<<className<<"_hdl%daddr, "<<name<<"_, len("<<name<<"_))"<<iendl ; 
    590       oss<<"ENDIF"<<iendl ; 
     570   void CInterface::AttributeFortranInterfaceGetBody<string>(ostream& oss, const string& className, const string& name) 
     571   { 
     572      oss << "IF (PRESENT(" << name << "_)) THEN" << iendl; 
     573      oss << "  CALL cxios_get_" << className << "_" << name << "(" << className << "_hdl%daddr, " << name << "_, len(" << name << "_))" << iendl; 
     574      oss << "ENDIF"; 
    591575   } 
    592576 
     
    594578#define macro(T) \ 
    595579   template <>  \ 
    596    void CInterface::AttributeFortranInterfaceBody< ARRAY(T,1) >(ostream& oss,const string& className,const string& name) \ 
    597    {  \ 
    598      string name_tmp=name+"__tmp" ; \ 
    599       \ 
    600      oss<<"IF (PRESENT("<<name<<"_)) THEN"<<iendl ; \ 
    601      if (!matchingTypeCFortran<T>())  \ 
    602      { \ 
    603        oss<<"  ALLOCATE("<<name_tmp<<"(size("<<name<<"_,1)))"<<iendl ; \ 
    604        oss<<"  "<<name_tmp<<"="<<name<<"_"<<iendl ; \ 
    605        oss<<"  CALL cxios_set_"<<className<<"_"<<name<<"("<<className<<"_hdl%daddr, "<<name_tmp<<",size("<<name<<"_,1))"<<iendl ; \ 
     580   void CInterface::AttributeFortranInterfaceBody< ARRAY(T,1) >(ostream& oss, const string& className, const string& name) \ 
     581   {  \ 
     582     string name_tmp=name+"__tmp"; \ 
     583      \ 
     584     oss << "IF (PRESENT(" << name << "_)) THEN" << iendl; \ 
     585     if (!matchingTypeCFortran<T>())  \ 
     586     { \ 
     587       oss << "  ALLOCATE(" << name_tmp << "(size(" << name << "_,1)))" << iendl; \ 
     588       oss << "  " << name_tmp << " = " << name << "_" << iendl; \ 
     589       oss << "  CALL cxios_set_" << className << "_" << name << "(" << className << "_hdl%daddr, " << name_tmp << ", size(" << name << "_,1))" << iendl; \ 
    606590     } \ 
    607      else oss<<"  CALL cxios_set_"<<className<<"_"<<name<<"("<<className<<"_hdl%daddr, "<<name<<"_,size("<<name<<"_,1))"<<iendl ; \ 
    608      oss<<"ENDIF"<<iendl ; \ 
    609    } \ 
    610  \ 
    611    template <>  \ 
    612    void CInterface::AttributeFortranInterfaceBody< ARRAY(T,2) >(ostream& oss,const string& className,const string& name) \ 
    613    {  \ 
    614      string name_tmp=name+"__tmp" ; \ 
    615       \ 
    616      oss<<"IF (PRESENT("<<name<<"_)) THEN"<<iendl ; \ 
    617      if (!matchingTypeCFortran<T>())  \ 
    618      { \ 
    619        oss<<"  ALLOCATE("<<name_tmp<<"(size("<<name<<"_,1),size("<<name<<"_,2)))"<<iendl ; \ 
    620        oss<<"  "<<name_tmp<<"="<<name<<"_"<<iendl ; \ 
    621        oss<<"  CALL cxios_set_"<<className<<"_"<<name<<"("<<className<<"_hdl%daddr, "<<name_tmp<<",size("<<name<<"_,1),size("<<name<<"_,2))"<<iendl ; \ 
     591     else oss << "  CALL cxios_set_" << className << "_" << name << "(" << className << "_hdl%daddr, " << name << "_, size(" << name << "_,1))" << iendl; \ 
     592     oss << "ENDIF"; \ 
     593   } \ 
     594 \ 
     595   template <>  \ 
     596   void CInterface::AttributeFortranInterfaceBody< ARRAY(T,2) >(ostream& oss, const string& className, const string& name) \ 
     597   {  \ 
     598     string name_tmp=name+"__tmp"; \ 
     599      \ 
     600     oss << "IF (PRESENT(" << name << "_)) THEN" << iendl; \ 
     601     if (!matchingTypeCFortran<T>())  \ 
     602     { \ 
     603       oss << "  ALLOCATE(" << name_tmp << "(size(" << name << "_,1), size(" << name << "_,2)))" << iendl; \ 
     604       oss << "  " << name_tmp << " = " << name << "_" << iendl; \ 
     605       oss << "  CALL cxios_set_" << className << "_" << name << "(" << className << "_hdl%daddr, " << name_tmp << ", size(" << name << "_,1), size(" << name << "_,2))" << iendl; \ 
    622606     } \ 
    623      else oss<<"  CALL cxios_set_"<<className<<"_"<<name<<"("<<className<<"_hdl%daddr, "<<name<<"_,size("<<name<<"_,1),size("<<name<<"_,2))"<<iendl ; \ 
    624      oss<<"ENDIF"<<iendl ; \ 
     607     else oss << "  CALL cxios_set_" << className << "_" << name << "(" << className << "_hdl%daddr, " << name << "_, size(" << name << "_,1), size(" << name << "_,2))" << iendl; \ 
     608     oss << "ENDIF"; \ 
    625609   } \ 
    626610    \ 
    627611   template <>  \ 
    628    void CInterface::AttributeFortranInterfaceBody< ARRAY(T,3) >(ostream& oss,const string& className,const string& name) \ 
    629    {  \ 
    630      string name_tmp=name+"__tmp" ; \ 
    631       \ 
    632      oss<<"IF (PRESENT("<<name<<"_)) THEN"<<iendl ; \ 
    633      if (!matchingTypeCFortran<T>())  \ 
    634      { \ 
    635        oss<<"  ALLOCATE("<<name_tmp<<"(size("<<name<<"_,1),size("<<name<<"_,2),size("<<name<<"_,3)))"<<iendl ; \ 
    636        oss<<"  "<<name_tmp<<"="<<name<<"_"<<iendl ; \ 
    637        oss<<"  CALL cxios_set_"<<className<<"_"<<name<<"("<<className<<"_hdl%daddr, "<<name_tmp<<",size("<<name<<"_,1),size("<<name<<"_,2),size("<<name<<"_,3))"<<iendl ; \ 
     612   void CInterface::AttributeFortranInterfaceBody< ARRAY(T,3) >(ostream& oss, const string& className, const string& name) \ 
     613   {  \ 
     614     string name_tmp=name+"__tmp"; \ 
     615      \ 
     616     oss << "IF (PRESENT(" << name << "_)) THEN" << iendl; \ 
     617     if (!matchingTypeCFortran<T>())  \ 
     618     { \ 
     619       oss << "  ALLOCATE(" << name_tmp << "(size(" << name << "_,1), size(" << name << "_,2), size(" << name << "_,3)))" << iendl; \ 
     620       oss << "  " << name_tmp << " = " << name << "_" << iendl; \ 
     621       oss << "  CALL cxios_set_" << className << "_" << name << "(" << className << "_hdl%daddr, " << name_tmp << ", size(" << name << "_,1), size(" << name << "_,2), size(" << name << "_,3))" << iendl; \ 
    638622     } \ 
    639      else oss<<"  CALL cxios_set_"<<className<<"_"<<name<<"("<<className<<"_hdl%daddr, "<<name<<"_,size("<<name<<"_,1),size("<<name<<"_,2),size("<<name<<"_,3))"<<iendl ; \ 
    640      oss<<"ENDIF"<<iendl ; \ 
     623     else oss << "  CALL cxios_set_" << className << "_" << name << "(" << className << "_hdl%daddr, " << name << "_, size(" << name << "_,1), size(" << name << "_,2), size(" << name << "_,3))" << iendl; \ 
     624     oss << "ENDIF"; \ 
    641625   } 
    642626 
     
    651635#define macro(T) \ 
    652636   template <>  \ 
    653    void CInterface::AttributeFortranInterfaceGetBody< ARRAY(T,1) >(ostream& oss,const string& className,const string& name) \ 
    654    {  \ 
    655      string name_tmp=name+"__tmp" ; \ 
    656       \ 
    657      oss<<"IF (PRESENT("<<name<<"_)) THEN"<<iendl ; \ 
    658      if (!matchingTypeCFortran<T>())  \ 
    659      { \ 
    660        oss<<"  ALLOCATE("<<name_tmp<<"(size("<<name<<"_,1)))"<<iendl ; \ 
    661        oss<<"  CALL cxios_get_"<<className<<"_"<<name<<"("<<className<<"_hdl%daddr, "<<name_tmp<<",size("<<name<<"_,1))"<<iendl ; \ 
    662        oss<<"  "<<name<<"_="<<name_tmp<<iendl ; \ 
     637   void CInterface::AttributeFortranInterfaceGetBody< ARRAY(T,1) >(ostream& oss, const string& className, const string& name) \ 
     638   {  \ 
     639     string name_tmp=name+"__tmp"; \ 
     640      \ 
     641     oss << "IF (PRESENT(" << name << "_)) THEN" << iendl; \ 
     642     if (!matchingTypeCFortran<T>())  \ 
     643     { \ 
     644       oss << "  ALLOCATE(" << name_tmp << "(size(" << name << "_,1)))" << iendl; \ 
     645       oss << "  CALL cxios_get_" << className << "_" << name << "(" << className << "_hdl%daddr, " << name_tmp << ", size(" << name << "_,1))" << iendl; \ 
     646       oss << "  " << name << "_ = " << name_tmp << iendl; \ 
    663647     } \ 
    664      else oss<<"  CALL cxios_get_"<<className<<"_"<<name<<"("<<className<<"_hdl%daddr, "<<name<<"_,size("<<name<<"_,1))"<<iendl ; \ 
    665      oss<<"ENDIF"<<iendl ; \ 
    666    } \ 
    667  \ 
    668    template <>  \ 
    669    void CInterface::AttributeFortranInterfaceGetBody< ARRAY(T,2) >(ostream& oss,const string& className,const string& name) \ 
    670    {  \ 
    671      string name_tmp=name+"__tmp" ; \ 
    672       \ 
    673      oss<<"IF (PRESENT("<<name<<"_)) THEN"<<iendl ; \ 
    674      if (!matchingTypeCFortran<T>())  \ 
    675      { \ 
    676        oss<<"  ALLOCATE("<<name_tmp<<"(size("<<name<<"_,1),size("<<name<<"_,2)))"<<iendl ; \ 
    677        oss<<"  CALL cxios_get_"<<className<<"_"<<name<<"("<<className<<"_hdl%daddr, "<<name_tmp<<",size("<<name<<"_,1),size("<<name<<"_,2))"<<iendl ; \ 
    678        oss<<"  "<<name<<"_="<<name_tmp<<iendl ; \ 
     648     else oss << "  CALL cxios_get_" << className << "_" << name << "(" << className << "_hdl%daddr, " << name << "_, size(" << name << "_,1))" << iendl; \ 
     649     oss << "ENDIF"; \ 
     650   } \ 
     651 \ 
     652   template <>  \ 
     653   void CInterface::AttributeFortranInterfaceGetBody< ARRAY(T,2) >(ostream& oss, const string& className, const string& name) \ 
     654   {  \ 
     655     string name_tmp=name+"__tmp"; \ 
     656      \ 
     657     oss << "IF (PRESENT(" << name << "_)) THEN" << iendl; \ 
     658     if (!matchingTypeCFortran<T>())  \ 
     659     { \ 
     660       oss << "  ALLOCATE(" << name_tmp << "(size(" << name << "_,1), size(" << name << "_,2)))" << iendl; \ 
     661       oss << "  CALL cxios_get_" << className << "_" << name << "(" << className << "_hdl%daddr, " << name_tmp << ", size(" << name << "_,1), size(" << name << "_,2))" << iendl; \ 
     662       oss << "  " << name << "_ = " << name_tmp << iendl; \ 
    679663     } \ 
    680      else oss<<"  CALL cxios_get_"<<className<<"_"<<name<<"("<<className<<"_hdl%daddr, "<<name<<"_,size("<<name<<"_,1),size("<<name<<"_,2))"<<iendl ; \ 
    681      oss<<"ENDIF"<<iendl ; \ 
     664     else oss << "  CALL cxios_get_" << className << "_" << name << "(" << className << "_hdl%daddr, " << name << "_, size(" << name << "_,1), size(" << name << "_,2))" << iendl; \ 
     665     oss << "ENDIF"; \ 
    682666   } \ 
    683667    \ 
    684668   template <>  \ 
    685    void CInterface::AttributeFortranInterfaceGetBody< ARRAY(T,3) >(ostream& oss,const string& className,const string& name) \ 
    686    {  \ 
    687      string name_tmp=name+"__tmp" ; \ 
    688       \ 
    689      oss<<"IF (PRESENT("<<name<<"_)) THEN"<<iendl ; \ 
    690      if (!matchingTypeCFortran<T>())  \ 
    691      { \ 
    692        oss<<"  ALLOCATE("<<name_tmp<<"(size("<<name<<"_,1),size("<<name<<"_,2),size("<<name<<"_,3)))"<<iendl ; \ 
    693        oss<<"  CALL cxios_get_"<<className<<"_"<<name<<"("<<className<<"_hdl%daddr, "<<name_tmp<<",size("<<name<<"_,1),size("<<name<<"_,2),size("<<name<<"_,3))"<<iendl ; \ 
    694        oss<<"  "<<name<<"_="<<name_tmp<<iendl ; \ 
     669   void CInterface::AttributeFortranInterfaceGetBody< ARRAY(T,3) >(ostream& oss, const string& className, const string& name) \ 
     670   {  \ 
     671     string name_tmp=name+"__tmp"; \ 
     672      \ 
     673     oss << "IF (PRESENT(" << name << "_)) THEN" << iendl; \ 
     674     if (!matchingTypeCFortran<T>())  \ 
     675     { \ 
     676       oss << "  ALLOCATE(" << name_tmp << "(size(" << name << "_,1), size(" << name << "_,2), size(" << name << "_,3)))" << iendl; \ 
     677       oss << "  CALL cxios_get_" << className << "_" << name << "(" << className << "_hdl%daddr, " << name_tmp << ", size(" << name << "_,1), size(" << name << "_,2), size(" << name << "_,3))" << iendl; \ 
     678       oss << "  " << name << "_ = " << name_tmp << iendl; \ 
    695679      } \ 
    696      else oss<<"  CALL cxios_get_"<<className<<"_"<<name<<"("<<className<<"_hdl%daddr, "<<name<<"_,size("<<name<<"_,1),size("<<name<<"_,2),size("<<name<<"_,3))"<<iendl ; \ 
    697      oss<<"ENDIF"<<iendl ; \ 
     680     else oss << "  CALL cxios_get_" << className << "_" << name << "(" << className << "_hdl%daddr, " << name << "_, size(" << name << "_,1), size(" << name << "_,2), size(" << name << "_,3))" << iendl; \ 
     681     oss << "ENDIF"; \ 
    698682   } 
    699683 
     
    707691// declaration for CArray 
    708692 
    709  
    710  
    711  
    712693#define macro(T) \ 
    713   template <>\ 
    714   void CInterface::AttributeCInterface<CArray<T,1> >(ostream& oss, const string& className,const string& name)\ 
    715   {\ 
    716     string typeName=getStrType<T>() ;\ 
     694  template <> \ 
     695  void CInterface::AttributeCInterface<CArray<T,1> >(ostream& oss, const string& className, const string& name) \ 
     696  { \ 
     697    string typeName=getStrType<T>(); \ 
    717698\ 
    718     oss<<"void cxios_set_"<<className<<"_"<<name<<"("<<className<<"_Ptr "<<className<<"_hdl, "<< typeName<<"* "<<name<<", int extent1)"<<iendl ;\ 
    719     oss<<"{"<<iendl ;\ 
    720     oss<<"  CTimer::get(\"XIOS\").resume();"<<iendl ; \ 
    721     oss<<"  CArray<"<<typeName<<",1> tmp("<<name<<",shape(extent1),neverDeleteData) ;"<<iendl ;\ 
    722     oss<<"  "<<className<<"_hdl->"<<name<<".reference(tmp.copy());"<<iendl ;\ 
    723 /*    oss<<"  "<<className<<"_hdl->sendAttributToServer("<<className<<"_hdl->"<<name<<");"<<iendl ;*/\ 
    724     oss<<"   CTimer::get(\"XIOS\").suspend();"<<iendl ;\ 
    725     oss<<"}"<<iendl ;\ 
    726     oss<<iendl; \ 
    727     oss<<"void cxios_get_"<<className<<"_"<<name<<"("<<className<<"_Ptr "<<className<<"_hdl, "<< typeName<<"* "<<name<<", int extent1)"<<iendl ;\ 
    728     oss<<"{"<<iendl; \ 
    729     oss<<"  CTimer::get(\"XIOS\").resume();"<<iendl ; \ 
    730     oss<<"  CArray<"<<typeName<<",1> tmp("<<name<<",shape(extent1),neverDeleteData) ;"<<iendl ;\ 
    731     oss<<"  tmp="<<className<<"_hdl->"<<name<<".getInheritedValue() ;"<<iendl ;\ 
    732     oss<<"   CTimer::get(\"XIOS\").suspend();"<<iendl ;\ 
    733     oss<<"}"<<iendl ;\ 
    734     oss<<iendl ;\ 
    735   }\ 
     699    oss << "void cxios_set_" << className << "_" << name << "(" << className << "_Ptr " << className << "_hdl, " << typeName << "* " << name << ", int extent1)" << iendl; \ 
     700    oss << "{" << iendl; \ 
     701    oss << "  CTimer::get(\"XIOS\").resume();" << iendl; \ 
     702    oss << "  CArray<" << typeName << ",1> tmp(" << name << ", shape(extent1), neverDeleteData);" << iendl; \ 
     703    oss << "  " << className << "_hdl->" << name << ".reference(tmp.copy());" << iendl; \ 
     704    /*oss << "  " << className << "_hdl->sendAttributToServer(" << className << "_hdl->" << name << ");" << iendl;*/ \ 
     705    oss << "   CTimer::get(\"XIOS\").suspend();" << iendl; \ 
     706    oss << "}" << std::endl; \ 
     707    oss << iendl; \ 
     708    oss << "void cxios_get_" << className << "_" << name << "(" << className << "_Ptr " << className << "_hdl, " << typeName << "* " << name << ", int extent1)" << iendl; \ 
     709    oss << "{" << iendl; \ 
     710    oss << "  CTimer::get(\"XIOS\").resume();" << iendl; \ 
     711    oss << "  CArray<" << typeName << ",1> tmp(" << name << ", shape(extent1), neverDeleteData);" << iendl; \ 
     712    oss << "  tmp=" << className << "_hdl->" << name << ".getInheritedValue();" << iendl; \ 
     713    oss << "   CTimer::get(\"XIOS\").suspend();" << iendl; \ 
     714    oss << "}" << std::endl; \ 
     715  } \ 
    736716\ 
    737717  template <> \ 
    738   void CInterface::AttributeCInterface<CArray<T,2> >(ostream& oss, const string& className,const string& name)\ 
    739   {\ 
    740     string typeName=getStrType<T>() ;\ 
     718  void CInterface::AttributeCInterface<CArray<T,2> >(ostream& oss, const string& className, const string& name) \ 
     719  { \ 
     720    string typeName=getStrType<T>(); \ 
    741721\ 
    742     oss<<"void cxios_set_"<<className<<"_"<<name<<"("<<className<<"_Ptr "<<className<<"_hdl, "<< typeName<<"* "<<name<<", int extent1, int extent2)"<<iendl ;\ 
    743     oss<<"{"<<iendl ;\ 
    744     oss<<"  CTimer::get(\"XIOS\").resume();"<<iendl ; \ 
    745     oss<<"  CArray<"<<typeName<<",2> tmp("<<name<<",shape(extent1,extent2),neverDeleteData) ;"<<iendl ;\ 
    746     oss<<"  "<<className<<"_hdl->"<<name<<".reference(tmp.copy());"<<iendl ;\ 
    747     /*oss<<"  "<<className<<"_hdl->sendAttributToServer("<<className<<"_hdl->"<<name<<");"<<iendl ;*/\ 
    748     oss<<"   CTimer::get(\"XIOS\").suspend();"<<iendl ;\ 
    749     oss<<"}"<<iendl ;\ 
    750     oss<<iendl; \ 
    751     oss<<"void cxios_get_"<<className<<"_"<<name<<"("<<className<<"_Ptr "<<className<<"_hdl, "<< typeName<<"* "<<name<<", int extent1, int extent2)"<<iendl ;\ 
    752     oss<<"{"<<iendl; \ 
    753     oss<<"  CTimer::get(\"XIOS\").resume();"<<iendl ; \ 
    754     oss<<"  CArray<"<<typeName<<",2> tmp("<<name<<",shape(extent1,extent2),neverDeleteData) ;"<<iendl ;\ 
    755     oss<<"  tmp="<<className<<"_hdl->"<<name<<".getInheritedValue() ;"<<iendl ;\ 
    756     oss<<"   CTimer::get(\"XIOS\").suspend();"<<iendl ;\ 
    757     oss<<"}"<<iendl ;\ 
    758     oss<<iendl ;\ 
    759   }\ 
     722    oss << "void cxios_set_" << className << "_" << name << "(" << className << "_Ptr " << className << "_hdl, " << typeName << "* " << name << ", int extent1, int extent2)" << iendl; \ 
     723    oss << "{" << iendl; \ 
     724    oss << "  CTimer::get(\"XIOS\").resume();" << iendl; \ 
     725    oss << "  CArray<" << typeName << ",2> tmp(" << name << ", shape(extent1, extent2), neverDeleteData);" << iendl; \ 
     726    oss << "  " << className << "_hdl->" << name << ".reference(tmp.copy());" << iendl; \ 
     727    /*oss << "  " << className << "_hdl->sendAttributToServer(" << className << "_hdl->" << name << ");" << iendl;*/ \ 
     728    oss << "   CTimer::get(\"XIOS\").suspend();" << iendl; \ 
     729    oss << "}" << std::endl; \ 
     730    oss << iendl; \ 
     731    oss << "void cxios_get_" << className << "_" << name << "(" << className << "_Ptr " << className << "_hdl, " << typeName << "* " << name << ", int extent1, int extent2)" << iendl; \ 
     732    oss << "{" << iendl; \ 
     733    oss << "  CTimer::get(\"XIOS\").resume();" << iendl; \ 
     734    oss << "  CArray<" << typeName << ",2> tmp(" << name << ", shape(extent1, extent2), neverDeleteData);" << iendl; \ 
     735    oss << "  tmp=" << className << "_hdl->" << name << ".getInheritedValue();" << iendl; \ 
     736    oss << "   CTimer::get(\"XIOS\").suspend();" << iendl; \ 
     737    oss << "}" << std::endl; \ 
     738  } \ 
    760739\ 
    761   template <>\ 
    762   void CInterface::AttributeCInterface<CArray<T,3> >(ostream& oss, const string& className,const string& name)\ 
    763   {\ 
    764     string typeName=getStrType<T>() ;\ 
     740  template <> \ 
     741  void CInterface::AttributeCInterface<CArray<T,3> >(ostream& oss, const string& className, const string& name) \ 
     742  { \ 
     743    string typeName=getStrType<T>(); \ 
    765744\ 
    766     oss<<"void cxios_set_"<<className<<"_"<<name<<"("<<className<<"_Ptr "<<className<<"_hdl, "<< typeName<<"* "<<name<<", int extent1, int extent2, int extent3)"<<iendl ;\ 
    767     oss<<"{"<<iendl ;\ 
    768     oss<<"  CTimer::get(\"XIOS\").resume();"<<iendl ; \ 
    769     oss<<"  CArray<"<<typeName<<",3> tmp("<<name<<",shape(extent1,extent2,extent3),neverDeleteData) ;"<<iendl ;\ 
    770     oss<<"  "<<className<<"_hdl->"<<name<<".reference(tmp.copy());"<<iendl ;\ 
    771     /*oss<<"  "<<className<<"_hdl->sendAttributToServer("<<className<<"_hdl->"<<name<<");"<<iendl ;*/\ 
    772     oss<<"   CTimer::get(\"XIOS\").suspend();"<<iendl ;\ 
    773     oss<<"}"<<iendl ;\ 
    774     oss<<iendl; \ 
    775     oss<<"void cxios_get_"<<className<<"_"<<name<<"("<<className<<"_Ptr "<<className<<"_hdl, "<< typeName<<"* "<<name<<", int extent1, int extent2, int extent3)"<<iendl ;\ 
    776     oss<<"{"<<iendl; \ 
    777     oss<<"  CTimer::get(\"XIOS\").resume();"<<iendl ; \ 
    778     oss<<"  CArray<"<<typeName<<",3> tmp("<<name<<",shape(extent1,extent2,extent3),neverDeleteData) ;"<<iendl ;\ 
    779     oss<<"  tmp="<<className<<"_hdl->"<<name<<".getInheritedValue() ;"<<iendl ;\ 
    780     oss<<"   CTimer::get(\"XIOS\").suspend();"<<iendl ;\ 
    781     oss<<"}"<<iendl ;\ 
    782     oss<<iendl ;\ 
     745    oss << "void cxios_set_" << className << "_" << name << "(" << className << "_Ptr " << className << "_hdl, " << typeName << "* " << name << ", int extent1, int extent2, int extent3)" << iendl; \ 
     746    oss << "{" << iendl; \ 
     747    oss << "  CTimer::get(\"XIOS\").resume();" << iendl; \ 
     748    oss << "  CArray<" << typeName << ",3> tmp(" << name << ", shape(extent1, extent2, extent3), neverDeleteData);" << iendl; \ 
     749    oss << "  " << className << "_hdl->" << name << ".reference(tmp.copy());" << iendl; \ 
     750    /*oss << "  " << className << "_hdl->sendAttributToServer(" << className << "_hdl->" << name << ");" << iendl;*/ \ 
     751    oss << "   CTimer::get(\"XIOS\").suspend();" << iendl; \ 
     752    oss << "}" << std::endl; \ 
     753    oss << iendl; \ 
     754    oss << "void cxios_get_" << className << "_" << name << "(" << className << "_Ptr " << className << "_hdl, " << typeName << "* " << name << ", int extent1, int extent2, int extent3)" << iendl; \ 
     755    oss << "{" << iendl; \ 
     756    oss << "  CTimer::get(\"XIOS\").resume();" << iendl; \ 
     757    oss << "  CArray<" << typeName << ",3> tmp(" << name << ", shape(extent1, extent2, extent3), neverDeleteData);" << iendl; \ 
     758    oss << "  tmp=" << className << "_hdl->" << name << ".getInheritedValue();" << iendl; \ 
     759    oss << "   CTimer::get(\"XIOS\").suspend();" << iendl; \ 
     760    oss << "}" << std::endl; \ 
    783761  } 
    784762 
     
    793771// ///////////////////////////////////////////////// 
    794772 
    795  
    796  
    797 #define macro(T)\ 
    798    template <>\ 
    799    void CInterface::AttributeFortran2003Interface<CArray<T,1> >(ostream& oss,const string& className,const string& name) \ 
    800    { \ 
    801      string fortranType=getStrFortranType<T>() ; \ 
    802      string fortranKindC=getStrFortranKindC<T>() ; \ 
    803       \ 
    804      oss<<"SUBROUTINE cxios_set_"<<className<<"_"<<name<<"("<<className<<"_hdl, "<<name<<", extent1) BIND(C)"<<iendl ; \ 
    805      oss<<"  USE ISO_C_BINDING"<<iendl ; \ 
    806      oss<<"  INTEGER (kind = C_INTPTR_T), VALUE       :: "<<className<<"_hdl"<<iendl ; \ 
    807      oss<<"  "<<fortranType<<" "<<fortranKindC<<"     , DIMENSION(*) :: "<<name<<iendl ; \ 
    808      oss<<"  INTEGER (kind = C_INT), VALUE  :: extent1"<<iendl ; \ 
    809      oss<<"END SUBROUTINE cxios_set_"<<className<<"_"<<name<<iendl ; \ 
    810      oss<<iendl; \ 
    811      oss<<"SUBROUTINE cxios_get_"<<className<<"_"<<name<<"("<<className<<"_hdl, "<<name<<", extent1) BIND(C)"<<iendl ; \ 
    812      oss<<"  USE ISO_C_BINDING"<<iendl ; \ 
    813      oss<<"  INTEGER (kind = C_INTPTR_T), VALUE       :: "<<className<<"_hdl"<<iendl ; \ 
    814      oss<<"  "<<fortranType<<" "<<fortranKindC<<"     , DIMENSION(*) :: "<<name<<iendl ; \ 
    815      oss<<"  INTEGER (kind = C_INT), VALUE  :: extent1"<<iendl ; \ 
    816      oss<<"END SUBROUTINE cxios_get_"<<className<<"_"<<name<<iendl ; \ 
    817      oss<<iendl ;\ 
    818    } \ 
    819  \ 
    820    template <> \ 
    821    void CInterface::AttributeFortran2003Interface<CArray<T,2> >(ostream& oss,const string& className,const string& name) \ 
    822    { \ 
    823      string fortranType=getStrFortranType<T>() ; \ 
    824      string fortranKindC=getStrFortranKindC<T>() ; \ 
    825       \ 
    826      oss<<"SUBROUTINE cxios_set_"<<className<<"_"<<name<<"("<<className<<"_hdl, "<<name<<", extent1, extent2) BIND(C)"<<iendl ; \ 
    827      oss<<"  USE ISO_C_BINDING"<<iendl ; \ 
    828      oss<<"  INTEGER (kind = C_INTPTR_T), VALUE       :: "<<className<<"_hdl"<<iendl ; \ 
    829      oss<<"  "<<fortranType<<" "<<fortranKindC<<"     , DIMENSION(*) :: "<<name<<iendl ; \ 
    830      oss<<"  INTEGER (kind = C_INT), VALUE  :: extent1"<<iendl ; \ 
    831      oss<<"  INTEGER (kind = C_INT), VALUE  :: extent2"<<iendl ; \ 
    832      oss<<"END SUBROUTINE cxios_set_"<<className<<"_"<<name<<iendl ; \ 
    833      oss<<iendl ; \ 
    834      oss<<"SUBROUTINE cxios_get_"<<className<<"_"<<name<<"("<<className<<"_hdl, "<<name<<", extent1, extent2) BIND(C)"<<iendl ; \ 
    835      oss<<"  USE ISO_C_BINDING"<<iendl ; \ 
    836      oss<<"  INTEGER (kind = C_INTPTR_T), VALUE       :: "<<className<<"_hdl"<<iendl ; \ 
    837      oss<<"  "<<fortranType<<" "<<fortranKindC<<"     , DIMENSION(*) :: "<<name<<iendl ; \ 
    838      oss<<"  INTEGER (kind = C_INT), VALUE  :: extent1"<<iendl ; \ 
    839      oss<<"  INTEGER (kind = C_INT), VALUE  :: extent2"<<iendl ; \ 
    840      oss<<"END SUBROUTINE cxios_get_"<<className<<"_"<<name<<iendl ; \ 
    841      oss<<iendl ;\ 
     773#define macro(T) \ 
     774   template <> \ 
     775   void CInterface::AttributeFortran2003Interface<CArray<T,1> >(ostream& oss, const string& className, const string& name) \ 
     776   { \ 
     777     string fortranType=getStrFortranType<T>(); \ 
     778     string fortranKindC=getStrFortranKindC<T>(); \ 
     779      \ 
     780     oss << "SUBROUTINE cxios_set_" << className << "_" << name << "(" << className << "_hdl, " << name << ", extent1) BIND(C)" << iendl; \ 
     781     oss << "  USE ISO_C_BINDING" << iendl; \ 
     782     oss << "  INTEGER (kind = C_INTPTR_T), VALUE       :: " << className << "_hdl" << iendl; \ 
     783     oss << "  " << fortranType << " " << fortranKindC << "     , DIMENSION(*) :: " << name << iendl; \ 
     784     oss << "  INTEGER (kind = C_INT), VALUE  :: extent1" << iendl; \ 
     785     oss << "END SUBROUTINE cxios_set_" << className << "_" << name << std::endl; \ 
     786     oss << iendl; \ 
     787     oss << "SUBROUTINE cxios_get_" << className << "_" << name << "(" << className << "_hdl, " << name << ", extent1) BIND(C)" << iendl; \ 
     788     oss << "  USE ISO_C_BINDING" << iendl; \ 
     789     oss << "  INTEGER (kind = C_INTPTR_T), VALUE       :: " << className << "_hdl" << iendl; \ 
     790     oss << "  " << fortranType << " " << fortranKindC << "     , DIMENSION(*) :: " << name << iendl; \ 
     791     oss << "  INTEGER (kind = C_INT), VALUE  :: extent1" << iendl; \ 
     792     oss << "END SUBROUTINE cxios_get_" << className << "_" << name << std::endl; \ 
     793   } \ 
     794 \ 
     795   template <> \ 
     796   void CInterface::AttributeFortran2003Interface<CArray<T,2> >(ostream& oss, const string& className, const string& name) \ 
     797   { \ 
     798     string fortranType=getStrFortranType<T>(); \ 
     799     string fortranKindC=getStrFortranKindC<T>(); \ 
     800      \ 
     801     oss << "SUBROUTINE cxios_set_" << className << "_" << name << "(" << className << "_hdl, " << name << ", extent1, extent2) BIND(C)" << iendl; \ 
     802     oss << "  USE ISO_C_BINDING" << iendl; \ 
     803     oss << "  INTEGER (kind = C_INTPTR_T), VALUE       :: " << className << "_hdl" << iendl; \ 
     804     oss << "  " << fortranType << " " << fortranKindC << "     , DIMENSION(*) :: " << name << iendl; \ 
     805     oss << "  INTEGER (kind = C_INT), VALUE  :: extent1" << iendl; \ 
     806     oss << "  INTEGER (kind = C_INT), VALUE  :: extent2" << iendl; \ 
     807     oss << "END SUBROUTINE cxios_set_" << className << "_" << name << std::endl; \ 
     808     oss << iendl; \ 
     809     oss << "SUBROUTINE cxios_get_" << className << "_" << name << "(" << className << "_hdl, " << name << ", extent1, extent2) BIND(C)" << iendl; \ 
     810     oss << "  USE ISO_C_BINDING" << iendl; \ 
     811     oss << "  INTEGER (kind = C_INTPTR_T), VALUE       :: " << className << "_hdl" << iendl; \ 
     812     oss << "  " << fortranType << " " << fortranKindC << "     , DIMENSION(*) :: " << name << iendl; \ 
     813     oss << "  INTEGER (kind = C_INT), VALUE  :: extent1" << iendl; \ 
     814     oss << "  INTEGER (kind = C_INT), VALUE  :: extent2" << iendl; \ 
     815     oss << "END SUBROUTINE cxios_get_" << className << "_" << name << std::endl; \ 
    842816   } \ 
    843817     \ 
    844818   template <> \ 
    845    void CInterface::AttributeFortran2003Interface<CArray<T,3> >(ostream& oss,const string& className,const string& name) \ 
    846    { \ 
    847      string fortranType=getStrFortranType<T>() ; \ 
    848      string fortranKindC=getStrFortranKindC<T>() ; \ 
    849       \ 
    850      oss<<"SUBROUTINE cxios_set_"<<className<<"_"<<name<<"("<<className<<"_hdl, "<<name<<", extent1, extent2, extent3) BIND(C)"<<iendl ; \ 
    851      oss<<"  USE ISO_C_BINDING"<<iendl ; \ 
    852      oss<<"  INTEGER (kind = C_INTPTR_T), VALUE       :: "<<className<<"_hdl"<<iendl ; \ 
    853      oss<<"  "<<fortranType<<" "<<fortranKindC<<"     , DIMENSION(*) :: "<<name<<iendl ; \ 
    854      oss<<"  INTEGER (kind = C_INT), VALUE  :: extent1"<<iendl ; \ 
    855      oss<<"  INTEGER (kind = C_INT), VALUE  :: extent2"<<iendl ; \ 
    856      oss<<"  INTEGER (kind = C_INT), VALUE  :: extent3"<<iendl ; \ 
    857      oss<<"END SUBROUTINE cxios_set_"<<className<<"_"<<name<<iendl ; \ 
    858      oss<<iendl ;\ 
    859      oss<<"SUBROUTINE cxios_get_"<<className<<"_"<<name<<"("<<className<<"_hdl, "<<name<<", extent1, extent2, extent3) BIND(C)"<<iendl ; \ 
    860      oss<<"  USE ISO_C_BINDING"<<iendl ; \ 
    861      oss<<"  INTEGER (kind = C_INTPTR_T), VALUE       :: "<<className<<"_hdl"<<iendl ; \ 
    862      oss<<"  "<<fortranType<<" "<<fortranKindC<<"     , DIMENSION(*) :: "<<name<<iendl ; \ 
    863      oss<<"  INTEGER (kind = C_INT), VALUE  :: extent1"<<iendl ; \ 
    864      oss<<"  INTEGER (kind = C_INT), VALUE  :: extent2"<<iendl ; \ 
    865      oss<<"  INTEGER (kind = C_INT), VALUE  :: extent3"<<iendl ; \ 
    866      oss<<"END SUBROUTINE cxios_get_"<<className<<"_"<<name<<iendl ; \ 
    867      oss<<iendl ;\ 
     819   void CInterface::AttributeFortran2003Interface<CArray<T,3> >(ostream& oss, const string& className, const string& name) \ 
     820   { \ 
     821     string fortranType=getStrFortranType<T>(); \ 
     822     string fortranKindC=getStrFortranKindC<T>(); \ 
     823      \ 
     824     oss << "SUBROUTINE cxios_set_" << className << "_" << name << "(" << className << "_hdl, " << name << ", extent1, extent2, extent3) BIND(C)" << iendl; \ 
     825     oss << "  USE ISO_C_BINDING" << iendl; \ 
     826     oss << "  INTEGER (kind = C_INTPTR_T), VALUE       :: " << className << "_hdl" << iendl; \ 
     827     oss << "  " << fortranType << " " << fortranKindC << "     , DIMENSION(*) :: " << name << iendl; \ 
     828     oss << "  INTEGER (kind = C_INT), VALUE  :: extent1" << iendl; \ 
     829     oss << "  INTEGER (kind = C_INT), VALUE  :: extent2" << iendl; \ 
     830     oss << "  INTEGER (kind = C_INT), VALUE  :: extent3" << iendl; \ 
     831     oss << "END SUBROUTINE cxios_set_" << className << "_" << name << std::endl; \ 
     832     oss << iendl; \ 
     833     oss << "SUBROUTINE cxios_get_" << className << "_" << name << "(" << className << "_hdl, " << name << ", extent1, extent2, extent3) BIND(C)" << iendl; \ 
     834     oss << "  USE ISO_C_BINDING" << iendl; \ 
     835     oss << "  INTEGER (kind = C_INTPTR_T), VALUE       :: " << className << "_hdl" << iendl; \ 
     836     oss << "  " << fortranType << " " << fortranKindC << "     , DIMENSION(*) :: " << name << iendl; \ 
     837     oss << "  INTEGER (kind = C_INT), VALUE  :: extent1" << iendl; \ 
     838     oss << "  INTEGER (kind = C_INT), VALUE  :: extent2" << iendl; \ 
     839     oss << "  INTEGER (kind = C_INT), VALUE  :: extent3" << iendl; \ 
     840     oss << "END SUBROUTINE cxios_get_" << className << "_" << name << std::endl; \ 
    868841   } 
    869842 
     
    874847  #undef macro 
    875848 
    876  
    877 #define macro(T)\ 
    878    template <> \ 
    879    void CInterface::AttributeFortranInterfaceDeclaration<CArray<T,1> >(ostream& oss,const string& className,const string& name) \ 
    880    { \ 
    881      oss<<getStrFortranType<T>()<<" "<<getStrFortranKind<T>() <<" , OPTIONAL, INTENT(IN) :: "<<name<<"(:)"<<iendl ; \ 
    882      if (!matchingTypeCFortran<T>()) oss<<getStrFortranType<T>()<<" "<<getStrFortranKindC<T>() <<" , ALLOCATABLE :: "<<name<<"_tmp(:)"<<iendl ; \ 
    883    } \ 
    884    template <> \ 
    885    void CInterface::AttributeFortranInterfaceGetDeclaration<CArray<T,1> >(ostream& oss,const string& className,const string& name) \ 
    886    { \ 
    887      oss<<getStrFortranType<T>()<<" "<<getStrFortranKind<T>() <<" , OPTIONAL, INTENT(OUT) :: "<<name<<"(:)"<<iendl ; \ 
    888      if (!matchingTypeCFortran<T>()) oss<<getStrFortranType<T>()<<" "<<getStrFortranKindC<T>() <<" , ALLOCATABLE :: "<<name<<"_tmp(:)"<<iendl ; \ 
    889    } \ 
    890  \ 
    891    template <> \ 
    892    void CInterface::AttributeFortranInterfaceDeclaration<CArray<T,2> >(ostream& oss,const string& className,const string& name) \ 
    893    { \ 
    894      oss<<getStrFortranType<T>()<<" "<<getStrFortranKind<T>() <<" , OPTIONAL, INTENT(IN) :: "<<name<<"(:,:)"<<iendl ; \ 
    895      if (!matchingTypeCFortran<T>()) oss<<getStrFortranType<T>()<<" "<<getStrFortranKindC<T>() <<" , ALLOCATABLE :: "<<name<<"_tmp(:,:)"<<iendl ; \ 
    896    } \ 
    897  \ 
    898    template <> \ 
    899    void CInterface::AttributeFortranInterfaceGetDeclaration<CArray<T,2> >(ostream& oss,const string& className,const string& name) \ 
    900    { \ 
    901      oss<<getStrFortranType<T>()<<" "<<getStrFortranKind<T>() <<" , OPTIONAL, INTENT(OUT) :: "<<name<<"(:,:)"<<iendl ; \ 
    902      if (!matchingTypeCFortran<T>()) oss<<getStrFortranType<T>()<<" "<<getStrFortranKindC<T>() <<" , ALLOCATABLE :: "<<name<<"_tmp(:,:)"<<iendl ; \ 
    903    } \ 
    904  \ 
    905    template <> \ 
    906    void CInterface::AttributeFortranInterfaceDeclaration<CArray<T,3> >(ostream& oss,const string& className,const string& name) \ 
    907    { \ 
    908      oss<<getStrFortranType<T>()<<" "<<getStrFortranKind<T>() <<" , OPTIONAL, INTENT(IN) :: "<<name<<"(:,:,:)"<<iendl ; \ 
    909      if (!matchingTypeCFortran<T>()) oss<<getStrFortranType<T>()<<" "<<getStrFortranKindC<T>() <<" , ALLOCATABLE :: "<<name<<"_tmp(:,:,:)"<<iendl ; \ 
    910    }\ 
    911  \ 
    912    template <> \ 
    913    void CInterface::AttributeFortranInterfaceGetDeclaration<CArray<T,3> >(ostream& oss,const string& className,const string& name) \ 
    914    { \ 
    915      oss<<getStrFortranType<T>()<<" "<<getStrFortranKind<T>() <<" , OPTIONAL, INTENT(OUT) :: "<<name<<"(:,:,:)"<<iendl ; \ 
    916      if (!matchingTypeCFortran<T>()) oss<<getStrFortranType<T>()<<" "<<getStrFortranKindC<T>() <<" , ALLOCATABLE :: "<<name<<"_tmp(:,:,:)"<<iendl ; \ 
     849#define macro(T) \ 
     850   template <> \ 
     851   void CInterface::AttributeFortranInterfaceDeclaration<CArray<T,1> >(ostream& oss, const string& className, const string& name) \ 
     852   { \ 
     853     oss << getStrFortranType<T>() << " " << getStrFortranKind<T>() << " , OPTIONAL, INTENT(IN) :: " << name << "(:)"; \ 
     854     if (!matchingTypeCFortran<T>()) oss << iendl << getStrFortranType<T>() << " " << getStrFortranKindC<T>() << " , ALLOCATABLE :: " << name << "_tmp(:)"; \ 
     855   } \ 
     856   template <> \ 
     857   void CInterface::AttributeFortranInterfaceGetDeclaration<CArray<T,1> >(ostream& oss, const string& className, const string& name) \ 
     858   { \ 
     859     oss << getStrFortranType<T>() << " " << getStrFortranKind<T>() << " , OPTIONAL, INTENT(OUT) :: " << name << "(:)"; \ 
     860     if (!matchingTypeCFortran<T>()) oss << iendl << getStrFortranType<T>() << " " << getStrFortranKindC<T>() << " , ALLOCATABLE :: " << name << "_tmp(:)"; \ 
     861   } \ 
     862 \ 
     863   template <> \ 
     864   void CInterface::AttributeFortranInterfaceDeclaration<CArray<T,2> >(ostream& oss, const string& className, const string& name) \ 
     865   { \ 
     866     oss << getStrFortranType<T>() << " " << getStrFortranKind<T>() << " , OPTIONAL, INTENT(IN) :: " << name << "(:,:)"; \ 
     867     if (!matchingTypeCFortran<T>()) oss << iendl << getStrFortranType<T>() << " " << getStrFortranKindC<T>() << " , ALLOCATABLE :: " << name << "_tmp(:,:)"; \ 
     868   } \ 
     869 \ 
     870   template <> \ 
     871   void CInterface::AttributeFortranInterfaceGetDeclaration<CArray<T,2> >(ostream& oss, const string& className, const string& name) \ 
     872   { \ 
     873     oss << getStrFortranType<T>() << " " << getStrFortranKind<T>() << " , OPTIONAL, INTENT(OUT) :: " << name << "(:,:)"; \ 
     874     if (!matchingTypeCFortran<T>()) oss << iendl << getStrFortranType<T>() << " " << getStrFortranKindC<T>() << " , ALLOCATABLE :: " << name << "_tmp(:,:)"; \ 
     875   } \ 
     876 \ 
     877   template <> \ 
     878   void CInterface::AttributeFortranInterfaceDeclaration<CArray<T,3> >(ostream& oss, const string& className, const string& name) \ 
     879   { \ 
     880     oss << getStrFortranType<T>() << " " << getStrFortranKind<T>() << " , OPTIONAL, INTENT(IN) :: " << name << "(:,:,:)"; \ 
     881     if (!matchingTypeCFortran<T>()) oss << iendl << getStrFortranType<T>() << " " << getStrFortranKindC<T>() << " , ALLOCATABLE :: " << name << "_tmp(:,:,:)"; \ 
     882   } \ 
     883 \ 
     884   template <> \ 
     885   void CInterface::AttributeFortranInterfaceGetDeclaration<CArray<T,3> >(ostream& oss, const string& className, const string& name) \ 
     886   { \ 
     887     oss << getStrFortranType<T>() << " " << getStrFortranKind<T>() << " , OPTIONAL, INTENT(OUT) :: " << name << "(:,:,:)"; \ 
     888     if (!matchingTypeCFortran<T>()) oss << iendl << getStrFortranType<T>() << " " << getStrFortranKindC<T>() << " , ALLOCATABLE :: " << name << "_tmp(:,:,:)"; \ 
    917889   } 
    918890 
     
    923895#undef macro 
    924896 
    925  
    926  
    927897#define macro(T) \ 
    928898   template <>  \ 
    929    void CInterface::AttributeFortranInterfaceBody< CArray<T,1> >(ostream& oss,const string& className,const string& name) \ 
    930    {  \ 
    931      string name_tmp=name+"__tmp" ; \ 
    932       \ 
    933      oss<<"IF (PRESENT("<<name<<"_)) THEN"<<iendl ; \ 
    934      if (!matchingTypeCFortran<T>())  \ 
    935      { \ 
    936        oss<<"  ALLOCATE("<<name_tmp<<"(size("<<name<<"_,1)))"<<iendl ; \ 
    937        oss<<"  "<<name_tmp<<"="<<name<<"_"<<iendl ; \ 
    938        oss<<"  CALL cxios_set_"<<className<<"_"<<name<<"("<<className<<"_hdl%daddr, "<<name_tmp<<",size("<<name<<"_,1))"<<iendl ; \ 
     899   void CInterface::AttributeFortranInterfaceBody< CArray<T,1> >(ostream& oss, const string& className, const string& name) \ 
     900   {  \ 
     901     string name_tmp=name+"__tmp"; \ 
     902      \ 
     903     oss << "IF (PRESENT(" << name << "_)) THEN" << iendl; \ 
     904     if (!matchingTypeCFortran<T>())  \ 
     905     { \ 
     906       oss << "  ALLOCATE(" << name_tmp << "(size(" << name << "_,1)))" << iendl; \ 
     907       oss << "  " << name_tmp << " = " << name << "_" << iendl; \ 
     908       oss << "  CALL cxios_set_" << className << "_" << name << "(" << className << "_hdl%daddr, " << name_tmp << ", size(" << name << "_,1))" << iendl; \ 
    939909     } \ 
    940      else oss<<"  CALL cxios_set_"<<className<<"_"<<name<<"("<<className<<"_hdl%daddr, "<<name<<"_,size("<<name<<"_,1))"<<iendl ; \ 
    941      oss<<"ENDIF"<<iendl ; \ 
    942    } \ 
    943  \ 
    944    template <>  \ 
    945    void CInterface::AttributeFortranInterfaceBody< CArray<T,2> >(ostream& oss,const string& className,const string& name) \ 
    946    {  \ 
    947      string name_tmp=name+"__tmp" ; \ 
    948       \ 
    949      oss<<"IF (PRESENT("<<name<<"_)) THEN"<<iendl ; \ 
    950      if (!matchingTypeCFortran<T>())  \ 
    951      { \ 
    952        oss<<"  ALLOCATE("<<name_tmp<<"(size("<<name<<"_,1),size("<<name<<"_,2)))"<<iendl ; \ 
    953        oss<<"  "<<name_tmp<<"="<<name<<"_"<<iendl ; \ 
    954        oss<<"  CALL cxios_set_"<<className<<"_"<<name<<"("<<className<<"_hdl%daddr, "<<name_tmp<<",size("<<name<<"_,1),size("<<name<<"_,2))"<<iendl ; \ 
     910     else oss << "  CALL cxios_set_" << className << "_" << name << "(" << className << "_hdl%daddr, " << name << "_, size(" << name << "_,1))" << iendl; \ 
     911     oss << "ENDIF"; \ 
     912   } \ 
     913 \ 
     914   template <>  \ 
     915   void CInterface::AttributeFortranInterfaceBody< CArray<T,2> >(ostream& oss, const string& className, const string& name) \ 
     916   {  \ 
     917     string name_tmp=name+"__tmp"; \ 
     918      \ 
     919     oss << "IF (PRESENT(" << name << "_)) THEN" << iendl; \ 
     920     if (!matchingTypeCFortran<T>())  \ 
     921     { \ 
     922       oss << "  ALLOCATE(" << name_tmp << "(size(" << name << "_,1), size(" << name << "_,2)))" << iendl; \ 
     923       oss << "  " << name_tmp << " = " << name << "_" << iendl; \ 
     924       oss << "  CALL cxios_set_" << className << "_" << name << "(" << className << "_hdl%daddr, " << name_tmp << ", size(" << name << "_,1), size(" << name << "_,2))" << iendl; \ 
    955925     } \ 
    956      else oss<<"  CALL cxios_set_"<<className<<"_"<<name<<"("<<className<<"_hdl%daddr, "<<name<<"_,size("<<name<<"_,1),size("<<name<<"_,2))"<<iendl ; \ 
    957      oss<<"ENDIF"<<iendl ; \ 
     926     else oss << "  CALL cxios_set_" << className << "_" << name << "(" << className << "_hdl%daddr, " << name << "_, size(" << name << "_,1), size(" << name << "_,2))" << iendl; \ 
     927     oss << "ENDIF"; \ 
    958928   } \ 
    959929    \ 
    960930   template <>  \ 
    961    void CInterface::AttributeFortranInterfaceBody< CArray<T,3> >(ostream& oss,const string& className,const string& name) \ 
    962    {  \ 
    963      string name_tmp=name+"__tmp" ; \ 
    964       \ 
    965      oss<<"IF (PRESENT("<<name<<"_)) THEN"<<iendl ; \ 
    966      if (!matchingTypeCFortran<T>())  \ 
    967      { \ 
    968        oss<<"  ALLOCATE("<<name_tmp<<"(size("<<name<<"_,1),size("<<name<<"_,2),size("<<name<<"_,3)))"<<iendl ; \ 
    969        oss<<"  "<<name_tmp<<"="<<name<<"_"<<iendl ; \ 
    970        oss<<"  CALL cxios_set_"<<className<<"_"<<name<<"("<<className<<"_hdl%daddr, "<<name_tmp<<",size("<<name<<"_,1),size("<<name<<"_,2),size("<<name<<"_,3))"<<iendl ; \ 
     931   void CInterface::AttributeFortranInterfaceBody< CArray<T,3> >(ostream& oss, const string& className, const string& name) \ 
     932   {  \ 
     933     string name_tmp=name+"__tmp"; \ 
     934      \ 
     935     oss << "IF (PRESENT(" << name << "_)) THEN" << iendl; \ 
     936     if (!matchingTypeCFortran<T>())  \ 
     937     { \ 
     938       oss << "  ALLOCATE(" << name_tmp << "(size(" << name << "_,1), size(" << name << "_,2), size(" << name << "_,3)))" << iendl; \ 
     939       oss << "  " << name_tmp << " = " << name << "_" << iendl; \ 
     940       oss << "  CALL cxios_set_" << className << "_" << name << "(" << className << "_hdl%daddr, " << name_tmp << ", size(" << name << "_,1), size(" << name << "_,2), size(" << name << "_,3))" << iendl; \ 
    971941     } \ 
    972      else oss<<"  CALL cxios_set_"<<className<<"_"<<name<<"("<<className<<"_hdl%daddr, "<<name<<"_,size("<<name<<"_,1),size("<<name<<"_,2),size("<<name<<"_,3))"<<iendl ; \ 
    973      oss<<"ENDIF"<<iendl ; \ 
     942     else oss << "  CALL cxios_set_" << className << "_" << name << "(" << className << "_hdl%daddr, " << name << "_, size(" << name << "_,1), size(" << name << "_,2), size(" << name << "_,3))" << iendl; \ 
     943     oss << "ENDIF"; \ 
    974944   } 
    975945 
     
    982952#define macro(T) \ 
    983953   template <>  \ 
    984    void CInterface::AttributeFortranInterfaceGetBody< CArray<T,1> >(ostream& oss,const string& className,const string& name) \ 
    985    {  \ 
    986      string name_tmp=name+"__tmp" ; \ 
    987       \ 
    988      oss<<"IF (PRESENT("<<name<<"_)) THEN"<<iendl ; \ 
    989      if (!matchingTypeCFortran<T>())  \ 
    990      { \ 
    991        oss<<"  ALLOCATE("<<name_tmp<<"(size("<<name<<"_,1)))"<<iendl ; \ 
    992        oss<<"  CALL cxios_get_"<<className<<"_"<<name<<"("<<className<<"_hdl%daddr, "<<name_tmp<<",size("<<name<<"_,1))"<<iendl ; \ 
    993        oss<<"  "<<name<<"_="<<name_tmp<<iendl ; \ 
     954   void CInterface::AttributeFortranInterfaceGetBody< CArray<T,1> >(ostream& oss, const string& className, const string& name) \ 
     955   {  \ 
     956     string name_tmp=name+"__tmp"; \ 
     957      \ 
     958     oss << "IF (PRESENT(" << name << "_)) THEN" << iendl; \ 
     959     if (!matchingTypeCFortran<T>())  \ 
     960     { \ 
     961       oss << "  ALLOCATE(" << name_tmp << "(size(" << name << "_,1)))" << iendl; \ 
     962       oss << "  CALL cxios_get_" << className << "_" << name << "(" << className << "_hdl%daddr, " << name_tmp << ", size(" << name << "_,1))" << iendl; \ 
     963       oss << "  " << name << "_ = " << name_tmp << iendl; \ 
    994964     } \ 
    995      else oss<<"  CALL cxios_get_"<<className<<"_"<<name<<"("<<className<<"_hdl%daddr, "<<name<<"_,size("<<name<<"_,1))"<<iendl ; \ 
    996      oss<<"ENDIF"<<iendl ; \ 
    997    } \ 
    998  \ 
    999    template <>  \ 
    1000    void CInterface::AttributeFortranInterfaceGetBody< CArray<T,2> >(ostream& oss,const string& className,const string& name) \ 
    1001    {  \ 
    1002      string name_tmp=name+"__tmp" ; \ 
    1003       \ 
    1004      oss<<"IF (PRESENT("<<name<<"_)) THEN"<<iendl ; \ 
    1005      if (!matchingTypeCFortran<T>())  \ 
    1006      { \ 
    1007        oss<<"  ALLOCATE("<<name_tmp<<"(size("<<name<<"_,1),size("<<name<<"_,2)))"<<iendl ; \ 
    1008        oss<<"  CALL cxios_get_"<<className<<"_"<<name<<"("<<className<<"_hdl%daddr, "<<name_tmp<<",size("<<name<<"_,1),size("<<name<<"_,2))"<<iendl ; \ 
    1009        oss<<"  "<<name<<"_="<<name_tmp<<iendl ; \ 
     965     else oss << "  CALL cxios_get_" << className << "_" << name << "(" << className << "_hdl%daddr, " << name << "_, size(" << name << "_,1))" << iendl; \ 
     966     oss << "ENDIF"; \ 
     967   } \ 
     968 \ 
     969   template <>  \ 
     970   void CInterface::AttributeFortranInterfaceGetBody< CArray<T,2> >(ostream& oss, const string& className, const string& name) \ 
     971   {  \ 
     972     string name_tmp=name+"__tmp"; \ 
     973      \ 
     974     oss << "IF (PRESENT(" << name << "_)) THEN" << iendl; \ 
     975     if (!matchingTypeCFortran<T>())  \ 
     976     { \ 
     977       oss << "  ALLOCATE(" << name_tmp << "(size(" << name << "_,1), size(" << name << "_,2)))" << iendl; \ 
     978       oss << "  CALL cxios_get_" << className << "_" << name << "(" << className << "_hdl%daddr, " << name_tmp << ", size(" << name << "_,1), size(" << name << "_,2))" << iendl; \ 
     979       oss << "  " << name << "_ = " << name_tmp << iendl; \ 
    1010980     } \ 
    1011      else oss<<"  CALL cxios_get_"<<className<<"_"<<name<<"("<<className<<"_hdl%daddr, "<<name<<"_,size("<<name<<"_,1),size("<<name<<"_,2))"<<iendl ; \ 
    1012      oss<<"ENDIF"<<iendl ; \ 
     981     else oss << "  CALL cxios_get_" << className << "_" << name << "(" << className << "_hdl%daddr, " << name << "_, size(" << name << "_,1), size(" << name << "_,2))" << iendl; \ 
     982     oss << "ENDIF"; \ 
    1013983   } \ 
    1014984    \ 
    1015985   template <>  \ 
    1016    void CInterface::AttributeFortranInterfaceGetBody< CArray<T,3> >(ostream& oss,const string& className,const string& name) \ 
    1017    {  \ 
    1018      string name_tmp=name+"__tmp" ; \ 
    1019       \ 
    1020      oss<<"IF (PRESENT("<<name<<"_)) THEN"<<iendl ; \ 
    1021      if (!matchingTypeCFortran<T>())  \ 
    1022      { \ 
    1023        oss<<"  ALLOCATE("<<name_tmp<<"(size("<<name<<"_,1),size("<<name<<"_,2),size("<<name<<"_,3)))"<<iendl ; \ 
    1024        oss<<"  CALL cxios_get_"<<className<<"_"<<name<<"("<<className<<"_hdl%daddr, "<<name_tmp<<",size("<<name<<"_,1),size("<<name<<"_,2),size("<<name<<"_,3))"<<iendl ; \ 
    1025        oss<<"  "<<name<<"_="<<name_tmp<<iendl ; \ 
     986   void CInterface::AttributeFortranInterfaceGetBody< CArray<T,3> >(ostream& oss, const string& className, const string& name) \ 
     987   {  \ 
     988     string name_tmp=name+"__tmp"; \ 
     989      \ 
     990     oss << "IF (PRESENT(" << name << "_)) THEN" << iendl; \ 
     991     if (!matchingTypeCFortran<T>())  \ 
     992     { \ 
     993       oss << "  ALLOCATE(" << name_tmp << "(size(" << name << "_,1), size(" << name << "_,2), size(" << name << "_,3)))" << iendl; \ 
     994       oss << "  CALL cxios_get_" << className << "_" << name << "(" << className << "_hdl%daddr, " << name_tmp << ", size(" << name << "_,1), size(" << name << "_,2), size(" << name << "_,3))" << iendl; \ 
     995       oss << "  " << name << "_ = " << name_tmp << iendl; \ 
    1026996      } \ 
    1027      else oss<<"  CALL cxios_get_"<<className<<"_"<<name<<"("<<className<<"_hdl%daddr, "<<name<<"_,size("<<name<<"_,1),size("<<name<<"_,2),size("<<name<<"_,3))"<<iendl ; \ 
    1028      oss<<"ENDIF"<<iendl ; \ 
     997     else oss << "  CALL cxios_get_" << className << "_" << name << "(" << className << "_hdl%daddr, " << name << "_, size(" << name << "_,1), size(" << name << "_,2), size(" << name << "_,3))" << iendl; \ 
     998     oss << "ENDIF"; \ 
    1029999   } 
    10301000 
     
    10341004 
    10351005#undef macro 
    1036  
    1037  
    1038  
    1039  
    1040  
    1041  
    1042  
    1043  
    1044  
    1045  
    1046  
    1047  
    1048  
    1049  
    1050  
    1051  
    1052  
    1053  
    1054  
    1055  
    1056  
    1057  
    1058  
    1059  
    1060  
    1061  
    1062  
    1063  
    1064  
    1065  
    1066  
    1067  
    1068  
    1069  
    1070  
    10711006} 
    1072  
    10731007#endif 
Note: See TracChangeset for help on using the changeset viewer.