From 2a76272011c1314e83e4efc00dc41442e455dc85 Mon Sep 17 00:00:00 2001 From: Matthew Thompson Date: Fri, 8 Nov 2024 15:51:52 -0500 Subject: [PATCH] Use iso_c_binding --- geom/FieldPointerUtilities.F90 | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/geom/FieldPointerUtilities.F90 b/geom/FieldPointerUtilities.F90 index aa6cdddd3a11..11d253957d16 100644 --- a/geom/FieldPointerUtilities.F90 +++ b/geom/FieldPointerUtilities.F90 @@ -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 @@ -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) @@ -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) @@ -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) @@ -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)