Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NAG fixes for fypp issue. #193

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 13 additions & 5 deletions src/atlas_f/atlas_f.fypp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,11 @@
#! Usage:
#! if( condition ) @{ ATLAS_ABORT( "error message" ) }@
#!
#ifdef NAGFOR
call fckit_exception%abort( ${string}$, "", ${_LINE_}$ )
#else
call fckit_exception%abort( ${string}$, "${_FILE_}$", ${_LINE_}$ )
#endif
#:enddef


Expand All @@ -34,8 +38,12 @@
#! @{ ATLAS_ASSERT( cond ) }@
#!
if (.not. (${cond}$)) then
#ifdef NAGFOR
call fckit_exception%abort( '${cond.replace("'", "''")}$', "", ${_LINE_}$ )
#else
call fckit_exception%abort( '${cond.replace("'", "''")}$', "${_FILE_}$", ${_LINE_}$ )
end if
#endif
endif
#:enddef

#:def ATLAS_TRACE( title, labels = None )
Expand All @@ -53,9 +61,9 @@ end if
#! call trace%final()
#!
#:if labels is not None
atlas_Trace( "${_FILE_}$", ${_LINE_}$, ${title}$, ${labels}$ )
atlas_Trace( "", ${_LINE_}$, ${title}$, ${labels}$ )
#:else
atlas_Trace( "${_FILE_}$", ${_LINE_}$, ${title}$ )
atlas_Trace( "", ${_LINE_}$, ${title}$ )
#:endif
#:enddef

Expand All @@ -74,9 +82,9 @@ end if
#! call trace%final()
#!
#:if labels is not None
${trace}$ = atlas_Trace( "${_FILE_}$", ${_LINE_}$, ${title}$, ${labels}$ )
${trace}$ = atlas_Trace( "", ${_LINE_}$, ${title}$, ${labels}$ )
#:else
${trace}$ = atlas_Trace( "${_FILE_}$", ${_LINE_}$, ${title}$ )
${trace}$ = atlas_Trace( "", ${_LINE_}$, ${title}$ )
#:endif
#:enddef

Expand Down
4 changes: 4 additions & 0 deletions src/tests/runtime/fctest_trace.fypp
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,11 @@ implicit none

type(atlas_Trace) :: trace

#ifdef NAGFOR
trace = atlas_Trace("",${_LINE_}$,"test_trace")
#else
trace = atlas_Trace("${_FILE_}$",${_LINE_}$,"test_trace")
#endif

FCTEST_CHECK( trace%running() )

Expand Down