Ignore:
Timestamp:
10/10/16 16:01:11 (8 years ago)
Author:
mhnguyen
Message:

Reducing length of line of auto-generate Fortran interface

+) Break line into smaller ones to make sure each line is not longer than 132 character

Test
+) Local with gcc4.8
+) Compilation passed

File:
1 edited

Legend:

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

    r932 r966  
    323323    { 
    324324      oss << "  " << name_tmp << " = " << name << "_" << iendl; 
    325       oss << "  CALL cxios_set_" << className << "_" << name << "(" << className << "_hdl%daddr, " << name_tmp << ")" << iendl; 
     325      oss << "  CALL cxios_set_" << className << "_" << name << " &" << iendl; 
     326      oss << "(" << className << "_hdl%daddr, " << name_tmp << ")" << iendl; 
    326327    } 
    327     else oss << "  CALL cxios_set_" << className << "_" << name << "(" << className << "_hdl%daddr, " << name << "_)" << iendl; 
     328    else { oss << "  CALL cxios_set_" << className << "_" << name << " &" << iendl; 
     329           oss << "(" << className << "_hdl%daddr, " << name << "_)" << iendl; } 
    328330    oss << "ENDIF"; 
    329331  } 
     
    337339    if (!matchingTypeCFortran<T>()) 
    338340    { 
    339       oss << "  CALL cxios_get_" << className << "_" << name << "(" << className << "_hdl%daddr, " << name_tmp << ")" << iendl; 
     341      oss << "  CALL cxios_get_" << className << "_" << name << " &" << iendl; 
     342      oss << "(" << className << "_hdl%daddr, " << name_tmp << ")" << iendl; 
    340343      oss << "  " << name << "_ = " << name_tmp << iendl; 
    341344    } 
    342     else oss << "  CALL cxios_get_" << className << "_" << name << "(" << className << "_hdl%daddr, " << name << "_)" << iendl; 
     345    else { oss << "  CALL cxios_get_" << className << "_" << name << " &" << iendl; 
     346           oss << "(" << className << "_hdl%daddr, " << name << "_)" << iendl; } 
    343347    oss << "ENDIF"; 
    344348  } 
     
    349353 
    350354    oss << "IF (PRESENT(" << name << "_)) THEN" << iendl; 
    351     oss << "  " << name << "__tmp = cxios_is_defined_" << className << "_" << name << "(" << className << "_hdl%daddr)" << iendl; 
     355    oss << "  " << name << "__tmp = cxios_is_defined_" << className << "_" << name << " &" << iendl; 
     356    oss << "(" << className << "_hdl%daddr)" << iendl; 
    352357    oss << "  " << name << "_ = " << name_tmp << iendl; 
    353358    oss << "ENDIF"; 
     
    358363  { 
    359364    oss << "IF (PRESENT(" << name << "_)) THEN" << iendl; 
    360     oss << "  CALL cxios_set_" << className << "_" << name << "(" << className << "_hdl%daddr, " << name << "_, len(" << name << "_))" << iendl; 
     365    oss << "  CALL cxios_set_" << className << "_" << name << " &" << iendl; 
     366    oss << "(" << className << "_hdl%daddr, " << name << "_, len(" << name << "_))" << iendl; 
    361367    oss << "ENDIF"; 
    362368  } 
     
    366372  { 
    367373    oss << "IF (PRESENT(" << name << "_)) THEN" << iendl; 
    368     oss << "  CALL cxios_get_" << className << "_" << name << "(" << className << "_hdl%daddr, " << name << "_, len(" << name << "_))" << iendl; 
     374    oss << "  CALL cxios_get_" << className << "_" << name << " &" << iendl; 
     375    oss << "(" << className << "_hdl%daddr, " << name << "_, len(" << name << "_))" << iendl; 
    369376    oss << "ENDIF"; 
    370377  } 
     
    813820      oss << "  ALLOCATE(" << name_tmp << "(SIZE(" << name << "_,1)))" << iendl; \ 
    814821      oss << "  " << name_tmp << " = " << name << "_" << iendl; \ 
    815       oss << "  CALL cxios_set_" << className << "_" << name << "(" << className << "_hdl%daddr, " << name_tmp << ", SHAPE(" << name << "_))" << iendl; \ 
     822      oss << "  CALL cxios_set_" << className << "_" << name << " &" << iendl; \ 
     823      oss << "(" << className << "_hdl%daddr, " << name_tmp << ", SHAPE(" << name << "_))" << iendl; \ 
    816824    } \ 
    817     else oss << "  CALL cxios_set_" << className << "_" << name << "(" << className << "_hdl%daddr, " << name << "_, SHAPE(" << name << "_))" << iendl; \ 
     825    else { oss << "  CALL cxios_set_" << className << "_" << name << " &" << iendl; \ 
     826           oss << "(" << className << "_hdl%daddr, " << name << "_, SHAPE(" << name << "_))" << iendl; } \ 
    818827    oss << "ENDIF"; \ 
    819828  } \ 
     
    829838      oss << "  ALLOCATE(" << name_tmp << "(SIZE(" << name << "_,1), SIZE(" << name << "_,2)))" << iendl; \ 
    830839      oss << "  " << name_tmp << " = " << name << "_" << iendl; \ 
    831       oss << "  CALL cxios_set_" << className << "_" << name << "(" << className << "_hdl%daddr, " << name_tmp << ", SHAPE(" << name << "_))" << iendl; \ 
     840      oss << "  CALL cxios_set_" << className << "_" << name << " &" << iendl; \ 
     841      oss << "(" << className << "_hdl%daddr, " << name_tmp << ", SHAPE(" << name << "_))" << iendl; \ 
    832842    } \ 
    833     else oss << "  CALL cxios_set_" << className << "_" << name << "(" << className << "_hdl%daddr, " << name << "_, SHAPE(" << name << "_))" << iendl; \ 
     843    else { oss << "  CALL cxios_set_" << className << "_" << name << " &" << iendl; \ 
     844           oss << "(" << className << "_hdl%daddr, " << name << "_, SHAPE(" << name << "_))" << iendl; } \ 
    834845    oss << "ENDIF"; \ 
    835846  } \ 
     
    845856      oss << "  ALLOCATE(" << name_tmp << "(SIZE(" << name << "_,1), SIZE(" << name << "_,2), SIZE(" << name << "_,3)))" << iendl; \ 
    846857      oss << "  " << name_tmp << " = " << name << "_" << iendl; \ 
    847       oss << "  CALL cxios_set_" << className << "_" << name << "(" << className << "_hdl%daddr, " << name_tmp << ", SHAPE(" << name << "_))" << iendl; \ 
     858      oss << "  CALL cxios_set_" << className << "_" << name << " &" << iendl; \ 
     859      oss << "(" << className << "_hdl%daddr, " << name_tmp << ", SHAPE(" << name << "_))" << iendl; \ 
    848860    } \ 
    849     else oss << "  CALL cxios_set_" << className << "_" << name << "(" << className << "_hdl%daddr, " << name << "_, SHAPE(" << name << "_))" << iendl; \ 
     861    else { oss << "  CALL cxios_set_" << className << "_" << name << " &" << iendl; \ 
     862           oss << "(" << className << "_hdl%daddr, " << name << "_, SHAPE(" << name << "_))" << iendl; } \ 
    850863    oss << "ENDIF"; \ 
    851864  }\ 
     
    859872    if (!matchingTypeCFortran<T>())  \ 
    860873    { \ 
    861       oss << "  ALLOCATE(" << name_tmp << "(SIZE(" << name << "_,1), SIZE(" << name << "_,2), SIZE(" << name << "_,3), SIZE(" << name << "_,4)))" << iendl; \ 
     874      oss << "  ALLOCATE(" << name_tmp << "(SIZE(" << name << "_,1), SIZE(" << name << "_,2), SIZE(" << name << "_,3), &" << iendl; \ 
     875      oss << " SIZE(" << name << "_,4)))" << iendl; \ 
    862876      oss << "  " << name_tmp << " = " << name << "_" << iendl; \ 
    863       oss << "  CALL cxios_set_" << className << "_" << name << "(" << className << "_hdl%daddr, " << name_tmp << ", SHAPE(" << name << "_))" << iendl; \ 
     877      oss << "  CALL cxios_set_" << className << "_" << name << " &" << iendl; \ 
     878      oss << "(" << className << "_hdl%daddr, " << name_tmp << ", SHAPE(" << name << "_))" << iendl; \ 
    864879    } \ 
    865     else oss << "  CALL cxios_set_" << className << "_" << name << "(" << className << "_hdl%daddr, " << name << "_, SHAPE(" << name << "_))" << iendl; \ 
     880    else { oss << "  CALL cxios_set_" << className << "_" << name << " &" << iendl; \ 
     881           oss << "(" << className << "_hdl%daddr, " << name << "_, SHAPE(" << name << "_))" << iendl; } \ 
    866882    oss << "ENDIF"; \ 
    867883  }\ 
     
    875891    if (!matchingTypeCFortran<T>())  \ 
    876892    { \ 
    877       oss << "  ALLOCATE(" << name_tmp << "(SIZE(" << name << "_,1), SIZE(" << name << "_,2), SIZE(" << name << "_,3), SIZE(" << name << "_,4), SIZE(" << name << "_,5)))" << iendl; \ 
     893      oss << "  ALLOCATE(" << name_tmp << "(SIZE(" << name << "_,1), SIZE(" << name << "_,2), SIZE(" << name << "_,3), &" << iendl; \ 
     894      oss << " SIZE(" << name << "_,4), SIZE(" << name << "_,5)))" << iendl; \ 
    878895      oss << "  " << name_tmp << " = " << name << "_" << iendl; \ 
    879       oss << "  CALL cxios_set_" << className << "_" << name << "(" << className << "_hdl%daddr, " << name_tmp << ", SHAPE(" << name << "_))" << iendl; \ 
     896      oss << "  CALL cxios_set_" << className << "_" << name << " &" << iendl; \ 
     897      oss << "(" << className << "_hdl%daddr, " << name_tmp << ", SHAPE(" << name << "_))" << iendl; \ 
    880898    } \ 
    881     else oss << "  CALL cxios_set_" << className << "_" << name << "(" << className << "_hdl%daddr, " << name << "_, SHAPE(" << name << "_))" << iendl; \ 
     899    else { oss << "  CALL cxios_set_" << className << "_" << name << " &" << iendl; \ 
     900           oss << "(" << className << "_hdl%daddr, " << name << "_, SHAPE(" << name << "_))" << iendl; } \ 
    882901    oss << "ENDIF"; \ 
    883902  }\ 
     
    891910    if (!matchingTypeCFortran<T>())  \ 
    892911    { \ 
    893       oss << "  ALLOCATE(" << name_tmp << "(SIZE(" << name << "_,1), SIZE(" << name << "_,2), SIZE(" << name << "_,3), SIZE(" << name << "_,4), SIZE(" << name << "_,5), SIZE(" << name << "_,6)))" << iendl; \ 
     912      oss << "  ALLOCATE(" << name_tmp << "(SIZE(" << name << "_,1), SIZE(" << name << "_,2), SIZE(" << name << "_,3), &" << iendl; \ 
     913      oss << " SIZE(" << name << "_,4), SIZE(" << name << "_,5), SIZE(" << name << "_,6)))" << iendl; \ 
    894914      oss << "  " << name_tmp << " = " << name << "_" << iendl; \ 
    895       oss << "  CALL cxios_set_" << className << "_" << name << "(" << className << "_hdl%daddr, " << name_tmp << ", SHAPE(" << name << "_))" << iendl; \ 
     915      oss << "  CALL cxios_set_" << className << "_" << name << " &" << iendl; \ 
     916      oss << "(" << className << "_hdl%daddr, " << name_tmp << ", SHAPE(" << name << "_))" << iendl; \ 
    896917    } \ 
    897     else oss << "  CALL cxios_set_" << className << "_" << name << "(" << className << "_hdl%daddr, " << name << "_, SHAPE(" << name << "_))" << iendl; \ 
     918    else { oss << "  CALL cxios_set_" << className << "_" << name << " &" << iendl; \ 
     919           oss << "(" << className << "_hdl%daddr, " << name << "_, SHAPE(" << name << "_))" << iendl; } \ 
    898920    oss << "ENDIF"; \ 
    899921  }\ 
     
    907929    if (!matchingTypeCFortran<T>())  \ 
    908930    { \ 
    909       oss << "  ALLOCATE(" << name_tmp << "(SIZE(" << name << "_,1), SIZE(" << name << "_,2), SIZE(" << name << "_,3), SIZE(" << name << "_,4), SIZE(" << name << "_,5), SIZE(" << name << "_,6), SIZE(" << name << "_,7)))" << iendl; \ 
     931      oss << "  ALLOCATE(" << name_tmp << "(SIZE(" << name << "_,1), SIZE(" << name << "_,2), SIZE(" << name << "_,3), &" << iendl; \ 
     932      oss << " SIZE(" << name << "_,4), SIZE(" << name << "_,5), SIZE(" << name << "_,6), &" << iendl; \ 
     933      oss << " SIZE(" << name << "_,7)))" << iendl; \ 
    910934      oss << "  " << name_tmp << " = " << name << "_" << iendl; \ 
    911       oss << "  CALL cxios_set_" << className << "_" << name << "(" << className << "_hdl%daddr, " << name_tmp << ", SHAPE(" << name << "_))" << iendl; \ 
     935      oss << "  CALL cxios_set_" << className << "_" << name << " &" << iendl; \ 
     936      oss << "(" << className << "_hdl%daddr, " << name_tmp << ", SHAPE(" << name << "_))" << iendl; \ 
    912937    } \ 
    913     else oss << "  CALL cxios_set_" << className << "_" << name << "(" << className << "_hdl%daddr, " << name << "_, SHAPE(" << name << "_))" << iendl; \ 
     938    else { oss << "  CALL cxios_set_" << className << "_" << name << " &" << iendl; \ 
     939           oss << "(" << className << "_hdl%daddr, " << name << "_, SHAPE(" << name << "_))" << iendl; } \ 
    914940    oss << "ENDIF"; \ 
    915941  } 
     
    931957    { \ 
    932958      oss << "  ALLOCATE(" << name_tmp << "(SIZE(" << name << "_,1)))" << iendl; \ 
    933       oss << "  CALL cxios_get_" << className << "_" << name << "(" << className << "_hdl%daddr, " << name_tmp << ", SHAPE(" << name << "_))" << iendl; \ 
     959      oss << "  CALL cxios_get_" << className << "_" << name << " &" << iendl; \ 
     960      oss << "(" << className << "_hdl%daddr, " << name_tmp << ", SHAPE(" << name << "_))" << iendl; \ 
    934961      oss << "  " << name << "_ = " << name_tmp << iendl; \ 
    935962    } \ 
    936     else oss << "  CALL cxios_get_" << className << "_" << name << "(" << className << "_hdl%daddr, " << name << "_, SHAPE(" << name << "_))" << iendl; \ 
     963    else { oss << "  CALL cxios_get_" << className << "_" << name << " &" << iendl; \ 
     964           oss << "(" << className << "_hdl%daddr, " << name << "_, SHAPE(" << name << "_))" << iendl; } \ 
    937965    oss << "ENDIF"; \ 
    938966  } \ 
     
    947975    { \ 
    948976      oss << "  ALLOCATE(" << name_tmp << "(SIZE(" << name << "_,1), SIZE(" << name << "_,2)))" << iendl; \ 
    949       oss << "  CALL cxios_get_" << className << "_" << name << "(" << className << "_hdl%daddr, " << name_tmp << ", SHAPE(" << name << "_))" << iendl; \ 
     977      oss << "  CALL cxios_get_" << className << "_" << name << " &" << iendl; \ 
     978      oss << "(" << className << "_hdl%daddr, " << name_tmp << ", SHAPE(" << name << "_))" << iendl; \ 
    950979      oss << "  " << name << "_ = " << name_tmp << iendl; \ 
    951980    } \ 
    952     else oss << "  CALL cxios_get_" << className << "_" << name << "(" << className << "_hdl%daddr, " << name << "_, SHAPE(" << name << "_))" << iendl; \ 
     981    else { oss << "  CALL cxios_get_" << className << "_" << name << " &" << iendl; \ 
     982           oss << "(" << className << "_hdl%daddr, " << name << "_, SHAPE(" << name << "_))" << iendl; } \ 
    953983    oss << "ENDIF"; \ 
    954984  } \ 
     
    963993    { \ 
    964994      oss << "  ALLOCATE(" << name_tmp << "(SIZE(" << name << "_,1), SIZE(" << name << "_,2), SIZE(" << name << "_,3)))" << iendl; \ 
    965       oss << "  CALL cxios_get_" << className << "_" << name << "(" << className << "_hdl%daddr, " << name_tmp << ", SHAPE(" << name << "_))" << iendl; \ 
     995      oss << "  CALL cxios_get_" << className << "_" << name << " &" << iendl; \ 
     996      oss << "(" << className << "_hdl%daddr, " << name_tmp << ", SHAPE(" << name << "_))" << iendl; \ 
    966997      oss << "  " << name << "_ = " << name_tmp << iendl; \ 
    967998      } \ 
    968     else oss << "  CALL cxios_get_" << className << "_" << name << "(" << className << "_hdl%daddr, " << name << "_, SHAPE(" << name << "_))" << iendl; \ 
     999    else { oss << "  CALL cxios_get_" << className << "_" << name << " &" << iendl; \ 
     1000           oss << "(" << className << "_hdl%daddr, " << name << "_, SHAPE(" << name << "_))" << iendl; } \ 
    9691001    oss << "ENDIF"; \ 
    9701002  } \ 
     
    9781010    if (!matchingTypeCFortran<T>())  \ 
    9791011    { \ 
    980       oss << "  ALLOCATE(" << name_tmp << "(SIZE(" << name << "_,1), SIZE(" << name << "_,2), SIZE(" << name << "_,3), SIZE(" << name << "_,4)))" << iendl; \ 
    981       oss << "  CALL cxios_get_" << className << "_" << name << "(" << className << "_hdl%daddr, " << name_tmp << ", SHAPE(" << name << "_))" << iendl; \ 
     1012      oss << "  ALLOCATE(" << name_tmp << "(SIZE(" << name << "_,1), SIZE(" << name << "_,2), SIZE(" << name << "_,3), &" << iendl; \ 
     1013      oss << " SIZE(" << name << "_,4)))" << iendl; \ 
     1014      oss << "  CALL cxios_get_" << className << "_" << name << " &" << iendl; \ 
     1015      oss << "(" << className << "_hdl%daddr, " << name_tmp << ", SHAPE(" << name << "_))" << iendl; \ 
    9821016      oss << "  " << name << "_ = " << name_tmp << iendl; \ 
    9831017      } \ 
    984     else oss << "  CALL cxios_get_" << className << "_" << name << "(" << className << "_hdl%daddr, " << name << "_, SHAPE(" << name << "_))" << iendl; \ 
     1018    else { oss << "  CALL cxios_get_" << className << "_" << name << " &" << iendl; \ 
     1019           oss << "(" << className << "_hdl%daddr, " << name << "_, SHAPE(" << name << "_))" << iendl; }\ 
    9851020    oss << "ENDIF"; \ 
    9861021  } \ 
     
    9941029    if (!matchingTypeCFortran<T>())  \ 
    9951030    { \ 
    996       oss << "  ALLOCATE(" << name_tmp << "(SIZE(" << name << "_,1), SIZE(" << name << "_,2), SIZE(" << name << "_,3), SIZE(" << name << "_,4), SIZE(" << name << "_,5)))" << iendl; \ 
    997       oss << "  CALL cxios_get_" << className << "_" << name << "(" << className << "_hdl%daddr, " << name_tmp << ", SHAPE(" << name << "_))" << iendl; \ 
     1031      oss << "  ALLOCATE(" << name_tmp << "(SIZE(" << name << "_,1), SIZE(" << name << "_,2), SIZE(" << name << "_,3), &" << iendl; \ 
     1032      oss << " SIZE(" << name << "_,4), SIZE(" << name << "_,5)))" << iendl; \ 
     1033      oss << "  CALL cxios_get_" << className << "_" << name << " &" << iendl; \ 
     1034      oss << "(" << className << "_hdl%daddr, " << name_tmp << ", SHAPE(" << name << "_))" << iendl; \ 
    9981035      oss << "  " << name << "_ = " << name_tmp << iendl; \ 
    9991036      } \ 
    1000     else oss << "  CALL cxios_get_" << className << "_" << name << "(" << className << "_hdl%daddr, " << name << "_, SHAPE(" << name << "_))" << iendl; \ 
     1037    else { oss << "  CALL cxios_get_" << className << "_" << name << " &" << iendl; \ 
     1038           oss << "(" << className << "_hdl%daddr, " << name << "_, SHAPE(" << name << "_))" << iendl; } \ 
    10011039    oss << "ENDIF"; \ 
    10021040  }\ 
     
    10101048    if (!matchingTypeCFortran<T>())  \ 
    10111049    { \ 
    1012       oss << "  ALLOCATE(" << name_tmp << "(SIZE(" << name << "_,1), SIZE(" << name << "_,2), SIZE(" << name << "_,3), SIZE(" << name << "_,4), SIZE(" << name << "_,5), SIZE(" << name << "_,6)))" << iendl; \ 
    1013       oss << "  CALL cxios_get_" << className << "_" << name << "(" << className << "_hdl%daddr, " << name_tmp << ", SHAPE(" << name << "_))" << iendl; \ 
     1050      oss << "  ALLOCATE(" << name_tmp << "(SIZE(" << name << "_,1), SIZE(" << name << "_,2), SIZE(" << name << "_,3), &" << iendl; \ 
     1051      oss << " SIZE(" << name << "_,4), SIZE(" << name << "_,5), SIZE(" << name << "_,6)))" << iendl; \ 
     1052      oss << "  CALL cxios_get_" << className << "_" << name << " &" << iendl; \ 
     1053      oss << "(" << className << "_hdl%daddr, " << name_tmp << ", SHAPE(" << name << "_))" << iendl; \ 
    10141054      oss << "  " << name << "_ = " << name_tmp << iendl; \ 
    10151055      } \ 
    1016     else oss << "  CALL cxios_get_" << className << "_" << name << "(" << className << "_hdl%daddr, " << name << "_, SHAPE(" << name << "_))" << iendl; \ 
     1056    else { oss << "  CALL cxios_get_" << className << "_" << name << " &" << iendl; \ 
     1057           oss << "(" << className << "_hdl%daddr, " << name << "_, SHAPE(" << name << "_))" << iendl; } \ 
    10171058    oss << "ENDIF"; \ 
    10181059  } \ 
     
    10261067    if (!matchingTypeCFortran<T>())  \ 
    10271068    { \ 
    1028       oss << "  ALLOCATE(" << name_tmp << "(SIZE(" << name << "_,1), SIZE(" << name << "_,2), SIZE(" << name << "_,3), SIZE(" << name << "_,4), SIZE(" << name << "_,5), SIZE(" << name << "_,6), SIZE(" << name << "_,7)))" << iendl; \ 
    1029       oss << "  CALL cxios_get_" << className << "_" << name << "(" << className << "_hdl%daddr, " << name_tmp << ", SHAPE(" << name << "_))" << iendl; \ 
     1069      oss << "  ALLOCATE(" << name_tmp << "(SIZE(" << name << "_,1), SIZE(" << name << "_,2), SIZE(" << name << "_,3), &" << iendl; \ 
     1070      oss << " SIZE(" << name << "_,4), SIZE(" << name << "_,5), SIZE(" << name << "_,6), &" << iendl; \ 
     1071      oss << " SIZE(" << name << "_,7)))" << iendl; \ 
     1072      oss << "  CALL cxios_get_" << className << "_" << name << " &" << iendl; \ 
     1073      oss << "(" << className << "_hdl%daddr, " << name_tmp << ", SHAPE(" << name << "_))" << iendl; \ 
    10301074      oss << "  " << name << "_ = " << name_tmp << iendl; \ 
    10311075      } \ 
    1032     else oss << "  CALL cxios_get_" << className << "_" << name << "(" << className << "_hdl%daddr, " << name << "_, SHAPE(" << name << "_))" << iendl; \ 
     1076    else { oss << "  CALL cxios_get_" << className << "_" << name << " &" << iendl; \ 
     1077           oss << "(" << className << "_hdl%daddr, " << name << "_, SHAPE(" << name << "_))" << iendl; } \ 
    10331078    oss << "ENDIF"; \ 
    10341079  } 
Note: See TracChangeset for help on using the changeset viewer.