Ejemplo n.º 1
0
def test_declaration_order():
    args=[
        pyf.Argument('explicit_shape',
            pyf.default_complex, 'out', dimension=('d1', 'd2')),
        pyf.Argument('d2', pyf.default_integer, 'in'),
        pyf.Argument('d1', pyf.default_integer, 'in'),
        ]
    arr_arg = pyf.Subroutine(name='arr_arg', args=args)
    iface = '''\
    interface
        subroutine arr_arg(explicit_shape, d2, d1)
            use fwrap_ktp_mod
            implicit none
            integer(kind=fwi_integer_t), intent(in) :: d2
            integer(kind=fwi_integer_t), intent(in) :: d1
            complex(kind=fwc_complex_t), dimension(d1, d2), intent(out) :: explicit_shape
        end subroutine arr_arg
    end interface
'''
    buf = CodeBuffer()
    fc_wrap.generate_interface(arr_arg, buf)
    compare(iface, buf.getvalue())
Ejemplo n.º 2
0
def test_declaration_order():
    args = [
        pyf.Argument('explicit_shape',
                     pyf.default_complex,
                     'out',
                     dimension=('d1', 'd2')),
        pyf.Argument('d2', pyf.default_integer, 'in'),
        pyf.Argument('d1', pyf.default_integer, 'in'),
    ]
    arr_arg = pyf.Subroutine(name='arr_arg', args=args)
    iface = '''\
    interface
        subroutine arr_arg(explicit_shape, d2, d1)
            use fwrap_ktp_mod
            implicit none
            integer(kind=fwi_integer_t), intent(in) :: d2
            integer(kind=fwi_integer_t), intent(in) :: d1
            complex(kind=fwc_complex_t), dimension(d1, d2), intent(out) :: explicit_shape
        end subroutine arr_arg
    end interface
'''
    buf = CodeBuffer()
    fc_wrap.generate_interface(arr_arg, buf)
    compare(iface, buf.getvalue())
Ejemplo n.º 3
0
 def gen_iface_gen(ast, istr):
     buf = CodeBuffer()
     #ast.generate_interface(buf)
     fc_wrap.generate_interface(ast, buf)
     compare(istr, buf.getvalue())
Ejemplo n.º 4
0
 def gen_iface_gen(ast, istr):
     buf = CodeBuffer()
     #ast.generate_interface(buf)
     fc_wrap.generate_interface(ast, buf)
     compare(istr, buf.getvalue())