Skip to content

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

Merged
climbfuji merged 18 commits into
NCAR:masterfrom
JulieSchramm:capgen_fixes
Apr 30, 2021
Merged

Fixes/modifications to ccpp-physics for transition to capgen#584
climbfuji merged 18 commits into
NCAR:masterfrom
JulieSchramm:capgen_fixes

Conversation

@JulieSchramm
Copy link
Copy Markdown

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

Comment thread physics/GFS_MP_generic.F90 Outdated

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
Copy Markdown
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.

Comment thread physics/GFS_MP_generic.meta Outdated
type = real
kind = kind_phys
intent = inout
intent = out
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

See above

Comment thread physics/GFS_SCNV_generic.F90 Outdated
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
Copy Markdown
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

Comment thread physics/cires_ugwp.meta Outdated
type = real
kind = kind_phys
intent = inout
intent = out
Copy link
Copy Markdown
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

Comment thread physics/cs_conv.F90 Outdated
@@ -1,4 +1,4 @@
!> \file cs_conv.F90
u> \file cs_conv.F90
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Revert typo

Comment thread physics/gfdl_sfc_layer.meta Outdated
dimensions = (horizontal_loop_extent)
type = real
kind = kind_phys
intent = inout
Copy link
Copy Markdown
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)

Comment thread physics/m_micro_interstitial.F90 Outdated
@@ -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
Copy Markdown
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)

Comment thread physics/module_MYJSFC_wrapper.meta Outdated
type = real
kind = kind_phys
intent = inout
intent = out
Copy link
Copy Markdown
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
Copy Markdown
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

Comment thread physics/mp_fer_hires.F90
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
Copy Markdown
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.

Comment thread physics/sfc_drv_ruc.meta Outdated
type = real
kind = kind_phys
intent = in
intent = inout
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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