diff --git a/CMakeLists.txt b/CMakeLists.txt index 6dfc07b8..9ade093b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,6 @@ cmake_minimum_required(VERSION 3.20.2) -project(Kaiju Fortran) +project(Kaiju Fortran C) +#K: Adding C to project to deal w/ issues w/ most recent HDF (10/13/25) # add and search for pfunit (fingers crossed) list(APPEND CMAKE_PREFIX_PATH "./external") diff --git a/cmake/compilers.cmake b/cmake/compilers.cmake index a4089d60..719249b0 100644 --- a/cmake/compilers.cmake +++ b/cmake/compilers.cmake @@ -83,7 +83,12 @@ if(CMAKE_Fortran_COMPILER_ID MATCHES Intel) #Base string(APPEND CMAKE_Fortran_FLAGS " -fPIC -fpconstant") #Production - set(PROD "-align array64byte -align rec32byte -no-prec-div -fast-transcendentals") + set(PROD "-align array64byte -align rec32byte -no-prec-div") + if (CMAKE_Fortran_COMPILER_VERSION VERSION_LESS 23.1) + #Fast transcendentals removed in ifx + string(APPEND PROD " -fast-transcendentals") + endif() + #Production with Debug Info set(PRODWITHDEBUGINFO "-traceback -debug all -align array64byte -align rec32byte -no-prec-div -fast-transcendentals") #Debug @@ -126,7 +131,7 @@ if(CMAKE_Fortran_COMPILER_ID MATCHES Intel) endif() #Check Intel Fortran version - if(NOT ALLOW_INVALID_COMPILERS AND CMAKE_Fortran_COMPILER_VERSION VERSION_GREATER "2021.9") + if(NOT ALLOW_INVALID_COMPILERS AND CMAKE_Fortran_COMPILER_VERSION VERSION_GREATER "2021.9" AND CMAKE_Fortran_COMPILER_VERSION VERSION_LESS "2025.1") message(FATAL_ERROR "Intel Fortran compilers newer than 2023 (version 2021.8) are not supported. Set the ALLOW_INVALID_COMPILERS variable to ON to force compilation at your own risk.") endif() diff --git a/src/voltron/mpi/modelInterfaces/gamCouple_mpi_V2G.F90 b/src/voltron/mpi/modelInterfaces/gamCouple_mpi_V2G.F90 index 910b23b6..e3565753 100644 --- a/src/voltron/mpi/modelInterfaces/gamCouple_mpi_V2G.F90 +++ b/src/voltron/mpi/modelInterfaces/gamCouple_mpi_V2G.F90 @@ -559,13 +559,13 @@ module gamCouple_mpi_V2G subroutine sendGameraCplDataMpi(gCplApp, CouplingTargetT) class(gamCouplerMpi_volt_T), intent(inout) :: gCplApp - real(rp), intent(in) :: CouplingTargetT + real(rp), intent(inout) :: CouplingTargetT call sendShallowCplDataMpi(gCplApp) if(gCplApp%doDeep) call sendDeepCplDataMpi(gCplApp) call sendCplTimeMpi(gCplApp, CouplingTargetT) - end subroutine + end subroutine sendGameraCplDataMpi subroutine sendShallowCplDataMpi(gCplApp) class(gamCouplerMpi_volt_T), intent(inout) :: gCplApp @@ -628,14 +628,14 @@ module gamCouple_mpi_V2G subroutine sendCplTimeMpi(gCplApp, CouplingTargetT) class(gamCouplerMpi_volt_T), intent(inout) :: gCplApp - real(rp), intent(in) :: CouplingTargetT + real(rp), intent(inout) :: CouplingTargetT integer :: ierr ! Send Target Time for next coupling call mpi_bcast(CouplingTargetT,1,MPI_MYFLOAT, gCplApp%myRank, gCplApp%couplingComm, ierr) - end subroutine + end subroutine sendCplTimeMpi end module diff --git a/src/voltron/mpi/volthelpers_mpi.F90 b/src/voltron/mpi/volthelpers_mpi.F90 index 7442fee4..66bf1474 100644 --- a/src/voltron/mpi/volthelpers_mpi.F90 +++ b/src/voltron/mpi/volthelpers_mpi.F90 @@ -107,7 +107,7 @@ module volthelpers_mpi ! chimp data update functions subroutine sendChimpStateData(ebState, vHelpComm) - type(ebState_T), intent(in) :: ebState + type(ebState_T), intent(inout) :: ebState type(MPI_Comm), intent(in) :: vHelpComm integer :: ierr, length @@ -195,7 +195,7 @@ module volthelpers_mpi call mpi_Abort(MPI_COMM_WORLD, 1, ierr) end if - end subroutine + end subroutine sendChimpStateData subroutine recvChimpStateData(ebState, vHelpComm) type(ebState_T), intent(inout) :: ebState @@ -272,7 +272,7 @@ module volthelpers_mpi end subroutine subroutine sendChimpUpdate(vApp) - type(voltAppMpi_T), intent(in) :: vApp + type(voltAppMpi_T), intent(inout) :: vApp integer :: ierr, length character( len = MPI_MAX_ERROR_STRING) :: message @@ -317,7 +317,7 @@ module volthelpers_mpi call mpi_Abort(MPI_COMM_WORLD, 1, ierr) end if - end subroutine + end subroutine sendChimpUpdate subroutine recvChimpUpdate(vApp) type(voltAppMpi_T), intent(inout) :: vApp @@ -374,14 +374,15 @@ module volthelpers_mpi type(voltAppMpi_T), intent(in) :: vApp integer, intent(in) :: rType - integer :: ierr + integer :: ierr,wtf type(MPI_Request) :: helpReq + wtf = rType ! async to match waiting helper nodes - call mpi_Ibcast(rType, 1, MPI_INTEGER, 0, vApp%vHelpComm, helpReq, ierr) + call mpi_Ibcast(wtf, 1, MPI_INTEGER, 0, vApp%vHelpComm, helpReq, ierr) call mpi_wait(helpReq, MPI_STATUS_IGNORE, ierr) - end subroutine + end subroutine vhRequestType subroutine vhReqStep(vApp) type(voltAppMpi_T), intent(inout) :: vApp