-
Notifications
You must be signed in to change notification settings - Fork 29
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
2394 support char logical in psydata #2509
base: master
Are you sure you want to change the base?
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #2509 +/- ##
=======================================
Coverage 99.88% 99.88%
=======================================
Files 359 359
Lines 50264 50264
=======================================
Hits 50208 50208
Misses 56 56 ☔ View full report in Codecov by Sentry. |
…ogical_in_psydata
…ogical_in_psydata
…ogical_in_psydata
…ogical_in_psydata
…ogical_in_psydata
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, small PR :-)
Would it be possible to extend one of the examples to make use of/exercise this new functionality? Otherwise it's completely untested :-(
Also, I have a concern about the 'number of bits' being specified for logical and character variables. I can't remember how you use this information?
… that executes the newly supported data types.
…ogical_in_psydata
That was a bit of a headache, since neither gocean nor lfric support character strings. So I've added a new generic read-only verification library, and added an example as nemo/eg6. I couldn't add an examples that will actually throw an error (since PSyclone processes the file and does not support
I have also refactored all of that, so no more bits specified. Unfortunately, all of that that made this PR somewhat bigger :) |
…ogical_in_psydata
|
||
This will create a library called ``lib_read_only.a``. | ||
An executable example for using the generic read-only-verification | ||
library is included in ``examples/gocean/eg6/``. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nemo/eg6 rather than gocean?
# Author: A. R. Porter, STFC Daresbury Lab | ||
# Modified J. Henrichs, Bureau of Meteorology | ||
|
||
# Makefile for the 5th NEMO example. Uses PSyclone (which must |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
First sentence is wrong (and could just be removed).
@@ -0,0 +1,98 @@ | |||
# PSyclone NEMO Example 6 - Read-only Verification |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add a brief section to examples/nemo/README.md to mention this new example.
@@ -783,6 +783,14 @@ compilation instructions are in the ``README.md`` file, including how | |||
to switch from using the stand-alone extraction library to the NetCDF-based | |||
one (see :ref:`extraction_libraries` for details). | |||
|
|||
Example 6: Read-only Verification |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I realise we have duplication between this text and the markdown README files. If you're feeling keen, we could experiment with removing this section and replacing it with an include of the appropriate README. Sphinx's include
directive supports a 'parser' option which apparently allows this (https://docutils.sourceforge.io/docs/ref/rst/directives.html#include-options). However, now that I write all that, I think perhaps that would be a separate issue.
If you copy the lines 32 and 33 from ``dummy.f90`` into ``psy.f90``, | ||
the code will modify ``logical_var`` (by using out-of-bound array accesses. | ||
Or you could just manually set ``logical_var = .true.``). If you then | ||
compile again, an error will be produced. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This worked for me. Good stuff. Only wrinkle is that doing make compile
again ran PSyclone and over-wrote my modified psy.f90 file. I had to cut-n-paste the compile and link lines to build with the modified psy.f90 file. Not a biggie. Either mention it here or perhaps it's just a small tweak to the Makefile?
@@ -0,0 +1,35 @@ | |||
program dummy |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add the ususal license and a brief comment summarising the purpose of this file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You could take the opportunity to say this is really just about exercising aspects of the read-only verification library.
# ----------------------------------------------------------------------------- | ||
# Author: J. Henrichs, Australian Bureau of Meteorology | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add a comment saying that this Makefile is for the read-only checking lib for generic Fortran code.
# Read-only Verification Library for Generic Fortran Code | ||
|
||
This library implements the [PSyData API]( | ||
https://psyclone.readthedocs.io/en/latest/psy_data.html#read-only-verification-library-for-gocean) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This link is for gocean. Is that deliberate?
The compilation process will create the wrapper library ``lib_read_only.a``. | ||
|
||
Similar to compilation of the [examples]( | ||
https://psyclone.readthedocs.io/en/latest/examples.html#compilation), the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be tutorials_and_examples.html
I think.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks very much Joerg. Just a few minor things now.
In testing the compilation of the examples I discovered that the xdsl Makefile was broken (spaces instead of tabs) so I've taken the liberty of fixing that and pushed it on your branch.
No description provided.