From b5de9e6b862f9e5433010e942a10a92f88d5d663 Mon Sep 17 00:00:00 2001 From: Lizzie Lundgren Date: Mon, 17 Jul 2023 15:32:56 -0400 Subject: [PATCH] Set EMSF logging mode at run-time via config file This update was provided by Matt Thompson (NASA GMAO). Signed-off-by: Lizzie Lundgren --- gridcomps/Cap/MAPL_Cap.F90 | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/gridcomps/Cap/MAPL_Cap.F90 b/gridcomps/Cap/MAPL_Cap.F90 index 624257ffdb58..58311733f2b1 100755 --- a/gridcomps/Cap/MAPL_Cap.F90 +++ b/gridcomps/Cap/MAPL_Cap.F90 @@ -273,11 +273,23 @@ subroutine run_model(this, comm, unusable, rc) integer(kind=INT64) :: start_tick, stop_tick, tick_rate integer :: status class(Logger), pointer :: lgr + logical :: file_exists _UNUSED_DUMMY(unusable) call start_timer() + ! Look for a file called "ESMF.rc" + inquire(file='ESMF.rc', exist=file_exists) + + ! If the file exists, we pass it into ESMF_Initialize, else, we + ! use the one from the command line arguments + if (file_exists) then + call ESMF_Initialize (configFileName='ESMF.rc', mpiCommunicator=comm, _RC) + else + call ESMF_Initialize (logKindFlag=this%cap_options%esmf_logging_mode, mpiCommunicator=comm, _RC) + end if + call ESMF_Initialize (logKindFlag=this%cap_options%esmf_logging_mode, mpiCommunicator=comm, rc=status) _VERIFY(status)