From c36ff9fcc8ccb218ab9fc49997d6d839489c2125 Mon Sep 17 00:00:00 2001 From: Matthew Thompson Date: Tue, 3 Oct 2023 10:30:02 -0400 Subject: [PATCH] Fixes for NVHPC --- Apps/Regrid_Util.F90 | 2 +- CHANGELOG.md | 2 ++ docs/tutorial/driver_app/Example_Driver.F90 | 1 + generic/OpenMP_Support.F90 | 5 ++++- gridcomps/Cap/FargparseCLI.F90 | 8 ++++---- .../History/MAPL_HistoryTrajectoryMod.F90 | 6 +++--- .../MAPL_HistoryTrajectoryMod_smod.F90 | 4 ++-- griddedio/TileIO.F90 | 20 +++++++++---------- 8 files changed, 27 insertions(+), 21 deletions(-) diff --git a/Apps/Regrid_Util.F90 b/Apps/Regrid_Util.F90 index 7a247d05c615..5ce9f17d2d44 100644 --- a/Apps/Regrid_Util.F90 +++ b/Apps/Regrid_Util.F90 @@ -338,7 +338,7 @@ Program Regrid_Util subroutine main() - type(regrid_support) :: support + type(regrid_support), target :: support type(ESMF_VM) :: vm ! ESMF Virtual Machine diff --git a/CHANGELOG.md b/CHANGELOG.md index 71812fc383f8..05a14a0a6bc9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed +- Various fixes for NVHPCP work + ### Removed ### Deprecated diff --git a/docs/tutorial/driver_app/Example_Driver.F90 b/docs/tutorial/driver_app/Example_Driver.F90 index f974d002a624..b967506b94c0 100644 --- a/docs/tutorial/driver_app/Example_Driver.F90 +++ b/docs/tutorial/driver_app/Example_Driver.F90 @@ -5,6 +5,7 @@ program Example_Driver use MPI use MAPL + use mapl_CapOptionsMod, only: MAPL_CapOptions implicit none type (MAPL_Cap) :: cap diff --git a/generic/OpenMP_Support.F90 b/generic/OpenMP_Support.F90 index a6919efa4182..a00d53e3c4b8 100644 --- a/generic/OpenMP_Support.F90 +++ b/generic/OpenMP_Support.F90 @@ -595,6 +595,7 @@ subroutine copy_callbacks(state, multi_states, rc) type(CallbackMethodWrapper), pointer :: wrapper type(CallbackMap), pointer :: callbacks type(CallbackMapIterator) :: iter + procedure(), pointer :: userRoutine n_multi = size(multi_states) call get_callbacks(state, callbacks, _RC) @@ -604,7 +605,9 @@ subroutine copy_callbacks(state, multi_states, rc) do while (iter /= e) wrapper => iter%second() do i = 1, n_multi - call ESMF_MethodAdd(multi_states(i), label=iter%first(), userRoutine=wrapper%userRoutine, _RC) + !call ESMF_MethodAdd(multi_states(i), label=iter%first(), userRoutine=wrapper%userRoutine, _RC) + userRoutine => wrapper%userRoutine + call ESMF_MethodAdd(multi_states(i), label=iter%first(), userRoutine=userRoutine, _RC) end do call iter%next() end do diff --git a/gridcomps/Cap/FargparseCLI.F90 b/gridcomps/Cap/FargparseCLI.F90 index 68360a1b0a5f..a20695b722fb 100644 --- a/gridcomps/Cap/FargparseCLI.F90 +++ b/gridcomps/Cap/FargparseCLI.F90 @@ -8,7 +8,7 @@ module MAPL_FargparseCLIMod use gFTL2_IntegerVector use mapl_KeywordEnforcerMod use mapl_ExceptionHandling - use mapl_CapOptionsMod, only: MAPL_CapOptions !Rename is for backward compatibility. Remove renaming for 3.0 + use mapl_CapOptionsMod, only: MAPL_CapOptions_ => MAPL_CapOptions !Rename is for backward compatibility. Remove renaming for 3.0 implicit none private @@ -45,7 +45,7 @@ subroutine I_extraoptions(parser, rc) function new_CapOptions_from_fargparse(unusable, dummy, extra, rc) result (cap_options) class(KeywordEnforcer), optional, intent(in) :: unusable - type (MAPL_CapOptions) :: cap_options + type (MAPL_CapOptions_) :: cap_options character(*), intent(in) :: dummy !Needed for backward compatibility. Remove after 3.0 procedure(I_extraoptions), optional :: extra integer, optional, intent(out) :: rc @@ -230,7 +230,7 @@ end subroutine add_command_line_options subroutine fill_cap_options(fargparseCLI, cap_options, unusable, rc) class(MAPL_FargparseCLI), intent(inout) :: fargparseCLI - type(MAPL_CapOptions), intent(out) :: cap_options + type(MAPL_CapOptions_), intent(out) :: cap_options class(KeywordEnforcer), optional, intent(in) :: unusable integer, optional, intent(out) :: rc integer :: status @@ -416,7 +416,7 @@ end subroutine fill_cap_options !Function for backward compatibility. Remove for 3.0 function old_CapOptions_from_Fargparse( fargparseCLI, unusable, rc) result (cap_options) - type (MAPL_CapOptions) :: cap_options + type (MAPL_CapOptions_) :: cap_options type (MAPL_FargparseCLI), intent(inout) :: fargparseCLI class (KeywordEnforcer), optional, intent(in) :: unusable integer, optional, intent(out) :: rc diff --git a/gridcomps/History/MAPL_HistoryTrajectoryMod.F90 b/gridcomps/History/MAPL_HistoryTrajectoryMod.F90 index aa5755f6aaf7..f9722b7693f4 100644 --- a/gridcomps/History/MAPL_HistoryTrajectoryMod.F90 +++ b/gridcomps/History/MAPL_HistoryTrajectoryMod.F90 @@ -78,7 +78,7 @@ module HistoryTrajectoryMod integer :: obsfile_Te_index logical :: is_valid contains - procedure :: initialize + procedure :: initialize => initialize_ procedure :: reinitialize procedure :: create_variable => create_metadata_variable procedure :: create_file_handle @@ -113,7 +113,7 @@ module function HistoryTrajectory_from_config(config,string,clock,rc) result(tra integer, optional, intent(out) :: rc end function HistoryTrajectory_from_config - module subroutine initialize(this,items,bundle,timeInfo,vdata,recycle_track,rc) + module subroutine initialize_(this,items,bundle,timeInfo,vdata,recycle_track,rc) class(HistoryTrajectory), intent(inout) :: this type(GriddedIOitemVector), target, intent(inout) :: items type(ESMF_FieldBundle), intent(inout) :: bundle @@ -121,7 +121,7 @@ module subroutine initialize(this,items,bundle,timeInfo,vdata,recycle_track,rc) type(VerticalData), optional, intent(inout) :: vdata logical, optional, intent(inout) :: recycle_track integer, optional, intent(out) :: rc - end subroutine initialize + end subroutine initialize_ module subroutine reinitialize(this,rc) class(HistoryTrajectory), intent(inout) :: this diff --git a/gridcomps/History/MAPL_HistoryTrajectoryMod_smod.F90 b/gridcomps/History/MAPL_HistoryTrajectoryMod_smod.F90 index 3760c8b54cbf..9a4e30309310 100644 --- a/gridcomps/History/MAPL_HistoryTrajectoryMod_smod.F90 +++ b/gridcomps/History/MAPL_HistoryTrajectoryMod_smod.F90 @@ -140,7 +140,7 @@ end procedure - module procedure initialize + module procedure initialize_ integer :: status type(ESMF_Grid) :: grid type(variable) :: v @@ -223,7 +223,7 @@ _RETURN(_SUCCESS) - end procedure initialize + end procedure initialize_ module procedure reinitialize diff --git a/griddedio/TileIO.F90 b/griddedio/TileIO.F90 index 7b55aca9609c..88a5a518c1d5 100644 --- a/griddedio/TileIO.F90 +++ b/griddedio/TileIO.F90 @@ -12,6 +12,10 @@ module MAPL_TileIOMod private + type tile_buffer + real, allocatable :: ptr(:) + end type + type, public :: MAPL_TileIO private type(ESMF_FieldBundle) :: bundle @@ -22,10 +26,6 @@ module MAPL_TileIOMod procedure :: process_data_from_file end type MAPL_TileIO - type tile_buffer - real, allocatable :: ptr(:) - end type - interface MAPL_TileIO module procedure new_MAPL_TileIO end interface MAPL_TileIO @@ -40,13 +40,13 @@ function new_MAPL_TileIO(bundle,read_collection_id) result(TileIO) TileIO%bundle = bundle TileIO%read_collection_id = read_collection_id end function - + subroutine request_data_from_file(this,filename,timeindex,rc) class(MAPL_TileIO), intent(inout) :: this character(len=*), intent(in) :: filename integer, intent(in) :: timeindex integer, intent(out), optional :: rc - + integer :: status integer :: num_vars,i,rank type(ArrayReference) :: ref @@ -76,10 +76,10 @@ subroutine request_data_from_file(this,filename,timeindex,rc) allocate(this%tile_buffer(i)%ptr((0)),_STAT) end if ref = ArrayReference(this%tile_buffer(i)%ptr) - call i_clients%collective_prefetch_data(this%read_collection_id, filename, trim(names(i)), ref, & + call i_clients%collective_prefetch_data(this%read_collection_id, filename, trim(names(i)), ref, & start=local_start, global_start=global_start, global_count = global_count) - deallocate(local_start,global_start,global_count) - else + deallocate(local_start,global_start,global_count) + else _FAIL("rank >1 tile fields not supported") end if end do @@ -117,5 +117,5 @@ subroutine process_data_from_file(this,rc) deallocate(this%tile_buffer) _RETURN(_SUCCESS) end subroutine - + end module