7.1.1.2.1.3.1.3. pycropml.transpiler.rules.fortranRules module¶
-
class
pycropml.transpiler.rules.fortranRules.
FortranRules
[source]¶ Bases:
pycropml.transpiler.rules.generalRule.GeneralRule
-
binary_op
= {'!=': '.NE.', '*': '*', '**': '**', '+': '+', '-': '-', '/': '/', '<': '.LT.', '<=': '.LE.', '==': '.EQ.', '>': '.GT.', '>=': '.GE.', 'and': '.AND.', 'not': '.NOT..', 'or': '.OR.'}¶
-
functions
= {'datetime': {'datetime': <function FortranRules.<lambda>>}, 'io': {'print': <function translatePrint>, 'read': 'Console.ReadLine', 'read_file': 'File.ReadAllText', 'write_file': 'File.WriteAllText'}, 'math': {'acos': 'ACOS', 'asin': 'ASIN', 'atan': 'ATAN', 'ceil': <function translateCeil>, 'cos': 'COS', 'exp': 'EXP', 'ln': 'LOG', 'log': 'LOG', 'pow': <function translatePow>, 'sin': 'SIN', 'sqrt': 'SQRT', 'tan': 'TAN'}, 'system': {'abs': 'ABS', 'max': 'MAX', 'min': <function translateMIN>, 'modulo': 'modulo', 'pow': <function translatePow>, 'round': 'Round'}}¶
-
methods
= {'array': {'append': <function FortranRules.<lambda>>, 'len': 'SIZE'}, 'dict': {'len': 'SIZE'}, 'float': {'int': 'INT'}, 'int': {'float': 'REAL'}, 'list': {'append': <function translateAppend>, 'contains?': <function translateContains>, 'index': <function translateIndex>, 'len': 'SIZE', 'not contains?': <function translateNotContains>, 'pop': <function translatePop>, 'sum': 'sum'}, 'str': {'find': <function translateFind>, 'int': 'INT'}}¶ dependencies = {
- ‘list’: {
- ‘index’: ‘list_sub’, ‘append’: ‘list_sub’
}
}
-
types
= {'array': '%s, DIMENSION(%s)', 'bool': 'LOGICAL', 'datetime': 'CHARACTER(65)', 'float': 'REAL', 'int': 'INTEGER', 'list': '%s,DIMENSION (:), ALLOCATABLE::', 'str': 'CHARACTER(65)'}¶
-
unary_op
= {'+': '+', '-': '-', 'not': '.NOT. ', '~': '~'}¶
-