Skip to content

Commit

Permalink
Construct logFileName in a way that works even if __FILE__ marco star…
Browse files Browse the repository at this point in the history
…ts with "./" as is the case for LLVM flang-new.
  • Loading branch information
theurich committed Oct 24, 2024
1 parent 56edd9c commit 90b9353
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/epilogue/src/ESMF_Test.F90
Original file line number Diff line number Diff line change
Expand Up @@ -799,11 +799,10 @@ subroutine ESMF_TestStart(file, line, unit, rc)
! create a file name for the log file
! find locations of the underscore and period
underScore = index (file, "_")
Period = index (file, ".")
Period = index (file, substring=".", back=.true.) ! search from back of string,
! safe for ./file start
logFileName = file(underScore+1:Period) // "Log"



! initialize the framework. if this fails, print a message directly
! because there is no guarentee that the log code will be working.
call ESMF_Initialize(vm=globalVM, defaultlogfilename=logFileName, &
Expand Down

0 comments on commit 90b9353

Please sign in to comment.