Skip to content

Commit

Permalink
tidy up (still runtime error on redistribute%execute)
Browse files Browse the repository at this point in the history
  • Loading branch information
sbrdar committed Nov 2, 2023
1 parent 7e1dec8 commit 51e11c2
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 14 deletions.
2 changes: 1 addition & 1 deletion src/atlas_f/redistribution/atlas_Redistribution_module.F90
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ subroutine atlas_Redistribution__execute(this, field_1, field_2)
use atlas_Field_module
class(atlas_Redistribution), intent(in) :: this
type(atlas_Field), intent(in) :: field_1
type(atlas_Field), intent(out) :: field_2
type(atlas_Field), intent(inout) :: field_2
call atlas__Redistribution__execute(this%CPTR_PGIBUG_A, field_1%CPTR_PGIBUG_A, field_2%CPTR_PGIBUG_A)
end subroutine

Expand Down
21 changes: 8 additions & 13 deletions src/tests/redistribution/fctest_redistribution.F90
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,10 @@ module fcta_Redistribution_fxt

implicit none
type(atlas_StructuredGrid) :: grid
type(atlas_FunctionSpace) :: fspace_1, fspace_2, fspace_hlp
!type(atlas_functionspace_StructuredColumns) :: fspace_1, fspace_2
type(atlas_functionspace_StructuredColumns) :: fspace_1, fspace_2, fspace_hlp
type(atlas_Redistribution) :: redist, redist_hlp
type(atlas_Field) :: field_1, field_2
real(c_double), pointer :: field_1v(:), field_2v(:)
real(c_float), pointer :: field_1v(:), field_2v(:)

grid = atlas_StructuredGrid("O8")
fspace_1 = atlas_functionspace_StructuredColumns(grid, atlas_Partitioner("equal_regions"), halo=2)
Expand All @@ -61,23 +60,19 @@ module fcta_Redistribution_fxt
fspace_hlp = redist%source()
fspace_hlp = redist%target()

field_1 = fspace_1%create_field(kind=atlas_real(c_double))
field_2 = fspace_2%create_field(kind=atlas_real(c_double))
field_1 = fspace_1%create_field(atlas_real(c_float))
field_2 = fspace_2%create_field(atlas_real(c_float))

call field_1%data(field_1v)
field_1v = 1._c_double
field_1v = 1._c_float
call field_2%data(field_2v)
field_2v = 2._c_double
field_2v = 2._c_float

print *, "fields done"

!call redist%execute(field_1, field_2)

print *, "redist exe done"
call redist%execute(field_1, field_2)

call field_2%data(field_2v)
call field_2%halo_exchange()
!FCTEST_CHECK(all(field_2v == 1.))
FCTEST_CHECK(all(field_2v == 1.))

call field_2%final()
call field_1%final()
Expand Down

0 comments on commit 51e11c2

Please sign in to comment.