Reference Guide  2.5.0
psyclone.f2pygen.DeallocateGen Class Reference
Inheritance diagram for psyclone.f2pygen.DeallocateGen:
Collaboration diagram for psyclone.f2pygen.DeallocateGen:

Public Member Functions

def __init__ (self, parent, content)
 
- Public Member Functions inherited from psyclone.f2pygen.BaseGen
def parent (self)
 
def children (self)
 
def root (self)
 
def add (self, new_object, position=None)
 
def previous_loop (self)
 
def last_declaration (self)
 
def start_parent_loop (self, debug=False)
 

Detailed Description

 Generates a Fortran deallocate statement 

Definition at line 863 of file f2pygen.py.

Constructor & Destructor Documentation

◆ __init__()

def psyclone.f2pygen.DeallocateGen.__init__ (   self,
  parent,
  content 
)
:param parent: node to which to add this DEALLOCATE as a child
:type parent: :py:class:`psyclone.f2pygen.BaseGen`
:param content: string or list of variables to deallocate
:type content: list of strings or a single string

:raises RuntimeError: if `content` is not of correct type

Reimplemented from psyclone.f2pygen.BaseGen.

Definition at line 865 of file f2pygen.py.

865  def __init__(self, parent, content):
866  '''
867  :param parent: node to which to add this DEALLOCATE as a child
868  :type parent: :py:class:`psyclone.f2pygen.BaseGen`
869  :param content: string or list of variables to deallocate
870  :type content: list of strings or a single string
871 
872  :raises RuntimeError: if `content` is not of correct type
873  '''
874  reader = FortranStringReader("deallocate(dummy)")
875  reader.set_format(FortranFormat(True, False)) # free form, strict
876  myline = reader.next()
877  self._decl = fparser1.statements.Deallocate(parent.root, myline)
878  if isinstance(content, str):
879  self._decl.items = [content]
880  elif isinstance(content, list):
881  self._decl.items = content
882  else:
883  raise RuntimeError(
884  f"DeallocateGen expected the content argument to be a str"
885  f" or a list, but found {type(content)}")
886  BaseGen.__init__(self, parent, self._decl)
887 
888 

References psyclone.f2pygen.AllocateGen._decl, psyclone.f2pygen.DeallocateGen._decl, psyclone.f2pygen.BaseDeclGen._decl, psyclone.f2pygen.DeclGen._decl, psyclone.f2pygen.CharDeclGen._decl, and psyclone.f2pygen.TypeDeclGen._decl.


The documentation for this class was generated from the following file: