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

Add initialize_constituents scheme #149

Open
wants to merge 4 commits into
base: development
Choose a base branch
from

Conversation

peverwhee
Copy link
Collaborator

@peverwhee peverwhee commented Nov 5, 2024

Originator(s): peverwhee

Summary (include the keyword ['closes', 'fixes', 'resolves'] and issue number): Adds new (non-portable) initialize_constituents scheme (.F90 and .meta). This scheme will be used to instantiate all constituents in the file (used to validate schemes that need the full constituent array but do not modify all of the individual constituents). Added to new "test_schemes" directory.

Describe any changes made to the namelist: N/A

List all files eliminated and why: N/A

List all files added and what they do:
A test/test_schemes/initialize_constituents.F90
A test/test_schemes/initialize_constituents.F90

  • add initialize_constituents scheme

List all existing files that have been modified, and describe the changes:
(Helpful git command: git diff --name-status development...<your_branch_name>)

List any test failures: none

Is this a science-changing update? New physics package, algorithm change, tuning changes, etc? No

Copy link
Collaborator

@nusbaume nusbaume left a comment

Choose a reason for hiding this comment

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

Thanks @peverwhee for getting this test helper scheme developed! I just had a few change requests.

test/test_schemes/initialize_constituents.F90 Outdated Show resolved Hide resolved
test/test_schemes/initialize_constituents.F90 Outdated Show resolved Hide resolved
test/test_schemes/initialize_constituents.F90 Show resolved Hide resolved
Copy link
Collaborator

@nusbaume nusbaume left a comment

Choose a reason for hiding this comment

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

Everything looks good to me now, thanks!

Copy link
Collaborator

@cacraigucar cacraigucar left a comment

Choose a reason for hiding this comment

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

I also have been testing a variation of this routine in the ZM conversion

Comment on lines +94 to +99
allocate(constituents(constituent_index), stat=ierr, errmsg=alloc_err_msg)
if (ierr /= 0) then
errcode = 1
errmsg = alloc_err_msg
return
end if
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think I prefer the old errmsg statements which said what field had the allocate error. Looking through the internet for an example of what errmsg might contain, I saw these two error messages:
errmsg = Attempt to allocate an allocated object
errmsg = insufficient virtual memory
The errmsg is probably compiler dependent, but the important thing is that neither indicate what field had the error being allocated. If you'd like to include the Fortran errmsg, perhaps you can concatentate the module/variable in front of the returned errmsg.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

3 participants