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

Explicitly use iso_c_binding types #2531

Merged
merged 3 commits into from
Jan 18, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Fixed

- Explictly `use` some `iso_c_binding` types previously pulled in through ESMF. This is fixed in future ESMF versions (8.7+) and so
we anticipate this here

### Removed

### Deprecated
Expand Down
5 changes: 3 additions & 2 deletions base/Plain_netCDF_Time.F90
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ module Plain_netCDF_Time
! use MAPL_CommsMod
use, intrinsic :: iso_fortran_env, only: REAL32
use, intrinsic :: iso_fortran_env, only: REAL64
use, intrinsic :: iso_c_binding, only: C_INT
implicit none
public

Expand Down Expand Up @@ -451,7 +452,7 @@ subroutine bisect_find_LB_R8_I8(xa, x, n, n_LB, n_UB, rc)
if(present(n_LB)) LB=max(LB, n_LB)
if(present(n_UB)) UB=min(UB, n_UB)
klo=LB; khi=UB; dk=1

if ( xa(LB ) > xa(UB) ) then
klo= UB
khi= LB
Expand Down Expand Up @@ -673,7 +674,7 @@ function matches( string, substring )
RETURN
end function matches


subroutine split_string_by_space (string_in, length_mx, &
mxseg, nseg, str_piece, jstatus)
integer, intent (in) :: length_mx
Expand Down
12 changes: 6 additions & 6 deletions field_utils/FieldPointerUtilities.F90
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
module MAPL_FieldPointerUtilities
use ESMF
use MAPL_ExceptionHandling
use, intrinsic :: iso_c_binding, only: c_ptr, c_f_pointer
use, intrinsic :: iso_c_binding, only: c_ptr, c_f_pointer, c_loc
implicit none
private

Expand Down Expand Up @@ -483,14 +483,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 @@ -842,7 +842,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 @@ -871,7 +871,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 @@ -888,7 +888,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