@@ -1804,6 +1804,10 @@ end subroutine f_ESMF_VMGlobalGet
1804
1804
type (ESMF_LogEntry), dimension (:), pointer :: localbuf
1805
1805
character (len= ESMF_MAXPATHLEN) :: fname
1806
1806
character (ESMF_MAXSTR) :: petNumChar
1807
+ integer :: msgAbortCnt
1808
+ type (ESMF_LogMsg_Flag) :: msgAbortLst(6 )
1809
+ character (ESMF_MAXSTR) :: envRtAbort
1810
+ integer :: idxRtAbort
1807
1811
character (8 ) :: position
1808
1812
integer :: petCount
1809
1813
integer :: digits
@@ -1864,7 +1868,58 @@ end subroutine f_ESMF_VMGlobalGet
1864
1868
alog% flushed = ESMF_FALSE
1865
1869
alog% dirty = ESMF_FALSE
1866
1870
alog% FileIsOpen= ESMF_FALSE
1867
- alog% logmsgAbort = > null ()
1871
+ if (associated (alog% logmsgAbort)) deallocate (alog% logmsgAbort)
1872
+ call c_ESMC_VMGetEnv(" ESMF_RUNTIME_LOGMSGABORT" , envRtAbort, localrc)
1873
+ if (localrc /= ESMF_SUCCESS) then
1874
+ write (ESMF_UtilIOStderr,* ) ESMF_METHOD, &
1875
+ " : VMGetEnv - ESMF_RUNTIME_LOGMSGABORT "
1876
+ call ESMF_UtilIOUnitFlush(ESMF_UtilIOStderr, rc= rc)
1877
+ if (present (rc)) rc= localrc
1878
+ return
1879
+ end if
1880
+ msgAbortCnt = 0
1881
+ idxRtAbort = index (envRtAbort, " ESMF_LOGMSG_INFO" )
1882
+ if (idxRtAbort > 0 ) then
1883
+ msgAbortCnt = msgAbortCnt + 1
1884
+ msgAbortLst(msgAbortCnt) = ESMF_LOGMSG_INFO
1885
+ endif
1886
+ idxRtAbort = index (envRtAbort, " ESMF_LOGMSG_WARNING" )
1887
+ if (idxRtAbort > 0 ) then
1888
+ msgAbortCnt = msgAbortCnt + 1
1889
+ msgAbortLst(msgAbortCnt) = ESMF_LOGMSG_WARNING
1890
+ endif
1891
+ idxRtAbort = index (envRtAbort, " ESMF_LOGMSG_ERROR" )
1892
+ if (idxRtAbort > 0 ) then
1893
+ msgAbortCnt = msgAbortCnt + 1
1894
+ msgAbortLst(msgAbortCnt) = ESMF_LOGMSG_ERROR
1895
+ endif
1896
+ idxRtAbort = index (envRtAbort, " ESMF_LOGMSG_TRACE" )
1897
+ if (idxRtAbort > 0 ) then
1898
+ msgAbortCnt = msgAbortCnt + 1
1899
+ msgAbortLst(msgAbortCnt) = ESMF_LOGMSG_TRACE
1900
+ endif
1901
+ idxRtAbort = index (envRtAbort, " ESMF_LOGMSG_DEBUG" )
1902
+ if (idxRtAbort > 0 ) then
1903
+ msgAbortCnt = msgAbortCnt + 1
1904
+ msgAbortLst(msgAbortCnt) = ESMF_LOGMSG_DEBUG
1905
+ endif
1906
+ idxRtAbort = index (envRtAbort, " ESMF_LOGMSG_JSON" )
1907
+ if (idxRtAbort > 0 ) then
1908
+ msgAbortCnt = msgAbortCnt + 1
1909
+ msgAbortLst(msgAbortCnt) = ESMF_LOGMSG_JSON
1910
+ endif
1911
+ if (msgAbortCnt > 6 ) then
1912
+ write (ESMF_UtilIOStderr,* ) ESMF_METHOD, &
1913
+ " : msgAbortLst overflow - ESMF_RUNTIME_LOGMSGABORT"
1914
+ call ESMF_UtilIOUnitFlush(ESMF_UtilIOStderr, rc= rc)
1915
+ if (present (rc)) rc= ESMF_RC_BUFFER_SHORT
1916
+ return
1917
+ elseif (msgAbortCnt == 0 ) then
1918
+ alog% logmsgAbort = > null ()
1919
+ else
1920
+ allocate (alog% logmsgAbort(msgAbortCnt))
1921
+ alog% logmsgAbort= msgAbortLst(1 :msgAbortCnt)
1922
+ endif
1868
1923
nullify(alog% errorMask)
1869
1924
alog% errorMaskCount= 0
1870
1925
if (present (logkindflag)) then
0 commit comments