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

Invalid scientific notation output by print_state() #32

Closed
2 tasks done
robgpita opened this issue Jan 26, 2021 · 0 comments · Fixed by #34
Closed
2 tasks done

Invalid scientific notation output by print_state() #32

robgpita opened this issue Jan 26, 2021 · 0 comments · Fixed by #34
Assignees
Labels
bug Something isn't working

Comments

@robgpita
Copy link
Contributor

robgpita commented Jan 26, 2021

Issue checklist

  • I have read the README and ref/README, including the Troubleshooting Guide.
  • I have reviewed existing issues to ensure this has not already been reported.

Describe the bug

The print_state() function is outputting non-standard scientific notation, and incompatible with standards used by other languages (C, C++, Julia) and other printf based I/O.

Recipe to reproduce

Steps to reproduce the behavior:

  1. Go to the print_state() function in sw_core.F90
  2. Observe print_state()'s calls to print_3d_variable() and print_2d_variable() functions. These functions' write statement should be altered to comply with the 'conventional' way that printf represents floating point numbers in scientific notation.

Expected behavior, Screenshots, and terminal output

The current output in scientific notation:

-0.10000000000E-07

printf's equivalent of how this value is expressed in scientific notation:

-1.00000000000E-08

This is what the modified Fortran code should output.

See current test outputs for full context.

Additional context

Fortran is the outlier in how scientific notation is expressed. The current output will make it very difficult for others to use baselines for testing.

Not only will the write statements in the print_3d_variable & print_2d_variable functions need to be changed, all of the files within the ref/test/test_output will need alterations to reflect the new scientific notation necessary to comply with future testing of the kernel.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
1 participant