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

refactor(IC): integrate initial conditions pkg with IDM #1425

Merged
merged 3 commits into from
Nov 7, 2023

Conversation

wpbonelli
Copy link
Contributor

@wpbonelli wpbonelli commented Nov 3, 2023

@wpbonelli wpbonelli marked this pull request as ready for review November 3, 2023 20:36
@wpbonelli wpbonelli requested a review from mjreno November 3, 2023 20:36
Copy link

@christianlangevin christianlangevin left a comment

Choose a reason for hiding this comment

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

Thank you for doing this, @wpbonelli

! -- ensure STRT was found
if (.not. found%strt) then
write (errmsg, '(a)') 'Error in GRIDDATA block: STRT not found.'
call store_error(errmsg)

Choose a reason for hiding this comment

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

I think we need another call to say what input file caused this error. Also, if store_error() isn't given terminate=.true., in this case the program will just continue until we do a check for count_errors. Do we need something like this?

call store_error_filename(this%input_fname)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Revised to

call store_error(errmsg, terminate=.false.)
call store_error_filename(this%input_fname)

I noticed store_error defaults to terminate false while store_error_filename defaults true. Should these be consistent or is this deliberate?

! -- Allocate and read modules attached to model
if (this%inic > 0) call this%ic%ic_ar(this%x)
! -- Load modules attached to model
if (this%inic > 0) call this%ic%ic_load(this%x)

Choose a reason for hiding this comment

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

Unless there is some reason we need to wait until AR, I think we should call this ic_load method as soon as possible, maybe toward the end of ic_create?

Copy link
Contributor Author

@wpbonelli wpbonelli Nov 4, 2023

Choose a reason for hiding this comment

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

After trying this out, it seems this needs to come after define (*_df), I think because that's where discretization sources its info, so I left this in AR for now.

!
! -- Assign x equal to strt
! -- assign starting head

Choose a reason for hiding this comment

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

Maybe we couldn't do this in ic_cr, which is why we are calling ic_load() as part of the AR calls. Maybe we can keep an ic_ar() routine and assign strt to model%x in it. I know it is not a "allocate and read" action, but maybe we keep the names consistent for now and consider renaming them later.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@christianlangevin christianlangevin merged commit 1b220d4 into MODFLOW-ORG:develop Nov 7, 2023
@wpbonelli wpbonelli deleted the ic-idm branch November 7, 2023 20:06
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