From 4a16f59b9b3fefe43c807321a2ea4dcb8c0c7ec3 Mon Sep 17 00:00:00 2001 From: Matthew Thompson Date: Mon, 9 Dec 2024 15:46:38 -0500 Subject: [PATCH 1/2] Add loggers when reading and writing weights --- CHANGELOG.md | 2 ++ base/MAPL_EsmfRegridder.F90 | 7 +++++++ 2 files changed, 9 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4458f034c4c7..15bdec700f20 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added +- Added loggers when writing or reading weight files + ### Changed ### Fixed diff --git a/base/MAPL_EsmfRegridder.F90 b/base/MAPL_EsmfRegridder.F90 index 97587cf6421d..4d645520140c 100644 --- a/base/MAPL_EsmfRegridder.F90 +++ b/base/MAPL_EsmfRegridder.F90 @@ -14,6 +14,7 @@ module MAPL_EsmfRegridderMod use MAPL_RegridderSpecRouteHandleMap use MAPL_MAPLGrid use MAPL_ConstantsMod + use pFlogger, only: logging, Logger implicit none private @@ -1442,6 +1443,9 @@ subroutine create_route_handle(this, kind, rc) character(len=ESMF_MAXPATHLEN) :: rh_file,rh_trans_file logical :: rh_file_exists, file_weights, compute_transpose + 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 @@ -1468,6 +1472,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 @@ -1586,8 +1591,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(rg_trans_file)) call ESMF_RouteHandleWrite(transpose_route_handle,rh_trans_file,_RC) end if end if From ff54749033cdc3ae8dcca0ef5990854d542edd96 Mon Sep 17 00:00:00 2001 From: Matthew Thompson Date: Mon, 9 Dec 2024 15:54:07 -0500 Subject: [PATCH 2/2] Fix typo --- base/MAPL_EsmfRegridder.F90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/base/MAPL_EsmfRegridder.F90 b/base/MAPL_EsmfRegridder.F90 index 4d645520140c..3fbdf9cf4734 100644 --- a/base/MAPL_EsmfRegridder.F90 +++ b/base/MAPL_EsmfRegridder.F90 @@ -1594,7 +1594,7 @@ subroutine create_route_handle(this, kind, rc) 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(rg_trans_file)) + 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