Skip to content

Commit

Permalink
Fixes for NVHPC 24.5
Browse files Browse the repository at this point in the history
  • Loading branch information
mathomp4 committed Jun 4, 2024
1 parent aa9264d commit 06323a4
Show file tree
Hide file tree
Showing 3 changed files with 71 additions and 22 deletions.
7 changes: 5 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added

- Add new option to Regrid_Util.x to write and re-use ESMF pregenerated weights
- If file path length exceeds ESMF_MAXSTR, add _FAIL in subroutine fglob
- If file path length exceeds ESMF_MAXSTR, add `_FAIL` in subroutine fglob
- Add GNU UFS-like CI test

### Changed

- fixed a bug in generate_newnxy in MAPL_SwathGridFactory.F90 (NX*NY=Ncore)
- fixed a bug in generate_newnxy in MAPL_SwathGridFactory.F90 (`NX*NY=Ncore`)
- pFIO Clients don't send "Done" message when there is no request
- Update `components.yaml`
- ESMA_cmake v3.45.1
Expand All @@ -24,6 +24,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Fixed

- Fixes for NVHPC 24.5
- Convert `MAPL_GeosatMaskMod` to "interface-in-both-files" submodule style

### Removed

### Deprecated
Expand Down
16 changes: 13 additions & 3 deletions gridcomps/History/Sampler/MAPL_GeosatMaskMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ module MaskSamplerGeosatMod
integer :: obsfile_Te_index
logical :: is_valid
contains
procedure :: initialize
procedure :: initialize => initialize_
procedure :: add_metadata
procedure :: create_file_handle
procedure :: close_file_handle
Expand All @@ -105,24 +105,30 @@ module MaskSamplerGeosatMod

interface
module function MaskSamplerGeosat_from_config(config,string,clock,rc) result(mask)
use BinIOMod
use pflogger, only : Logger, logging

type(MaskSamplerGeosat) :: mask
type(ESMF_Config), intent(inout) :: config
character(len=*), intent(in) :: string
type(ESMF_Clock), intent(in) :: clock
integer, optional, intent(out) :: rc
end function MaskSamplerGeosat_from_config

module subroutine initialize(this,items,bundle,timeInfo,vdata,reinitialize,rc)
module subroutine initialize_(this,items,bundle,timeInfo,vdata,reinitialize,rc)
class(MaskSamplerGeosat), intent(inout) :: this
type(GriddedIOitemVector), optional, intent(inout) :: items
type(ESMF_FieldBundle), optional, intent(inout) :: bundle
type(TimeData), optional, intent(inout) :: timeInfo
type(VerticalData), optional, intent(inout) :: vdata
logical, optional, intent(in) :: reinitialize
integer, optional, intent(out) :: rc
end subroutine initialize
end subroutine initialize_

module subroutine create_Geosat_grid_find_mask(this, rc)
use pflogger, only: Logger, logging
implicit none

class(MaskSamplerGeosat), intent(inout) :: this
integer, optional, intent(out) :: rc
end subroutine create_Geosat_grid_find_mask
Expand Down Expand Up @@ -151,12 +157,16 @@ module subroutine close_file_handle(this,rc)
end subroutine close_file_handle

module subroutine regrid_accumulate_append_file(this,current_time,rc)
implicit none

class(MaskSamplerGeosat), intent(inout) :: this
type(ESMF_Time), intent(inout) :: current_time
integer, optional, intent(out) :: rc
end subroutine regrid_accumulate_append_file

module function compute_time_for_current(this,current_time,rc) result(rtime)
use MAPL_NetCDF, only : convert_NetCDF_DateTime_to_ESMF

class(MaskSamplerGeosat), intent(inout) :: this
type(ESMF_Time), intent(in) :: current_time
integer, optional, intent(out) :: rc
Expand Down
70 changes: 53 additions & 17 deletions gridcomps/History/Sampler/MAPL_GeosatMaskMod_smod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,15 @@
implicit none
contains

module procedure MaskSamplerGeosat_from_config
module function MaskSamplerGeosat_from_config(config,string,clock,rc) result(mask)
use BinIOMod
use pflogger, only : Logger, logging
type(MaskSamplerGeosat) :: mask
type(ESMF_Config), intent(inout) :: config
character(len=*), intent(in) :: string
type(ESMF_Clock), intent(in) :: clock
integer, optional, intent(out) :: rc

type(ESMF_Time) :: currTime
type(ESMF_TimeInterval) :: epoch_frequency
type(ESMF_TimeInterval) :: obs_time_span
Expand Down Expand Up @@ -94,13 +100,21 @@

105 format (1x,a,2x,a)
106 format (1x,a,2x,i8)
end procedure MaskSamplerGeosat_from_config
end function MaskSamplerGeosat_from_config


!
!-- integrate both initialize and reinitialize
!
module procedure initialize
module subroutine initialize_(this,items,bundle,timeInfo,vdata,reinitialize,rc)
class(MaskSamplerGeosat), intent(inout) :: this
type(GriddedIOitemVector), optional, intent(inout) :: items
type(ESMF_FieldBundle), optional, intent(inout) :: bundle
type(TimeData), optional, intent(inout) :: timeInfo
type(VerticalData), optional, intent(inout) :: vdata
logical, optional, intent(in) :: reinitialize
integer, optional, intent(out) :: rc

integer :: status
type(ESMF_Grid) :: grid
type(variable) :: v
Expand Down Expand Up @@ -131,12 +145,16 @@

_RETURN(_SUCCESS)

end procedure initialize
end subroutine initialize_


module procedure create_Geosat_grid_find_mask
module subroutine create_Geosat_grid_find_mask(this, rc)
use pflogger, only: Logger, logging
implicit none

class(MaskSamplerGeosat), intent(inout) :: this
integer, optional, intent(out) :: rc

type(Logger), pointer :: lgr
real(ESMF_KIND_R8), pointer :: ptAT(:)
type(ESMF_routehandle) :: RH
Expand Down Expand Up @@ -453,10 +471,13 @@
iroot, mpic, ierr )

_RETURN(_SUCCESS)
end procedure create_Geosat_grid_find_mask
end subroutine create_Geosat_grid_find_mask


module subroutine add_metadata(this,rc)
class(MaskSamplerGeosat), intent(inout) :: this
integer, optional, intent(out) :: rc

module procedure add_metadata
type(variable) :: v
type(ESMF_Field) :: field
integer :: fieldCount
Expand Down Expand Up @@ -543,12 +564,16 @@
deallocate (fieldNameList, _STAT)

_RETURN(_SUCCESS)
end procedure add_metadata
end subroutine add_metadata


module procedure regrid_accumulate_append_file
!
module subroutine regrid_accumulate_append_file(this,current_time,rc)
implicit none

class(MaskSamplerGeosat), intent(inout) :: this
type(ESMF_Time), intent(inout) :: current_time
integer, optional, intent(out) :: rc
!
integer :: status
integer :: fieldCount
integer :: ub(1), lb(1)
Expand Down Expand Up @@ -671,11 +696,14 @@
end do

_RETURN(_SUCCESS)
end procedure regrid_accumulate_append_file
end subroutine regrid_accumulate_append_file



module procedure create_file_handle
module subroutine create_file_handle(this,filename,rc)
class(MaskSamplerGeosat), intent(inout) :: this
character(len=*), intent(in) :: filename
integer, optional, intent(out) :: rc
type(variable) :: v
integer :: status, j
real(kind=REAL64), allocatable :: x(:)
Expand Down Expand Up @@ -703,22 +731,30 @@
! call this%formatter%put_var('mask_name',this%mask_name,_RC)

_RETURN(_SUCCESS)
end procedure create_file_handle
end subroutine create_file_handle


module procedure close_file_handle
module subroutine close_file_handle(this,rc)
class(MaskSamplerGeosat), intent(inout) :: this
integer, optional, intent(out) :: rc

integer :: status
if (trim(this%ofile) /= '') then
if (mapl_am_i_root()) then
call this%formatter%close(_RC)
end if
end if
_RETURN(_SUCCESS)
end procedure close_file_handle
end subroutine close_file_handle


module procedure compute_time_for_current
module function compute_time_for_current(this,current_time,rc) result(rtime)
use MAPL_NetCDF, only : convert_NetCDF_DateTime_to_ESMF
class(MaskSamplerGeosat), intent(inout) :: this
type(ESMF_Time), intent(in) :: current_time
integer, optional, intent(out) :: rc
real(kind=ESMF_KIND_R8) :: rtime

integer :: status
type(ESMF_TimeInterval) :: t_interval
class(Variable), pointer :: var
Expand All @@ -744,7 +780,7 @@
rtime = rtime_1d(1)

_RETURN(_SUCCESS)
end procedure compute_time_for_current
end function compute_time_for_current



Expand Down

0 comments on commit 06323a4

Please sign in to comment.