summaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
authorschnetter <schnetter@17b73243-c579-4c4c-a9d2-2d5706c11dac>2004-01-19 14:22:04 +0000
committerschnetter <schnetter@17b73243-c579-4c4c-a9d2-2d5706c11dac>2004-01-19 14:22:04 +0000
commita871263329e969b92a3835a06286df9ee2574e3d (patch)
tree173e1678f7e5cad0532c8c553aa0a004b35a9efe /src/include
parent539f0616473c60e35b88780ac7b96d4cba1ef6f9 (diff)
Add (incomplete) Fortran 90 bindings for the flesh functions.
Also, detect Fortran 90 inter-module dependencies automatically. git-svn-id: http://svn.cactuscode.org/flesh/trunk@3524 17b73243-c579-4c4c-a9d2-2d5706c11dac
Diffstat (limited to 'src/include')
-rw-r--r--src/include/cctk.F9017
-rw-r--r--src/include/cctk_ActiveThorns.F90105
-rw-r--r--src/include/cctk_Banner.F9021
-rw-r--r--src/include/cctk_Cache.F9023
-rw-r--r--src/include/cctk_Comm.F90160
-rw-r--r--src/include/cctk_CommandLine.F9030
-rw-r--r--src/include/cctk_Complex.F9014
-rw-r--r--src/include/cctk_Constants.F9013
-rw-r--r--src/include/cctk_Coord.F90147
-rw-r--r--src/include/make.code.defn20
10 files changed, 550 insertions, 0 deletions
diff --git a/src/include/cctk.F90 b/src/include/cctk.F90
new file mode 100644
index 00000000..b2309552
--- /dev/null
+++ b/src/include/cctk.F90
@@ -0,0 +1,17 @@
+! $Header$
+
+! Fortran 90 interface declarations for the flesh routines
+
+#include "cctk.h"
+
+module cctk
+ use cctk_ActiveThorns
+ use cctk_Banner
+ use cctk_Cache
+ use cctk_Comm
+ use cctk_CommandLine
+ use cctk_Complex
+ use cctk_Constants
+ use cctk_Coord
+ implicit none
+end module cctk
diff --git a/src/include/cctk_ActiveThorns.F90 b/src/include/cctk_ActiveThorns.F90
new file mode 100644
index 00000000..a0b2f0b1
--- /dev/null
+++ b/src/include/cctk_ActiveThorns.F90
@@ -0,0 +1,105 @@
+! $Header$
+
+! Fortran 90 interface declarations for the routines
+! which have their C declarations in cctk_ActiveThorns.h
+
+#include "cctk.h"
+
+module cctk_ActiveThorns
+ implicit none
+
+ interface
+
+! This routine has been made a function instead of a subroutine
+! and is declared in cctk.h
+! subroutine CCTK_IsThornActive (ierr, name)
+! implicit none
+! integer ierr
+! character(*) name
+! end subroutine CCTK_IsThornActive
+
+ subroutine CCTK_ThornHandle (handle, name)
+ implicit none
+ CCTK_POINTER_TO_CONST handle
+ character(*) name
+ end subroutine CCTK_ThornHandle
+
+ subroutine CCTK_IsThornActiveH (ierr, handle)
+ implicit none
+ integer ierr
+ CCTK_POINTER_TO_CONST handle
+ end subroutine CCTK_IsThornActiveH
+
+ subroutine CCTK_IsThornCompiled (ierr, name)
+ implicit none
+ integer ierr
+ character(*) name
+ end subroutine CCTK_IsThornCompiled
+
+ subroutine CCTK_IsImplementationActive (ierr, name)
+ implicit none
+ integer ierr
+ character(*) name
+ end subroutine CCTK_IsImplementationActive
+
+ subroutine CCTK_IsImplementationCompiled (ierr, name)
+ implicit none
+ integer ierr
+ character(*) name
+ end subroutine CCTK_IsImplementationCompiled
+
+ subroutine CCTK_ActivatingThorn (thorn, imp)
+ implicit none
+ character(*) thorn
+ character(*) imp
+ end subroutine CCTK_ActivatingThorn
+
+ subroutine CCTK_ImpThornList (thornlist, imp)
+ implicit none
+ CCTK_POINTER thornlist
+ character(*) imp
+ end subroutine CCTK_ImpThornList
+
+ subroutine CCTK_ThornImplementation (imp, thorn)
+ implicit none
+ character(*) imp
+ character(*) thorn
+ end subroutine CCTK_ThornImplementation
+
+ subroutine CCTK_ImplementationThorn (thorn, imp)
+ implicit none
+ character(*) thorn
+ character(*) imp
+ end subroutine CCTK_ImplementationThorn
+
+ subroutine CCTK_ImplementationRequires (implist, imp)
+ implicit none
+ CCTK_POINTER implist
+ character(*) imp
+ end subroutine CCTK_ImplementationRequires
+
+ subroutine CCTK_NumCompiledThorns (num)
+ implicit none
+ integer num
+ end subroutine CCTK_NumCompiledThorns
+
+ subroutine CCTK_NumCompiledImplementations (num)
+ implicit none
+ integer num
+ end subroutine CCTK_NumCompiledImplementations
+
+ subroutine CCTK_CompiledThorn (thorn_name, thorn_index)
+ implicit none
+ character(*) thorn_name
+ integer thorn_index
+ end subroutine CCTK_CompiledThorn
+
+ subroutine CCTK_CompiledImplementation (imp_name, imp_index)
+ implicit none
+ character(*) imp_name
+ integer imp_index
+ end subroutine CCTK_CompiledImplementation
+
+ end interface
+
+end module cctk_ActiveThorns
diff --git a/src/include/cctk_Banner.F90 b/src/include/cctk_Banner.F90
new file mode 100644
index 00000000..d930dc13
--- /dev/null
+++ b/src/include/cctk_Banner.F90
@@ -0,0 +1,21 @@
+! $Header$
+
+! Fortran 90 interface declarations for the routines
+! which have their C declarations in cctk_Banner.h
+
+#include "cctk.h"
+
+module cctk_Banner
+ implicit none
+
+ interface
+
+ subroutine CCTK_RegisterBanner (ierr, banner)
+ implicit none
+ integer ierr
+ character(*) banner
+ end subroutine CCTK_RegisterBanner
+
+ end interface
+
+end module cctk_Banner
diff --git a/src/include/cctk_Cache.F90 b/src/include/cctk_Cache.F90
new file mode 100644
index 00000000..421d1dcd
--- /dev/null
+++ b/src/include/cctk_Cache.F90
@@ -0,0 +1,23 @@
+! $Header$
+
+! Fortran 90 interface declarations for the routines
+! which have their C declarations in cctk_Cache.h
+
+#include "cctk.h"
+
+module cctk_Cache
+ implicit none
+
+ interface
+
+ subroutine Util_CacheMalloc (pointer, index, size, realstart)
+ implicit none
+ CCTK_POINTER pointer
+ integer index
+ integer size
+ CCTK_POINTER realstart
+ end subroutine Util_CacheMalloc
+
+ end interface
+
+end module cctk_Cache
diff --git a/src/include/cctk_Comm.F90 b/src/include/cctk_Comm.F90
new file mode 100644
index 00000000..66aff156
--- /dev/null
+++ b/src/include/cctk_Comm.F90
@@ -0,0 +1,160 @@
+! $Header$
+
+! Fortran 90 interface declarations for the routines
+! which have their C declarations in cctk_Comm.h
+
+#include "cctk.h"
+
+module cctk_Comm
+ implicit none
+
+ interface
+
+ subroutine CCTK_SyncGroup (ierr, GH, group)
+ implicit none
+ integer ierr
+ CCTK_POINTER_TO_CONST GH
+ character(*) group
+ end subroutine CCTK_SyncGroup
+
+ subroutine CCTK_Barrier (ierr, GH)
+ implicit none
+ integer ierr
+ CCTK_POINTER_TO_CONST GH
+ end subroutine CCTK_Barrier
+
+! This routine has been made a function instead of a subroutine
+! and is declared in cctk.h
+! subroutine CCTK_MyProc (ierr, GH)
+! implicit none
+! integer ierr
+! CCTK_POINTER_TO_CONST GH
+! end subroutine CCTK_MyProc
+
+! This routine has been made a function instead of a subroutine
+! and is declared in cctk.h
+! subroutine CCTK_nProcs (ierr, GH)
+! implicit none
+! integer ierr
+! CCTK_POINTER_TO_CONST GH
+! end subroutine CCTK_nProcs
+
+ subroutine CCTK_ParallelInit (ierr, GH)
+ implicit none
+ integer ierr
+ CCTK_POINTER_TO_CONST GH
+ end subroutine CCTK_ParallelInit
+
+ subroutine CCTK_Exit (ierr, GH, retval)
+ implicit none
+ integer ierr
+ CCTK_POINTER GH
+ integer retval
+ end subroutine CCTK_Exit
+
+ subroutine CCTK_Abort (ierr, GH, retval)
+ implicit none
+ integer ierr
+ CCTK_POINTER GH
+ integer retval
+ end subroutine CCTK_Abort
+
+ subroutine CCTK_SetupGH (GH, config, convergence_level)
+ implicit none
+ CCTK_POINTER GH
+ CCTK_POINTER config
+ integer convergence_level
+ end subroutine CCTK_SetupGH
+
+! CCTK_ArrayGroupSizeB is not available from Fortran
+
+ subroutine CCTK_QueryGroupStorageB (ierr, GH, group, groupname)
+ implicit none
+ integer ierr
+ CCTK_POINTER_TO_CONST GH
+ integer group
+ character(*) groupname
+ end subroutine CCTK_QueryGroupStorageB
+
+ subroutine CCTK_GroupDynamicData (ierr, GH, group, data)
+ implicit none
+ integer ierr
+ CCTK_POINTER_TO_CONST GH
+ integer group
+ CCTK_POINTER data
+ end subroutine CCTK_GroupDynamicData
+
+ subroutine CCTK_GroupStorageIncrease &
+ (ierr, GH, n_groups, groups, timelevels, status)
+ implicit none
+ integer ierr
+ CCTK_POINTER_TO_CONST GH
+ integer n_groups
+ integer groups(n_groups)
+ integer timelevels(n_groups)
+ integer status(n_groups)
+ end subroutine CCTK_GroupStorageIncrease
+
+ subroutine CCTK_GroupStorageDecrease &
+ (ierr, GH, n_groups, groups, timelevels, status)
+ implicit none
+ integer ierr
+ CCTK_POINTER_TO_CONST GH
+ integer n_groups
+ integer groups(n_groups)
+ integer timelevels(n_groups)
+ integer status(n_groups)
+ end subroutine CCTK_GroupStorageDecrease
+
+ subroutine CCTK_InterpGridArrays &
+ (ierr, &
+ GH, &
+ N_dims, &
+ local_interp_handle, &
+ param_table_handle, &
+ coord_system_handle, &
+ N_interp_points, &
+ interp_coords_type, &
+ interp_coords, &
+ N_input_arrays, &
+ input_array_indices, &
+ N_output_arrays, &
+ output_array_types, &
+ output_arrays)
+ implicit none
+ integer ierr
+ CCTK_POINTER_TO_CONST GH
+ integer N_dims
+ integer local_interp_handle
+ integer param_table_handle
+ integer coord_system_handle
+ integer N_interp_points
+ integer interp_coords_type
+ CCTK_POINTER_TO_CONST interp_coords(N_dims)
+ integer N_input_arrays
+ CCTK_INT input_array_indices(N_input_arrays)
+ integer N_output_arrays
+ CCTK_INT output_array_types(N_output_arrays)
+ CCTK_POINTER output_arrays(N_output_arrays)
+ end subroutine CCTK_InterpGridArrays
+
+ subroutine CCTK_QueryGroupStorage (ierr, GH, groupname)
+ implicit none
+ integer ierr
+ CCTK_POINTER_TO_CONST GH
+ character(*) groupname
+ end subroutine CCTK_QueryGroupStorage
+
+ subroutine CCTK_QueryGroupStorageI (ierr, GH, group)
+ implicit none
+ integer ierr
+ CCTK_POINTER_TO_CONST GH
+ integer group
+ end subroutine CCTK_QueryGroupStorageI
+
+! CCTK_ArrayGroupSize is not available from Fortran
+! CCTK_ArrayGroupSizeI is not available from Fortran
+
+ end interface
+
+end module cctk_Comm
diff --git a/src/include/cctk_CommandLine.F90 b/src/include/cctk_CommandLine.F90
new file mode 100644
index 00000000..1fc65b0a
--- /dev/null
+++ b/src/include/cctk_CommandLine.F90
@@ -0,0 +1,30 @@
+! $Header$
+
+! Fortran 90 interface declarations for the routines
+! which have their C declarations in cctk_CommandLine.h
+
+#include "cctk.h"
+
+module cctk_CommandLine
+ implicit none
+
+ interface
+
+! This subroutine has been renamed
+! because it conflicts with the name of this module
+ subroutine CCTK_GetCommandLine (argc, outargv)
+ implicit none
+ integer argc
+ CCTK_POINTER outargv
+ end subroutine CCTK_GetCommandLine
+
+ subroutine CCTK_ParameterFileName (ierr, filename, filenamelen)
+ implicit none
+ integer ierr
+ character(*) filename
+ integer filenamelen
+ end subroutine CCTK_ParameterFileName
+
+ end interface
+
+end module cctk_CommandLine
diff --git a/src/include/cctk_Complex.F90 b/src/include/cctk_Complex.F90
new file mode 100644
index 00000000..710347f6
--- /dev/null
+++ b/src/include/cctk_Complex.F90
@@ -0,0 +1,14 @@
+! $Header$
+
+! Fortran 90 interface declarations for the routines
+! which have their C declarations in cctk_Complex.h
+
+#include "cctk.h"
+
+module cctk_Complex
+ implicit none
+
+! Fortran handles complex numbers just fine all by itself
+! and does not need an additional library
+
+end module cctk_Complex
diff --git a/src/include/cctk_Constants.F90 b/src/include/cctk_Constants.F90
new file mode 100644
index 00000000..20025dca
--- /dev/null
+++ b/src/include/cctk_Constants.F90
@@ -0,0 +1,13 @@
+! $Header$
+
+! Fortran 90 interface declarations for the routines
+! which have their C declarations in cctk_Constants.h
+
+#include "cctk.h"
+
+module cctk_Constants
+ implicit none
+
+! This file declares no routines
+
+end module cctk_Constants
diff --git a/src/include/cctk_Coord.F90 b/src/include/cctk_Coord.F90
new file mode 100644
index 00000000..502399b5
--- /dev/null
+++ b/src/include/cctk_Coord.F90
@@ -0,0 +1,147 @@
+! $Header$
+
+! Fortran 90 interface declarations for the routines
+! which have their C declarations in cctk_Coord.h
+
+#include "cctk.h"
+
+module cctk_Coord
+ implicit none
+
+ interface
+
+ subroutine CCTK_CoordDir (dir, name, systemname)
+ implicit none
+ integer dir
+ character(*) name
+ character(*) systemname
+ end subroutine CCTK_CoordDir
+
+ subroutine CCTK_CoordIndex (ierr, dir, name, systemname)
+ implicit none
+ integer ierr
+ integer dir
+ character(*) name
+ character(*) systemname
+ end subroutine CCTK_CoordIndex
+
+ subroutine CCTK_CoordName (name, namelen, dir, systemname)
+ implicit none
+ character(*) name
+ integer namelen
+ integer dir
+ character(*) systemname
+ end subroutine CCTK_CoordName
+
+ subroutine CCTK_CoordRange &
+ (GH, coord_lower, coord_upper, coord_dir, coord_name, system_name)
+ implicit none
+ integer ierr
+ CCTK_POINTER_TO_CONST GH
+ CCTK_REAL coord_lower
+ CCTK_REAL coord_upper
+ integer coord_dir
+ character(*) coord_name
+ character(*) system_name
+ end subroutine CCTK_CoordRange
+
+ subroutine CCTK_CoordRangePhysIndex &
+ (ierr, GH, lower, upper, coorddir, coordname, systemname)
+ implicit none
+ integer ierr
+ CCTK_POINTER_TO_CONST GH
+ integer lower
+ integer upper
+ integer coorddir
+ character(*) coordname
+ character(*) systemname
+ end subroutine CCTK_CoordRangePhysIndex
+
+ subroutine CCTK_CoordRegisterData (ierr, dir, gv, name, systemname)
+ implicit none
+ integer ierr
+ integer dir
+ character(*) gv
+ character(*) name
+ character(*) systemname
+ end subroutine CCTK_CoordRegisterData
+
+ subroutine CCTKi_CoordRegisterSystem &
+ (ierr, dim, implementation, systemname)
+ implicit none
+ integer ierr
+ integer dim
+ character(*) implementation
+ character(*) systemname
+ end subroutine CCTKi_CoordRegisterSystem
+
+ subroutine CCTK_CoordSystemDim (dim, systemname)
+ implicit none
+ integer dim
+ character(*) systemname
+ end subroutine CCTK_CoordSystemDim
+
+ subroutine CCTK_CoordSystemHandle (handle, systemname)
+ implicit none
+ integer handle
+ character(*) systemname
+ end subroutine CCTK_CoordSystemHandle
+
+ subroutine CCTK_CoordSystemName (name, namelen, handle)
+ implicit none
+ character(*) name
+ integer namelen
+ integer handle
+ end subroutine CCTK_CoordSystemName
+
+ subroutine CCTK_CoordLocalRange &
+ (GH, lower, upper, coord_dir, coord_name, system_name)
+ implicit none
+ integer ierr
+ CCTK_POINTER_TO_CONST GH
+ CCTK_REAL lower
+ CCTK_REAL upper
+ integer coord_dir
+ character(*) coord_name
+ character(*) system_name
+ end subroutine CCTK_CoordLocalRange
+
+ subroutine CCTK_CoordRegisterRange &
+ (GH, coord_min, coord_max, coord_dir, coord_name, system_name)
+ implicit none
+ integer ierr
+ CCTK_POINTER_TO_CONST GH
+ CCTK_REAL coord_min
+ CCTK_REAL coord_max
+ integer coord_dir
+ character(*) coord_name
+ character(*) system_name
+ end subroutine CCTK_CoordRegisterRange
+
+ subroutine CCTK_CoordRegisterRangePhysIndex &
+ (ierr, GH, coord_min, coord_max, coord_dir, coord_name, system_name)
+ implicit none
+ integer ierr
+ CCTK_POINTER_TO_CONST GH
+ integer coord_min
+ integer coord_max
+ integer coord_dir
+ character(*) coord_name
+ character(*) system_name
+ end subroutine CCTK_CoordRegisterRangePhysIndex
+
+ subroutine CCTK_NumCoordSystems (num)
+ implicit none
+ integer num
+ end subroutine CCTK_NumCoordSystems
+
+ subroutine CCTK_CoordSystemImplementation (imp, implen, handle)
+ implicit none
+ character(*) imp
+ integer implen
+ integer handle
+ end subroutine CCTK_CoordSystemImplementation
+
+ end interface
+
+end module cctk_Coord
diff --git a/src/include/make.code.defn b/src/include/make.code.defn
new file mode 100644
index 00000000..fdb9a356
--- /dev/null
+++ b/src/include/make.code.defn
@@ -0,0 +1,20 @@
+# Source file for the src/include directory.
+#
+# $Header$
+
+ifneq ($(strip $(F90)),none)
+
+SRCS=\
+cctk.F90\
+cctk_ActiveThorns.F90\
+cctk_Banner.F90\
+cctk_Cache.F90\
+cctk_Comm.F90\
+cctk_CommandLine.F90\
+cctk_Complex.F90\
+cctk_Constants.F90\
+cctk_Coord.F90
+
+else
+SRCS=
+endif