diff --git a/CMakeLists.txt b/CMakeLists.txt index c66e3ed..21d1b3c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,9 @@ cmake_minimum_required(VERSION 3.4 FATAL_ERROR) +if (DEFINED OpenCMISSLibs_DIR) + set(CMAKE_PROJECT_INCLUDE_BEFORE ${OpenCMISSLibs_DIR}/opencmisslibs-preconfig.cmake) +endif () + project(Stokes_ALE VERSION 1.0 LANGUAGES C Fortran) find_package(OpenCMISSLibs 1.3.0 REQUIRED COMPONENTS Iron CONFIG) diff --git a/src/fortran/stokes_ale.F90 b/src/fortran/stokes_ale.F90 index 29d931b..80f39a0 100644 --- a/src/fortran/stokes_ale.F90 +++ b/src/fortran/stokes_ale.F90 @@ -1,11 +1,13 @@ -PROGRAM stokes_ale +PROGRAM StokesALEExample USE OpenCMISS USE OpenCMISS_Iron #ifndef NOMPIMOD USE MPI #endif + IMPLICIT NONE + #ifdef NOMPIMOD #include "mpif.h" #endif @@ -19,6 +21,7 @@ PROGRAM stokes_ale REAL(CMISSRP), PARAMETER :: WIDTH=1.0_CMISSRP REAL(CMISSRP), PARAMETER :: LENGTH=1.0_CMISSRP + INTEGER(CMISSIntg), PARAMETER :: ContextUserNumber=1 INTEGER(CMISSIntg), PARAMETER :: CoordinateSystemUserNumber=1 INTEGER(CMISSIntg), PARAMETER :: RegionUserNumber=2 INTEGER(CMISSIntg), PARAMETER :: MeshUserNumber=3 @@ -130,6 +133,7 @@ PROGRAM stokes_ale TYPE(cmfe_RegionType) :: Region TYPE(cmfe_RegionType) :: WorldRegion + TYPE(cmfe_ComputationEnvironmentType) :: computationEnvironment TYPE(cmfe_CoordinateSystemType) :: CoordinateSystem TYPE(cmfe_CoordinateSystemType) :: WorldCoordinateSystem TYPE(cmfe_BasisType) :: BasisGeometry @@ -188,8 +192,9 @@ PROGRAM stokes_ale !CHECK COMPUTATIONAL NODE !Get the computational nodes information - CALL cmfe_ComputationalNumberOfNodesGet(NumberOfComputationalNodes,Err) - CALL cmfe_ComputationalNodeNumberGet(ComputationalNodeNumber,Err) + CALL cmfe_ComputationEnvironment_Initialise(computationEnvironment,err) + CALL cmfe_ComputationEnvironment_NumberOfWorldNodesGet(computationEnvironment,numberOfComputationalNodes,err) + CALL cmfe_ComputationEnvironment_WorldNodeNumberGet(computationEnvironment,computationalNodeNumber,err) ! !================================================================================================================================ @@ -885,4 +890,4 @@ PROGRAM stokes_ale WRITE(*,'(A)') "Program successfully completed." STOP -END PROGRAM stokes_ale +END PROGRAM StokesALEExample