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 consistency checks for mesh_nx mesh_ny relative to mesh_file in gen_mksurfdata_namelist.py #1796

Merged

Conversation

slevis-lmwg
Copy link
Contributor

@slevis-lmwg slevis-lmwg commented Jul 6, 2022

Description of changes

If mesh_file contains mesh_nx mesh_ny info, read it from the file.
Else abort and require user to enter it at the command line.
Confirm that the product of mesh_nx x mesh_ny (user-entered or from mesh_file) = elementCount (from mesh_file).

Address #1791 here, so as to name fsurdat files by their site/grid name rather than by their NX x NY.

Also address #1776 here, so as to stop hardwiring the mpirun command according to --machine in gen_mksurfdata_jobscript_single.py. Now get the mpirun command from env_mach_specific.xml.

Specific notes

Contributors other than yourself, if any: @ekluzek

CTSM Issues Fixed (include github issue #): #1790 #1791 #1776

Are answers expected to change (and if so in what way)? No.

Any User Interface Changes (namelist or namelist defaults changes)? No.

Testing performed, if any:
Running gen_mksurfdata_namelist.py for cases with and without --model_mesh in the user-entered arguments and confirming expected behavior.

@slevis-lmwg
Copy link
Contributor Author

slevis-lmwg commented Jul 6, 2022

@ekluzek this PR could be ready for review and merging UNLESS you think I should fold #1776 here, too. I wouldn't mind doing that rather than opening a separate PR for that. Whatever you think makes more sense.

Update: I decided to keep working in the same PR.

@slevis-lmwg slevis-lmwg added PR status: ready PR: this is ready to merge in, with all tests satisfactory and reviews complete and removed PR status: work in progress labels Jul 11, 2022
@slevis-lmwg
Copy link
Contributor Author

I see a git behavior that I don't understand.
Izumi gives the response that I expected:

> git branch
nx_ny_consist_checks
> git log
commit fb87525e7c6e1ae8092afbe6d643239e22f000a9
> git describe
alpha-ctsm5.2.mksrf.05_ctsm5.1.dev090-5-gfb87525e7

On cheyenne, the first two agree, but the third gives a different response:

> git describe
alpha-ctsm5.2.mksrf.04_ctsm5.1.dev090-53-gfb87525e7

@ekluzek
Copy link
Collaborator

ekluzek commented Jul 11, 2022

@slevisconsulting this likely means you haven't pulled all the tags in both of your clones. If you fetch everything in both clones they will likely be consistent. The tags it's pointing to are the ESCOMP tags, so fetch from ESCOMP, and you might need to use the "-t" option to make sure you pull all the tags.

@slevis-lmwg
Copy link
Contributor Author

slevis-lmwg commented Jul 11, 2022

@slevisconsulting this likely means you haven't pulled all the tags in both of your clones. If you fetch everything in both clones they will likely be consistent. The tags it's pointing to are the ESCOMP tags, so fetch from ESCOMP, and you might need to use the "-t" option to make sure you pull all the tags.

Interesting. The -t option returned this:

> git fetch -t escomp
From https://github.com/ESCOMP/ctsm
 ! [rejected]            alpha-ctsm5.2.mksrf.04_ctsm5.1.dev090 -> alpha-ctsm5.2.mksrf.04_ctsm5.1.dev090  (would clobber existing tag)
 ! [rejected]            alpha-ctsm5.2.mksrf.05_ctsm5.1.dev090 -> alpha-ctsm5.2.mksrf.05_ctsm5.1.dev090  (would clobber existing tag)

If it's not concerning, I can leave as is and make the next tag (after we go over my mods) from izumi in case it makes a difference.

@ekluzek
Copy link
Collaborator

ekluzek commented Jul 11, 2022

That sounds like your local tag in your clone is in disagreement with the tag on ESCOMP. I would trust the tag on ESCOMP and be suspicious of the tag on your local clone. You could look into it in more detail to see which is right, and if the ESCOMP ones are actually correct. But, even if the tags are wrong we are unlikely to do anything about it for these branch tags. But, you probably don't want to have a tag on your local clone that disagrees with ESCOMP.

cmd = ems_file.get_mpirun(fake_case, attribs, job='name',
overrides = {"total_tasks" : total_tasks,})
executable = f'{cmd[0]} {" ".join(cmd[1])}'.replace('ENV{', ''). \
replace('}', '')
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@ekluzek request:
add comments to explain these lines, esp the last one

important_msg = 'Found data for force_model_mesh_nx and ' \
'force_model_mesh_ny in the mesh file so ' \
'IGNORING ANY CORRESPONDING USER-ENTERED VALUES.'
logger.info(important_msg)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@ekluzek request:
if orig_grid_dims disagrees with user-entered values, then abort with error message
if agrees, go on

'fsurdat file using the subset_data tool instead. Alternatively ' \
'and definitely for curvilinear grids, you may generate ' \
'a mesh file using the workflow currently (2022/7/6) described in ' \
'https://github.com/ESCOMP/CTSM/issues/1773#issuecomment-1163432584'
Copy link
Contributor Author

@slevis-lmwg slevis-lmwg Jul 13, 2022

Choose a reason for hiding this comment

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

@ekluzek comment:
add TODO that this workflow should be included in the User's Guide.
add similar comment in the issue (#1773 ).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR status: ready PR: this is ready to merge in, with all tests satisfactory and reviews complete
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

2 participants