Added a sample for testing the Fortran interface
This commit is contained in:
4
samples/fortrantest/CMakeLists.txt
Normal file
4
samples/fortrantest/CMakeLists.txt
Normal file
@@ -0,0 +1,4 @@
|
||||
enable_language(Fortran)
|
||||
|
||||
add_executable(fortrantest main.f90)
|
||||
target_link_libraries(fortrantest astaroth_core)
|
23
samples/fortrantest/main.f90
Normal file
23
samples/fortrantest/main.f90
Normal file
@@ -0,0 +1,23 @@
|
||||
program pc
|
||||
use, intrinsic :: iso_c_binding
|
||||
implicit none
|
||||
|
||||
include "astaroth.f90"
|
||||
|
||||
type(AcMeshInfo) :: info
|
||||
type(c_ptr) :: device
|
||||
|
||||
print *, "Num int params"
|
||||
print *, AC_NUM_INT_PARAMS
|
||||
|
||||
! Setup config
|
||||
info%int_params(AC_nx + 1) = 128
|
||||
info%int_params(AC_ny + 1) = 128
|
||||
info%int_params(AC_nz + 1) = 128
|
||||
call acupdatebuiltinparams(info)
|
||||
|
||||
call acdevicecreate(0, info, device)
|
||||
call acdeviceprintinfo(device)
|
||||
call acdevicedestroy(device)
|
||||
|
||||
end program
|
Reference in New Issue
Block a user