Skip to content

Commit

Permalink
Use iso_c_binding
Browse files Browse the repository at this point in the history
  • Loading branch information
mathomp4 committed Nov 8, 2024
1 parent f75769b commit 2a76272
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions geom/FieldPointerUtilities.F90
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ module MAPL_FieldPointerUtilities
use MAPL_ExceptionHandling
use, intrinsic :: iso_fortran_env, only: REAL32, REAL64
use, intrinsic :: iso_fortran_env, only: INT8, INT16, INT32, INT64
use, intrinsic :: iso_c_binding, only: c_ptr, c_f_pointer, c_loc
implicit none
private

Expand Down Expand Up @@ -484,14 +485,14 @@ logical function are_broadcast_conformable(x, y, rc) result(conformable)
integer, dimension(:), allocatable :: count_x, count_y
integer :: status
logical :: normal_conformable

conformable = .false.
! this should really used the geom and ungridded dims
! for now we will do this until we have a geom agnostic stuff worked out...
! the ideal algorithm would be if geom == geom and input does not have ungridded
! and thing we are copying to does, then we are "conformable"
normal_conformable = FIeldsAreConformable(x,y,_RC)

if (normal_conformable) then
conformable = .true.
_RETURN(_SUCCESS)
Expand Down Expand Up @@ -843,7 +844,7 @@ subroutine MAPL_FieldGetLocalElementCount(field,local_count,rc)
else
_FAIL("Unsupported rank")
end if
else
else
_FAIL("Unsupported type")
end if
_RETURN(_SUCCESS)
Expand Down Expand Up @@ -872,7 +873,7 @@ subroutine GetFieldsUndef_r4(fields,undef_values,rc)

integer :: status, i
logical :: isPresent

allocate(undef_values(size(fields)))
do i =1,size(fields)
call ESMF_AttributeGet(fields(i),name="missing_value",isPresent=isPresent,_RC)
Expand All @@ -889,7 +890,7 @@ subroutine GetFieldsUndef_r8(fields,undef_values,rc)

integer :: status, i
logical :: isPresent

allocate(undef_values(size(fields)))
do i =1,size(fields)
call ESMF_AttributeGet(fields(i),name="missing_value",isPresent=isPresent,_RC)
Expand Down

0 comments on commit 2a76272

Please sign in to comment.