Skip to content

Commit

Permalink
Merge PR #29 (Set ESMF logging mode at run-time via config file)
Browse files Browse the repository at this point in the history
This merge brings PR #29 (Set ESMF logging mode at run-time via config
file, by @lizziel) into the gchp/dev branch.  This eliminates hardwired
configuration of ESMF log file options.  A new config file, ESMF.rc,
is added to control ESMF log file options.

Signed-off-by: Bob Yantosca <[email protected]>
  • Loading branch information
yantosca committed Jul 18, 2023
2 parents 388dda8 + b5de9e6 commit 277e83f
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions gridcomps/Cap/MAPL_Cap.F90
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down

0 comments on commit 277e83f

Please sign in to comment.