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

Feature/pnorris/#1915 all MAPL orbital parameters now encapsulated in Sun_Mod in MAPL_sun_uc.F90 #1920

Conversation

dr0cloud
Copy link
Contributor

@dr0cloud dr0cloud commented Jan 10, 2023

Description

Changed call to MAPL_SunOrbitCreate() inside MAPL_Generic.F90 to new MAPL_SunOrbitCreateFromConfig(). The latter gets the orbital parameters from the MAPL state's Config. In this way no default orbital parameter values need appear in MAPL_Generic.F90. Rather, these default values are encapsulated where they belong in Sun_Mod in base/MAPL_sun_uc.F90 and are now explicitly named and commented on at the head of the module.

Related Issue

issue #1915

Motivation and Context

It cleans up the code so hardwired orbital parameter default values no longer appear in MAPL_Generic. It was decided it would be better to place them directly in Sun_Mod. This makes the code more encapsulated. To expose them instead in a Physical Constants file would be both incorrect (they are epoch relevant values, not constants) and might expose them more easily to inappropriate changes.

How Has This Been Tested?

Tested to be zero-diff.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Trivial change (affects only documentation or cleanup)

Checklist:

  • I have tested this change with a run of GEOSgcm (if non-trivial)
  • I have added one of the required labels (0 diff, 0 diff trivial, 0 diff structural, non 0-diff)
  • I have updated the CHANGELOG.md accordingly following the style of Keep a Changelog

@dr0cloud dr0cloud requested a review from tclune January 10, 2023 23:05
@dr0cloud dr0cloud requested a review from a team as a code owner January 10, 2023 23:05
@dr0cloud
Copy link
Contributor Author

@tclune @mathomp4 Hi Tom and Matt. Can you check this PR? I mistakenly put it on main rather than develop. Can you fix that? Also can you merge in the changes to develop for me? Thanks, Peter.

@mathomp4 mathomp4 changed the base branch from main to develop January 10, 2023 23:56
@mathomp4
Copy link
Member

@tclune @mathomp4 Hi Tom and Matt. Can you check this PR? I mistakenly put it on main rather than develop. Can you fix that? Also can you merge in the changes to develop for me? Thanks, Peter.

@dr0cloud Yeah, you picked the wrong base. I've updated that.

@weiyuan-jiang
Copy link
Contributor

Can we added a function MAPL_SunOrbitCreateDefault ? Sometimes users may not have access to Config.

@tclune
Copy link
Collaborator

tclune commented Jan 11, 2023

@weiyuan-jiang The interface on STATE is still there in generic. No grid comps need to change from this refactoring. It just reduces the responsibilities of the generic layer and aligns the orbit stuff (mostly) into one module.

CHANGELOG.md Outdated Show resolved Hide resolved
base/MAPL_sun_uc.F90 Outdated Show resolved Hide resolved
@dr0cloud
Copy link
Contributor Author

@tclune Tom, Thanks, I pushed your recommended changes. Re the ESMF_GetConfigAttribute(), yes, we dropped trying the MAPL_GetResource() because it still involved a circular reference to the latter's definition in MAPL_Generic().

@mathomp4 mathomp4 merged commit 9731a77 into develop Jan 12, 2023
@mathomp4
Copy link
Member

Tested and zero-diff.

@mathomp4 mathomp4 deleted the feature/pnorris/#1915-all-MAPL-Orbital-parameters-encapsulated-in-Sun_Mod branch January 12, 2023 20:41
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.

None yet

4 participants