Skip to content

Commit

Permalink
Merge pull request #3014 from GEOS-ESM/mapl3/tclune/cleanup-warnings
Browse files Browse the repository at this point in the history
Further work to reduce compiler warnings.
  • Loading branch information
tclune authored Sep 9, 2024
2 parents 71c8504 + 93b69ab commit 3072c69
Show file tree
Hide file tree
Showing 28 changed files with 81 additions and 453 deletions.
2 changes: 1 addition & 1 deletion generic3g/FieldDictionary.F90
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ function to_item(item_node, rc) result(item)
integer, optional, intent(out) :: rc

integer :: status
type(ESMF_HConfig) :: aliases_node, alias_node
type(ESMF_HConfig) :: aliases_node
character(:), allocatable :: long_name, units, temp_string
type(StringVector) :: aliases
type(ESMF_HConfigIter) :: hconfigIter,hconfigIterBegin,hconfigIterEnd
Expand Down
3 changes: 2 additions & 1 deletion generic3g/InnerMetaComponent.F90
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,8 @@ subroutine attach_inner_meta(self_gc, outer_gc, rc)
type(InnerMetaComponent), pointer :: inner_meta
integer :: status

_SET_NAMED_PRIVATE_STATE(self_gc, InnerMetaComponent, INNER_META_PRIVATE_STATE, inner_meta)
_SET_NAMED_PRIVATE_STATE(self_gc, InnerMetaComponent, INNER_META_PRIVATE_STATE)
_GET_NAMED_PRIVATE_STATE(self_gc, InnerMetaComponent, INNER_META_PRIVATE_STATE, inner_meta)
inner_meta = InnerMetaComponent(self_gc, outer_gc)

_RETURN(_SUCCESS)
Expand Down
2 changes: 0 additions & 2 deletions generic3g/MultiState.F90
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,6 @@ subroutine write_multistate(this, unit, iotype, v_list, iostat, iomsg)
integer, intent(out) :: iostat
character(*), intent(inout) :: iomsg

integer :: status

#ifndef __GFORTRAN__
write(unit,*, iostat=iostat, iomsg=iomsg) 'IMPORT:', this%importState
write(unit,*, iostat=iostat, iomsg=iomsg) 'EXPORT:', this%exportState
Expand Down
2 changes: 1 addition & 1 deletion generic3g/OuterMetaComponent.F90
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ module mapl3g_OuterMetaComponent
use gFTL2_StringVector
use mapl_keywordEnforcer, only: KE => KeywordEnforcer
use esmf
use pflogger, only: logging, Logger
use pflogger, only: Logger

implicit none
private
Expand Down
3 changes: 1 addition & 2 deletions generic3g/OuterMetaComponent/attach_outer_meta.F90
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,8 @@ module subroutine attach_outer_meta(gridcomp, rc)
integer, optional, intent(out) :: rc

integer :: status
type(OuterMetaComponent), pointer :: outer_meta

_SET_NAMED_PRIVATE_STATE(gridcomp, OuterMetaComponent, OUTER_META_PRIVATE_STATE, outer_meta)
_SET_NAMED_PRIVATE_STATE(gridcomp, OuterMetaComponent, OUTER_META_PRIVATE_STATE)

_RETURN(_SUCCESS)
end subroutine attach_outer_meta
Expand Down
1 change: 1 addition & 0 deletions generic3g/OuterMetaComponent/init_meta.F90
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#include "MAPL_Generic.h"

submodule (mapl3g_OuterMetaComponent) init_meta_smod
use pFlogger, only: logging
implicit none

contains
Expand Down
10 changes: 2 additions & 8 deletions generic3g/OuterMetaComponent/initialize_advertise.F90
Original file line number Diff line number Diff line change
Expand Up @@ -64,14 +64,11 @@ subroutine self_advertise(this, unusable, rc)
type(VariableSpecVectorIterator) :: iter
type(VariableSpec), pointer :: var_spec

!# if (this%component_spec%var_specs%size() > 0) then
!# _ASSERT(allocated(this%geom),'Component must define a geom to advertise variables.')
!# end if
associate (e => this%component_spec%var_specs%end())
iter = this%component_spec%var_specs%begin()
do while (iter /= e)
var_spec => iter%of()
call advertise_variable (var_spec, this%registry, this%geom, this%vertical_grid, _RC)
call advertise_variable (var_spec, this%registry, _RC)
call iter%next()
end do
end associate
Expand All @@ -81,11 +78,9 @@ subroutine self_advertise(this, unusable, rc)
end subroutine self_advertise


subroutine advertise_variable(var_spec, registry, geom, vertical_grid, unusable, rc)
subroutine advertise_variable(var_spec, registry, unusable, rc)
type(VariableSpec), intent(in) :: var_spec
type(StateRegistry), target, intent(inout) :: registry
type(ESMF_Geom), optional, intent(in) :: geom
class(VerticalGrid), optional, intent(in) :: vertical_grid
class(KE), optional, intent(in) :: unusable
integer, optional, intent(out) :: rc

Expand All @@ -99,7 +94,6 @@ subroutine advertise_variable(var_spec, registry, geom, vertical_grid, unusable,
allocate(item_spec, source=make_ItemSpec(var_spec, registry, rc=status))
_VERIFY(status)
call item_spec%create(_RC)
!# call item_spec%initialize(geom, vertical_grid, _RC)

virtual_pt = var_spec%make_virtualPt()
call registry%add_primary_spec(virtual_pt, item_spec)
Expand Down
6 changes: 3 additions & 3 deletions generic3g/OuterMetaComponent/initialize_modify_advertised.F90
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ module recursive subroutine initialize_modify_advertised(this, importState, expo

integer :: status
character(*), parameter :: PHASE_NAME = 'GENERIC::INIT_MODIFY_ADVERTISED'
type(MultiState) :: outer_states, user_states

call apply_to_children(this, set_child_geom, _RC)
call this%run_custom(ESMF_METHOD_INITIALIZE, PHASE_NAME, _RC)
Expand All @@ -27,15 +26,16 @@ module recursive subroutine initialize_modify_advertised(this, importState, expo

_RETURN(_SUCCESS)
_UNUSED_DUMMY(unusable)
_UNUSED_DUMMY(importState)
_UNUSED_DUMMY(exportState)
_UNUSED_DUMMY(clock)
contains

subroutine set_child_geom(this, child_meta, rc)
class(OuterMetaComponent), target, intent(inout) :: this
type(OuterMetaComponent), target, intent(inout) :: child_meta
integer, optional, intent(out) :: rc

integer :: status

associate(kind => child_meta%component_spec%geometry_spec%kind)
_RETURN_IF(kind /= GEOMETRY_FROM_PARENT)

Expand Down
1 change: 1 addition & 0 deletions generic3g/OuterMetaComponent/run_child_by_name.F90
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ module recursive subroutine run_child_by_name(this, child_name, unusable, phase_
call child%run(phase_idx=phase_idx, _RC)

_RETURN(_SUCCESS)
_UNUSED_DUMMY(unusable)
end subroutine run_child_by_name

end submodule run_child_by_name_smod
1 change: 1 addition & 0 deletions generic3g/OuterMetaComponent/run_children.F90
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ module recursive subroutine run_children_(this, unusable, phase_name, rc)
end associate

_RETURN(_SUCCESS)
_UNUSED_DUMMY(unusable)
end subroutine run_children_

end submodule run_children_smod
1 change: 1 addition & 0 deletions generic3g/OuterMetaComponent/run_clock_advance.F90
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ module recursive subroutine run_clock_advance(this, unusable, rc)
end if

_RETURN(ESMF_SUCCESS)
_UNUSED_DUMMY(unusable)
end subroutine run_clock_advance

end submodule run_clock_advance_smod
4 changes: 2 additions & 2 deletions generic3g/OuterMetaComponent/run_user.F90
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@ module recursive subroutine run_user(this, phase_name, unusable, rc)
class(KE), optional, intent(in) :: unusable
integer, optional, intent(out) :: rc

integer :: status, userRC
integer :: phase_idx
integer :: status
type(StringVector), pointer :: run_phases
logical :: found
integer :: phase
Expand Down Expand Up @@ -45,6 +44,7 @@ module recursive subroutine run_user(this, phase_name, unusable, rc)
end do

_RETURN(ESMF_SUCCESS)
_UNUSED_DUMMY(unusable)
end subroutine run_user

end submodule run_user_smod
2 changes: 2 additions & 0 deletions generic3g/OuterMetaComponent/write_restart.F90
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ module recursive subroutine write_restart(this, importState, exportState, clock,
end if

_RETURN(ESMF_SUCCESS)
_UNUSED_DUMMY(exportState)
_UNUSED_DUMMY(importState)
end subroutine write_restart

end submodule write_restart_smod
6 changes: 3 additions & 3 deletions generic3g/RestartHandler.F90
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,8 @@ module mapl3g_RestartHandler
use mapl_ErrorHandling, only: MAPL_Verify, MAPL_Return, MAPL_Assert
use mapl3g_geomio, only: bundle_to_metadata, GeomPFIO, make_geom_pfio, get_mapl_geom
use mapl3g_SharedIO, only: esmf_to_pfio_type
use MAPL_FieldPointerUtilities, only: FieldGetCPtr, FieldGetLocalElementCount
use pFIO, only: PFIO_READ, FileMetaData, NetCDF4_FileFormatter
use pFIO, only: i_Clients, o_Clients, ArrayReference
use pFIO, only: i_Clients, o_Clients
use pFlogger, only: logging, logger

implicit none
Expand Down Expand Up @@ -119,7 +118,8 @@ type(ESMF_FieldBundle) function get_bundle_from_state_(state, rc) result(bundle)
type(ESMF_FieldStatus_Flag) :: field_status
integer :: item_count, idx, status

bundle = ESMF_FieldBundleCreate(_RC) ! bundle to pack fields in
! bundle to pack fields in
bundle = ESMF_FieldBundleCreate(_RC)
call ESMF_StateGet(state, itemCount=item_count, _RC)
allocate(item_name(item_count), _STAT)
allocate(item_type(item_count), _STAT)
Expand Down
1 change: 1 addition & 0 deletions generic3g/UserSetServices.F90
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ subroutine write_formatted_proc(this, unit, iotype, v_list, iostat, iomsg)
write(unit,*,iostat=iostat, iomsg=iomsg) "userRoutine: <procedure>"
_UNUSED_DUMMY(iotype)
_UNUSED_DUMMY(v_list)
_UNUSED_DUMMY(this)
end subroutine write_formatted_proc

!----------------------------------
Expand Down
2 changes: 1 addition & 1 deletion generic3g/actions/ConvertUnitsAction.F90
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ subroutine run(this, importState, exportState, clock, rc)
end if

_FAIL('unsupported typekind')

_UNUSED_DUMMY(clock)
end subroutine run

end module mapl3g_ConvertUnitsAction
6 changes: 4 additions & 2 deletions generic3g/actions/CopyAction.F90
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,13 @@ subroutine initialize(this, importState, exportState, clock, rc)
type(ESMF_Clock) :: clock
integer, optional, intent(out) :: rc

integer :: status

! No-op

_RETURN(_SUCCESS)
_UNUSED_DUMMY(this)
_UNUSED_DUMMY(importState)
_UNUSED_DUMMY(exportState)
_UNUSED_DUMMY(clock)
end subroutine initialize

subroutine run(this, importState, exportState, clock, rc)
Expand Down
10 changes: 9 additions & 1 deletion generic3g/actions/NullAction.F90
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ subroutine initialize(this, importState, exportState, clock, rc)
type(ESMF_Clock) :: clock
integer, optional, intent(out) :: rc
_FAIL('This procedure should not be called.')
_UNUSED_DUMMY(this)
_UNUSED_DUMMY(importState)
_UNUSED_DUMMY(exportState)
_UNUSED_DUMMY(clock)
end subroutine initialize

subroutine run(this, importState, exportState, clock, rc)
Expand All @@ -46,6 +50,10 @@ subroutine run(this, importState, exportState, clock, rc)
type(ESMF_Clock) :: clock
integer, optional, intent(out) :: rc
_FAIL('This procedure should not be called.')
end subroutine run
_UNUSED_DUMMY(this)
_UNUSED_DUMMY(importState)
_UNUSED_DUMMY(exportState)
_UNUSED_DUMMY(clock)
end subroutine run

end module mapl3g_NullAction
49 changes: 6 additions & 43 deletions generic3g/actions/RegridAction.F90
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,9 @@ module mapl3g_RegridAction
procedure :: run
end type ScalarRegridAction

!# type, extends(AbstractAction) :: VectorRegridAction
!# class(AbstractRegridder), pointer :: regridder
!# type(ESMF_Field) :: uv_src(2), uv_dst(2)
!# contains
!# procedure :: run
!# end type VectorRegridAction

interface RegridAction
module procedure :: new_ScalarRegridAction
module procedure :: new_ScalarRegridAction2
!# module procedure :: new_RegridAction_vector
!# module procedure :: new_RegridAction_bundle
end interface RegridAction

contains
Expand Down Expand Up @@ -79,22 +70,6 @@ function new_ScalarRegridAction2(src_geom, dst_geom, dst_param) result(action)

end function new_ScalarRegridAction2

!# function new_RegridAction_vector(uv_src, uv_dst) then (action)
!# use mapl_RegridderManager
!#
!# ptype(ESMF_Grid) :: grid_src, grid_dst
!#
!# action%uv_src = uv_src
!# action%uv_dst = uv_dst
!#
!# get_grid(grid_src)
!# get_grid(grid_dst)
!# action%regridder => regridder_manager%get_regridder(grid_src, grid_dst)
!#
!# end function new_RegridAction_scalar
!#
!#

subroutine initialize(this, importState, exportState, clock, rc)
use esmf
class(ScalarRegridAction), intent(inout) :: this
Expand All @@ -109,9 +84,13 @@ subroutine initialize(this, importState, exportState, clock, rc)

regridder_manager => get_regridder_manager()
spec = RegridderSpec(this%dst_param, this%src_geom, this%dst_geom)
this%regrdr => regridder_manager%get_regridder(spec, rc=status)
this%regrdr => regridder_manager%get_regridder(spec, _RC)

_RETURN(_SUCCESS)
_UNUSED_DUMMY(this)
_UNUSED_DUMMY(importState)
_UNUSED_DUMMY(exportState)
_UNUSED_DUMMY(clock)
end subroutine initialize


Expand All @@ -132,23 +111,7 @@ subroutine run(this, importState, exportState, clock, rc)


_RETURN(_SUCCESS)
_UNUSED_DUMMY(clock)
end subroutine run

!# subroutine run_vector(this, importState, exporState)
!#
!# call get_pointer(importState, fname_src_u, f_src(1))
!# call get_pointer(importState, fname_src_v, f_src(2)
!# call get_pointer(exportState, fname_dst_u, f_dst(1))
!# call get_pointer(exportState, fname_dst_v, f_dst(2))
!#
!# call regridder%regrid(f_src(:), f_dst(:), _RC)
!#
!# end subroutine run

!# subroutine run_bundle(this)
!#
!# call this%regridder%regrid(this%b_src, this%b_dst, _RC)
!#
!# end subroutine run
!#
end module mapl3g_RegridAction
3 changes: 1 addition & 2 deletions generic3g/couplers/CouplerMetaComponent.F90
Original file line number Diff line number Diff line change
Expand Up @@ -238,9 +238,8 @@ subroutine attach_coupler_meta(gridcomp, rc)
integer, optional, intent(out) :: rc

integer :: status
type(CouplerMetaComponent), pointer :: meta

_SET_NAMED_PRIVATE_STATE(gridcomp, CouplerMetaComponent, COUPLER_META_PRIVATE_STATE, meta)
_SET_NAMED_PRIVATE_STATE(gridcomp, CouplerMetaComponent, COUPLER_META_PRIVATE_STATE)

_RETURN(_SUCCESS)
end subroutine attach_coupler_meta
Expand Down
Loading

0 comments on commit 3072c69

Please sign in to comment.