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 step for reconstruction coeffs #717

Merged
merged 4 commits into from
Oct 18, 2023

Conversation

xylar
Copy link
Collaborator

@xylar xylar commented Oct 15, 2023

Checklist

  • User's Guide has been updated
  • Developer's Guide has been updated
  • API documentation in the Developer's Guide (api.rst) has any new or modified class, method and/or functions listed
  • Documentation has been built locally and changes look as expected
  • Document (in a comment titled Testing in this PR) any testing that was used to verify the changes

@xylar xylar added enhancement New feature or request ocean in progress This PR is not ready for review or merging labels Oct 15, 2023
@xylar xylar requested a review from alicebarthel October 15, 2023 12:13
@xylar xylar self-assigned this Oct 15, 2023
@xylar
Copy link
Collaborator Author

xylar commented Oct 15, 2023

Testing

I have tested this along with MPAS-Dev/MPAS-Tools#531 on Chrysalis by running:

ocean/global_ocean/QU240/mesh
ocean/global_ocean/QU240/WOA23/init
ocean/global_ocean/QU240/WOA23/dynamic_adjustment
ocean/global_ocean/QU240/WOA23/files_for_e3sm

The resulting coeffs_reconstruct.nc has the expected field for reconstructing velocity vectors, and the file velocity_components.nc shows the Cartesian, zonal and meridional velocity components, as expected:

zonal_velocity

@xylar xylar removed the in progress This PR is not ready for review or merging label Oct 16, 2023
@xylar xylar marked this pull request as ready for review October 16, 2023 09:10
@xylar
Copy link
Collaborator Author

xylar commented Oct 16, 2023

@alicebarthel, I was hoping you might be able to review this and use it as a demo of the process for reconstructing vector fields. The easiest might be if you set up and run the same 4 test cases I ran:

ocean/global_ocean/QU240/mesh
ocean/global_ocean/QU240/WOA23/init
ocean/global_ocean/QU240/WOA23/dynamic_adjustment
ocean/global_ocean/QU240/WOA23/files_for_e3sm

You can look at the write_coeffs_reconstruct step of files_for_e3ms to see the namelist and streams file the step sets up to run for 1 time step (it asks for a run duration of 1 second) and writing out the coefficients. Then, it has a snippet of code that I'll point out where it uses the coefficients to do velocity reconstruction as an example.

Comment on lines +49 to +55
args = ['vector_reconstruct',
'-i', 'restart.nc',
'-o', 'velocity_components.nc',
'-w', 'coeffs_reconstruct.nc',
'-v', 'normalVelocity',
'--out_variables', 'velocity']
check_call(args=args, logger=self.logger)
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Here's where it does the reconstruction of velocity by calling vector_reconstruct.

@xylar xylar force-pushed the add-step-for-reconstruction-coeffs branch from 09480af to 07f389a Compare October 16, 2023 11:32
xylar added 4 commits October 16, 2023 13:42
We need to add `**kwargs` to the constructors and make sure the
`super()` versions of all inherited methods are getting called.
The coefficients are used to construct 3D Cartesian as well as
zonal and meridional components of a field at cell centers from
the normal component of the field at edges.
This is performed after writing out the vector reconstruction
coefficients
@xylar xylar force-pushed the add-step-for-reconstruction-coeffs branch from 07f389a to 2bd9845 Compare October 16, 2023 11:42
@xylar xylar removed the request for review from alicebarthel October 18, 2023 07:26
@xylar
Copy link
Collaborator Author

xylar commented Oct 18, 2023

@alicebarthel, I'm going to go ahead and merge this so I can generate the reconstruction coefficients for the 10 E3SM v3 meshes, since I need to recreate the iceberg data freshwater fluxes anyway.

Please feel free to take a look at the new step that this branch adds to help with the process of generating reconstruction coefficients for other meshes as well.

@xylar xylar merged commit ab68ad7 into MPAS-Dev:main Oct 18, 2023
4 checks passed
@xylar xylar deleted the add-step-for-reconstruction-coeffs branch October 18, 2023 07:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request ocean
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant