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

Fixes/modifications to ccpp-physics for transition to capgen #584

Merged
merged 18 commits into from
Apr 30, 2021
Merged

Fixes/modifications to ccpp-physics for transition to capgen #584

merged 18 commits into from
Apr 30, 2021

Conversation

JulieSchramm
Copy link

Mostly fixes to intent mismatches, out of order arguments and subroutines.
Not tested.

Outstanding issues with passing capgen consistency check include:

  • Invalid 'type' property value,
  • Invalid dimension, '1:levs+1'
  • Missing local_variables
  • 'nlev+1' is not a valid Fortran identifier

@@ -22,8 +22,8 @@ subroutine GFS_MP_generic_pre_run(im, levs, ldiag3d, qdiag3d, do_aw, ntcw, nncl,
real(kind=kind_phys), dimension(im, levs), intent(in) :: gt0
real(kind=kind_phys), dimension(im, levs, ntrac), intent(in) :: gq0

real(kind=kind_phys), dimension(im, levs), intent(inout) :: save_t, save_qv
real(kind=kind_phys), dimension(im, levs, ntrac), intent(inout) :: save_q
real(kind=kind_phys), dimension(im, levs), intent(out) :: save_t, save_qv
Copy link
Collaborator

Choose a reason for hiding this comment

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

These must be intent(inout) because they are only modified under certain conditions, otherwise let unchanged. Fix also in metadata.

@@ -96,7 +96,7 @@
dimensions = (horizontal_loop_extent,vertical_dimension)
type = real
kind = kind_phys
intent = inout
intent = out
Copy link
Collaborator

Choose a reason for hiding this comment

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

See above

@@ -25,7 +25,7 @@ subroutine GFS_SCNV_generic_pre_run (im, levs, ldiag3d, qdiag3d, gu0, gv0, gt0,
logical, intent(in) :: ldiag3d, qdiag3d, flag_for_scnv_generic_tend
real(kind=kind_phys), dimension(im,levs), intent(in) :: gu0, gv0, gt0, gq0_water_vapor

real(kind=kind_phys), dimension(im,levs), intent(inout) :: save_u, save_v, save_t, save_qv
real(kind=kind_phys), dimension(im,levs), intent(out) :: save_u, save_v, save_t, save_qv
Copy link
Collaborator

Choose a reason for hiding this comment

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

No, intent(inout), see above. Also fix in physics/GFS_SCNV_generic.meta

@@ -697,7 +697,7 @@
dimensions = (horizontal_loop_extent,vertical_dimension)
type = real
kind = kind_phys
intent = inout
intent = out
Copy link
Collaborator

Choose a reason for hiding this comment

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

du3dt_mtb, du3dt_ogw, du3dt_tms all need to be intent(inout) in both the Fortran code and the metadata

@@ -1,4 +1,4 @@
!> \file cs_conv.F90
u> \file cs_conv.F90
Copy link
Collaborator

Choose a reason for hiding this comment

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

Revert typo

@@ -783,20 +783,26 @@
dimensions = (horizontal_loop_extent)
type = real
kind = kind_phys
intent = inout
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 qss_{ocn,ice,lnd} are all intent(out)

@@ -176,12 +176,12 @@ subroutine m_micro_post_run( &
real(kind=kind_phys), intent(inout) :: qsnw(1:im,1:levs)
real(kind=kind_phys), intent(inout) :: qgl(1:im,1:levs)
real(kind=kind_phys), intent(inout) :: gq0_ice(1:im,1:levs)
Copy link
Collaborator

Choose a reason for hiding this comment

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

qg0_ice should be intent(in)

@@ -379,7 +379,7 @@
dimensions = (horizontal_loop_extent)
type = real
kind = kind_phys
intent = inout
intent = out
Copy link
Collaborator

Choose a reason for hiding this comment

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

intent(inout) in both metadata and Fortran, because only set if flag_iter is true

Copy link
Collaborator

Choose a reason for hiding this comment

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

same for ch, ffm, ffh, ffn10, ffh2, wind

real(kind_phys), intent(inout) :: f_rimef(1:ncol,1:nlev)
real(kind_phys), intent(out ) :: f_ice(1:ncol,1:nlev)
real(kind_phys), intent(out ) :: f_rain(1:ncol,1:nlev)
real(kind_phys), intent(out ) :: f_rimef(1:ncol,1:nlev)
Copy link
Collaborator

Choose a reason for hiding this comment

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

This scheme is a bit messy ... can you also make the following change, please? In lines 57-59, please remove the "optional" keyword and change optional = T to F in the metadata file (init routine).

Your changes in lines 164-166 are fine.

@@ -697,7 +697,7 @@
dimensions = (horizontal_loop_extent)
type = real
kind = kind_phys
intent = in
intent = inout
Copy link
Collaborator

Choose a reason for hiding this comment

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

srflag should be intent(in) in both Fortran and metadata

@climbfuji
Copy link
Collaborator

Thanks @JulieSchramm for making those changes. I'll add the PR to the UFS commit queue. You may have to pull in changes from master one more time when it is our turn.

@climbfuji climbfuji changed the title Capgen fixes Modifications to ccpp-physics for transition to capgen. Fixes/modifications to ccpp-physics for transition to capgen Mar 3, 2021
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.

Looks good. Will approve once regression testing has been completed.

HelinWei-NOAA pushed a commit to HelinWei-NOAA/ccpp-physics that referenced this pull request Feb 26, 2023
…in branch to ufs-community/ccpp-physics ufs/dev branch (NCAR#584)

* Officially changed the ccpp-physics pointer from NCAR/ccpp-physics main branch to ufs-community/ccpp-physics ufs/dev branch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants