PyForTool
Python-fortran-tool
|
Public Member Functions | |
__init__ (self, filename, output=None, parser=None, parserOptions=None, verbosity=None, wrapH=False, tree=None, enableCache=False) | |
setParallel (cls, tree, clsLock=None, clsRLock=None) | |
lockFile (cls, filename) | |
unlockFile (cls, filename, silence=False) | |
__enter__ (self) | |
__exit__ (self, excType, excVal, excTb) | |
close (self) | |
xml (self) | |
fortran (self) | |
renameUpper (self) | |
renameLower (self) | |
write (self) | |
writeXML (self, filename) | |
Public Member Functions inherited from pyfortool.scope.PYFTscope | |
__copy__ (self) | |
__deepcopy__ (self, memo) | |
__getattr__ (self, attr) | |
path (self) | |
mainScope (self) | |
parentScope (self) | |
getParent (self, item, level=1) | |
getSiblings (self, item, before=True, after=True) | |
showScopesList (self, includeItself=False) | |
getScopes (self, level=-1, excludeContains=True, excludeKinds=None, includeItself=True) | |
getScopeNode (self, scopePath, excludeContains=True, includeItself=True) | |
isScopeNode (self, node) | |
getParentScopeNode (self, item, mustRaise=True) | |
getScopePath (self, item, includeItself=True) | |
getFileName (self) | |
empty (self, addStmt=None, simplify=False) | |
Public Member Functions inherited from pyfortool.scope.ElementView | |
tag (self) | |
tail (self) | |
text (self) | |
findtext (self, *args, **kwargs) | |
iterfind (self, *args, **kwargs) | |
itertext (self, *args, **kwargs) | |
__getitem__ (self, *args, **kwargs) | |
__len__ (self, *args, **kwargs) | |
__iter__ (self) | |
find (self, *args, **kwargs) | |
findall (self, *args, **kwargs) | |
iter (self, *args, **kwargs) | |
items (self, *args, **kwargs) | |
clear (self) | |
append (self, *args, **kwargs) | |
extend (self, *args, **kwargs) | |
__setitem__ (self, index, item) | |
__delitem__ (self, index) | |
insert (self, index, item) | |
remove (self, node) | |
Public Member Functions inherited from pyfortool.variables.Variables | |
varList (self) | |
attachArraySpecToEntity (self) | |
checkImplicitNone (self, mustRaise=False) | |
checkIntent (self, mustRaise=False) | |
removeVar (self, varList, simplify=False) | |
addVar (self, varList) | |
addModuleVar (self, moduleVarList) | |
showUnusedVar (self) | |
removeUnusedLocalVar (self, excludeList=None, simplify=False) | |
addExplicitArrayBounds (self, node=None) | |
addArrayParentheses (self) | |
addArrayParenthesesInNode (self, node) | |
modifyAutomaticArrays (self, declTemplate=None, startTemplate=None, endTemplate=None) | |
findIndexArrayBounds (self, arr, index, loopVar) | |
arrayR2parensR (self, namedE, table) | |
findArrayBounds (self, arr, loopVar, extraVarList=None) | |
renameVar (self, oldName, newName) | |
removeVarIfUnused (self, varList, excludeDummy=False, excludeModule=False, simplify=False) | |
isVarUsed (self, varList, exactScope=False, dummyAreAlwaysUsed=False) | |
addArgInTree (self, varName, declStmt, pos, stopScopes, moduleVarList=None, otherNames=None, parser=None, parserOptions=None, wrapH=False) | |
Public Member Functions inherited from pyfortool.cosmetics.Cosmetics | |
upperCase (self) | |
lowerCase (self) | |
indent (self, nodeToUpdate=None, indentProgramunit=0, indentBranch=2, exclDirectives=None) | |
removeEmptyLines (self) | |
removeComments (self, exclDirectives=None, pattern=None) | |
updateContinuation (self, nodeToUpdate=None, align=True, removeALL=False, addBegin=True, removeBegin=False) | |
updateSpaces (self, beforeOp=1, afterOp=1, inOperator=True, beforeComma=0, afterComma=1, beforeParenthesis=0, afterParenthesis=0, beforeAffectation=1, afterAffectation=1, inAffectation=True, beforeRangeDelim=0, afterRangeDelim=0, beforeUseDelim=0, afterUseDelim=1, beforeDeclDelim=1, afterDeclDelim=1, inDeclDelim=True, afterTypeDecl=1, beforeEqDo=0, afterEqDo=0, beforeEqCall=0, afterEqCall=0, beforeEqInit=0, afterEqInit=0, beforeEndcnt=1, afterBegincnt=1, afterIfwherecase=1, beforeThen=1, beforeIfaction=1, afterProgunit=1, endOfLine=True, afterName=0, inName=True, beforeCmdsep=0, afterCmdsep=1, adjacentKeywords=__NO_VALUE__, afterKeywords=__NO_VALUE__) | |
changeIfStatementsInIfConstructs (self, singleItem=None) | |
removeEmptyCONTAINS (self) | |
Public Member Functions inherited from pyfortool.applications.Applications | |
splitModuleRoutineFile (self) | |
buildModi (self) | |
deleteNonColumnCallsPHYEX (self, simplify=False) | |
convertTypesInCompute (self) | |
deleteDrHook (self, simplify=False) | |
addDrHook (self) | |
deleteBudgetDDH (self, simplify=False) | |
deleteRoutineCallsMesoNHGPU (self, simplify=True) | |
addMPPDB_CHECKS (self, printsMode=False) | |
addStack (self, model, stopScopes, parser=None, parserOptions=None, wrapH=False) | |
inlineContainedSubroutinesPHYEX (self, simplify=False) | |
removeIJDim (self, stopScopes, parser=None, parserOptions=None, wrapH=False, simplify=False) | |
removePHYEXUnusedLocalVar (self, excludeList=None, simplify=False) | |
expandAllArraysPHYEX (self, concurrent=False) | |
mathFunctoBRFunc (self) | |
shumanFUNCtoCALL (self) | |
buildACCTypeHelpers (self) | |
Public Member Functions inherited from pyfortool.statements.Statements | |
isNodeInProcedure (self, node, procList) | |
isNodeInCall (self, node) | |
removeCall (self, callName, simplify=False) | |
removePrints (self, simplify=False) | |
removeArraySyntax (self, concurrent=False, useMnhExpand=True, everywhere=True, loopVar=None, reuseLoop=True, funcList=None, updateMemSet=False, updateCopy=False, addAccIndependentCollapse=True) | |
inlineContainedSubroutines (self, simplify=False, loopVar=None) | |
inline (self, subContained, callStmt, mainScope, simplify=False, loopVar=None) | |
setFalseIfStmt (self, flags, simplify=False) | |
evalFalseIfStmt (self, nodes, simplify=False) | |
checkOpInCall (self, mustRaise=False) | |
insertStatement (self, stmt, first) | |
removeStmtNode (self, nodes, simplifyVar, simplifyStruct) | |
removeConstructNode (self, node, simplifyVar, simplifyStruct) | |
removeFromList (self, item, itemPar) | |
Public Member Functions inherited from pyfortool.cpp.Cpp | |
applyCPPifdef (self, keys) | |
Public Member Functions inherited from pyfortool.openacc.Openacc | |
removeACC (self) | |
removebyPassDOCONCURRENT (self) | |
craybyPassDOCONCURRENT (self) | |
addACCData (self) | |
addACCRoutineSeq (self, stopScopes) | |
Public Attributes | |
fortran | |
xml | |
Public Attributes inherited from pyfortool.scope.PYFTscope | |
tree | |
path | |
Public Attributes inherited from pyfortool.scope.ElementView | |
text | |
tail | |
Public Attributes inherited from pyfortool.variables.Variables |
Static Public Attributes | |
list | DEFAULT_FXTRAN_OPTIONS = ['-construct-tag', '-no-include', '-no-cpp', '-line-length', '9999'] |
list | MANDATORY_FXTRAN_OPTIONS = ['-construct-tag'] |
SHARED_TREE = None | |
NO_PARALLEL_LOCK = None | |
PARALLEL_FILE_LOCKS = None | |
Static Public Attributes inherited from pyfortool.scope.PYFTscope | |
dict | SCOPE_STMT |
dict | SCOPE_CONSTRUCT |
Protected Member Functions | |
_rename (self, mod) | |
Protected Member Functions inherited from pyfortool.scope.PYFTscope | |
_getNodePath (self, node) | |
Protected Member Functions inherited from pyfortool.scope.ElementView | |
_virtual (self) | |
_getIndex (self, index) | |
Protected Member Functions inherited from pyfortool.variables.Variables | |
_normalizeScopeVar (self, scopeVarList) | |
_normalizeUniqVar (self, scopeVarList) | |
Protected Attributes | |
_filename | |
_originalName | |
_output | |
_parser | |
_parserOptions | |
Protected Attributes inherited from pyfortool.scope.PYFTscope | |
_mainScope | |
_path | |
_parentScope | |
_cacheParent | |
Protected Attributes inherited from pyfortool.scope.ElementView | |
_excludeContains | |
_xml | |
_virtual | |
Protected Attributes inherited from pyfortool.variables.Variables | |
_varList | |
_excludeContains | |
Additional Inherited Members | |
Static Public Member Functions inherited from pyfortool.scope.PYFTscope | |
normalizeScope (scopePath) | |
Static Public Member Functions inherited from pyfortool.variables.Variables | |
varSpec2stmt (varSpec) | |
Static Public Member Functions inherited from pyfortool.statements.Statements | |
createDoConstruct (loopVariables, indent=0, concurrent=False) | |
insertInList (pos, item, parent) | |
Static Protected Member Functions inherited from pyfortool.scope.PYFTscope | |
_getNodeName (node) | |
This class extends the PYFTscope one by adding file support (read/write)
Definition at line 57 of file pyfortool.py.
pyfortool.pyfortool.PYFT.__init__ | ( | self, | |
filename, | |||
output = None , |
|||
parser = None , |
|||
parserOptions = None , |
|||
verbosity = None , |
|||
wrapH = False , |
|||
tree = None , |
|||
enableCache = False |
|||
) |
:param filename: Input file name containing FORTRAN code :param output: Output file name, None to replace input file :param parser: path to the fxtran parser :param parserOptions: dictionnary holding the parser options :param verbosity: if not None, sets the verbosity level :param wrapH: if True, content of .h file is put in a .F90 file (to force fxtran to recognize it as free form) inside a module (to enable the reading of files containing only a code part) :param tree: an optional Tree instance :param enableCache: True to cache node parents
Reimplemented from pyfortool.scope.PYFTscope.
Definition at line 68 of file pyfortool.py.
pyfortool.pyfortool.PYFT.__enter__ | ( | self | ) |
Context manager
Definition at line 158 of file pyfortool.py.
pyfortool.pyfortool.PYFT.__exit__ | ( | self, | |
excType, | |||
excVal, | |||
excTb | |||
) |
Context manager
Definition at line 164 of file pyfortool.py.
|
protected |
The output file will have a modified extension. :param mod: function to apply to the file extension
Definition at line 203 of file pyfortool.py.
pyfortool.pyfortool.PYFT.close | ( | self | ) |
Closes the FORTRAN file
Definition at line 170 of file pyfortool.py.
pyfortool.pyfortool.PYFT.fortran | ( | self | ) |
Returns the FORTRAN as a string
Definition at line 185 of file pyfortool.py.
pyfortool.pyfortool.PYFT.lockFile | ( | cls, | |
filename | |||
) |
Acquire lock for filename :param filename: name of the file whose lock must be acquired
Definition at line 130 of file pyfortool.py.
pyfortool.pyfortool.PYFT.renameLower | ( | self | ) |
The output file will have a lower case extension
Definition at line 197 of file pyfortool.py.
pyfortool.pyfortool.PYFT.renameUpper | ( | self | ) |
The output file will have an upper case extension
Definition at line 191 of file pyfortool.py.
pyfortool.pyfortool.PYFT.setParallel | ( | cls, | |
tree, | |||
clsLock = None , |
|||
clsRLock = None |
|||
) |
Prepare the class to be used to instanciate parallel objects :param tree: Tree object shared among processes :param clsLock: class to use for Lock (defaults to multiprocessing.Lock) :param clsRLock: class to use for RLock (defaults to multiprocessing.RLock)
Definition at line 113 of file pyfortool.py.
pyfortool.pyfortool.PYFT.unlockFile | ( | cls, | |
filename, | |||
silence = False |
|||
) |
Release lock for filename :param filename: name of the file whose lock must be acquired :param silence: do not raise exception if file is already unlocked
Definition at line 142 of file pyfortool.py.
pyfortool.pyfortool.PYFT.write | ( | self | ) |
Writes the output FORTRAN file
Definition at line 216 of file pyfortool.py.
pyfortool.pyfortool.PYFT.writeXML | ( | self, | |
filename | |||
) |
Writes the output XML file :param filename: XML output file name
Definition at line 231 of file pyfortool.py.
pyfortool.pyfortool.PYFT.xml | ( | self | ) |
Returns the xml as a string
Definition at line 178 of file pyfortool.py.
|
protected |
Definition at line 87 of file pyfortool.py.
|
protected |
Definition at line 88 of file pyfortool.py.
|
protected |
Definition at line 90 of file pyfortool.py.
|
protected |
Definition at line 91 of file pyfortool.py.
|
protected |
Definition at line 97 of file pyfortool.py.
|
static |
Definition at line 61 of file pyfortool.py.
pyfortool.pyfortool.PYFT.fortran |
Definition at line 222 of file pyfortool.py.
|
static |
Definition at line 62 of file pyfortool.py.
|
static |
Definition at line 64 of file pyfortool.py.
|
static |
Definition at line 65 of file pyfortool.py.
|
static |
Definition at line 63 of file pyfortool.py.
pyfortool.pyfortool.PYFT.xml |
Definition at line 237 of file pyfortool.py.