diff --git a/component/ComponentDriver.F90 b/component/ComponentDriver.F90 index 6310b2793f2..d6db81243b4 100644 --- a/component/ComponentDriver.F90 +++ b/component/ComponentDriver.F90 @@ -33,7 +33,7 @@ module mapl3g_ComponentDriver recursive subroutine I_run(this, unusable, phase_idx, rc) use :: MaplShared, only: KeywordEnforcer import ComponentDriver - class(ComponentDriver), intent(inout) :: this + class(ComponentDriver), target, intent(inout) :: this class(KeywordEnforcer), optional, intent(in) :: unusable integer, optional, intent(in) :: phase_idx integer, optional, intent(out) :: rc diff --git a/component/GriddedComponentDriver.F90 b/component/GriddedComponentDriver.F90 index 1740ffdb318..48b6f294cf4 100644 --- a/component/GriddedComponentDriver.F90 +++ b/component/GriddedComponentDriver.F90 @@ -47,7 +47,7 @@ module mapl3g_GriddedComponentDriver interface module recursive subroutine initialize(this, unusable, phase_idx, rc) - class(GriddedComponentDriver), intent(inout) :: this + class(GriddedComponentDriver), target, intent(inout) :: this class(KE), optional, intent(in) :: unusable integer, optional, intent(in) :: phase_idx integer, optional, intent(out) :: rc @@ -56,21 +56,21 @@ end subroutine initialize ! run_self() is implemented in submodule to avoid circular dependency ! on OuterMetaComponent. module recursive subroutine run(this, unusable, phase_idx, rc) - class(GriddedComponentDriver), intent(inout) :: this + class(GriddedComponentDriver), target, intent(inout) :: this class(KE), optional, intent(in) :: unusable integer, optional, intent(in) :: phase_idx integer, optional, intent(out) :: rc end subroutine module recursive subroutine finalize(this, unusable, phase_idx, rc) - class(GriddedComponentDriver), intent(inout) :: this + class(GriddedComponentDriver), target, intent(inout) :: this class(KE), optional, intent(in) :: unusable integer, optional, intent(in) :: phase_idx integer, optional, intent(out) :: rc end subroutine finalize module recursive subroutine write_restart(this, unusable, phase_idx, rc) - class(GriddedComponentDriver), intent(inout) :: this + class(GriddedComponentDriver), target, intent(inout) :: this class(KE), optional, intent(in) :: unusable integer, optional, intent(in) :: phase_idx integer, optional, intent(out) :: rc diff --git a/component/GriddedComponentDriver/finalize.F90 b/component/GriddedComponentDriver/finalize.F90 index 34fda469bdf..26e9ccaee89 100644 --- a/component/GriddedComponentDriver/finalize.F90 +++ b/component/GriddedComponentDriver/finalize.F90 @@ -7,7 +7,7 @@ contains module recursive subroutine finalize(this, unusable, phase_idx, rc) - class(GriddedComponentDriver), intent(inout) :: this + class(GriddedComponentDriver), target, intent(inout) :: this class(KE), optional, intent(in) :: unusable integer, optional, intent(in) :: phase_idx integer, optional, intent(out) :: rc diff --git a/component/GriddedComponentDriver/initialize.F90 b/component/GriddedComponentDriver/initialize.F90 index 6f20ad7d9ca..0f58cbd486d 100644 --- a/component/GriddedComponentDriver/initialize.F90 +++ b/component/GriddedComponentDriver/initialize.F90 @@ -8,7 +8,7 @@ recursive module subroutine initialize(this, unusable, phase_idx, rc) - class(GriddedComponentDriver), intent(inout) :: this + class(GriddedComponentDriver), target, intent(inout) :: this class(KE), optional, intent(in) :: unusable integer, optional, intent(in) :: phase_idx integer, optional, intent(out) :: rc diff --git a/component/GriddedComponentDriver/run.F90 b/component/GriddedComponentDriver/run.F90 index 203558f3696..259972f3626 100644 --- a/component/GriddedComponentDriver/run.F90 +++ b/component/GriddedComponentDriver/run.F90 @@ -7,7 +7,7 @@ contains module recursive subroutine run(this, unusable, phase_idx, rc) - class(GriddedComponentDriver), intent(inout) :: this + class(GriddedComponentDriver), target, intent(inout) :: this class(KE), optional, intent(in) :: unusable integer, optional, intent(in) :: phase_idx integer, optional, intent(out) :: rc diff --git a/component/GriddedComponentDriver/write_restart.F90 b/component/GriddedComponentDriver/write_restart.F90 index 3fe547ec8a0..3e5d212eec9 100644 --- a/component/GriddedComponentDriver/write_restart.F90 +++ b/component/GriddedComponentDriver/write_restart.F90 @@ -7,7 +7,7 @@ contains module recursive subroutine write_restart(this, unusable, phase_idx, rc) - class(GriddedComponentDriver), intent(inout) :: this + class(GriddedComponentDriver), target, intent(inout) :: this class(KE), optional, intent(in) :: unusable integer, optional, intent(in) :: phase_idx integer, optional, intent(out) :: rc diff --git a/docs/user_guide/README.md b/docs/user_guide/README.md index a9fb23e6f83..420e98e3858 100644 --- a/docs/user_guide/README.md +++ b/docs/user_guide/README.md @@ -23,9 +23,15 @@ It: ### 3.3 [Building complex applications: MAPL_Connect](docs/mapl_connect.md) + + +### 3.4 Doing Diagnostics: History (needs updating for MAPL3) + +### 3.5 Connecting Import Fields to Data on File: ExtData (needs updating for MAPL3) ### 3.6 [Performing Arithmetic Operations on Fields](../../base/ArthParser.md) diff --git a/generic3g/ComponentSpecParser/parse_connections.F90 b/generic3g/ComponentSpecParser/parse_connections.F90 index 249049c8fc6..37077e87ce2 100644 --- a/generic3g/ComponentSpecParser/parse_connections.F90 +++ b/generic3g/ComponentSpecParser/parse_connections.F90 @@ -22,7 +22,7 @@ module function parse_connections(hconfig, rc) result(connections) num_specs = ESMF_HConfigGetSize(conn_specs, _RC) do i = 1, num_specs conn_spec = ESMF_HConfigCreateAt(conn_specs, index=i, _RC) - allocate(conn, source=parse_connection(conn_spec, rc=status)); _VERIFY(status) + conn = parse_connection(conn_spec, _RC) call connections%push_back(conn) deallocate(conn) enddo diff --git a/generic3g/OuterMetaComponent.F90 b/generic3g/OuterMetaComponent.F90 index aca946439ee..b23d77a8d0e 100644 --- a/generic3g/OuterMetaComponent.F90 +++ b/generic3g/OuterMetaComponent.F90 @@ -290,16 +290,16 @@ end subroutine initialize_advertise module recursive subroutine initialize_modify_advertised(this, importState, exportState, clock, unusable, rc) class(OuterMetaComponent), target, intent(inout) :: this - ! optional arguments type(ESMF_State) :: importState type(ESMF_State) :: exportState type(ESMF_Clock) :: clock + ! optional arguments class(KE), optional, intent(in) :: unusable integer, optional, intent(out) :: rc end subroutine initialize_modify_advertised module recursive subroutine initialize_realize(this, importState, exportState, clock, unusable, rc) - class(OuterMetaComponent), intent(inout) :: this + class(OuterMetaComponent), target, intent(inout) :: this type(ESMF_State) :: importState type(ESMF_State) :: exportState type(ESMF_Clock) :: clock @@ -340,7 +340,7 @@ module recursive subroutine initialize_user(this, unusable, rc) end subroutine initialize_user module subroutine run_custom(this, method_flag, phase_name, rc) - class(OuterMetaComponent), intent(inout) :: this + class(OuterMetaComponent), target, intent(inout) :: this type(ESMF_METHOD_FLAG), intent(in) :: method_flag character(*), intent(in) :: phase_name integer, optional, intent(out) :: rc diff --git a/generic3g/OuterMetaComponent/SetServices.F90 b/generic3g/OuterMetaComponent/SetServices.F90 index a88374da7cc..bd6c49cd2ad 100644 --- a/generic3g/OuterMetaComponent/SetServices.F90 +++ b/generic3g/OuterMetaComponent/SetServices.F90 @@ -41,9 +41,9 @@ recursive module subroutine SetServices_(this, rc) user_gridcomp = this%user_gc_driver%get_gridcomp() call attach_inner_meta(user_gridcomp, this%self_gridcomp, _RC) logger => this%get_logger() - call logger%info("SetServices:: starting...") + call logger%info("SetServices:: starting...", _RC) call this%user_setservices%run(user_gridcomp, _RC) - call logger%info("SetServices:: ...completed") + call logger%info("SetServices:: ...completed", _RC) call add_children(this, _RC) call run_children_setservices(this, _RC) diff --git a/generic3g/OuterMetaComponent/has_geom.F90 b/generic3g/OuterMetaComponent/has_geom.F90 index 16c4c855880..30fd47bb471 100644 --- a/generic3g/OuterMetaComponent/has_geom.F90 +++ b/generic3g/OuterMetaComponent/has_geom.F90 @@ -10,8 +10,8 @@ module function has_geom(this) logical :: has_geom class(OuterMetaComponent), intent(in) :: this - has_geom = .false. - if (allocated(this%geom)) has_geom = .true. + has_geom = allocated(this%geom) + end function has_geom end submodule has_geom_smod diff --git a/generic3g/OuterMetaComponent/initialize_read_restart.F90 b/generic3g/OuterMetaComponent/initialize_read_restart.F90 index 14dce69c495..71bee0a3e54 100644 --- a/generic3g/OuterMetaComponent/initialize_read_restart.F90 +++ b/generic3g/OuterMetaComponent/initialize_read_restart.F90 @@ -32,12 +32,12 @@ module recursive subroutine initialize_read_restart(this, unusable, rc) _RETURN_UNLESS(this%has_geom()) driver => this%get_user_gc_driver() + states = driver%get_states() call esmf_ClockGet(driver%get_clock(), currTime=currTime, _RC) user_logger => this%get_logger() restart_handler = RestartHandler(this%get_geom(), currTime, user_logger) - states = driver%get_states() subdir = get_checkpoint_subdir(this%hconfig, currTime, _RC) if (this%component_spec%misc%restart_controls%import) then diff --git a/generic3g/OuterMetaComponent/initialize_realize.F90 b/generic3g/OuterMetaComponent/initialize_realize.F90 index d567a5a521c..5ad34205d8d 100644 --- a/generic3g/OuterMetaComponent/initialize_realize.F90 +++ b/generic3g/OuterMetaComponent/initialize_realize.F90 @@ -9,7 +9,7 @@ contains module recursive subroutine initialize_realize(this, importState, exportState, clock, unusable, rc) - class(OuterMetaComponent), intent(inout) :: this + class(OuterMetaComponent), target, intent(inout) :: this type(esmf_State) :: importState type(esmf_State) :: exportState type(esmf_Clock) :: clock diff --git a/generic3g/OuterMetaComponent/run_custom.F90 b/generic3g/OuterMetaComponent/run_custom.F90 index cf52dd0cc56..7cd4468ef13 100644 --- a/generic3g/OuterMetaComponent/run_custom.F90 +++ b/generic3g/OuterMetaComponent/run_custom.F90 @@ -8,7 +8,7 @@ contains module subroutine run_custom(this, method_flag, phase_name, rc) - class(OuterMetaComponent), intent(inout) :: this + class(OuterMetaComponent), target, intent(inout) :: this type(ESMF_METHOD_FLAG), intent(in) :: method_flag character(*), intent(in) :: phase_name integer, optional, intent(out) :: rc diff --git a/generic3g/connection/Connection.F90 b/generic3g/connection/Connection.F90 index 20919f62e06..29c2d2eda71 100644 --- a/generic3g/connection/Connection.F90 +++ b/generic3g/connection/Connection.F90 @@ -26,7 +26,7 @@ end function I_get subroutine I_activate(this, registry, rc) use mapl3g_StateRegistry import Connection - class(Connection), intent(in) :: this + class(Connection), target, intent(in) :: this type(StateRegistry), target, intent(inout) :: registry integer, optional, intent(out) :: rc end subroutine I_activate @@ -34,7 +34,7 @@ end subroutine I_activate subroutine I_connect(this, registry, rc) use mapl3g_StateRegistry import Connection - class(Connection), intent(inout) :: this + class(Connection), target, intent(inout) :: this type(StateRegistry), target, intent(inout) :: registry integer, optional, intent(out) :: rc end subroutine I_connect diff --git a/generic3g/connection/MatchConnection.F90 b/generic3g/connection/MatchConnection.F90 index d5c3dfbd361..0e1091e249b 100644 --- a/generic3g/connection/MatchConnection.F90 +++ b/generic3g/connection/MatchConnection.F90 @@ -26,7 +26,7 @@ module mapl3g_MatchConnection private type(ConnectionPt) :: source type(ConnectionPt) :: destination - logical :: consumed = .false. + logical :: consumed contains procedure :: get_source procedure :: get_destination @@ -47,6 +47,7 @@ function new_MatchConnection(source, destination) result(this) this%source = source this%destination = destination + this%consumed = .false. end function new_MatchConnection @@ -63,14 +64,14 @@ function get_destination(this) result(destination) end function get_destination recursive subroutine activate(this, registry, rc) - class(MatchConnection), intent(in) :: this + class(MatchConnection), target, intent(in) :: this type(StateRegistry), target, intent(inout) :: registry integer, optional, intent(out) :: rc integer :: status - type(ConnectionPt) :: src_pt, dst_pt + type(ConnectionPt) :: src_pt, dst_pt type(StateRegistry), pointer :: src_registry, dst_registry - type(VirtualConnectionPtVector) :: src_v_pts, dst_v_pts + type(VirtualConnectionPtVector), target :: src_v_pts, dst_v_pts type(VirtualConnectionPt), pointer :: dst_pattern, src_v_pt type(VirtualConnectionPt) :: src_pattern, dst_v_pt integer :: i, j @@ -117,7 +118,7 @@ recursive subroutine activate(this, registry, rc) end subroutine activate recursive subroutine connect(this, registry, rc) - class(MatchConnection), intent(inout) :: this + class(MatchConnection), target, intent(inout) :: this type(StateRegistry), target, intent(inout) :: registry integer, optional, intent(out) :: rc @@ -125,7 +126,7 @@ recursive subroutine connect(this, registry, rc) type(ConnectionPt) :: src_pt, dst_pt type(StateRegistry), pointer :: src_registry, dst_registry - type(VirtualConnectionPtVector) :: src_v_pts, dst_v_pts + type(VirtualConnectionPtVector), target :: src_v_pts, dst_v_pts type(VirtualConnectionPt), pointer :: dst_pattern, src_v_pt type(VirtualConnectionPt) :: src_pattern, dst_v_pt integer :: i, j diff --git a/generic3g/connection/ReexportConnection.F90 b/generic3g/connection/ReexportConnection.F90 index dee01c3505e..20a1afe24b1 100644 --- a/generic3g/connection/ReexportConnection.F90 +++ b/generic3g/connection/ReexportConnection.F90 @@ -62,7 +62,7 @@ end function get_destination ! No-op: reexports are always active recursive subroutine activate(this, registry, rc) - class(ReexportConnection), intent(in) :: this + class(ReexportConnection), target, intent(in) :: this type(StateRegistry), target, intent(inout) :: registry integer, optional, intent(out) :: rc @@ -80,7 +80,7 @@ recursive subroutine activate(this, registry, rc) end subroutine activate recursive subroutine connect(this, registry, rc) - class(ReexportConnection), intent(inout) :: this + class(ReexportConnection), target, intent(inout) :: this type(StateRegistry), target, intent(inout) :: registry integer, optional, intent(out) :: rc diff --git a/generic3g/connection/SimpleConnection.F90 b/generic3g/connection/SimpleConnection.F90 index 1c0aa01a06c..9f8d34fb87a 100644 --- a/generic3g/connection/SimpleConnection.F90 +++ b/generic3g/connection/SimpleConnection.F90 @@ -28,7 +28,7 @@ module mapl3g_SimpleConnection private type(ConnectionPt) :: source type(ConnectionPt) :: destination - logical :: consumed=.false. + logical :: consumed contains procedure :: get_source procedure :: get_destination @@ -50,6 +50,7 @@ function new_SimpleConnection(source, destination) result(this) this%source = source this%destination = destination + this%consumed = .false. end function new_SimpleConnection @@ -66,7 +67,7 @@ function get_destination(this) result(destination) end function get_destination recursive subroutine activate(this, registry, rc) - class(SimpleConnection), intent(in) :: this + class(SimpleConnection), target, intent(in) :: this type(StateRegistry), target, intent(inout) :: registry integer, optional, intent(out) :: rc @@ -111,7 +112,7 @@ end subroutine activate recursive subroutine connect(this, registry, rc) - class(SimpleConnection), intent(inout) :: this + class(SimpleConnection), target, intent(inout) :: this type(StateRegistry), target, intent(inout) :: registry integer, optional, intent(out) :: rc @@ -142,7 +143,7 @@ end subroutine connect recursive subroutine connect_sibling(this, dst_registry, src_registry, unusable, rc) - class(SimpleConnection), intent(in) :: this + class(SimpleConnection), target, intent(in) :: this type(StateRegistry), target, intent(inout) :: dst_registry type(StateRegistry), target, intent(inout) :: src_registry class(KeywordEnforcer), optional, intent(in) :: unusable diff --git a/generic3g/registry/StateRegistry.F90 b/generic3g/registry/StateRegistry.F90 index 1fc90ed1483..403f8442783 100644 --- a/generic3g/registry/StateRegistry.F90 +++ b/generic3g/registry/StateRegistry.F90 @@ -332,6 +332,7 @@ function get_subregistry_by_name(this, name, rc) result(subregistry) _FAIL('Illegal subtype of AbstractRegistry encountered.') end select + _RETURN(_SUCCESS) end function get_subregistry_by_name function get_subregistry_by_conn_pt(this, conn_pt, rc) result(subregistry) diff --git a/generic3g/tests/Test_Scenarios.pf b/generic3g/tests/Test_Scenarios.pf index 98164b5387e..9b6f587aba5 100644 --- a/generic3g/tests/Test_Scenarios.pf +++ b/generic3g/tests/Test_Scenarios.pf @@ -159,10 +159,9 @@ contains logical :: has_numsteps file_name = './scenarios/' // this%scenario_name // '/' // this%scenario_root - config = ESMF_HConfigCreate(filename=file_name) + config = ESMF_HConfigCreate(filename=file_name, _RC) call NUOPC_FieldDictionarySetup(filename='./scenarios/FieldDictionary.yml', _RC) - @assert_that(status, is(0)) associate (outer_gc => this%outer_gc, outer_states => this%outer_states, grid => this%grid) diff --git a/profiler/BaseProfiler.F90 b/profiler/BaseProfiler.F90 index d154c299acf..2081ef68fcd 100644 --- a/profiler/BaseProfiler.F90 +++ b/profiler/BaseProfiler.F90 @@ -53,8 +53,6 @@ module mapl_BaseProfiler procedure :: get_root_node procedure :: get_status procedure :: copy_profiler -!# procedure(copy_profiler), deferred :: copy -!# generic :: assignment(=) => copy procedure :: reset procedure :: accumulate diff --git a/profiler/DistributedProfiler.F90 b/profiler/DistributedProfiler.F90 index daae25eeb6e..0a6545392ed 100644 --- a/profiler/DistributedProfiler.F90 +++ b/profiler/DistributedProfiler.F90 @@ -21,7 +21,6 @@ module MAPL_DistributedProfiler contains procedure :: make_meter procedure :: reduce -!# procedure :: copy end type DistributedProfiler interface DistributedProfiler @@ -83,17 +82,4 @@ subroutine reduce(this) end subroutine reduce - subroutine copy(new, old) - class(DistributedProfiler), target, intent(inout) :: new - class(BaseProfiler), target, intent(in) :: old - - call new%copy_profiler(old) - select type (old) - class is (DistributedProfiler) - new%gauge = old%gauge - new%comm = old%comm - end select - - end subroutine copy - end module MAPL_DistributedProfiler diff --git a/profiler/MemoryProfiler.F90 b/profiler/MemoryProfiler.F90 index d675600ad6d..fe211cddfd1 100644 --- a/profiler/MemoryProfiler.F90 +++ b/profiler/MemoryProfiler.F90 @@ -19,7 +19,6 @@ module MAPL_MemoryProfiler_private private contains procedure :: make_meter - procedure :: copy end type MemoryProfiler interface MemoryProfiler @@ -49,16 +48,6 @@ function make_meter(this) result(meter) end function make_meter - subroutine copy(new, old) - class(MemoryProfiler), target, intent(inout) :: new - class(BaseProfiler), target, intent(in) :: old - - _HERE -!# call new%copy_profiler(old) - - end subroutine copy - - end module MAPL_MemoryProfiler_private diff --git a/profiler/StubProfiler.F90 b/profiler/StubProfiler.F90 index fd8b4fd4d50..9034fac4951 100644 --- a/profiler/StubProfiler.F90 +++ b/profiler/StubProfiler.F90 @@ -18,7 +18,6 @@ module MAPL_StubProfiler private contains procedure :: make_meter - procedure :: copy procedure :: start_name, start_self procedure :: stop_name, stop_self procedure :: reduce @@ -58,15 +57,6 @@ function make_meter(this) result(meter) end function make_meter - subroutine copy(new, old) - class(StubProfiler), target, intent(inout) :: new - class(BaseProfiler), target, intent(in) :: old - - _HERE -!# call new%copy_profiler(old) - - end subroutine copy - subroutine start_self(this, unusable, rc) class(StubProfiler), target, intent(inout) :: this class(KeywordEnforcer), optional, intent(in) :: unusable diff --git a/profiler/TimeProfiler.F90 b/profiler/TimeProfiler.F90 index 8a26c6817d8..ce8108f82a4 100644 --- a/profiler/TimeProfiler.F90 +++ b/profiler/TimeProfiler.F90 @@ -18,7 +18,7 @@ module mapl_TimeProfiler_private private contains procedure :: make_meter - procedure :: copy + end type TimeProfiler interface TimeProfiler @@ -44,15 +44,6 @@ function make_meter(this) result(meter) meter = AdvancedMeter(MpiTimerGauge()) end function make_meter - subroutine copy(new, old) - class(TimeProfiler), target, intent(inout) :: new - class(BaseProfiler), target, intent(in) :: old - - _HERE -!# call new%copy_profiler(old) - - end subroutine copy - end module mapl_TimeProfiler_Private module mapl_TimeProfiler