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

Strategy for Fortran STOP #5

Open
mwtoews opened this issue Aug 17, 2023 · 4 comments
Open

Strategy for Fortran STOP #5

mwtoews opened this issue Aug 17, 2023 · 4 comments

Comments

@mwtoews
Copy link
Collaborator

mwtoews commented Aug 17, 2023

As mention in #3 (comment) there are potential issues with the Fortran STOP statements, which will exit the Python process.

Find them in src with:

git grep -B1 -i stop

There are approx. 50 of these in src, mostly with gslib's sgsim_code.f90.

There are a few strategies:

@jtwhite79
Copy link
Contributor

I like first option the most bc it jives with the rest of the code. Can we use the existing functionality for setting the error message? @mwtoews , do you have a feel for how much effort it would be to patch these stops to be more amenable to library calls? Im happy to help on this front if you can work a strategy/approach..or we can divide and conquer?

@mwtoews
Copy link
Collaborator Author

mwtoews commented Aug 17, 2023

Wrt option 1 to refactor Fortran, I'll take a look at what John as done and see if I can catch "INVALID power variogram" as a start. But also, raise this with John when you get a chance.

@jtwhite79
Copy link
Contributor

So do think most of the stops are sourced to the power variogram? If so, we can just trap that on the python side...

@mwtoews
Copy link
Collaborator Author

mwtoews commented Aug 17, 2023

I've started some data validation strategies with d470ed5 which operate on either scalars or vectors. E.g., here for install_structured_grid:

validate_scalar("ncol", ncol, gt=0)
validate_scalar("nrow", nrow, gt=0)
validate_scalar("nlay", nlay, gt=0)
col = ManyArrays(float_any={"delr": delr}, ar_len=ncol)
row = ManyArrays(float_any={"delc": delc}, ar_len=nrow)
col.validate("delr", gt=0.0)
row.validate("delc", gt=0.0)
validate_scalar("icorner", icorner, isin=[1, 2])

These will be expanded elsewhere later.

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

No branches or pull requests

2 participants