From 69e0e6463ec89c5342035d7a63f5bb3bed3b01ec Mon Sep 17 00:00:00 2001 From: Purnendu Chakraborty Date: Mon, 25 Nov 2024 09:16:45 -0500 Subject: [PATCH 1/6] Printing spec --- generic3g/registry/StateItemExtension.F90 | 2 ++ generic3g/specs/FieldSpec.F90 | 13 +++++++------ generic3g/tests/Test_Scenarios.pf | 4 ++-- generic3g/vertical/FixedLevelsVerticalGrid.F90 | 2 +- generic3g/vertical/ModelVerticalGrid.F90 | 18 +++++++++++++----- 5 files changed, 25 insertions(+), 14 deletions(-) diff --git a/generic3g/registry/StateItemExtension.F90 b/generic3g/registry/StateItemExtension.F90 index ec1e32785248..011df6d09db2 100644 --- a/generic3g/registry/StateItemExtension.F90 +++ b/generic3g/registry/StateItemExtension.F90 @@ -126,7 +126,9 @@ recursive function make_extension(this, goal, rc) result(extension) do i = 1, size(adapters) match = adapters(i)%adapter%match(new_spec, _RC) if (match) cycle + _HERE call adapters(i)%adapter%adapt(new_spec, action, _RC) + print *, "make_extension::new_spec: ", new_spec exit end do diff --git a/generic3g/specs/FieldSpec.F90 b/generic3g/specs/FieldSpec.F90 index 91efbacd0ab2..2d299629f267 100644 --- a/generic3g/specs/FieldSpec.F90 +++ b/generic3g/specs/FieldSpec.F90 @@ -352,19 +352,19 @@ subroutine write_formatted(this, unit, iotype, v_list, iostat, iomsg) integer, intent(out) :: iostat character(*), intent(inout) :: iomsg - write(unit, "(a, a)", iostat=iostat, iomsg=iomsg) "FieldSpec(", new_line("a") + write(unit, "(a)", iostat=iostat, iomsg=iomsg) "FieldSpec(" if (allocated(this%standard_name)) then - write(unit, "(3x, a, a, a)", iostat=iostat, iomsg=iomsg) "standard name:", this%standard_name, new_line("a") + write(unit, "(a, a, a)", iostat=iostat, iomsg=iomsg) new_line("a"), "standard name:", this%standard_name end if if (allocated(this%long_name)) then - write(unit, "(3x, a, a, a)", iostat=iostat, iomsg=iomsg) "long name:", this%long_name, new_line("a") + write(unit, "(a, a, a)", iostat=iostat, iomsg=iomsg) new_line("a"), "long name:", this%long_name end if if (allocated(this%units)) then - write(unit, "(3x, a, a, a)", iostat=iostat, iomsg=iomsg) "units:", this%units, new_line("a") + write(unit, "(a, a, a)", iostat=iostat, iomsg=iomsg) new_line("a"), "units:", this%units end if - write(unit, "(3x, dt'g0', a)", iostat=iostat, iomsg=iomsg) this%vertical_dim_spec, new_line("a") + write(unit, "(a, dt'g0')", iostat=iostat, iomsg=iomsg) new_line("a"), this%vertical_dim_spec if (allocated(this%vertical_grid)) then - write(unit, "(3x, dt'g0', a)", iostat=iostat, iomsg=iomsg) this%vertical_grid + write(unit, "(a, dt'g0', a)", iostat=iostat, iomsg=iomsg) new_line("a"), this%vertical_grid end if write(unit, "(a)") ")" @@ -867,6 +867,7 @@ subroutine adapt_vertical_grid(this, spec, action, rc) spec%vertical_grid = this%vertical_grid spec%vertical_dim_spec = this%vertical_dim_spec end select + print *, "adapt_vertical_grid::spec: ", spec _RETURN(_SUCCESS) end subroutine adapt_vertical_grid diff --git a/generic3g/tests/Test_Scenarios.pf b/generic3g/tests/Test_Scenarios.pf index e5f0d5dbcbf9..3650ac60f0cc 100644 --- a/generic3g/tests/Test_Scenarios.pf +++ b/generic3g/tests/Test_Scenarios.pf @@ -129,11 +129,11 @@ contains ScenarioDescription('regrid', 'cap.yaml', check_name, check_stateitem), & ScenarioDescription('propagate_geom', 'parent.yaml', check_name, check_stateitem), & ScenarioDescription('vertical_regridding', 'parent.yaml', check_name, check_stateitem) & -#ifndef __GFORTRAN__ +! #ifndef __GFORTRAN__ , & ScenarioDescription('vertical_regridding_2', 'parent.yaml', check_name, check_stateitem), & ScenarioDescription('vertical_regridding_3', 'AGCM.yaml', check_name, check_stateitem) & -#endif +! #endif ] end function add_params diff --git a/generic3g/vertical/FixedLevelsVerticalGrid.F90 b/generic3g/vertical/FixedLevelsVerticalGrid.F90 index 0e347753ee56..5d1f83cb1f0f 100644 --- a/generic3g/vertical/FixedLevelsVerticalGrid.F90 +++ b/generic3g/vertical/FixedLevelsVerticalGrid.F90 @@ -114,7 +114,7 @@ subroutine write_formatted(this, unit, iotype, v_list, iostat, iomsg) integer, intent(out) :: iostat character(*), intent(inout) :: iomsg - write(unit, "(a, a, 3x, a, a, a, 3x, a, a, a, 3x, a, *(g0, 1x))", iostat=iostat, iomsg=iomsg) & + write(unit, "(a, a, a, a, a, a, a, a, a, *(g0, 1x))", iostat=iostat, iomsg=iomsg) & "FixedLevelsVerticalGrid(", new_line("a"), & "standard name: ", this%standard_name, new_line("a"), & "units: ", this%get_units(), new_line("a"), & diff --git a/generic3g/vertical/ModelVerticalGrid.F90 b/generic3g/vertical/ModelVerticalGrid.F90 index 09b05dbe010c..8debde5f1164 100644 --- a/generic3g/vertical/ModelVerticalGrid.F90 +++ b/generic3g/vertical/ModelVerticalGrid.F90 @@ -164,11 +164,19 @@ subroutine write_formatted(this, unit, iotype, v_list, iostat, iomsg) integer, intent(out) :: iostat character(*), intent(inout) :: iomsg - write(unit, "(a, a, g0, a)", iostat=iostat, iomsg=iomsg) & - "ModelVerticalGrid(", & - "num levels: ", this%num_levels, & - ")" - + write(unit, "(a, a)", iostat=iostat, iomsg=iomsg) "ModelVerticalGrid(" + if (allocated(this%standard_name)) then + write(unit, "(a, a, a)", iostat=iostat, iomsg=iomsg) new_line("a"), "standard name:", this%standard_name + end if + write(unit, "(a, g0, a)", iostat=iostat, iomsg=iomsg) new_line("a"), "num_levels:", this%num_levels + if (allocated(this%short_name_edge)) then + write(unit, "(a, a, a)", iostat=iostat, iomsg=iomsg) new_line("a"), "short name (edge):", this%short_name_edge + end if + if (allocated(this%short_name_center)) then + write(unit, "(a, a, a)", iostat=iostat, iomsg=iomsg) new_line("a"), "short name (center):", this%short_name_center + end if + write(unit, "(a)") ")" + _UNUSED_DUMMY(iotype) _UNUSED_DUMMY(v_list) end subroutine write_formatted From 2a6d68cca241e91cb802c653f7d0c118813de399 Mon Sep 17 00:00:00 2001 From: Purnendu Chakraborty Date: Wed, 27 Nov 2024 10:09:12 -0500 Subject: [PATCH 2/6] gfortran has trouble with type bound write overload - deactivating it --- generic3g/registry/StateItemExtension.F90 | 2 -- generic3g/specs/BracketSpec.F90 | 4 ++++ generic3g/specs/FieldSpec.F90 | 5 ++++- generic3g/specs/InvalidSpec.F90 | 5 ++++- generic3g/specs/ServiceSpec.F90 | 4 ++++ generic3g/specs/StateItemSpec.F90 | 4 ++++ generic3g/specs/StateSpec.F90 | 4 ++++ generic3g/specs/WildcardSpec.F90 | 4 ++++ 8 files changed, 28 insertions(+), 4 deletions(-) diff --git a/generic3g/registry/StateItemExtension.F90 b/generic3g/registry/StateItemExtension.F90 index 011df6d09db2..ec1e32785248 100644 --- a/generic3g/registry/StateItemExtension.F90 +++ b/generic3g/registry/StateItemExtension.F90 @@ -126,9 +126,7 @@ recursive function make_extension(this, goal, rc) result(extension) do i = 1, size(adapters) match = adapters(i)%adapter%match(new_spec, _RC) if (match) cycle - _HERE call adapters(i)%adapter%adapt(new_spec, action, _RC) - print *, "make_extension::new_spec: ", new_spec exit end do diff --git a/generic3g/specs/BracketSpec.F90 b/generic3g/specs/BracketSpec.F90 index d7e50d015a49..1fb58f573599 100644 --- a/generic3g/specs/BracketSpec.F90 +++ b/generic3g/specs/BracketSpec.F90 @@ -47,7 +47,9 @@ module mapl3g_BracketSpec procedure :: make_adapters procedure :: set_geometry +#ifndef __GFORTRAN__ procedure :: write_formatted +#endif end type BracketSpec interface BracketSpec @@ -268,6 +270,7 @@ subroutine set_geometry(this, geom, vertical_grid, rc) _UNUSED_DUMMY(vertical_grid) end subroutine set_geometry +#ifndef __GFORTRAN__ subroutine write_formatted(this, unit, iotype, v_list, iostat, iomsg) class(BracketSpec), intent(in) :: this integer, intent(in) :: unit @@ -278,6 +281,7 @@ subroutine write_formatted(this, unit, iotype, v_list, iostat, iomsg) write(unit, "(a)", iostat=iostat, iomsg=iomsg) "BracketSpec(write not implemented yet)" end subroutine write_formatted +#endif function make_adapters(this, goal_spec, rc) result(adapters) type(StateItemAdapterWrapper), allocatable :: adapters(:) diff --git a/generic3g/specs/FieldSpec.F90 b/generic3g/specs/FieldSpec.F90 index 2d299629f267..2095479181a6 100644 --- a/generic3g/specs/FieldSpec.F90 +++ b/generic3g/specs/FieldSpec.F90 @@ -114,7 +114,9 @@ module mapl3g_FieldSpec procedure :: set_geometry +#ifndef __GFORTRAN__ procedure :: write_formatted +#endif end type FieldSpec interface FieldSpec @@ -344,6 +346,7 @@ subroutine allocate(this, rc) _RETURN(ESMF_SUCCESS) end subroutine allocate +#ifndef __GFORTRAN__ subroutine write_formatted(this, unit, iotype, v_list, iostat, iomsg) class(FieldSpec), intent(in) :: this integer, intent(in) :: unit @@ -371,6 +374,7 @@ subroutine write_formatted(this, unit, iotype, v_list, iostat, iomsg) _UNUSED_DUMMY(iotype) _UNUSED_DUMMY(v_list) end subroutine write_formatted +#endif function get_ungridded_bounds(this, rc) result(bounds) type(LU_Bound), allocatable :: bounds(:) @@ -867,7 +871,6 @@ subroutine adapt_vertical_grid(this, spec, action, rc) spec%vertical_grid = this%vertical_grid spec%vertical_dim_spec = this%vertical_dim_spec end select - print *, "adapt_vertical_grid::spec: ", spec _RETURN(_SUCCESS) end subroutine adapt_vertical_grid diff --git a/generic3g/specs/InvalidSpec.F90 b/generic3g/specs/InvalidSpec.F90 index 93967fbeba23..0d5aad4298d8 100644 --- a/generic3g/specs/InvalidSpec.F90 +++ b/generic3g/specs/InvalidSpec.F90 @@ -38,8 +38,9 @@ module mapl3g_InvalidSpec procedure :: set_geometry => set_geometry +#ifndef __GFORTRAN__ procedure :: write_formatted - +#endif procedure :: make_adapters end type InvalidSpec @@ -145,6 +146,7 @@ subroutine set_geometry(this, geom, vertical_grid, rc) _UNUSED_DUMMY(vertical_grid) end subroutine set_geometry +#ifndef __GFORTRAN__ subroutine write_formatted(this, unit, iotype, v_list, iostat, iomsg) class(InvalidSpec), intent(in) :: this integer, intent(in) :: unit @@ -155,6 +157,7 @@ subroutine write_formatted(this, unit, iotype, v_list, iostat, iomsg) write(unit, "(a)", iostat=iostat, iomsg=iomsg) "InvalidSpec()" end subroutine write_formatted +#endif ! Stub implementation function make_adapters(this, goal_spec, rc) result(adapters) diff --git a/generic3g/specs/ServiceSpec.F90 b/generic3g/specs/ServiceSpec.F90 index 3fa46a513c37..cebc39322e64 100644 --- a/generic3g/specs/ServiceSpec.F90 +++ b/generic3g/specs/ServiceSpec.F90 @@ -48,7 +48,9 @@ module mapl3g_ServiceSpec procedure :: add_to_bundle procedure :: set_geometry +#ifndef __GFORTRAN__ procedure :: write_formatted +#endif !!$ procedure :: check_complete end type ServiceSpec @@ -212,6 +214,7 @@ subroutine set_geometry(this, geom, vertical_grid, rc) _RETURN(_SUCCESS) end subroutine set_geometry +#ifndef __GFORTRAN__ subroutine write_formatted(this, unit, iotype, v_list, iostat, iomsg) class(ServiceSpec), intent(in) :: this integer, intent(in) :: unit @@ -222,6 +225,7 @@ subroutine write_formatted(this, unit, iotype, v_list, iostat, iomsg) write(unit, "(a)", iostat=iostat, iomsg=iomsg) "ServiceSpec(write not implemented yet)" end subroutine write_formatted +#endif function make_adapters(this, goal_spec, rc) result(adapters) type(StateItemAdapterWrapper), allocatable :: adapters(:) diff --git a/generic3g/specs/StateItemSpec.F90 b/generic3g/specs/StateItemSpec.F90 index 5d38e537a2be..cc4c00903227 100644 --- a/generic3g/specs/StateItemSpec.F90 +++ b/generic3g/specs/StateItemSpec.F90 @@ -53,8 +53,10 @@ module mapl3g_StateItemSpec procedure(I_add_to_bundle), deferred :: add_to_bundle procedure(I_set_geometry), deferred :: set_geometry +#ifndef __GFORTRAN__ procedure(I_write_formatted), deferred :: write_formatted generic :: write(formatted) => write_formatted +#endif procedure, non_overridable :: set_allocated procedure, non_overridable :: is_allocated @@ -158,6 +160,7 @@ subroutine I_set_geometry(this, geom, vertical_grid, rc) integer, optional, intent(out) :: rc end subroutine I_set_geometry +#ifndef __GFORTRAN__ subroutine I_write_formatted(this, unit, iotype, v_list, iostat, iomsg) import StateItemSpec class(StateItemSpec), intent(in) :: this @@ -167,6 +170,7 @@ subroutine I_write_formatted(this, unit, iotype, v_list, iostat, iomsg) integer, intent(out) :: iostat character(*), intent(inout) :: iomsg end subroutine I_write_formatted +#endif ! Returns an ordered list of adapters that priorities matching ! rules for connecting a family of extension to a goal spec. diff --git a/generic3g/specs/StateSpec.F90 b/generic3g/specs/StateSpec.F90 index 94e39c156635..b74d2925286f 100644 --- a/generic3g/specs/StateSpec.F90 +++ b/generic3g/specs/StateSpec.F90 @@ -40,7 +40,9 @@ module mapl3g_StateSpec procedure :: add_to_state procedure :: add_to_bundle +#ifndef __GFORTRAN__ procedure :: write_formatted +#endif end type StateSpec contains @@ -164,6 +166,7 @@ subroutine add_to_bundle(this, bundle, rc) _UNUSED_DUMMY(bundle) end subroutine add_to_bundle +#ifndef __GFORTRAN__ subroutine write_formatted(this, unit, iotype, v_list, iostat, iomsg) class(StateSpec), intent(in) :: this integer, intent(in) :: unit @@ -174,6 +177,7 @@ subroutine write_formatted(this, unit, iotype, v_list, iostat, iomsg) write(unit, "(a)", iostat=iostat, iomsg=iomsg) "StateSpec(write not implemented yet)" end subroutine write_formatted +#endif function make_adapters(this, goal_spec, rc) result(adapters) type(StateItemAdapterWrapper), allocatable :: adapters(:) diff --git a/generic3g/specs/WildcardSpec.F90 b/generic3g/specs/WildcardSpec.F90 index d5183bd9eb7c..314f00df0c9a 100644 --- a/generic3g/specs/WildcardSpec.F90 +++ b/generic3g/specs/WildcardSpec.F90 @@ -37,7 +37,9 @@ module mapl3g_WildcardSpec procedure :: add_to_bundle procedure :: set_geometry +#ifndef __GFORTRAN__ procedure :: write_formatted +#endif procedure :: get_reference_spec end type WildcardSpec @@ -212,6 +214,7 @@ subroutine set_geometry(this, geom, vertical_grid, rc) _RETURN(_SUCCESS) end subroutine set_geometry +#ifndef __GFORTRAN__ subroutine write_formatted(this, unit, iotype, v_list, iostat, iomsg) class(WildcardSpec), intent(in) :: this integer, intent(in) :: unit @@ -222,6 +225,7 @@ subroutine write_formatted(this, unit, iotype, v_list, iostat, iomsg) write(unit, "(a)", iostat=iostat, iomsg=iomsg) "WildcardSpec(write not implemented yet)" end subroutine write_formatted +#endif function make_adapters(this, goal_spec, rc) result(adapters) type(StateItemAdapterWrapper), allocatable :: adapters(:) From 49747b68b21df8a8337621e0b04579a8a0f8d1a2 Mon Sep 17 00:00:00 2001 From: Purnendu Chakraborty Date: Wed, 27 Nov 2024 10:25:57 -0500 Subject: [PATCH 3/6] Scenarios tests vertical_regridding_2/3 are now active --- generic3g/tests/Test_Scenarios.pf | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/generic3g/tests/Test_Scenarios.pf b/generic3g/tests/Test_Scenarios.pf index 3650ac60f0cc..9eede24bae4f 100644 --- a/generic3g/tests/Test_Scenarios.pf +++ b/generic3g/tests/Test_Scenarios.pf @@ -128,12 +128,9 @@ contains ScenarioDescription('export_dependency', 'parent.yaml', check_name, check_stateitem), & ScenarioDescription('regrid', 'cap.yaml', check_name, check_stateitem), & ScenarioDescription('propagate_geom', 'parent.yaml', check_name, check_stateitem), & - ScenarioDescription('vertical_regridding', 'parent.yaml', check_name, check_stateitem) & -! #ifndef __GFORTRAN__ - , & + ScenarioDescription('vertical_regridding', 'parent.yaml', check_name, check_stateitem), & ScenarioDescription('vertical_regridding_2', 'parent.yaml', check_name, check_stateitem), & ScenarioDescription('vertical_regridding_3', 'AGCM.yaml', check_name, check_stateitem) & -! #endif ] end function add_params From 742bbd496f8a609a242d97ea57b3ac2ad5528819 Mon Sep 17 00:00:00 2001 From: Purnendu Chakraborty Date: Wed, 27 Nov 2024 11:48:32 -0500 Subject: [PATCH 4/6] FixedLevels/ModelVerticalGrid - reverting back to original write overloads --- generic3g/vertical/FixedLevelsVerticalGrid.F90 | 2 +- generic3g/vertical/ModelVerticalGrid.F90 | 18 +++++------------- 2 files changed, 6 insertions(+), 14 deletions(-) diff --git a/generic3g/vertical/FixedLevelsVerticalGrid.F90 b/generic3g/vertical/FixedLevelsVerticalGrid.F90 index 5d1f83cb1f0f..0e347753ee56 100644 --- a/generic3g/vertical/FixedLevelsVerticalGrid.F90 +++ b/generic3g/vertical/FixedLevelsVerticalGrid.F90 @@ -114,7 +114,7 @@ subroutine write_formatted(this, unit, iotype, v_list, iostat, iomsg) integer, intent(out) :: iostat character(*), intent(inout) :: iomsg - write(unit, "(a, a, a, a, a, a, a, a, a, *(g0, 1x))", iostat=iostat, iomsg=iomsg) & + write(unit, "(a, a, 3x, a, a, a, 3x, a, a, a, 3x, a, *(g0, 1x))", iostat=iostat, iomsg=iomsg) & "FixedLevelsVerticalGrid(", new_line("a"), & "standard name: ", this%standard_name, new_line("a"), & "units: ", this%get_units(), new_line("a"), & diff --git a/generic3g/vertical/ModelVerticalGrid.F90 b/generic3g/vertical/ModelVerticalGrid.F90 index 8debde5f1164..09b05dbe010c 100644 --- a/generic3g/vertical/ModelVerticalGrid.F90 +++ b/generic3g/vertical/ModelVerticalGrid.F90 @@ -164,19 +164,11 @@ subroutine write_formatted(this, unit, iotype, v_list, iostat, iomsg) integer, intent(out) :: iostat character(*), intent(inout) :: iomsg - write(unit, "(a, a)", iostat=iostat, iomsg=iomsg) "ModelVerticalGrid(" - if (allocated(this%standard_name)) then - write(unit, "(a, a, a)", iostat=iostat, iomsg=iomsg) new_line("a"), "standard name:", this%standard_name - end if - write(unit, "(a, g0, a)", iostat=iostat, iomsg=iomsg) new_line("a"), "num_levels:", this%num_levels - if (allocated(this%short_name_edge)) then - write(unit, "(a, a, a)", iostat=iostat, iomsg=iomsg) new_line("a"), "short name (edge):", this%short_name_edge - end if - if (allocated(this%short_name_center)) then - write(unit, "(a, a, a)", iostat=iostat, iomsg=iomsg) new_line("a"), "short name (center):", this%short_name_center - end if - write(unit, "(a)") ")" - + write(unit, "(a, a, g0, a)", iostat=iostat, iomsg=iomsg) & + "ModelVerticalGrid(", & + "num levels: ", this%num_levels, & + ")" + _UNUSED_DUMMY(iotype) _UNUSED_DUMMY(v_list) end subroutine write_formatted From 0b24b7a37d96c30c604d0b7258581e41d78fa04e Mon Sep 17 00:00:00 2001 From: Purnendu Chakraborty Date: Mon, 2 Dec 2024 09:55:02 -0500 Subject: [PATCH 5/6] Turns out that we need to ifdef only the generic statement --- generic3g/specs/BracketSpec.F90 | 8 ++++---- generic3g/specs/FieldSpec.F90 | 8 ++++---- generic3g/specs/InvalidSpec.F90 | 8 ++++---- generic3g/specs/ServiceSpec.F90 | 8 ++++---- generic3g/specs/StateItemSpec.F90 | 6 +++--- generic3g/specs/StateSpec.F90 | 8 ++++---- generic3g/specs/WildcardSpec.F90 | 8 ++++---- 7 files changed, 27 insertions(+), 27 deletions(-) diff --git a/generic3g/specs/BracketSpec.F90 b/generic3g/specs/BracketSpec.F90 index 1fb58f573599..fee77d621a42 100644 --- a/generic3g/specs/BracketSpec.F90 +++ b/generic3g/specs/BracketSpec.F90 @@ -47,9 +47,9 @@ module mapl3g_BracketSpec procedure :: make_adapters procedure :: set_geometry -#ifndef __GFORTRAN__ +! #ifndef __GFORTRAN__ procedure :: write_formatted -#endif +! #endif end type BracketSpec interface BracketSpec @@ -270,7 +270,7 @@ subroutine set_geometry(this, geom, vertical_grid, rc) _UNUSED_DUMMY(vertical_grid) end subroutine set_geometry -#ifndef __GFORTRAN__ +! #ifndef __GFORTRAN__ subroutine write_formatted(this, unit, iotype, v_list, iostat, iomsg) class(BracketSpec), intent(in) :: this integer, intent(in) :: unit @@ -281,7 +281,7 @@ subroutine write_formatted(this, unit, iotype, v_list, iostat, iomsg) write(unit, "(a)", iostat=iostat, iomsg=iomsg) "BracketSpec(write not implemented yet)" end subroutine write_formatted -#endif +! #endif function make_adapters(this, goal_spec, rc) result(adapters) type(StateItemAdapterWrapper), allocatable :: adapters(:) diff --git a/generic3g/specs/FieldSpec.F90 b/generic3g/specs/FieldSpec.F90 index 2095479181a6..502b888f13ca 100644 --- a/generic3g/specs/FieldSpec.F90 +++ b/generic3g/specs/FieldSpec.F90 @@ -114,9 +114,9 @@ module mapl3g_FieldSpec procedure :: set_geometry -#ifndef __GFORTRAN__ +! #ifndef __GFORTRAN__ procedure :: write_formatted -#endif +! #endif end type FieldSpec interface FieldSpec @@ -346,7 +346,7 @@ subroutine allocate(this, rc) _RETURN(ESMF_SUCCESS) end subroutine allocate -#ifndef __GFORTRAN__ +! #ifndef __GFORTRAN__ subroutine write_formatted(this, unit, iotype, v_list, iostat, iomsg) class(FieldSpec), intent(in) :: this integer, intent(in) :: unit @@ -374,7 +374,7 @@ subroutine write_formatted(this, unit, iotype, v_list, iostat, iomsg) _UNUSED_DUMMY(iotype) _UNUSED_DUMMY(v_list) end subroutine write_formatted -#endif +! #endif function get_ungridded_bounds(this, rc) result(bounds) type(LU_Bound), allocatable :: bounds(:) diff --git a/generic3g/specs/InvalidSpec.F90 b/generic3g/specs/InvalidSpec.F90 index 0d5aad4298d8..ea4d2669e6f4 100644 --- a/generic3g/specs/InvalidSpec.F90 +++ b/generic3g/specs/InvalidSpec.F90 @@ -38,9 +38,9 @@ module mapl3g_InvalidSpec procedure :: set_geometry => set_geometry -#ifndef __GFORTRAN__ +! #ifndef __GFORTRAN__ procedure :: write_formatted -#endif +! #endif procedure :: make_adapters end type InvalidSpec @@ -146,7 +146,7 @@ subroutine set_geometry(this, geom, vertical_grid, rc) _UNUSED_DUMMY(vertical_grid) end subroutine set_geometry -#ifndef __GFORTRAN__ +! #ifndef __GFORTRAN__ subroutine write_formatted(this, unit, iotype, v_list, iostat, iomsg) class(InvalidSpec), intent(in) :: this integer, intent(in) :: unit @@ -157,7 +157,7 @@ subroutine write_formatted(this, unit, iotype, v_list, iostat, iomsg) write(unit, "(a)", iostat=iostat, iomsg=iomsg) "InvalidSpec()" end subroutine write_formatted -#endif +! #endif ! Stub implementation function make_adapters(this, goal_spec, rc) result(adapters) diff --git a/generic3g/specs/ServiceSpec.F90 b/generic3g/specs/ServiceSpec.F90 index cebc39322e64..b3d9f66609b2 100644 --- a/generic3g/specs/ServiceSpec.F90 +++ b/generic3g/specs/ServiceSpec.F90 @@ -48,9 +48,9 @@ module mapl3g_ServiceSpec procedure :: add_to_bundle procedure :: set_geometry -#ifndef __GFORTRAN__ +! #ifndef __GFORTRAN__ procedure :: write_formatted -#endif +! #endif !!$ procedure :: check_complete end type ServiceSpec @@ -214,7 +214,7 @@ subroutine set_geometry(this, geom, vertical_grid, rc) _RETURN(_SUCCESS) end subroutine set_geometry -#ifndef __GFORTRAN__ +! #ifndef __GFORTRAN__ subroutine write_formatted(this, unit, iotype, v_list, iostat, iomsg) class(ServiceSpec), intent(in) :: this integer, intent(in) :: unit @@ -225,7 +225,7 @@ subroutine write_formatted(this, unit, iotype, v_list, iostat, iomsg) write(unit, "(a)", iostat=iostat, iomsg=iomsg) "ServiceSpec(write not implemented yet)" end subroutine write_formatted -#endif +! #endif function make_adapters(this, goal_spec, rc) result(adapters) type(StateItemAdapterWrapper), allocatable :: adapters(:) diff --git a/generic3g/specs/StateItemSpec.F90 b/generic3g/specs/StateItemSpec.F90 index cc4c00903227..65fafdcc5dc5 100644 --- a/generic3g/specs/StateItemSpec.F90 +++ b/generic3g/specs/StateItemSpec.F90 @@ -53,8 +53,8 @@ module mapl3g_StateItemSpec procedure(I_add_to_bundle), deferred :: add_to_bundle procedure(I_set_geometry), deferred :: set_geometry -#ifndef __GFORTRAN__ procedure(I_write_formatted), deferred :: write_formatted +#ifndef __GFORTRAN__ generic :: write(formatted) => write_formatted #endif @@ -160,7 +160,7 @@ subroutine I_set_geometry(this, geom, vertical_grid, rc) integer, optional, intent(out) :: rc end subroutine I_set_geometry -#ifndef __GFORTRAN__ +! #ifndef __GFORTRAN__ subroutine I_write_formatted(this, unit, iotype, v_list, iostat, iomsg) import StateItemSpec class(StateItemSpec), intent(in) :: this @@ -170,7 +170,7 @@ subroutine I_write_formatted(this, unit, iotype, v_list, iostat, iomsg) integer, intent(out) :: iostat character(*), intent(inout) :: iomsg end subroutine I_write_formatted -#endif +! #endif ! Returns an ordered list of adapters that priorities matching ! rules for connecting a family of extension to a goal spec. diff --git a/generic3g/specs/StateSpec.F90 b/generic3g/specs/StateSpec.F90 index b74d2925286f..56e84665c50c 100644 --- a/generic3g/specs/StateSpec.F90 +++ b/generic3g/specs/StateSpec.F90 @@ -40,9 +40,9 @@ module mapl3g_StateSpec procedure :: add_to_state procedure :: add_to_bundle -#ifndef __GFORTRAN__ +! #ifndef __GFORTRAN__ procedure :: write_formatted -#endif +! #endif end type StateSpec contains @@ -166,7 +166,7 @@ subroutine add_to_bundle(this, bundle, rc) _UNUSED_DUMMY(bundle) end subroutine add_to_bundle -#ifndef __GFORTRAN__ +! #ifndef __GFORTRAN__ subroutine write_formatted(this, unit, iotype, v_list, iostat, iomsg) class(StateSpec), intent(in) :: this integer, intent(in) :: unit @@ -177,7 +177,7 @@ subroutine write_formatted(this, unit, iotype, v_list, iostat, iomsg) write(unit, "(a)", iostat=iostat, iomsg=iomsg) "StateSpec(write not implemented yet)" end subroutine write_formatted -#endif +! #endif function make_adapters(this, goal_spec, rc) result(adapters) type(StateItemAdapterWrapper), allocatable :: adapters(:) diff --git a/generic3g/specs/WildcardSpec.F90 b/generic3g/specs/WildcardSpec.F90 index 314f00df0c9a..46ad6f2a0f22 100644 --- a/generic3g/specs/WildcardSpec.F90 +++ b/generic3g/specs/WildcardSpec.F90 @@ -37,9 +37,9 @@ module mapl3g_WildcardSpec procedure :: add_to_bundle procedure :: set_geometry -#ifndef __GFORTRAN__ +! #ifndef __GFORTRAN__ procedure :: write_formatted -#endif +! #endif procedure :: get_reference_spec end type WildcardSpec @@ -214,7 +214,7 @@ subroutine set_geometry(this, geom, vertical_grid, rc) _RETURN(_SUCCESS) end subroutine set_geometry -#ifndef __GFORTRAN__ +! #ifndef __GFORTRAN__ subroutine write_formatted(this, unit, iotype, v_list, iostat, iomsg) class(WildcardSpec), intent(in) :: this integer, intent(in) :: unit @@ -225,7 +225,7 @@ subroutine write_formatted(this, unit, iotype, v_list, iostat, iomsg) write(unit, "(a)", iostat=iostat, iomsg=iomsg) "WildcardSpec(write not implemented yet)" end subroutine write_formatted -#endif +! #endif function make_adapters(this, goal_spec, rc) result(adapters) type(StateItemAdapterWrapper), allocatable :: adapters(:) From 50eb3cd26a3ee02ea63277a140dac23b02fa0115 Mon Sep 17 00:00:00 2001 From: Purnendu Chakraborty Date: Mon, 2 Dec 2024 13:29:40 -0500 Subject: [PATCH 6/6] Cleaned up - removed commented ifdef's --- generic3g/specs/BracketSpec.F90 | 4 ---- generic3g/specs/FieldSpec.F90 | 4 ---- generic3g/specs/InvalidSpec.F90 | 4 ---- generic3g/specs/ServiceSpec.F90 | 4 ---- generic3g/specs/StateItemSpec.F90 | 2 -- generic3g/specs/StateSpec.F90 | 4 ---- generic3g/specs/WildcardSpec.F90 | 4 ---- 7 files changed, 26 deletions(-) diff --git a/generic3g/specs/BracketSpec.F90 b/generic3g/specs/BracketSpec.F90 index fee77d621a42..d7e50d015a49 100644 --- a/generic3g/specs/BracketSpec.F90 +++ b/generic3g/specs/BracketSpec.F90 @@ -47,9 +47,7 @@ module mapl3g_BracketSpec procedure :: make_adapters procedure :: set_geometry -! #ifndef __GFORTRAN__ procedure :: write_formatted -! #endif end type BracketSpec interface BracketSpec @@ -270,7 +268,6 @@ subroutine set_geometry(this, geom, vertical_grid, rc) _UNUSED_DUMMY(vertical_grid) end subroutine set_geometry -! #ifndef __GFORTRAN__ subroutine write_formatted(this, unit, iotype, v_list, iostat, iomsg) class(BracketSpec), intent(in) :: this integer, intent(in) :: unit @@ -281,7 +278,6 @@ subroutine write_formatted(this, unit, iotype, v_list, iostat, iomsg) write(unit, "(a)", iostat=iostat, iomsg=iomsg) "BracketSpec(write not implemented yet)" end subroutine write_formatted -! #endif function make_adapters(this, goal_spec, rc) result(adapters) type(StateItemAdapterWrapper), allocatable :: adapters(:) diff --git a/generic3g/specs/FieldSpec.F90 b/generic3g/specs/FieldSpec.F90 index 502b888f13ca..8255044f66e9 100644 --- a/generic3g/specs/FieldSpec.F90 +++ b/generic3g/specs/FieldSpec.F90 @@ -114,9 +114,7 @@ module mapl3g_FieldSpec procedure :: set_geometry -! #ifndef __GFORTRAN__ procedure :: write_formatted -! #endif end type FieldSpec interface FieldSpec @@ -346,7 +344,6 @@ subroutine allocate(this, rc) _RETURN(ESMF_SUCCESS) end subroutine allocate -! #ifndef __GFORTRAN__ subroutine write_formatted(this, unit, iotype, v_list, iostat, iomsg) class(FieldSpec), intent(in) :: this integer, intent(in) :: unit @@ -374,7 +371,6 @@ subroutine write_formatted(this, unit, iotype, v_list, iostat, iomsg) _UNUSED_DUMMY(iotype) _UNUSED_DUMMY(v_list) end subroutine write_formatted -! #endif function get_ungridded_bounds(this, rc) result(bounds) type(LU_Bound), allocatable :: bounds(:) diff --git a/generic3g/specs/InvalidSpec.F90 b/generic3g/specs/InvalidSpec.F90 index ea4d2669e6f4..b0daeb9c3ca5 100644 --- a/generic3g/specs/InvalidSpec.F90 +++ b/generic3g/specs/InvalidSpec.F90 @@ -38,9 +38,7 @@ module mapl3g_InvalidSpec procedure :: set_geometry => set_geometry -! #ifndef __GFORTRAN__ procedure :: write_formatted -! #endif procedure :: make_adapters end type InvalidSpec @@ -146,7 +144,6 @@ subroutine set_geometry(this, geom, vertical_grid, rc) _UNUSED_DUMMY(vertical_grid) end subroutine set_geometry -! #ifndef __GFORTRAN__ subroutine write_formatted(this, unit, iotype, v_list, iostat, iomsg) class(InvalidSpec), intent(in) :: this integer, intent(in) :: unit @@ -157,7 +154,6 @@ subroutine write_formatted(this, unit, iotype, v_list, iostat, iomsg) write(unit, "(a)", iostat=iostat, iomsg=iomsg) "InvalidSpec()" end subroutine write_formatted -! #endif ! Stub implementation function make_adapters(this, goal_spec, rc) result(adapters) diff --git a/generic3g/specs/ServiceSpec.F90 b/generic3g/specs/ServiceSpec.F90 index b3d9f66609b2..3fa46a513c37 100644 --- a/generic3g/specs/ServiceSpec.F90 +++ b/generic3g/specs/ServiceSpec.F90 @@ -48,9 +48,7 @@ module mapl3g_ServiceSpec procedure :: add_to_bundle procedure :: set_geometry -! #ifndef __GFORTRAN__ procedure :: write_formatted -! #endif !!$ procedure :: check_complete end type ServiceSpec @@ -214,7 +212,6 @@ subroutine set_geometry(this, geom, vertical_grid, rc) _RETURN(_SUCCESS) end subroutine set_geometry -! #ifndef __GFORTRAN__ subroutine write_formatted(this, unit, iotype, v_list, iostat, iomsg) class(ServiceSpec), intent(in) :: this integer, intent(in) :: unit @@ -225,7 +222,6 @@ subroutine write_formatted(this, unit, iotype, v_list, iostat, iomsg) write(unit, "(a)", iostat=iostat, iomsg=iomsg) "ServiceSpec(write not implemented yet)" end subroutine write_formatted -! #endif function make_adapters(this, goal_spec, rc) result(adapters) type(StateItemAdapterWrapper), allocatable :: adapters(:) diff --git a/generic3g/specs/StateItemSpec.F90 b/generic3g/specs/StateItemSpec.F90 index 65fafdcc5dc5..09f1e48b0796 100644 --- a/generic3g/specs/StateItemSpec.F90 +++ b/generic3g/specs/StateItemSpec.F90 @@ -160,7 +160,6 @@ subroutine I_set_geometry(this, geom, vertical_grid, rc) integer, optional, intent(out) :: rc end subroutine I_set_geometry -! #ifndef __GFORTRAN__ subroutine I_write_formatted(this, unit, iotype, v_list, iostat, iomsg) import StateItemSpec class(StateItemSpec), intent(in) :: this @@ -170,7 +169,6 @@ subroutine I_write_formatted(this, unit, iotype, v_list, iostat, iomsg) integer, intent(out) :: iostat character(*), intent(inout) :: iomsg end subroutine I_write_formatted -! #endif ! Returns an ordered list of adapters that priorities matching ! rules for connecting a family of extension to a goal spec. diff --git a/generic3g/specs/StateSpec.F90 b/generic3g/specs/StateSpec.F90 index 56e84665c50c..94e39c156635 100644 --- a/generic3g/specs/StateSpec.F90 +++ b/generic3g/specs/StateSpec.F90 @@ -40,9 +40,7 @@ module mapl3g_StateSpec procedure :: add_to_state procedure :: add_to_bundle -! #ifndef __GFORTRAN__ procedure :: write_formatted -! #endif end type StateSpec contains @@ -166,7 +164,6 @@ subroutine add_to_bundle(this, bundle, rc) _UNUSED_DUMMY(bundle) end subroutine add_to_bundle -! #ifndef __GFORTRAN__ subroutine write_formatted(this, unit, iotype, v_list, iostat, iomsg) class(StateSpec), intent(in) :: this integer, intent(in) :: unit @@ -177,7 +174,6 @@ subroutine write_formatted(this, unit, iotype, v_list, iostat, iomsg) write(unit, "(a)", iostat=iostat, iomsg=iomsg) "StateSpec(write not implemented yet)" end subroutine write_formatted -! #endif function make_adapters(this, goal_spec, rc) result(adapters) type(StateItemAdapterWrapper), allocatable :: adapters(:) diff --git a/generic3g/specs/WildcardSpec.F90 b/generic3g/specs/WildcardSpec.F90 index 46ad6f2a0f22..d5183bd9eb7c 100644 --- a/generic3g/specs/WildcardSpec.F90 +++ b/generic3g/specs/WildcardSpec.F90 @@ -37,9 +37,7 @@ module mapl3g_WildcardSpec procedure :: add_to_bundle procedure :: set_geometry -! #ifndef __GFORTRAN__ procedure :: write_formatted -! #endif procedure :: get_reference_spec end type WildcardSpec @@ -214,7 +212,6 @@ subroutine set_geometry(this, geom, vertical_grid, rc) _RETURN(_SUCCESS) end subroutine set_geometry -! #ifndef __GFORTRAN__ subroutine write_formatted(this, unit, iotype, v_list, iostat, iomsg) class(WildcardSpec), intent(in) :: this integer, intent(in) :: unit @@ -225,7 +222,6 @@ subroutine write_formatted(this, unit, iotype, v_list, iostat, iomsg) write(unit, "(a)", iostat=iostat, iomsg=iomsg) "WildcardSpec(write not implemented yet)" end subroutine write_formatted -! #endif function make_adapters(this, goal_spec, rc) result(adapters) type(StateItemAdapterWrapper), allocatable :: adapters(:)