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

Creating Vertical Diffusion Solver #133

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

Conversation

mwaxmonsky
Copy link
Collaborator

Originator(s): mwaxmonsky

Summary (include the keyword ['closes', 'fixes', 'resolves'] and issue number):

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 to-be-ccpp-ized/utilities/coords_1d.F90
A to-be-ccpp-ized/utilities/linear_1d_operators.F90
A to-be-ccpp-ized/utilities/vertical_diffusion/vertical_diffusion_solver.F90

  • Adds initial set of files to support solve step of vertical diffusion. Top level utilities files are copied directly from CAM and will be removed from CAM when integrating.

List all existing files that have been modified, and describe the changes: N\A
(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?
N\A

@mwaxmonsky mwaxmonsky self-assigned this Oct 14, 2024
@jimmielin jimmielin self-requested a review October 14, 2024 21:11
@mwaxmonsky mwaxmonsky marked this pull request as ready for review October 14, 2024 21:13
Copy link
Member

@jimmielin jimmielin left a comment

Choose a reason for hiding this comment

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

Thanks @mwaxmonsky! This looks good, I just had a few minor comments. The most major one is just to check the name of the to-be-ccpp(-)ized folder since it's not in ESCOMP/atmospheric_physics now.

@@ -0,0 +1,152 @@
module coords_1d
Copy link
Member

Choose a reason for hiding this comment

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

Just confirming the directory is to be named to-be-ccpp-ized or to-be-ccppized (https://github.com/cacraigucar/atmospheric_physics/tree/atmos_phys_zmcleanup3/to_be_ccppized) since I've seen two variants around!

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Good catch @jimmielin!

@nusbaume, @cacraigucar, @peverwhee, we might have discussed this previously so my apologies for not taking better notes but do we have a preferred layout/naming convention for these non-ccppized files? Particularly with coords1d and linear_1d_operators being helper files (which might be needed by other files later) and the high level interface in the solver file.

I think having them at separate layers might be best for organization but not too sure on the naming conventions.

! The sizes must be consistent among all the coefficients that are
! actually present, i.e. coef_q_diff and coef_q_adv should be one level
! bigger than coef_q and coef_q_weight, and have the same column number.
real(r8), contiguous, intent(in), optional :: coef_q(:,:), &
Copy link
Member

Choose a reason for hiding this comment

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

Here contiguous is used directly but the CESM-specific CPP macro USE_CONTIGUOUS is used in coords_1d.F90 and linear_1d_operators.F90. Maybe the same macro could be used here?

Copy link
Contributor

Choose a reason for hiding this comment

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

I think the old USE_CONTIGUOUS macro is not needed and should be discontinued. I think this harks back to a time when not all Fortran compilers supported the contiguous attribute.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Since the solve module is a new wrapper around the solve step and the other 2 files are helper files being copied directly over from CAM, is it reasonable to leave linear_1d_operators and coords_1d as is and prefer contiguous in new/refactored code moving forward?

Copy link
Member

@jimmielin jimmielin left a comment

Choose a reason for hiding this comment

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

Thanks @mwaxmonsky for addressing my comments, I left the to-be-ccpp(-)ized and contiguous comments unresolved as there's some unfinished discussions on those. Once these are confirmed it should be good to go, I will approve the PR now.

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.

5 participants