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)