Skip to content

Commit

Permalink
Merge pull request #2345 from GEOS-ESM/bugfix/mathomp4/mpt-gnu-bugfix
Browse files Browse the repository at this point in the history
Fix MPT + GNU bug at NAS
  • Loading branch information
mathomp4 authored Sep 8, 2023
2 parents a58fae0 + 7cf03d0 commit 2d59331
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Fixed

- Add call to initialize pFlogger layer for the unit tests.
- Rename `mpi_comm` to `comm` in `MAPL_HistoryGridComp.F90` to avoid GNU
+ MPT bug at NAS

### Removed

Expand Down
10 changes: 5 additions & 5 deletions gridcomps/History/MAPL_HistoryGridComp.F90
Original file line number Diff line number Diff line change
Expand Up @@ -5063,27 +5063,27 @@ subroutine shavebits( state, list, rc)
type(ESMF_Field) :: field
real, pointer :: ptr1d(:), ptr2d(:,:), ptr3d(:,:,:)
type(ESMF_VM) :: vm
integer :: mpi_comm
integer :: comm

if (list%nbits_to_keep >=MAPL_NBITS_UPPER_LIMIT) then
_RETURN(ESMF_SUCCESS)
endif

call ESMF_VMGetCurrent(vm,_RC)
call ESMF_VMGet(vm,mpiCommunicator=mpi_comm,_RC)
call ESMF_VMGet(vm,mpiCommunicator=comm,_RC)

do m=1,list%field_set%nfields
call ESMF_StateGet(state, trim(list%field_set%fields(3,m)),field,_RC )
call ESMF_FieldGet(field, rank=fieldRank,_RC)
if (fieldRank ==1) then
call ESMF_FieldGet(field, farrayptr=ptr1d, _RC)
call DownBit(ptr1d,ptr1d,list%nbits_to_keep,undef=MAPL_undef,mpi_comm=mpi_comm,_RC)
call DownBit(ptr1d,ptr1d,list%nbits_to_keep,undef=MAPL_undef,mpi_comm=comm,_RC)
elseif (fieldRank ==2) then
call ESMF_FieldGet(field, farrayptr=ptr2d, _RC)
call DownBit(ptr2d,ptr2d,list%nbits_to_keep,undef=MAPL_undef,mpi_comm=mpi_comm,_RC)
call DownBit(ptr2d,ptr2d,list%nbits_to_keep,undef=MAPL_undef,mpi_comm=comm,_RC)
elseif (fieldRank ==3) then
call ESMF_FieldGet(field, farrayptr=ptr3d, _RC)
call DownBit(ptr3d,ptr3d,list%nbits_to_keep,undef=MAPL_undef,mpi_comm=mpi_comm,_RC)
call DownBit(ptr3d,ptr3d,list%nbits_to_keep,undef=MAPL_undef,mpi_comm=comm,_RC)
else
_FAIL('The field rank is not implmented')
endif
Expand Down

0 comments on commit 2d59331

Please sign in to comment.