Skip to content

Commit

Permalink
Merge branch 'develop' into release/MAPL-v3
Browse files Browse the repository at this point in the history
  • Loading branch information
mathomp4 committed Dec 10, 2024
2 parents 428fb37 + 4dbc5e3 commit 39d4278
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ _ Add run_dt to ComponentSpec and ComponentSpecParser

### Added

- Added loggers when writing or reading weight files

### Changed

### Fixed
Expand Down
7 changes: 7 additions & 0 deletions base/MAPL_EsmfRegridder.F90
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ module MAPL_EsmfRegridderMod
use MAPL_RegridderSpecRouteHandleMap
use MAPL_MAPLGrid
use MAPL_ConstantsMod
use pFlogger, only: logging, Logger
implicit none
private

Expand Down Expand Up @@ -1443,6 +1444,9 @@ subroutine create_route_handle(this, kind, rc)
logical :: rh_file_exists, file_weights, compute_transpose
type(ESMF_Info) :: infoh

type(Logger), pointer :: lgr
lgr => logging%get_logger('MAPL')

if (kind == ESMF_TYPEKIND_R4) then
route_handles => route_handles_r4
transpose_route_handles => transpose_route_handles_r4
Expand All @@ -1469,6 +1473,7 @@ subroutine create_route_handle(this, kind, rc)
rh_file_exists = .false.
end if
if (rh_file_exists) then
call lgr%info('Reading weight file: %a', trim(rh_file))
route_handle = ESMF_RouteHandleCreate(rh_file,_RC)
call route_handles%insert(spec, route_handle)
if (compute_transpose) then
Expand Down Expand Up @@ -1588,8 +1593,10 @@ subroutine create_route_handle(this, kind, rc)
call ESMF_FieldDestroy(dst_field, rc=status)
_VERIFY(status)
if (file_weights) then
call lgr%info('Writing weight file: %a', trim(rh_file))
call ESMF_RouteHandleWrite(route_handle,rh_file,_RC)
if (compute_transpose) then
call lgr%info('Writing transpose weight file: %a', trim(rh_trans_file))
call ESMF_RouteHandleWrite(transpose_route_handle,rh_trans_file,_RC)
end if
end if
Expand Down

0 comments on commit 39d4278

Please sign in to comment.