New URL for NEMO forge!   http://forge.nemo-ocean.eu

Since March 2022 along with NEMO 4.2 release, the code development moved to a self-hosted GitLab.
This present forge is now archived and remained online for history.
generate_interface.hpp in vendors/XIOS/current/src – NEMO

source: vendors/XIOS/current/src/generate_interface.hpp @ 3408

Last change on this file since 3408 was 3408, checked in by rblod, 12 years ago

importing initial XIOS vendor drop

  • Property svn:keywords set to Id
File size: 2.6 KB
Line 
1#ifndef  __XIOS_GENERATE_INTERFACE_HPP__
2#define  __XIOS_GENERATE_INTERFACE_HPP__
3
4#include "xmlioserver_spl.hpp"
5
6namespace xios
7{
8  class CInterface
9  {
10    public:
11   
12    template <class T>
13    static void AttributeCInterface(ostream& oss,const string& className,const string& name) ;
14   
15   template <class T>
16   static void AttributeFortran2003Interface(ostream& oss,const string& className,const string& name) ;
17   
18   template <class T>
19   static void AttributeFortranInterfaceDeclaration(ostream& oss,const string& className,const string& name) ;
20   
21   template <class T>
22   static void AttributeFortranInterfaceGetDeclaration(ostream& oss,const string& className,const string& name) ;
23
24   template <class T>
25   static void AttributeFortranInterfaceBody(ostream& oss,const string& className,const string& name) ;
26 
27   template <class T>
28   static void AttributeFortranInterfaceGetBody(ostream& oss,const string& className,const string& name) ;
29 
30   template <class T>
31   static string getStrFortranType(void) ;
32
33   template <class T>
34   static string getStrFortranKind(void) ;
35   
36   template <class T>
37   static string getStrFortranKindC(void) ;
38   
39   template <class T>
40   static bool matchingTypeCFortran(void) ;
41   
42
43  };
44 
45  template<> string CInterface::getStrFortranType<int>(void) {return string("INTEGER") ;}
46  template<> string CInterface::getStrFortranType<bool>(void) {return string("LOGICAL") ;}
47  template<> string CInterface::getStrFortranType<double>(void) {return string("REAL") ;}
48  template<> string CInterface::getStrFortranType<float>(void) {return string("REAL") ;}
49 
50  template<> string CInterface::getStrFortranKind<int>(void) {return string("") ;}
51  template<> string CInterface::getStrFortranKind<bool>(void) {return string("") ;}
52  template<> string CInterface::getStrFortranKind<double>(void) {return string("(KIND=8)") ;}
53  template<> string CInterface::getStrFortranKind<float>(void) {return string("(KIND=4)") ;}
54 
55  template<> string CInterface::getStrFortranKindC<int>(void) {return string("(KIND=C_INT)") ;}
56  template<> string CInterface::getStrFortranKindC<bool>(void) {return string("(KIND=C_BOOL)") ;}
57  template<> string CInterface::getStrFortranKindC<double>(void) {return string("(KIND=C_DOUBLE)") ;}
58  template<> string CInterface::getStrFortranKindC<float>(void) {return string("(KIND=C_FLOAT)") ;}
59 
60  template<> bool CInterface::matchingTypeCFortran<int>(void) { return true ; } 
61  template<> bool CInterface::matchingTypeCFortran<bool>(void) { return false ;} 
62  template<> bool CInterface::matchingTypeCFortran<double>(void) { return true; }
63  template<> bool CInterface::matchingTypeCFortran<float>(void) { return true; }
64 
65}
66#endif
Note: See TracBrowser for help on using the repository browser.