Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/NCAR/ccpp-physics into HEAD
Browse files Browse the repository at this point in the history
  • Loading branch information
climbfuji committed May 20, 2021
2 parents 417ec2d + 144d079 commit 94bf989
Show file tree
Hide file tree
Showing 221 changed files with 8,839 additions and 6,916 deletions.
33 changes: 33 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: bug
assignees: ''

---

# Description

Provide a clear and concise description of the bug and what behavior you are expecting.

## Steps to Reproduce

Please provide detailed steps for reproducing the issue.

1. step 1
2. step 2
3. see the bug...

## Additional Context

Please provide any relevant information about your setup. This is important in case the issue is not reproducible except for under certain conditions.

* Machine
* Compiler
* Suite Definition File or Scheme
* Reference other issues or PRs in other repositories that this is related to, and how they are related.

## Output

Please include any relevant log files, screenshots or other output here.
20 changes: 20 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: enhancement
assignees: ''

---

## Description
Provide a clear and concise description of the problem to be solved.

## Solution
Add a clear and concise description of the proposed solution.

## Alternatives (optional)
If applicable, add a description of any alternative solutions or features you've considered.

## Related to (optional)
Directly reference any issues or PRs in this or other repositories that this is related to, and describe how they are related.
22 changes: 22 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
## Description of Changes:
One or more paragraphs describing the problem, solution, and required changes.

## Tests Conducted:
Explicitly state what tests were run on these changes, or if any are still pending (for README or other text-only changes, just put "None required". Make note of the compilers used, the platform/machine, and other relevant details as necessary. For more complicated changes, or those resulting in scientific changes, please be explicit!
**OR** Add any links to tests conducted. For example, "See ufs-community/ufs-weather-model/pull/<pr_number>"

## Dependencies:
Add any links to parent PRs (e.g. SCM and/or UFS PRs) or submodules (e.g. rte-rrtmgp). For example:
- NCAR/ccpp-framework/pull/<pr_number>
- NOAA-EMC/fv3atm/pull/<pr_number>
- ufs-community/ufs-weather-model/pull/<pr_number>

## Documentation:
Does this PR add new capabilities that need to be documented or require modifications to the existing documentation? If so, brief supporting material can be provided here. Contact the CODEOWNERS if your PR requires extensive updates to the documentation. See https://github.com/NCAR/ccpp-doc for Technical Documentation or https://dtcenter.org/community-code/common-community-physics-package-ccpp/documentation for the latest Scientific Documentation.

## Issue (optional):
If this PR is resolving or referencing one or more issues, in this repository or elewhere, list them here. For example, "Fixes issue mentioned in #123" or "Related to bug in https://github.com/NCAR/other_repository/pull/63"

## Contributors (optional):
If others have contributed to this work aside from the PR author, list them here

266 changes: 142 additions & 124 deletions CMakeLists.txt

Large diffs are not rendered by default.

53 changes: 26 additions & 27 deletions physics/GFS_DCNV_generic.F90
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,14 @@ subroutine GFS_DCNV_generic_pre_run (im, levs, ldiag3d, qdiag3d, do_cnvgwd, cplc

integer, intent(in) :: im, levs, nsamftrac, ntqv, index_of_process_dcnv, dtidx(:,:)
logical, intent(in) :: ldiag3d, qdiag3d, do_cnvgwd, cplchm
real(kind=kind_phys), dimension(im,levs), intent(in) :: gu0
real(kind=kind_phys), dimension(im,levs), intent(in) :: gv0
real(kind=kind_phys), dimension(im,levs), intent(in) :: gt0
real(kind=kind_phys), dimension(:,:,:), intent(inout) :: gq0
real(kind=kind_phys), dimension(im,levs), intent(inout) :: save_u
real(kind=kind_phys), dimension(im,levs), intent(inout) :: save_v
real(kind=kind_phys), dimension(im,levs), intent(inout) :: save_t
real(kind=kind_phys), dimension(:,:,:), intent(inout) :: save_q
real(kind=kind_phys), dimension(:,:), intent(in) :: gu0
real(kind=kind_phys), dimension(:,:), intent(in) :: gv0
real(kind=kind_phys), dimension(:,:), intent(in) :: gt0
real(kind=kind_phys), dimension(:,:,:), intent(inout) :: gq0
real(kind=kind_phys), dimension(:,:), intent(inout) :: save_u
real(kind=kind_phys), dimension(:,:), intent(inout) :: save_v
real(kind=kind_phys), dimension(:,:), intent(inout) :: save_t
real(kind=kind_phys), dimension(:,:,:), intent(inout) :: save_q
! dqdti only allocated if cplchm is .true.
real(kind=kind_phys), dimension(:,:), intent(inout) :: dqdti
character(len=*), intent(out) :: errmsg
Expand Down Expand Up @@ -117,27 +117,22 @@ subroutine GFS_DCNV_generic_post_run (im, levs, lssav, ldiag3d, ras, cscnv, &
logical, intent(in) :: flag_for_dcnv_generic_tend

real(kind=kind_phys), intent(in) :: frain, dtf
real(kind=kind_phys), dimension(im), intent(in) :: rain1, cld1d
real(kind=kind_phys), dimension(im,levs), intent(in) :: save_u, save_v, save_t
real(kind=kind_phys), dimension(im,levs), intent(in) :: gu0, gv0, gt0
real(kind=kind_phys), dimension(:,:,:), intent(in) :: gq0, save_q
real(kind=kind_phys), dimension(im,levs), intent(in) :: ud_mf, dd_mf, dt_mf
real(kind=kind_phys), dimension(:), intent(in) :: rain1, cld1d
real(kind=kind_phys), dimension(:,:), intent(in) :: save_u, save_v, save_t
real(kind=kind_phys), dimension(:,:), intent(in) :: gu0, gv0, gt0
real(kind=kind_phys), dimension(:,:,:), intent(in) :: gq0, save_q
real(kind=kind_phys), dimension(:,:), intent(in) :: ud_mf, dd_mf, dt_mf
real(kind=kind_phys), intent(in) :: con_g
integer, intent(in) :: npdf3d, num_p3d, ncnvcld3d

real(kind=kind_phys), dimension(im), intent(inout) :: rainc, cldwrk
! dtend, upd_mf, dwn_mf, det_mf only allocated if ldiag3d == .true.
real(kind=kind_phys), dimension(:), intent(inout) :: rainc, cldwrk
real(kind=kind_phys), dimension(:,:), intent(inout) :: upd_mf, dwn_mf, det_mf
real(kind=kind_phys), dimension(im,levs), intent(inout) :: cnvw, cnvc
real(kind=kind_phys), dimension(:,:), intent(inout) :: cnvw, cnvc

real(kind=kind_phys), dimension(:,:,:), intent(inout) :: dtend
integer, intent(in) :: dtidx(:,:), index_of_process_dcnv, index_of_temperature, &
index_of_x_wind, index_of_y_wind, ntqv

! The following arrays may not be allocated, depending on certain flags and microphysics schemes.
! Since Intel 15 crashes when passing unallocated arrays to arrays defined with explicit shape,
! use assumed-shape arrays. Note that Intel 18 and GNU 6.2.0-8.1.0 tolerate explicit-shape arrays
! as long as these do not get used when not allocated (it is still invalid Fortran code, though).
real(kind=kind_phys), dimension(:,:), intent(inout) :: cnvw_phy_f3d, cnvc_phy_f3d

character(len=*), intent(out) :: errmsg
Expand Down Expand Up @@ -209,13 +204,17 @@ subroutine GFS_DCNV_generic_post_run (im, levs, lssav, ldiag3d, ras, cscnv, &
endif

! convective mass fluxes
do k=1,levs
do i=1,im
upd_mf(i,k) = upd_mf(i,k) + ud_mf(i,k) * (con_g*frain)
dwn_mf(i,k) = dwn_mf(i,k) + dd_mf(i,k) * (con_g*frain)
det_mf(i,k) = det_mf(i,k) + dt_mf(i,k) * (con_g*frain)
enddo
enddo
if(qdiag3d) then
do k=1,levs
do i=1,im
dq3dt(i,k) = dq3dt(i,k) + (gq0_water_vapor(i,k)-save_qv(i,k)) * frain
! convective mass fluxes
upd_mf(i,k) = upd_mf(i,k) + ud_mf(i,k) * (con_g*frain)
dwn_mf(i,k) = dwn_mf(i,k) + dd_mf(i,k) * (con_g*frain)
det_mf(i,k) = det_mf(i,k) + dt_mf(i,k) * (con_g*frain)
enddo
enddo
endif
endif ! if (ldiag3d)

endif ! if (lssav)
Expand Down
19 changes: 14 additions & 5 deletions physics/GFS_GWD_generic.F90
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
!> \file GFS_GWD_generic.f
!> \file GFS_GWD_generic.F90
!! This file contains the CCPP-compliant orographic gravity wave
!! drag pre interstitial codes.

module GFS_GWD_generic_pre

contains

!! \section arg_table_GFS_GWD_generic_pre_init Argument Table
!! \htmlinclude GFS_GWD_generic_pre_init.html
!!
subroutine GFS_GWD_generic_pre_init()
end subroutine GFS_GWD_generic_pre_init

Expand All @@ -29,15 +32,15 @@ subroutine GFS_GWD_generic_pre_run( &
implicit none

integer, intent(in) :: im, levs, nmtvr
real(kind=kind_phys), intent(in) :: mntvar(im,nmtvr)
real(kind=kind_phys), intent(in) :: mntvar(:,:)

real(kind=kind_phys), intent(out) :: &
& oc(im), oa4(im,4), clx(im,4), &
& oc(:), oa4(:,:), clx(:,:), &
& varss(:), ocss(:), oa4ss(:,:), clxss(:,:), &
& theta(im), sigma(im), gamma(im), elvmax(im)
& theta(:), sigma(:), gamma(:), elvmax(:)

logical, intent(in) :: lssav, ldiag3d, flag_for_gwd_generic_tend
real(kind=kind_phys), intent(in) :: dtdt(im,levs), dudt(im,levs), dvdt(im,levs)
real(kind=kind_phys), intent(in) :: dtdt(:,:), dudt(:,:), dvdt(:,:)
! dtend only allocated only if ldiag3d is .true.
real(kind=kind_phys), intent(inout) :: dtend(:,:,:)
integer, intent(in) :: dtidx(:,:), index_of_temperature, &
Expand Down Expand Up @@ -141,6 +144,9 @@ subroutine GFS_GWD_generic_pre_run( &
end subroutine GFS_GWD_generic_pre_run
!> @}

!! \section arg_table_GFS_GWD_generic_pre_finalize Argument Table
!! \htmlinclude GFS_GWD_generic_pre_finalize.html
!!
subroutine GFS_GWD_generic_pre_finalize()
end subroutine GFS_GWD_generic_pre_finalize

Expand Down Expand Up @@ -216,6 +222,9 @@ subroutine GFS_GWD_generic_post_run(lssav, ldiag3d, dtf, dusfcg, dvsfcg, dudt, d
end subroutine GFS_GWD_generic_post_run
!> @}

!! \section arg_table_GFS_GWD_generic_post_finalize Argument Table
!! \htmlinclude GFS_GWD_generic_post_finalize.html
!!
subroutine GFS_GWD_generic_post_finalize()
end subroutine GFS_GWD_generic_post_finalize

Expand Down
4 changes: 2 additions & 2 deletions physics/GFS_GWD_generic.meta
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@
dimensions = (horizontal_loop_extent,vertical_dimension)
type = real
kind = kind_phys
intent = inout
intent = in
optional = F
[dvdt]
standard_name = tendency_of_y_wind_due_to_model_physics
Expand All @@ -171,7 +171,7 @@
dimensions = (horizontal_loop_extent,vertical_dimension)
type = real
kind = kind_phys
intent = inout
intent = in
optional = F
[dtdt]
standard_name = tendency_of_air_temperature_due_to_model_physics
Expand Down
74 changes: 37 additions & 37 deletions physics/GFS_MP_generic.F90
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,19 @@ end subroutine GFS_MP_generic_pre_init
!> \section arg_table_GFS_MP_generic_pre_run Argument Table
!! \htmlinclude GFS_MP_generic_pre_run.html
!!
subroutine GFS_MP_generic_pre_run(im, levs, ldiag3d, qdiag3d, do_aw, ntcw, nncl, ntrac, gt0, gq0, save_t, save_q, errmsg, errflg)
subroutine GFS_MP_generic_pre_run(im, levs, ldiag3d, qdiag3d, do_aw, ntcw, nncl, &
ntrac, gt0, gq0, save_t, save_q, errmsg, errflg)
!
use machine, only: kind_phys

implicit none
integer, intent(in) :: im, levs, ntcw, nncl, ntrac
logical, intent(in) :: ldiag3d, qdiag3d, do_aw
real(kind=kind_phys), dimension(im, levs), intent(in) :: gt0
real(kind=kind_phys), dimension(im, levs, ntrac), intent(in) :: gq0
integer, intent(in) :: im, levs, ntcw, nncl, ntrac
logical, intent(in) :: ldiag3d, qdiag3d, do_aw
real(kind=kind_phys), dimension(:,:), intent(in) :: gt0
real(kind=kind_phys), dimension(:,:,:), intent(in) :: gq0

real(kind=kind_phys), dimension(im, levs), intent(inout) :: save_t
real(kind=kind_phys), dimension(im, levs, ntrac), intent(inout) :: save_q
real(kind=kind_phys), dimension(:,:), intent(inout) :: save_t
real(kind=kind_phys), dimension(:,:,:), intent(inout) :: save_q

character(len=*), intent(out) :: errmsg
integer, intent(out) :: errflg
Expand Down Expand Up @@ -102,42 +103,41 @@ subroutine GFS_MP_generic_post_run(im, levs, kdt, nrcm, ncld, nncl, ntcw, ntrac,
logical, intent(in) :: cal_pre, lssav, ldiag3d, qdiag3d, cplflx, cplchm
integer, intent(in) :: index_of_temperature,index_of_process_mp

real(kind=kind_phys), intent(in) :: dtf, frain, con_g
real(kind=kind_phys), dimension(im), intent(in) :: rain1, xlat, xlon, tsfc
real(kind=kind_phys), dimension(im), intent(inout) :: ice, snow, graupel, rainc
real(kind=kind_phys), dimension(im), intent(in) :: rain0, ice0, snow0, graupel0
real(kind=kind_phys), dimension(im,nrcm), intent(in) :: rann
real(kind=kind_phys), dimension(im,levs), intent(in) :: gt0, prsl, save_t, del
real(kind=kind_phys), dimension(im,levs+1), intent(in) :: prsi, phii
real(kind=kind_phys), dimension(im,levs,ntrac), intent(in) :: gq0, save_q

real(kind=kind_phys), dimension(im), intent(in ) :: sr
real(kind=kind_phys), dimension(im), intent(inout) :: rain, domr_diag, domzr_diag, domip_diag, doms_diag, tprcp, &
srflag, cnvprcp, totprcp, totice, totsnw, totgrp, cnvprcpb, &
totprcpb, toticeb, totsnwb, totgrpb, rain_cpl, rainc_cpl, &
snow_cpl, pwat

real(kind=kind_phys), dimension(:,:,:), intent(inout) :: dtend ! only if ldiag3d
real(kind=kind_phys), intent(in) :: dtf, frain, con_g
real(kind=kind_phys), dimension(:), intent(in) :: rain1, xlat, xlon, tsfc
real(kind=kind_phys), dimension(:), intent(inout) :: ice, snow, graupel, rainc
real(kind=kind_phys), dimension(:), intent(in) :: rain0, ice0, snow0, graupel0
real(kind=kind_phys), dimension(:,:), intent(in) :: rann
real(kind=kind_phys), dimension(:,:), intent(in) :: gt0, prsl, save_t, del
real(kind=kind_phys), dimension(:,:), intent(in) :: prsi, phii
real(kind=kind_phys), dimension(:,:,:), intent(in) :: gq0, save_q

real(kind=kind_phys), dimension(:), intent(in ) :: sr
real(kind=kind_phys), dimension(:), intent(inout) :: rain, domr_diag, domzr_diag, domip_diag, doms_diag, tprcp, &
srflag, cnvprcp, totprcp, totice, totsnw, totgrp, cnvprcpb, &
totprcpb, toticeb, totsnwb, totgrpb, pwat
real(kind=kind_phys), dimension(:), intent(inout) :: rain_cpl, rainc_cpl, snow_cpl

real(kind=kind_phys), dimension(:,:,:), intent(inout) :: dtend
integer, dimension(:,:), intent(in) :: dtidx

! Stochastic physics / surface perturbations
real(kind=kind_phys), dimension(im), intent(inout) :: drain_cpl
real(kind=kind_phys), dimension(im), intent(inout) :: dsnow_cpl
real(kind=kind_phys), dimension(:), intent(inout) :: drain_cpl, dsnow_cpl

! Rainfall variables previous time step
integer, intent(in) :: lsm, lsm_ruc, lsm_noahmp
real(kind=kind_phys), dimension(im), intent(inout) :: raincprv
real(kind=kind_phys), dimension(im), intent(inout) :: rainncprv
real(kind=kind_phys), dimension(im), intent(inout) :: iceprv
real(kind=kind_phys), dimension(im), intent(inout) :: snowprv
real(kind=kind_phys), dimension(im), intent(inout) :: graupelprv
real(kind=kind_phys), dimension(im), intent(inout) :: draincprv
real(kind=kind_phys), dimension(im), intent(inout) :: drainncprv
real(kind=kind_phys), dimension(im), intent(inout) :: diceprv
real(kind=kind_phys), dimension(im), intent(inout) :: dsnowprv
real(kind=kind_phys), dimension(im), intent(inout) :: dgraupelprv

real(kind=kind_phys), intent(in) :: dtp
real(kind=kind_phys), dimension(:), intent(inout) :: raincprv
real(kind=kind_phys), dimension(:), intent(inout) :: rainncprv
real(kind=kind_phys), dimension(:), intent(inout) :: iceprv
real(kind=kind_phys), dimension(:), intent(inout) :: snowprv
real(kind=kind_phys), dimension(:), intent(inout) :: graupelprv
real(kind=kind_phys), dimension(:), intent(inout) :: draincprv
real(kind=kind_phys), dimension(:), intent(inout) :: drainncprv
real(kind=kind_phys), dimension(:), intent(inout) :: diceprv
real(kind=kind_phys), dimension(:), intent(inout) :: dsnowprv
real(kind=kind_phys), dimension(:), intent(inout) :: dgraupelprv

real(kind=kind_phys), intent(in) :: dtp

! CCPP error handling
character(len=*), intent(out) :: errmsg
Expand Down
2 changes: 1 addition & 1 deletion physics/GFS_MP_generic.meta
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@
dimensions = (horizontal_loop_extent)
type = real
kind = kind_phys
intent = in
intent = inout
optional = F
[rain1]
standard_name = lwe_thickness_of_explicit_precipitation_amount
Expand Down
Loading

0 comments on commit 94bf989

Please sign in to comment.