Changeset 1625


Ignore:
Timestamp:
12/14/18 17:28:25 (5 years ago)
Author:
oabramkina
Message:

XIOS 2.5: limiting the line length to 132 characters in the Fortran interface. Certain function names were exceeding this limit causing a compilation error in case gcc without -ffree-line-length-none option.

Location:
XIOS/branchs/xios-2.5
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • XIOS/branchs/xios-2.5/arch/arch-GCC_LINUX.fcm

    r983 r1625  
    1212%DEBUG_CFLAGS   -g  
    1313 
    14 %BASE_FFLAGS    -D__NONE__ -ffree-line-length-none  
     14%BASE_FFLAGS    -D__NONE__  
    1515%PROD_FFLAGS    -O3 
    1616%DEV_FFLAGS     -g -O2 
  • XIOS/branchs/xios-2.5/src/generate_interface_impl.hpp

    r1158 r1625  
    215215    string fortranKindC=getStrFortranKindC<T>(); 
    216216 
    217     oss << "SUBROUTINE cxios_set_" << className << "_" << name << "(" << className << "_hdl, " << name << ") BIND(C)" << iendl; 
     217//    oss << "SUBROUTINE cxios_set_" << className << "_" << name << "(" << className << "_hdl, " << name << ") BIND(C)" << iendl; 
     218    int indent = oss.iword(iendl.index); 
     219    string str = "SUBROUTINE cxios_set_" + className + "_" + name + "(" + className + "_hdl, " + name + ") BIND(C)"; 
     220    if ((str.length() + indent) >132) 
     221    { 
     222      oss << str.substr(0,130-indent) ; 
     223      oss << "&" << endl; 
     224      oss << "&" << str.substr(130-indent,str.length()) ; 
     225    } 
     226    else 
     227    { 
     228      oss << str; 
     229    } 
     230    oss << iendl; 
    218231    oss << "  USE ISO_C_BINDING" << iendl; 
    219232    oss << "  INTEGER (kind = C_INTPTR_T), VALUE :: " << className << "_hdl" << iendl; 
     
    231244  void CInterface::AttributeFortran2003Interface<string>(ostream& oss, const string& className, const string& name) 
    232245  { 
    233     oss << "SUBROUTINE cxios_set_" << className << "_" << name << "(" << className << "_hdl, " << name << ", " << name << "_size) BIND(C)" << iendl; 
     246//    oss << "SUBROUTINE cxios_set_" << className << "_" << name << "(" << className << "_hdl, " << name << ", " << name << "_size) BIND(C)" << iendl; 
     247    int indent = oss.iword(iendl.index); 
     248    string str ="SUBROUTINE cxios_set_" + className + "_" + name + "(" + className + "_hdl, " + name + ", " + name + "_size) BIND(C)"; 
     249    if ((str.length() + indent) >132) 
     250    { 
     251      oss << str.substr(0,130-indent) ; 
     252      oss << "&" << endl; 
     253      oss << "&" << str.substr(130-indent,str.length()) ; 
     254    } 
     255    else 
     256    { 
     257      oss << str; 
     258    } 
     259    oss << iendl; 
    234260    oss << "  USE ISO_C_BINDING" << iendl; 
    235261    oss << "  INTEGER (kind = C_INTPTR_T), VALUE :: " << className << "_hdl" << iendl; 
     
    238264    oss << "END SUBROUTINE cxios_set_" << className << "_" << name << std::endl; 
    239265    oss << iendl; 
    240     oss << "SUBROUTINE cxios_get_" << className << "_" << name << "(" << className << "_hdl, " << name << ", " << name << "_size) BIND(C)" << iendl; 
     266//    oss << "SUBROUTINE cxios_get_" << className << "_" << name << "(" << className << "_hdl, " << name << ", " << name << "_size) BIND(C)" << iendl; 
     267    str = "SUBROUTINE cxios_get_" + className + "_" + name + "(" + className + "_hdl, " + name + ", " + name + "_size) BIND(C)"; 
     268    if ((str.length() + indent) >132) 
     269    { 
     270      oss << str.substr(0,130-indent) ; 
     271      oss << "&" << endl; 
     272      oss << "&" << str.substr(130-indent,str.length()) ; 
     273    } 
     274    else 
     275    { 
     276      oss << str; 
     277    } 
     278    oss << iendl; 
    241279    oss << "  USE ISO_C_BINDING" << iendl; 
    242280    oss << "  INTEGER (kind = C_INTPTR_T), VALUE :: " << className << "_hdl" << iendl; 
     
    247285 
    248286  template <> 
    249   void CInterface::AttributeFortran2003Interface<CDate>(ostream& oss, const string& className, const string& name) 
    250   { 
    251     oss << "SUBROUTINE cxios_set_" << className << "_" << name << "(" << className << "_hdl, " << name << ") BIND(C)" << iendl; 
    252     oss << "  USE ISO_C_BINDING" << iendl; 
    253     oss << "  USE IDATE" << iendl; 
    254     oss << "  INTEGER (kind = C_INTPTR_T), VALUE :: " << className << "_hdl" << iendl; 
    255     oss << "  TYPE(txios(date)), VALUE :: " << name << iendl; 
    256     oss << "END SUBROUTINE cxios_set_" << className << "_" << name << std::endl; 
     287  void CInterface::AttributeFortran2003Interface<CDuration>(ostream& oss, const string& className, const string& name) 
     288  { 
     289//    oss << "SUBROUTINE cxios_set_" << className << "_" << name << "(" << className << "_hdl, " << name << ") BIND(C)" << iendl; 
     290    string str = "SUBROUTINE cxios_set_" + className + "_" + name + "(" + className + "_hdl, " + name + ") BIND(C)"; 
     291    int indent = oss.iword(iendl.index); 
     292    if ((str.length() + indent) >132) 
     293    { 
     294      oss << str.substr(0,130-indent) ; 
     295      oss << "&" << endl; 
     296      oss << "&" << str.substr(130-indent,str.length()) ; 
     297    } 
     298    else 
     299    { 
     300      oss << str; 
     301    } 
    257302    oss << iendl; 
    258     oss << "SUBROUTINE cxios_get_" << className << "_" << name << "(" << className << "_hdl, " << name << ") BIND(C)" << iendl; 
    259     oss << "  USE ISO_C_BINDING" << iendl; 
    260     oss << "  USE IDATE" << iendl; 
    261     oss << "  INTEGER (kind = C_INTPTR_T), VALUE :: " << className << "_hdl" << iendl; 
    262     oss << "  TYPE(txios(date)) :: " << name << iendl; 
    263     oss << "END SUBROUTINE cxios_get_" << className << "_" << name << std::endl; 
    264   } 
    265  
    266   template <> 
    267   void CInterface::AttributeFortran2003Interface<CDuration>(ostream& oss, const string& className, const string& name) 
    268   { 
    269     oss << "SUBROUTINE cxios_set_" << className << "_" << name << "(" << className << "_hdl, " << name << ") BIND(C)" << iendl; 
    270303    oss << "  USE ISO_C_BINDING" << iendl; 
    271304    oss << "  USE IDURATION" << iendl; 
  • XIOS/branchs/xios-2.5/src/interface/fortran_attr/interpolate_domain_interface_attr.F90

    r1492 r1625  
    8888 
    8989 
    90     SUBROUTINE cxios_set_interpolate_domain_read_write_convention(interpolate_domain_hdl, read_write_convention, read_write_convention_size) BIND(C) 
     90    SUBROUTINE cxios_set_interpolate_domain_read_write_convention(interpolate_domain_hdl, read_write_convention, read_write_conven& 
     91&tion_size) BIND(C) 
    9192      USE ISO_C_BINDING 
    9293      INTEGER (kind = C_INTPTR_T), VALUE :: interpolate_domain_hdl 
     
    9596    END SUBROUTINE cxios_set_interpolate_domain_read_write_convention 
    9697 
    97     SUBROUTINE cxios_get_interpolate_domain_read_write_convention(interpolate_domain_hdl, read_write_convention, read_write_convention_size) BIND(C) 
     98    SUBROUTINE cxios_get_interpolate_domain_read_write_convention(interpolate_domain_hdl, read_write_convention, read_write_conven& 
     99&tion_size) BIND(C) 
    98100      USE ISO_C_BINDING 
    99101      INTEGER (kind = C_INTPTR_T), VALUE :: interpolate_domain_hdl 
Note: See TracChangeset for help on using the changeset viewer.