Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resolve gfortran segfault issue with vertical regridding tests #3195

Open
wants to merge 6 commits into
base: release/MAPL-v3
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions generic3g/specs/BracketSpec.F90
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,9 @@ module mapl3g_BracketSpec

procedure :: make_adapters
procedure :: set_geometry
#ifndef __GFORTRAN__
procedure :: write_formatted
#endif
end type BracketSpec

interface BracketSpec
Expand Down Expand Up @@ -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
Expand All @@ -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(:)
Expand Down
16 changes: 10 additions & 6 deletions generic3g/specs/FieldSpec.F90
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,9 @@ module mapl3g_FieldSpec

procedure :: set_geometry

#ifndef __GFORTRAN__
procedure :: write_formatted
#endif
end type FieldSpec

interface FieldSpec
Expand Down Expand Up @@ -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
Expand All @@ -352,25 +355,26 @@ 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)") ")"

_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(:)
Expand Down
5 changes: 4 additions & 1 deletion generic3g/specs/InvalidSpec.F90
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,9 @@ module mapl3g_InvalidSpec

procedure :: set_geometry => set_geometry

#ifndef __GFORTRAN__
procedure :: write_formatted

#endif
procedure :: make_adapters
end type InvalidSpec

Expand Down Expand Up @@ -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
Expand All @@ -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)
Expand Down
4 changes: 4 additions & 0 deletions generic3g/specs/ServiceSpec.F90
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand All @@ -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(:)
Expand Down
4 changes: 4 additions & 0 deletions generic3g/specs/StateItemSpec.F90
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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.
Expand Down
4 changes: 4 additions & 0 deletions generic3g/specs/StateSpec.F90
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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(:)
Expand Down
4 changes: 4 additions & 0 deletions generic3g/specs/WildcardSpec.F90
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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(:)
Expand Down
5 changes: 1 addition & 4 deletions generic3g/tests/Test_Scenarios.pf
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down