Ignore:
Timestamp:
08/25/15 10:50:20 (9 years ago)
Author:
rlacroix
Message:

generate_interface_impl.hpp: Remove old code.

File:
1 edited

Legend:

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

    r591 r672  
    6464    oss << "  CTimer::get(\"XIOS\").resume();" << iendl; 
    6565    oss << "  " << className << "_hdl->" << name << ".setValue(" << name << ");" << iendl; 
    66 //  oss << "  " << className << "_hdl->sendAttributToServer(" << className << "_hdl->" << name << ");" << iendl; 
    6766    oss << "  CTimer::get(\"XIOS\").suspend();" << iendl; 
    6867    oss << "}" << std::endl; 
     
    8685    oss << "  CTimer::get(\"XIOS\").resume();" << iendl; 
    8786    oss << "  " << className << "_hdl->" << name << ".setValue(" << name << "_str);" << iendl; 
    88 //  oss << "  " << className << "_hdl->sendAttributToServer(" << className << "_hdl->" << name << ");" << iendl; 
    8987    oss << "  CTimer::get(\"XIOS\").suspend();" << iendl; 
    9088    oss << "}" << std::endl; 
     
    9795    oss << "  if (!string_copy(" << className << "_hdl->" << name << ".getInheritedValue(), " << name << ", " << name << "_size))" << iendl; 
    9896    oss << "    ERROR(\"void cxios_get_" << className << "_" << name << "(" << className << "_Ptr " << className << "_hdl, char * " << name << ", int " 
    99        << name << "_size)\", << \"Input string is too short\");" << iendl; 
     97        << name << "_size)\", << \"Input string is too short\");" << iendl; 
    10098    oss << "  CTimer::get(\"XIOS\").suspend();" << iendl; 
    10199    oss << "}" << std::endl; 
     
    111109    oss << "  CTimer::get(\"XIOS\").resume();" << iendl; 
    112110    oss << "  " << className << "_hdl->" << name << ".fromString(" << name << "_str);" << iendl; 
    113 //  oss << "  " << className << "_hdl->sendAttributToServer(" << className << "_hdl->" << name << ");" << iendl; 
    114111    oss << "  CTimer::get(\"XIOS\").suspend();" << iendl; 
    115112    oss << "}" << std::endl; 
     
    122119    oss << "  if (!string_copy(" << className << "_hdl->" << name << ".getInheritedStringValue(), " << name << ", " << name << "_size))" << iendl; 
    123120    oss << "    ERROR(\"void cxios_get_" << className << "_" << name << "(" << className << "_Ptr " << className << "_hdl, char * " << name << ", int " 
    124        << name << "_size)\", << \"Input string is too short\");" << iendl; 
     121        << name << "_size)\", << \"Input string is too short\");" << iendl; 
    125122    oss << "  CTimer::get(\"XIOS\").suspend();" << iendl; 
    126123    oss << "}" << std::endl; 
     
    197194  } 
    198195 
    199 /* 
    200 #define macro(T) \ 
    201   template <> \ 
    202   void CInterface::AttributeCInterface<ARRAY(T,1)>(ostream& oss, const string& className, const string& name) \ 
    203   { \ 
    204     string typeName=getStrType<T>(); \ 
    205 \ 
    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   } \ 
    223 \ 
    224   template <> \ 
    225   void CInterface::AttributeCInterface<ARRAY(T,2)>(ostream& oss, const string& className, const string& name) \ 
    226   { \ 
    227     string typeName=getStrType<T>(); \ 
    228 \ 
    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   } \ 
    246 \ 
    247   template <> \ 
    248   void CInterface::AttributeCInterface<ARRAY(T,3)>(ostream& oss, const string& className, const string& name) \ 
    249   { \ 
    250     string typeName=getStrType<T>(); \ 
    251 \ 
    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; \ 
    268   } 
    269  
    270 macro(bool) 
    271 macro(double) 
    272 macro(int) 
    273 */ 
    274  
    275196#undef macro 
    276197 
     
    278199// //          Fortran 2003 Interface             // 
    279200// ///////////////////////////////////////////////// 
    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; 
    287    } 
    288  
    289    template <class T> 
    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    } 
    307  
    308    template <> 
    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; 
    324    } 
     201 
     202  void CInterface::AttributeIsDefinedFortran2003Interface(ostream& oss, const string& className, const string& name) 
     203  { 
     204    oss << "FUNCTION cxios_is_defined_" << className << "_" << name << "(" << className << "_hdl) BIND(C)" << iendl; 
     205    oss << "  USE ISO_C_BINDING" << iendl; 
     206    oss << "  LOGICAL(kind=C_BOOL) :: cxios_is_defined_" << className << "_" << name << iendl; 
     207    oss << "  INTEGER (kind = C_INTPTR_T), VALUE :: " << className << "_hdl" << iendl; 
     208    oss << "END FUNCTION cxios_is_defined_" << className << "_" << name << std::endl; 
     209  } 
     210 
     211  template <class T> 
     212  void CInterface::AttributeFortran2003Interface(ostream& oss, const string& className, const string& name) 
     213  { 
     214    string fortranType=getStrFortranType<T>(); 
     215    string fortranKindC=getStrFortranKindC<T>(); 
     216 
     217    oss << "SUBROUTINE cxios_set_" << className << "_" << name << "(" << className << "_hdl, " << name << ") BIND(C)" << iendl; 
     218    oss << "  USE ISO_C_BINDING" << iendl; 
     219    oss << "  INTEGER (kind = C_INTPTR_T), VALUE :: " << className << "_hdl" << iendl; 
     220    oss << "  " << fortranType << " " << fortranKindC << "      , VALUE :: " << name << iendl; 
     221    oss << "END SUBROUTINE cxios_set_" << className << "_" << name << std::endl; 
     222    oss << iendl; 
     223    oss << "SUBROUTINE cxios_get_" << className << "_" << name << "(" << className << "_hdl, " << name << ") BIND(C)" << iendl; 
     224    oss << "  USE ISO_C_BINDING" << iendl; 
     225    oss << "  INTEGER (kind = C_INTPTR_T), VALUE :: " << className << "_hdl" << iendl; 
     226    oss << "  " << fortranType << " " << fortranKindC << "             :: " << name << iendl; 
     227    oss << "END SUBROUTINE cxios_get_" << className << "_" << name << std::endl; 
     228  } 
     229 
     230  template <> 
     231  void CInterface::AttributeFortran2003Interface<string>(ostream& oss, const string& className, const string& name) 
     232  { 
     233    oss << "SUBROUTINE cxios_set_" << className << "_" << name << "(" << className << "_hdl, " << name << ", " << name << "_size) BIND(C)" << iendl; 
     234    oss << "  USE ISO_C_BINDING" << iendl; 
     235    oss << "  INTEGER (kind = C_INTPTR_T), VALUE :: " << className << "_hdl" << iendl; 
     236    oss << "  CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: " << name << iendl; 
     237    oss << "  INTEGER  (kind = C_INT)     , VALUE        :: " << name << "_size" << iendl; 
     238    oss << "END SUBROUTINE cxios_set_" << className << "_" << name << std::endl; 
     239    oss << iendl; 
     240    oss << "SUBROUTINE cxios_get_" << className << "_" << name << "(" << className << "_hdl, " << name << ", " << name << "_size) BIND(C)" << iendl; 
     241    oss << "  USE ISO_C_BINDING" << iendl; 
     242    oss << "  INTEGER (kind = C_INTPTR_T), VALUE :: " << className << "_hdl" << iendl; 
     243    oss << "  CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: " << name << iendl; 
     244    oss << "  INTEGER  (kind = C_INT)     , VALUE        :: " << name << "_size" << iendl; 
     245    oss << "END SUBROUTINE cxios_get_" << className << "_" << name << std::endl; 
     246  } 
    325247 
    326248  template <> 
     
    360282  } 
    361283 
    362 /* 
    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; \ 
    406    } \ 
    407      \ 
    408    template <> \ 
    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; \ 
    431    } 
    432  
    433   macro(bool) 
    434   macro(double) 
    435   macro(int) 
    436  
    437   #undef macro 
    438 */ 
    439    template <class T> 
    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"; 
    444    } 
    445  
    446    template <class T> 
    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"; 
    457    } 
    458  
    459    template <> 
    460    void CInterface::AttributeFortranInterfaceDeclaration<string>(ostream& oss, const string& className, const string& name) 
    461    { 
    462      oss << "CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: " << name; 
    463    } 
    464  
    465    template <> 
    466    void CInterface::AttributeFortranInterfaceGetDeclaration<string>(ostream& oss, const string& className, const string& name) 
    467    { 
    468      oss << "CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: " << name; 
    469    } 
    470  
    471 /* 
    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(:,:,:)"; \ 
    512    } 
    513  
    514   macro(bool) 
    515   macro(double) 
    516   macro(int) 
    517  
    518 #undef macro 
    519 */ 
    520  
    521    template <class T> 
    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; 
    527      if (!matchingTypeCFortran<T>()) 
    528      { 
    529        oss << "  " << name_tmp << " = " << name << "_" << iendl; 
    530        oss << "  CALL cxios_set_" << className << "_" << name << "(" << className << "_hdl%daddr, " << name_tmp << ")" << iendl; 
    531      } 
    532      else oss << "  CALL cxios_set_" << className << "_" << name << "(" << className << "_hdl%daddr, " << name << "_)" << iendl; 
    533      oss << "ENDIF"; 
    534    } 
    535  
    536    template <class T> 
    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; 
    542      if (!matchingTypeCFortran<T>()) 
    543      { 
    544        oss << "  CALL cxios_get_" << className << "_" << name << "(" << className << "_hdl%daddr, " << name_tmp << ")" << iendl; 
    545        oss << "  " << name << "_ = " << name_tmp << iendl; 
    546      } 
    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"; 
    559    } 
    560  
    561    template <> 
    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"; 
    567    } 
    568  
    569    template <> 
    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"; 
    575    } 
    576  
    577 /* 
    578 #define macro(T) \ 
    579    template <>  \ 
    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; \ 
    590      } \ 
    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; \ 
    606      } \ 
    607      else oss << "  CALL cxios_set_" << className << "_" << name << "(" << className << "_hdl%daddr, " << name << "_, size(" << name << "_,1), size(" << name << "_,2))" << iendl; \ 
    608      oss << "ENDIF"; \ 
    609    } \ 
    610     \ 
    611    template <>  \ 
    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; \ 
    622      } \ 
    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"; \ 
    625    } 
    626  
    627   macro(bool) 
    628   macro(double) 
    629   macro(int) 
    630  
    631 #undef macro 
    632 */ 
    633  
    634 /* 
    635 #define macro(T) \ 
    636    template <>  \ 
    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; \ 
    647      } \ 
    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; \ 
    663      } \ 
    664      else oss << "  CALL cxios_get_" << className << "_" << name << "(" << className << "_hdl%daddr, " << name << "_, size(" << name << "_,1), size(" << name << "_,2))" << iendl; \ 
    665      oss << "ENDIF"; \ 
    666    } \ 
    667     \ 
    668    template <>  \ 
    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; \ 
    679       } \ 
    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"; \ 
    682    } 
    683  
    684   macro(bool) 
    685   macro(double) 
    686   macro(int) 
    687  
    688 #undef macro 
    689 */ 
     284  template <class T> 
     285  void CInterface::AttributeFortranInterfaceDeclaration(ostream& oss, const string& className, const string& name) 
     286  { 
     287    oss << getStrFortranType<T>() << " " << getStrFortranKind<T>() << " , OPTIONAL, INTENT(IN) :: " << name; 
     288    if (!matchingTypeCFortran<T>()) oss << iendl << getStrFortranType<T>() << " " << getStrFortranKindC<T>() << " :: " << name << "_tmp"; 
     289  } 
     290 
     291  template <class T> 
     292  void CInterface::AttributeFortranInterfaceGetDeclaration(ostream& oss, const string& className, const string& name) 
     293  { 
     294    oss << getStrFortranType<T>() << " " << getStrFortranKind<T>() << " , OPTIONAL, INTENT(OUT) :: " << name; 
     295    if (!matchingTypeCFortran<T>()) oss << iendl << getStrFortranType<T>() << " " << getStrFortranKindC<T>() << " :: " << name << "_tmp"; 
     296  } 
     297 
     298  void CInterface::AttributeFortranInterfaceIsDefinedDeclaration(ostream& oss, const string& className, const string& name) 
     299  { 
     300    oss << "LOGICAL, OPTIONAL, INTENT(OUT) :: " << name << iendl; 
     301    oss << "LOGICAL(KIND=C_BOOL) :: " << name << "_tmp"; 
     302  } 
     303 
     304  template <> 
     305  void CInterface::AttributeFortranInterfaceDeclaration<string>(ostream& oss, const string& className, const string& name) 
     306  { 
     307    oss << "CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: " << name; 
     308  } 
     309 
     310  template <> 
     311  void CInterface::AttributeFortranInterfaceGetDeclaration<string>(ostream& oss, const string& className, const string& name) 
     312  { 
     313    oss << "CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: " << name; 
     314  } 
     315 
     316  template <class T> 
     317  void CInterface::AttributeFortranInterfaceBody(ostream& oss, const string& className, const string& name) 
     318  { 
     319    string name_tmp=name+"__tmp"; 
     320 
     321    oss << "IF (PRESENT(" << name << "_)) THEN" << iendl; 
     322    if (!matchingTypeCFortran<T>()) 
     323    { 
     324      oss << "  " << name_tmp << " = " << name << "_" << iendl; 
     325      oss << "  CALL cxios_set_" << className << "_" << name << "(" << className << "_hdl%daddr, " << name_tmp << ")" << iendl; 
     326    } 
     327    else oss << "  CALL cxios_set_" << className << "_" << name << "(" << className << "_hdl%daddr, " << name << "_)" << iendl; 
     328    oss << "ENDIF"; 
     329  } 
     330 
     331  template <class T> 
     332  void CInterface::AttributeFortranInterfaceGetBody(ostream& oss, const string& className, const string& name) 
     333  { 
     334    string name_tmp=name+"__tmp"; 
     335 
     336    oss << "IF (PRESENT(" << name << "_)) THEN" << iendl; 
     337    if (!matchingTypeCFortran<T>()) 
     338    { 
     339      oss << "  CALL cxios_get_" << className << "_" << name << "(" << className << "_hdl%daddr, " << name_tmp << ")" << iendl; 
     340      oss << "  " << name << "_ = " << name_tmp << iendl; 
     341    } 
     342    else oss << "  CALL cxios_get_" << className << "_" << name << "(" << className << "_hdl%daddr, " << name << "_)" << iendl; 
     343    oss << "ENDIF"; 
     344  } 
     345 
     346  void CInterface::AttributeFortranInterfaceIsDefinedBody(ostream& oss, const string& className, const string& name) 
     347  { 
     348    string name_tmp=name+"__tmp"; 
     349 
     350    oss << "IF (PRESENT(" << name << "_)) THEN" << iendl; 
     351    oss << "  " << name << "__tmp = cxios_is_defined_" << className << "_" << name << "(" << className << "_hdl%daddr)" << iendl; 
     352    oss << "  " << name << "_ = " << name_tmp << iendl; 
     353    oss << "ENDIF"; 
     354  } 
     355 
     356  template <> 
     357  void CInterface::AttributeFortranInterfaceBody<string>(ostream& oss, const string& className, const string& name) 
     358  { 
     359    oss << "IF (PRESENT(" << name << "_)) THEN" << iendl; 
     360    oss << "  CALL cxios_set_" << className << "_" << name << "(" << className << "_hdl%daddr, " << name << "_, len(" << name << "_))" << iendl; 
     361    oss << "ENDIF"; 
     362  } 
     363 
     364  template <> 
     365  void CInterface::AttributeFortranInterfaceGetBody<string>(ostream& oss, const string& className, const string& name) 
     366  { 
     367    oss << "IF (PRESENT(" << name << "_)) THEN" << iendl; 
     368    oss << "  CALL cxios_get_" << className << "_" << name << "(" << className << "_hdl%daddr, " << name << "_, len(" << name << "_))" << iendl; 
     369    oss << "ENDIF"; 
     370  } 
    690371 
    691372// declaration for CArray 
     
    772453 
    773454#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    } \ 
     455  template <> \ 
     456  void CInterface::AttributeFortran2003Interface<CArray<T,1> >(ostream& oss, const string& className, const string& name) \ 
     457  { \ 
     458    string fortranType=getStrFortranType<T>(); \ 
     459    string fortranKindC=getStrFortranKindC<T>(); \ 
     460      \ 
     461    oss << "SUBROUTINE cxios_set_" << className << "_" << name << "(" << className << "_hdl, " << name << ", extent1) BIND(C)" << iendl; \ 
     462    oss << "  USE ISO_C_BINDING" << iendl; \ 
     463    oss << "  INTEGER (kind = C_INTPTR_T), VALUE       :: " << className << "_hdl" << iendl; \ 
     464    oss << "  " << fortranType << " " << fortranKindC << "     , DIMENSION(*) :: " << name << iendl; \ 
     465    oss << "  INTEGER (kind = C_INT), VALUE  :: extent1" << iendl; \ 
     466    oss << "END SUBROUTINE cxios_set_" << className << "_" << name << std::endl; \ 
     467    oss << iendl; \ 
     468    oss << "SUBROUTINE cxios_get_" << className << "_" << name << "(" << className << "_hdl, " << name << ", extent1) BIND(C)" << iendl; \ 
     469    oss << "  USE ISO_C_BINDING" << iendl; \ 
     470    oss << "  INTEGER (kind = C_INTPTR_T), VALUE       :: " << className << "_hdl" << iendl; \ 
     471    oss << "  " << fortranType << " " << fortranKindC << "     , DIMENSION(*) :: " << name << iendl; \ 
     472    oss << "  INTEGER (kind = C_INT), VALUE  :: extent1" << iendl; \ 
     473    oss << "END SUBROUTINE cxios_get_" << className << "_" << name << std::endl; \ 
     474  } \ 
    794475 \ 
    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; \ 
    816    } \ 
    817      \ 
    818    template <> \ 
    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; \ 
    841    } 
     476  template <> \ 
     477  void CInterface::AttributeFortran2003Interface<CArray<T,2> >(ostream& oss, const string& className, const string& name) \ 
     478  { \ 
     479    string fortranType=getStrFortranType<T>(); \ 
     480    string fortranKindC=getStrFortranKindC<T>(); \ 
     481      \ 
     482    oss << "SUBROUTINE cxios_set_" << className << "_" << name << "(" << className << "_hdl, " << name << ", extent1, extent2) BIND(C)" << iendl; \ 
     483    oss << "  USE ISO_C_BINDING" << iendl; \ 
     484    oss << "  INTEGER (kind = C_INTPTR_T), VALUE       :: " << className << "_hdl" << iendl; \ 
     485    oss << "  " << fortranType << " " << fortranKindC << "     , DIMENSION(*) :: " << name << iendl; \ 
     486    oss << "  INTEGER (kind = C_INT), VALUE  :: extent1" << iendl; \ 
     487    oss << "  INTEGER (kind = C_INT), VALUE  :: extent2" << iendl; \ 
     488    oss << "END SUBROUTINE cxios_set_" << className << "_" << name << std::endl; \ 
     489    oss << iendl; \ 
     490    oss << "SUBROUTINE cxios_get_" << className << "_" << name << "(" << className << "_hdl, " << name << ", extent1, extent2) BIND(C)" << iendl; \ 
     491    oss << "  USE ISO_C_BINDING" << iendl; \ 
     492    oss << "  INTEGER (kind = C_INTPTR_T), VALUE       :: " << className << "_hdl" << iendl; \ 
     493    oss << "  " << fortranType << " " << fortranKindC << "     , DIMENSION(*) :: " << name << iendl; \ 
     494    oss << "  INTEGER (kind = C_INT), VALUE  :: extent1" << iendl; \ 
     495    oss << "  INTEGER (kind = C_INT), VALUE  :: extent2" << iendl; \ 
     496    oss << "END SUBROUTINE cxios_get_" << className << "_" << name << std::endl; \ 
     497  } \ 
     498    \ 
     499  template <> \ 
     500  void CInterface::AttributeFortran2003Interface<CArray<T,3> >(ostream& oss, const string& className, const string& name) \ 
     501  { \ 
     502    string fortranType=getStrFortranType<T>(); \ 
     503    string fortranKindC=getStrFortranKindC<T>(); \ 
     504      \ 
     505    oss << "SUBROUTINE cxios_set_" << className << "_" << name << "(" << className << "_hdl, " << name << ", extent1, extent2, extent3) BIND(C)" << iendl; \ 
     506    oss << "  USE ISO_C_BINDING" << iendl; \ 
     507    oss << "  INTEGER (kind = C_INTPTR_T), VALUE       :: " << className << "_hdl" << iendl; \ 
     508    oss << "  " << fortranType << " " << fortranKindC << "     , DIMENSION(*) :: " << name << iendl; \ 
     509    oss << "  INTEGER (kind = C_INT), VALUE  :: extent1" << iendl; \ 
     510    oss << "  INTEGER (kind = C_INT), VALUE  :: extent2" << iendl; \ 
     511    oss << "  INTEGER (kind = C_INT), VALUE  :: extent3" << iendl; \ 
     512    oss << "END SUBROUTINE cxios_set_" << className << "_" << name << std::endl; \ 
     513    oss << iendl; \ 
     514    oss << "SUBROUTINE cxios_get_" << className << "_" << name << "(" << className << "_hdl, " << name << ", extent1, extent2, extent3) BIND(C)" << iendl; \ 
     515    oss << "  USE ISO_C_BINDING" << iendl; \ 
     516    oss << "  INTEGER (kind = C_INTPTR_T), VALUE       :: " << className << "_hdl" << iendl; \ 
     517    oss << "  " << fortranType << " " << fortranKindC << "     , DIMENSION(*) :: " << name << iendl; \ 
     518    oss << "  INTEGER (kind = C_INT), VALUE  :: extent1" << iendl; \ 
     519    oss << "  INTEGER (kind = C_INT), VALUE  :: extent2" << iendl; \ 
     520    oss << "  INTEGER (kind = C_INT), VALUE  :: extent3" << iendl; \ 
     521    oss << "END SUBROUTINE cxios_get_" << className << "_" << name << std::endl; \ 
     522  } 
    842523 
    843524  macro(bool) 
     
    848529 
    849530#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    } \ 
     531  template <> \ 
     532  void CInterface::AttributeFortranInterfaceDeclaration<CArray<T,1> >(ostream& oss, const string& className, const string& name) \ 
     533  { \ 
     534    oss << getStrFortranType<T>() << " " << getStrFortranKind<T>() << " , OPTIONAL, INTENT(IN) :: " << name << "(:)"; \ 
     535    if (!matchingTypeCFortran<T>()) oss << iendl << getStrFortranType<T>() << " " << getStrFortranKindC<T>() << " , ALLOCATABLE :: " << name << "_tmp(:)"; \ 
     536  } \ 
     537  template <> \ 
     538  void CInterface::AttributeFortranInterfaceGetDeclaration<CArray<T,1> >(ostream& oss, const string& className, const string& name) \ 
     539  { \ 
     540    oss << getStrFortranType<T>() << " " << getStrFortranKind<T>() << " , OPTIONAL, INTENT(OUT) :: " << name << "(:)"; \ 
     541    if (!matchingTypeCFortran<T>()) oss << iendl << getStrFortranType<T>() << " " << getStrFortranKindC<T>() << " , ALLOCATABLE :: " << name << "_tmp(:)"; \ 
     542  } \ 
    862543 \ 
    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    } \ 
     544  template <> \ 
     545  void CInterface::AttributeFortranInterfaceDeclaration<CArray<T,2> >(ostream& oss, const string& className, const string& name) \ 
     546  { \ 
     547    oss << getStrFortranType<T>() << " " << getStrFortranKind<T>() << " , OPTIONAL, INTENT(IN) :: " << name << "(:,:)"; \ 
     548    if (!matchingTypeCFortran<T>()) oss << iendl << getStrFortranType<T>() << " " << getStrFortranKindC<T>() << " , ALLOCATABLE :: " << name << "_tmp(:,:)"; \ 
     549  } \ 
    869550 \ 
    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    } \ 
     551  template <> \ 
     552  void CInterface::AttributeFortranInterfaceGetDeclaration<CArray<T,2> >(ostream& oss, const string& className, const string& name) \ 
     553  { \ 
     554    oss << getStrFortranType<T>() << " " << getStrFortranKind<T>() << " , OPTIONAL, INTENT(OUT) :: " << name << "(:,:)"; \ 
     555    if (!matchingTypeCFortran<T>()) oss << iendl << getStrFortranType<T>() << " " << getStrFortranKindC<T>() << " , ALLOCATABLE :: " << name << "_tmp(:,:)"; \ 
     556  } \ 
    876557 \ 
    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    } \ 
     558  template <> \ 
     559  void CInterface::AttributeFortranInterfaceDeclaration<CArray<T,3> >(ostream& oss, const string& className, const string& name) \ 
     560  { \ 
     561    oss << getStrFortranType<T>() << " " << getStrFortranKind<T>() << " , OPTIONAL, INTENT(IN) :: " << name << "(:,:,:)"; \ 
     562    if (!matchingTypeCFortran<T>()) oss << iendl << getStrFortranType<T>() << " " << getStrFortranKindC<T>() << " , ALLOCATABLE :: " << name << "_tmp(:,:,:)"; \ 
     563  } \ 
    883564 \ 
    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(:,:,:)"; \ 
    889    } 
     565  template <> \ 
     566  void CInterface::AttributeFortranInterfaceGetDeclaration<CArray<T,3> >(ostream& oss, const string& className, const string& name) \ 
     567  { \ 
     568    oss << getStrFortranType<T>() << " " << getStrFortranKind<T>() << " , OPTIONAL, INTENT(OUT) :: " << name << "(:,:,:)"; \ 
     569    if (!matchingTypeCFortran<T>()) oss << iendl << getStrFortranType<T>() << " " << getStrFortranKindC<T>() << " , ALLOCATABLE :: " << name << "_tmp(:,:,:)"; \ 
     570  } 
    890571 
    891572  macro(bool) 
     
    896577 
    897578#define macro(T) \ 
    898    template <>  \ 
    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; \ 
    909      } \ 
    910      else oss << "  CALL cxios_set_" << className << "_" << name << "(" << className << "_hdl%daddr, " << name << "_, size(" << name << "_,1))" << iendl; \ 
    911      oss << "ENDIF"; \ 
    912    } \ 
     579  template <>  \ 
     580  void CInterface::AttributeFortranInterfaceBody< CArray<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; \ 
     590    } \ 
     591    else oss << "  CALL cxios_set_" << className << "_" << name << "(" << className << "_hdl%daddr, " << name << "_, size(" << name << "_,1))" << iendl; \ 
     592    oss << "ENDIF"; \ 
     593  } \ 
    913594 \ 
    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; \ 
    925      } \ 
    926      else oss << "  CALL cxios_set_" << className << "_" << name << "(" << className << "_hdl%daddr, " << name << "_, size(" << name << "_,1), size(" << name << "_,2))" << iendl; \ 
    927      oss << "ENDIF"; \ 
    928    } \ 
     595  template <>  \ 
     596  void CInterface::AttributeFortranInterfaceBody< CArray<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; \ 
     606    } \ 
     607    else oss << "  CALL cxios_set_" << className << "_" << name << "(" << className << "_hdl%daddr, " << name << "_, size(" << name << "_,1), size(" << name << "_,2))" << iendl; \ 
     608    oss << "ENDIF"; \ 
     609  } \ 
    929610    \ 
    930    template <>  \ 
    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; \ 
    941      } \ 
    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"; \ 
    944    } 
     611  template <>  \ 
     612  void CInterface::AttributeFortranInterfaceBody< CArray<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; \ 
     622    } \ 
     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"; \ 
     625  } 
    945626 
    946627  macro(bool) 
     
    951632 
    952633#define macro(T) \ 
    953    template <>  \ 
    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; \ 
    964      } \ 
    965      else oss << "  CALL cxios_get_" << className << "_" << name << "(" << className << "_hdl%daddr, " << name << "_, size(" << name << "_,1))" << iendl; \ 
    966      oss << "ENDIF"; \ 
    967    } \ 
     634  template <>  \ 
     635  void CInterface::AttributeFortranInterfaceGetBody< CArray<T,1> >(ostream& oss, const string& className, const string& name) \ 
     636  {  \ 
     637    string name_tmp=name+"__tmp"; \ 
     638      \ 
     639    oss << "IF (PRESENT(" << name << "_)) THEN" << iendl; \ 
     640    if (!matchingTypeCFortran<T>())  \ 
     641    { \ 
     642      oss << "  ALLOCATE(" << name_tmp << "(size(" << name << "_,1)))" << iendl; \ 
     643      oss << "  CALL cxios_get_" << className << "_" << name << "(" << className << "_hdl%daddr, " << name_tmp << ", size(" << name << "_,1))" << iendl; \ 
     644      oss << "  " << name << "_ = " << name_tmp << iendl; \ 
     645    } \ 
     646    else oss << "  CALL cxios_get_" << className << "_" << name << "(" << className << "_hdl%daddr, " << name << "_, size(" << name << "_,1))" << iendl; \ 
     647    oss << "ENDIF"; \ 
     648  } \ 
    968649 \ 
    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; \ 
    980      } \ 
    981      else oss << "  CALL cxios_get_" << className << "_" << name << "(" << className << "_hdl%daddr, " << name << "_, size(" << name << "_,1), size(" << name << "_,2))" << iendl; \ 
    982      oss << "ENDIF"; \ 
    983    } \ 
     650  template <>  \ 
     651  void CInterface::AttributeFortranInterfaceGetBody< CArray<T,2> >(ostream& oss, const string& className, const string& name) \ 
     652  {  \ 
     653    string name_tmp=name+"__tmp"; \ 
     654      \ 
     655    oss << "IF (PRESENT(" << name << "_)) THEN" << iendl; \ 
     656    if (!matchingTypeCFortran<T>())  \ 
     657    { \ 
     658      oss << "  ALLOCATE(" << name_tmp << "(size(" << name << "_,1), size(" << name << "_,2)))" << iendl; \ 
     659      oss << "  CALL cxios_get_" << className << "_" << name << "(" << className << "_hdl%daddr, " << name_tmp << ", size(" << name << "_,1), size(" << name << "_,2))" << iendl; \ 
     660      oss << "  " << name << "_ = " << name_tmp << iendl; \ 
     661    } \ 
     662    else oss << "  CALL cxios_get_" << className << "_" << name << "(" << className << "_hdl%daddr, " << name << "_, size(" << name << "_,1), size(" << name << "_,2))" << iendl; \ 
     663    oss << "ENDIF"; \ 
     664  } \ 
    984665    \ 
    985    template <>  \ 
    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; \ 
     666  template <>  \ 
     667  void CInterface::AttributeFortranInterfaceGetBody< CArray<T,3> >(ostream& oss, const string& className, const string& name) \ 
     668  {  \ 
     669    string name_tmp=name+"__tmp"; \ 
     670      \ 
     671    oss << "IF (PRESENT(" << name << "_)) THEN" << iendl; \ 
     672    if (!matchingTypeCFortran<T>())  \ 
     673    { \ 
     674      oss << "  ALLOCATE(" << name_tmp << "(size(" << name << "_,1), size(" << name << "_,2), size(" << name << "_,3)))" << iendl; \ 
     675      oss << "  CALL cxios_get_" << className << "_" << name << "(" << className << "_hdl%daddr, " << name_tmp << ", size(" << name << "_,1), size(" << name << "_,2), size(" << name << "_,3))" << iendl; \ 
     676      oss << "  " << name << "_ = " << name_tmp << iendl; \ 
    996677      } \ 
    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"; \ 
    999    } 
     678    else oss << "  CALL cxios_get_" << className << "_" << name << "(" << className << "_hdl%daddr, " << name << "_, size(" << name << "_,1), size(" << name << "_,2), size(" << name << "_,3))" << iendl; \ 
     679    oss << "ENDIF"; \ 
     680  } 
    1000681 
    1001682  macro(bool) 
Note: See TracChangeset for help on using the changeset viewer.