(self, routine)
return code_list
Returns the opening statements of the fortran routine
Returns the opening statements of the fortran routine
Returns the opening statements of the fortran routine
def _get_routine_opening(self, routine):
        """
        Returns the opening statements of the fortran routine
        """
        code_list = []
        if len(routine.results) > 1:
            raise CodeGenError(
                "Fortran only supports a single or no return value.")
        elif len(routine.results) == 1:
            result = routine.results[0]
            code_list.append(result.get_datatype('fortran'))
            code_list.append("function")
        else:
            code_list.append("subroutine")

        args = ", ".join("%s" % self._get_symbol(arg.name)
                for arg in routine.arguments)

        # name of the routine + arguments
        code_list.append("%s(%s)\n" % (routine.name, args))
        code_list = [ " ".join(code_list) ]

        code_list.append('implicit none\n')
        return code_list
def _get_routine_opening ( self , routine ) : code_list = [ ] if len ( routine . results ) > 1 : raise CodeGenError ( "Fortran only supports a single or no return value." ) elif len ( routine . results ) == 1 : result = routine . results [ 0 ] code_list . append ( result . get_datatype ( 'fortran' ) ) code_list . append ( "function" ) else : code_list . append ( "subroutine" ) args = ", " . join ( "%s" % self . _get_symbol ( arg . name ) for arg in routine . arguments ) # name of the routine + arguments code_list . append ( "%s(%s)\n" % ( routine . name , args ) ) code_list = [ " " . join ( code_list ) ] code_list . append ( 'implicit none\n' ) return code_list