Skip to content

Stop and print#191

Open
rouson wants to merge 18 commits into
BerkeleyLab:mainfrom
rouson:stop-and-print
Open

Stop and print#191
rouson wants to merge 18 commits into
BerkeleyLab:mainfrom
rouson:stop-and-print

Conversation

@rouson

@rouson rouson commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

No description provided.

rouson added 18 commits June 22, 2026 09:02
This commit adds a pure stop_and_print subroutine and a
corresponding unit test.  The new subroutine facilitates printing
string_t objects, including the results of string_t expressions,
during error termination.

Example Usage:

call stop_and_print( "array = " // string_t( [1,2,3,4] ) )
This commit works around several build-time and runtime gfortran
conpiler bugs.
The character_stop_code subroutine is public only for purposes of
calling it from thetest suite so there's no need to have it in the
public interface (julienne_m).
This commit supports using user-defined derived-type output (UDDTO)
to create stop codes for derived types that extend the new writable_t
abstract type, which has

- A write_formatted deferred binding that obligates child types to
  support UDDTO,
- A private maxlen_ component that sets the maximum stop-code length,
- A maxlen type-bound function that returns maxlen_, and
- A set_maxlen type-bound subroutine that sets maxlen_.

This commit also includes a corresponding unit test.

@bonachea bonachea left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rouson This PR needs to be rebased and conflicts resolved before CI will run.

I don't have time for an in-depth review today, but here's a few things I noticed on a quick skim

if (.not. command_line%argument_present([character(len=len("--help"))::"--help","-h"])) then
#if TEST_INTENTIONAL_FAILURE && ASSERTIONS
if (me==1) print '(a)', new_line('') // 'Test the intentional failure of stop_and_print in a pure procedure: ' // new_line('')
if (me==1) print '(a)', new_line('') // 'Test the intentional failure of an idiomatic assertion: ' // new_line('')

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (me==1) print '(a)', new_line('') // 'Test the intentional failure of an idiomatic assertion: ' // new_line('')
if (me==1) print '(a)', new_line('') // 'Test the intentional failure of an idiomatic stop_and_print: ' // new_line('')

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Julienne library code should never call error stop directly.
Every new error stop in this file should be replaced with internal_error_stop

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants