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

File open in micro_pumas_utils.F90 is not legal in CAM #49

Open
cacraigucar opened this issue Feb 25, 2023 · 4 comments
Open

File open in micro_pumas_utils.F90 is not legal in CAM #49

cacraigucar opened this issue Feb 25, 2023 · 4 comments
Labels
bug Something isn't working

Comments

@cacraigucar
Copy link
Collaborator

cacraigucar commented Feb 25, 2023

There is a file open using unit 10 to read in lkuptable_filename. CAM can not guarantee that unit 10 won't already be open with some other file. See below for newunit which should be used

Obsolete comment - kept for documentation purposes, but should not be done.The unit number should be passed into the init_lookup_table subroutine and provided by the host model.

@gold2718
Copy link

The unit number should be passed into the init_lookup_table subroutine and provided by the host model.

I do not understand this. Why can't this just use newunit?

open(newunit=unitn,file=lkuptable_filename,status='old')

With an integer, unitn, defined as a local variable and used in the read and close statements.

@gold2718 gold2718 added the bug Something isn't working label Feb 25, 2023
@cacraigucar
Copy link
Collaborator Author

"My bad" - I'd forgotten about newunit. I edited the original comment appropriately.

@gold2718 - As an aside, looking forward to CCPP'izing PUMAS, what are the current constraints for reading within a scheme? I believe we relaxed the rule about schemes being forbidden from doing reads at least at initialization, but wanted to confirm the rule (since I've demonstrated my memory is not 100% accurate).

@Katetc
Copy link
Collaborator

Katetc commented Mar 1, 2023

Ok, I have fixed the unit=10 problem, but this has alerted me to the fact that micro_pumas_utils is kind of a mess with various debugging states of unified ice code (previously known as MG4). I don't think this het ice nucleation tag is the right place for a full pumas_utils cleanup, and since we still plan to bring that in, I want to leave this here. But know that it will be getting a lot of clean up. And also that these functions aren't used in the PUMAS version in Cam.

@gold2718
Copy link

gold2718 commented Mar 1, 2023

As an aside, looking forward to CCPP'izing PUMAS, what are the current constraints for reading within a scheme? I believe we relaxed the rule about schemes being forbidden from doing reads at least at initialization, but wanted to confirm the rule (since I've demonstrated my memory is not 100% accurate).

I don't think there was ever a rule. As a followup to our recent call, here is the text from the CCPP Framework rules for compliant physics schemes

The init phase, which performs actions needed to set up the scheme before the model integration begins. Examples of actions needed in this phase include the reading/computation of lookup tables, setting of constants (as described in Section 2.6), etc.

So I think it is okay to read non-gridded data at init time (or any phase except the run phase).

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
Development

No branches or pull requests

3 participants