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

Collect PRs #613, #628, #634, #635 / update long names and vertical dimension for atmosphere_heat_diffusivity and atmosphere_momentum_diffusivity #641

Merged
merged 13 commits into from
Apr 28, 2021

Conversation

climbfuji
Copy link
Collaborator

@climbfuji climbfuji commented Apr 23, 2021

This PR collects various small PRs (see there for a description of the changes):

Additional changes:

  • Change vertical dimension of arrays atmosphere_heat_diffusivity (aka dkt) and atmosphere_momentum_diffusivity (aka dku) and update their long names

Fixes #639
Fixes #632
Fixes #625

Associated PRs:

NCAR/ccpp-framework#368
#641
NOAA-EMC/fv3atm#291
ufs-community/ufs-weather-model#541

For regression testing, see ufs-community/ufs-weather-model#541

grantfirl and others added 12 commits April 9, 2021 10:00
…_2017() call; also cires_orowam2017.F90 appears to be a duplicate and is not used by any scheme
pulling latest master into local ltp-bugfix
…g flags for ugwpv1_gsldrag and GFS_DCNV_generic.F90
…ure, temperature, and specific humidity for Thompson MP. Use extended arrays plyr, tlyr, and qlyr respectively.
…dkt) and atmosphere_momentum_diffusivity (aka dku), update long names
@climbfuji climbfuji changed the title Collect PRs XXX, update long names and vertical dimension for atmosphere_heat_diffusivity and atmosphere_momentum_diffusivity Collect PRs #613, #628, #634, #635 / update long names and vertical dimension for atmosphere_heat_diffusivity and atmosphere_momentum_diffusivity Apr 23, 2021
write(6,*) ' error in opening file ',trim(fngrib)
print *,'error in opening file ',trim(fngrib)
write(6,*) ' FATAL ERROR: in opening file ',trim(fngrib)
print *,'FATAL ERROR: in opening file ',trim(fngrib)
call abort
Copy link
Collaborator

Choose a reason for hiding this comment

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

This is not necessarily related to this PR, but I didn't notice until now -- sfcsub.F is full of "call abort" statements, but CCPP schemes are not supposed to stop the model. Was this "grandfathered" in with the GFS physics originally? I'm guessing that since the error-handling was touched for this file as part of this PR and that it was not modified to use CCPP error-handling that it was a "bridge too far"?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I mentioned that in my review, too. UFS_UTILS is now also pointing to this file / using this file. We should definitely make the change in the near future (as I suggested). The much bigger picture here is that we need to make sure that all error messages created by CCPP are compliant with NCO error handling. Hopefully this will not be a problem for other users of the CCPP.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Thanks. I see your comment in #628. I didn't review the combined PRs individually, so sorry for the duplication.

@@ -116,7 +116,7 @@ subroutine hedmf_run (im,km,ntrac,ntcw,dv,du,tau,rtg, &
& dtsfc(im), dqsfc(im), &
& hpbl(im)
real(kind=kind_phys), intent(out) :: &
& dkt(im,km-1), dku(im,km-1)
& dkt(im,km), dku(im,km)
Copy link
Collaborator

@BinLiu-NOAA BinLiu-NOAA Apr 27, 2021

Choose a reason for hiding this comment

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

Is there any potential issue that the dkt and dku are defined as km levels but are only initialized below for km1 levels? This probably will not affect FV3ATM, since they are already initialized at the FV3ATM level before passing into ccpp/physics. But, if this is also used in other applications (SCM or other models), then they may get uninitialized values for the extra one vertical level.

!>  - Initialize diffusion coefficients to 0 and calculate the total radiative heating rate (dku, dkt, radx)
      do k = 1,km1
        do i = 1,im
          dku(i,k)  = 0.
          dkt(i,k)  = 0.
          dktx(i,k) = 0.
          cku(i,k)  = 0.
          ckt(i,k)  = 0.
          tem       = zi(i,k+1)-zi(i,k)
          radx(i,k) = tem*(swh(i,k)*xmu(i)+hlw(i,k))
        enddo
      enddo

Copy link
Collaborator

Choose a reason for hiding this comment

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

To comment on the SCM, this should not be an issue. Both dku and dkt are in the interstitial DDT and both entire arrays get reset to zero during every physics timestep (FV3 and SCM behave identically here).

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It is always the responsibility of the component that defines/allocates data to initialize it properly. One cannot rely on some other component doing that. We will also talk about the definition of intent(out) in the ccpp framework meeting today, which is somewhat related.

Copy link
Contributor

Choose a reason for hiding this comment

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

@BinLiu-NOAA I stand corrected to what I said beforehand, according to the Fortran standard, a variable declared as intent(out) must be set entirely, not just partially, inside the scheme (i.e. going back to our old definition in CCPP). A scheme cannot rely on the other pieces being initialized elsewhere. I am going to create an issue to follow up on this PR and initialize the arrays dku and dkt correctly in all schemes that have them declared as intent(out).

Copy link
Contributor

Choose a reason for hiding this comment

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

See #642

Copy link
Collaborator

Choose a reason for hiding this comment

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

Thanks, @climbfuji! Sounds reasonable to me.

@climbfuji climbfuji merged commit ead39d1 into NCAR:master Apr 28, 2021
@climbfuji climbfuji deleted the collect_various_prs_20210422 branch June 27, 2022 03:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
8 participants