Skip to content

AmrLevel Tutorial & SP: Fortran Types in Memorypool #1183

Open
@ax3l

Description

@ax3l

The AmrLevel tutorial is hard-coded in double precision, which means it fails to build against AMReX with single-precision support since the memory pool bindings in Fortran only expose single or double precision routines.

Example reproducer with CMake (but not specific to CMake):

cmake .. -DENABLE_TUTORIALS=ON -DENABLE_DP=OFF
make tutorials VERBOSE=ON

(Seen with both GCC 7.5 and Clang 6.0 on my Ubuntu 18.04.)

amrex/Tutorials/Amr/Advection_AmrLevel/Source/Src_3d/slope_3d.f90:146:72:     call bl_allocate(dsgn, lo(1), hi(1), lo(2), hi(2), lo(3)-1, hi(3)+1)
                                                                        1
Error: There is no specific subroutine for the generic 'bl_allocate' at (1)

The solution is probably to expose bindings to SP and DP in the Fortran memory pool interfaces, independent of the build type. (In the practical case, a user might use SP by default and has some selected helper functionality in DP for numerical reasons.)

Refs.:

cc @WeiqunZhang @mic84

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions