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 ccpp_compliant ozphys_2015.f #160

Merged
merged 8 commits into from
Oct 1, 2018
Merged

Conversation

mzhangw
Copy link
Collaborator

@mzhangw mzhangw commented Sep 13, 2018

add ccpp_compliant ozphys_2015.f

! June 2015 - Shrinivas Moorthi
!
use machine , only : kind_phys
use physcons, only : grav => con_g
Copy link
Collaborator

Choose a reason for hiding this comment

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

con_g should come in via the argument list, not as a "use physcons" statement. Please correct. This will also require removing ", parameter" for the definition of gravi.

@mzhangw
Copy link
Collaborator Author

mzhangw commented Sep 14, 2018

So it applies to ozphys_run too?

@climbfuji
Copy link
Collaborator

In theory, yes, but all this old stuff is "grandfathered" in from the first implementation beginning of the year. I think we should try to keep good practices when adding new schemes. If you have time to "fix" ozphys as well, please do so, if not we'll do it in another round of cleanup work.

@mzhangw
Copy link
Collaborator Author

mzhangw commented Sep 20, 2018

all comment are addressed

Copy link
Contributor

@llpcarson llpcarson left a comment

Choose a reason for hiding this comment

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

approved

Copy link
Collaborator

@grantfirl grantfirl left a comment

Choose a reason for hiding this comment

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

Looks good to me, although you should probably revert one change in ozphys_run for performance reasons.

physics/ozphys.f Outdated
character(len=*), intent(out) :: errmsg
integer, intent(out) :: errflg
!
! Local variables
real, parameter :: gravi=1.0/grav
! real, parameter :: gravi=1.0/grav
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think that you should still define gravi as a real variable (not parameter) and calculate it at the top of the routine (as done in ozphys_2015). Putting 1.0/con_g in the loop potentially hurts performance. By coding as before, by defining gravi and calculating once per call, you're saving (im*levs) division operations.

@mzhangw
Copy link
Collaborator Author

mzhangw commented Sep 24, 2018 via email

@grantfirl
Copy link
Collaborator

Even though ozphys.f is "grandfathered", it is the current operational scheme, and I don't think that we should introduce a code change that degrades performance if we can avoid it.

@mzhangw
Copy link
Collaborator Author

mzhangw commented Sep 24, 2018

Please check again. it passed ozphys and ozphys_2015 CCPP RT tests. @grantfirl

@grantfirl
Copy link
Collaborator

Thanks, Man!

!
! this code assumes that both prsl and po3 are from bottom to top
! as are all other variables
!
use machine , only : kind_phys
use physcons, only : grav => con_g
Copy link
Collaborator

Choose a reason for hiding this comment

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

Thanks for fixing this, Man!

character(len=*), intent(out) :: errmsg
integer, intent(out) :: errflg
!
! Local variables
real, parameter :: gravi=1.0/grav
Copy link
Collaborator

Choose a reason for hiding this comment

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

You could have just removed the ", parameter" statement and used

real :: gravi =1.0/grav

but that's not worth requesting an additional change. Leave it like it is.

Copy link
Collaborator

@climbfuji climbfuji left a comment

Choose a reason for hiding this comment

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

All issues were addressed.

@climbfuji climbfuji merged commit 059a54b into NCAR:master Oct 1, 2018
@mzhangw mzhangw deleted the ozphys2015 branch October 23, 2018 20:24
hannahcbarnes pushed a commit to hannahcbarnes/ccpp-physics that referenced this pull request Aug 3, 2022
* add esmf810 VMEpoch change and iau restart timing change
lisa-bengtsson pushed a commit to lisa-bengtsson/ccpp-physics that referenced this pull request Mar 19, 2024
Resolve various subroutine argument mismatches
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.

4 participants