Skip to content

Commit

Permalink
Merge pull request NCAR#279 from climbfuji/cleanup_work_gerrit_codere…
Browse files Browse the repository at this point in the history
…view_20190626

Cleanup work for CCPP transition 2019/06/27 - 1
  • Loading branch information
climbfuji authored Jun 28, 2019
2 parents dbae6fe + 480670c commit 8914f4c
Show file tree
Hide file tree
Showing 14 changed files with 18 additions and 44 deletions.
6 changes: 3 additions & 3 deletions physics/GFS_DCNV_generic.F90
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ end subroutine GFS_DCNV_generic_post_finalize
!! | cnvc | convective_cloud_cover | convective cloud cover | frac | 2 | real | kind_phys | inout | F |
!! | cnvw_phy_f3d | convective_cloud_water_mixing_ratio_in_phy_f3d | convective cloud water mixing ratio in the phy_f3d array | kg kg-1 | 2 | real | kind_phys | inout | F |
!! | cnvc_phy_f3d | convective_cloud_cover_in_phy_f3d | convective cloud cover in the phy_f3d array | frac | 2 | real | kind_phys | inout | F |
!! | cape | convective_available_potential_energy_for_coupling | convective available potential energy for coupling DH* CHECK THIS DOESN'T MAKE SENSE!!! *DH | m2 s-2 | 1 | real | kind_phys | inout | F |
!! | cape | convective_available_potential_energy_for_coupling | convective available potential energy for coupling | m2 s-2 | 1 | real | kind_phys | inout | F |
!! | tconvtend | tendency_of_air_temperature_due_to_deep_convection_for_coupling_on_physics_timestep | tendency of air temperature due to deep convection | K | 2 | real | kind_phys | inout | F |
!! | qconvtend | tendency_of_water_vapor_specific_humidity_due_to_deep_convection_for_coupling_on_physics_timestep | tendency of specific humidity due to deep convection | kg kg-1 | 2 | real | kind_phys | inout | F |
!! | uconvtend | tendency_of_x_wind_due_to_deep_convection_for_coupling_on_physics_timestep | tendency_of_x_wind_due_to_deep_convection | m s-1 | 2 | real | kind_phys | inout | F |
Expand Down Expand Up @@ -194,12 +194,12 @@ subroutine GFS_DCNV_generic_post_run (im, levs, lssav, ldiag3d, lgocart, ras, cs
! dqdti, cnvqci, upd_mfi, dwn_mfi, det_mfi only allocated if ldiag3d == .true. or lgocart == .true.
real(kind=kind_phys), dimension(:,:), intent(inout) :: dqdti, cnvqci, upd_mfi, dwn_mfi, det_mfi
real(kind=kind_phys), dimension(im,levs), intent(inout) :: cnvw, cnvc
! DH* The following arrays may not be allocated, depending on certain flags and microphysics schemes.
! 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
! *DH

real(kind=kind_phys), dimension(im), intent(inout) :: cape
real(kind=kind_phys), dimension(im,levs), intent(inout) :: tconvtend, qconvtend, uconvtend, vconvtend

Expand Down
5 changes: 3 additions & 2 deletions physics/GFS_MP_generic.F90
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,8 @@ subroutine GFS_MP_generic_post_run(im, ix, levs, kdt, nrcm, ncld, nncl, ntcw, nt
srflag, cnvprcp, totprcp, totice, totsnw, totgrp, cnvprcpb, &
totprcpb, toticeb, totsnwb, totgrpb, rain_cpl, rainc_cpl, &
snow_cpl, pwat
real(kind=kind_phys), dimension(im,levs), intent(inout) :: dt3dt, dq3dt
! These arrays are only allocated if ldiag3d is .true.
real(kind=kind_phys), dimension(:,:), intent(inout) :: dt3dt, dq3dt

! Stochastic physics / surface perturbations
logical, intent(in) :: do_sppt
Expand Down Expand Up @@ -259,7 +260,7 @@ subroutine GFS_MP_generic_post_run(im, ix, levs, kdt, nrcm, ncld, nncl, ntcw, nt
! put ice, snow, graupel on dynamics timestep. The way the code in
! GFS_physics_driver is written, Diag%{graupel,ice,snow} are on the
! physics timestep, while Diag%{rain,rainc} and all totprecip etc
! are on the dynamics timestep. Totally confusing and wrong. *DH
! are on the dynamics timestep. Confusing, but works if frain=1. *DH
if (imp_physics == imp_physics_gfdl) then
tprcp = max(0., rain) ! clu: rain -> tprcp
!graupel = frain*graupel0
Expand Down
3 changes: 1 addition & 2 deletions physics/GFS_PBL_generic.F90
Original file line number Diff line number Diff line change
Expand Up @@ -320,14 +320,13 @@ subroutine GFS_PBL_generic_post_run (im, levs, nvdiff, ntrac,

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

! DH* The following arrays may not be allocated, depending on certain flags (cplflx, ...).
! The following arrays may not be allocated, depending on certain flags (cplflx, ...).
! 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.
real(kind=kind_phys), dimension(:,:), intent(inout) :: dt3dt, du3dt_PBL, du3dt_OGWD, dv3dt_PBL, dv3dt_OGWD, dq3dt, dq3dt_ozone
real(kind=kind_phys), dimension(:), intent(inout) :: dusfc_cpl, dvsfc_cpl, dtsfc_cpl, dqsfc_cpl, dusfci_cpl, dvsfci_cpl, &
dtsfci_cpl, dqsfci_cpl, dusfc_diag, dvsfc_diag, dtsfc_diag, dqsfc_diag, dusfci_diag, dvsfci_diag, dtsfci_diag, dqsfci_diag
! *DH

character(len=*), intent(out) :: errmsg
integer, intent(out) :: errflg
Expand Down
3 changes: 2 additions & 1 deletion physics/GFS_suite_interstitial.F90
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,8 @@ subroutine GFS_suite_interstitial_2_run (im, levs, lssav, ldiag3d, lsidea, cplfl

integer, intent(inout), dimension(im) :: kinver
real(kind=kind_phys), intent(inout), dimension(im) :: suntim, dlwsfc, ulwsfc, psmean, adjsfculw, ctei_rml, ctei_r
real(kind=kind_phys), intent(inout), dimension(im, levs) :: dt3dt_lw, dt3dt_sw, dt3dt_pbl, dt3dt_dcnv, dt3dt_scnv, dt3dt_mp
! These arrays are only allocated if ldiag3d is .true.
real(kind=kind_phys), intent(inout), dimension(:,:) :: dt3dt_lw, dt3dt_sw, dt3dt_pbl, dt3dt_dcnv, dt3dt_scnv, dt3dt_mp

character(len=*), intent(out) :: errmsg
integer, intent(out) :: errflg
Expand Down
2 changes: 1 addition & 1 deletion physics/cu_gf_driver.F90
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ subroutine cu_gf_driver_run(tottracer,ntrac,garea,im,ix,km,dt,cactiv, &
dd_mf =0.
dt_mf =0.
tau_ecmwf(:)=0.
!
!
j=1
ht(:)=phil(:,1)/g
do i=its,ite
Expand Down
1 change: 0 additions & 1 deletion physics/gfdl_fv_sat_adj.F90
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ module fv_sat_adj
! </tr>
! </table>
! DH* TODO - MAKE THIS INPUT ARGUMENTS *DH
!use constants_mod, only: rvgas, rdgas, grav, hlv, hlf, cp_air
use physcons, only : rdgas => con_rd_dyn, &
rvgas => con_rv_dyn, &
grav => con_g_dyn, &
Expand Down
3 changes: 2 additions & 1 deletion physics/gwdps.f
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@ subroutine gwdps_pre_run( &

logical, intent(in) :: lssav, ldiag3d
real(kind=kind_phys), intent(in) :: dtdt(im,levs)
real(kind=kind_phys), intent(inout) :: dt3dt(im,levs)
! dt3dt only allocated only if ldiag3d is .true.
real(kind=kind_phys), intent(inout) :: dt3dt(:,:)
real(kind=kind_phys), intent(in) :: dtf

character(len=*), intent(out) :: errmsg
Expand Down
2 changes: 1 addition & 1 deletion physics/maximum_hourly_diagnostics.F90
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ module maximum_hourly_diagnostics

public maximum_hourly_diagnostics_init, maximum_hourly_diagnostics_run, maximum_hourly_diagnostics_finalize

! DH* TODO - THIS CAME FROM PHYSCONS.F90 BUT IS IT BETTER PLACED IN HERE?
! DH* TODO - cleanup use of constants
real(kind=kind_phys), parameter ::PQ0=379.90516E0, A2A=17.2693882, A3=273.16, A4=35.86, RHmin=1.0E-6
! *DH

Expand Down
2 changes: 0 additions & 2 deletions physics/module_mp_thompson.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1486,11 +1486,9 @@ subroutine mp_thompson (qv1d, qc1d, qi1d, qr1d, qs1d, qg1d, ni1d, &
rainprod, evapprod, &
#endif
kts, kte, dt, ii, jj)
! DH*
#ifdef MPI
use mpi
#endif
! *DH
implicit none

!..Sub arguments
Expand Down
25 changes: 1 addition & 24 deletions physics/mp_thompson_post.F90
Original file line number Diff line number Diff line change
Expand Up @@ -21,28 +21,24 @@ module mp_thompson_post
!! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional |
!! |-----------------|-------------------------------------------------------|----------------------------------------------------------|------------|------|-----------|-----------|--------|----------|
!! | ncol | horizontal_loop_extent | horizontal loop extent | count | 0 | integer | | in | F |
!! | area | cell_area | area of the grid cell | m2 | 1 | real | kind_phys | in | F |
!! | ttendlim | limit_for_temperature_tendency_for_microphysics | temperature tendency limiter per physics time step | K s-1 | 0 | real | kind_phys | in | F |
!! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F |
!! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F |
!!
#endif
subroutine mp_thompson_post_init(ncol, area, ttendlim, errmsg, errflg)
subroutine mp_thompson_post_init(ncol, ttendlim, errmsg, errflg)

implicit none

! Interface variables
integer, intent(in) :: ncol
! DH* TODO: remove area and dx (also from metadata table)
real(kind_phys), dimension(1:ncol), intent(in) :: area
real(kind_phys), intent(in) :: ttendlim

! CCPP error handling
character(len=*), intent( out) :: errmsg
integer, intent( out) :: errflg

! Local variables
!real(kind_phys), dimension(1:ncol) :: dx
integer :: i

! Initialize the CCPP error handling variables
Expand All @@ -60,26 +56,7 @@ subroutine mp_thompson_post_init(ncol, area, ttendlim, errmsg, errflg)

allocate(mp_tend_lim(1:ncol))

!! Cell size in m as square root of cell area
!dx = sqrt(area)

do i=1,ncol
! The column-dependent values that were set here previously
! are replaced with a single value set in the namelist
! input.nml.This value is independent of the grid spacing
! (as opposed to setting it here on a per-column basis).
! However, given that the timestep is the same for all grid
! columns and determined by the smallest grid spacing in
! the domain, it makes sense to use a single value.
!
! The values previously used in RAP/HRRR were
! mp_tend_lim(i) = 0.07 ! [K/s], 3-km HRRR value
! and
! mp_tend_lim(i) = 0.002 ! [K/s], 13-km RAP value
!
! Our testing with FV3 has shown thus far that 0.002 is
! too small for a 13km (C768) resolution and that 0.01
! works better. This is work in progress ...
mp_tend_lim(i) = ttendlim
end do

Expand Down
2 changes: 1 addition & 1 deletion physics/multi_gases.F90
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ module ccpp_multi_gases_mod
! </tr>
! </table>
use machine, only: kind_dyn
! DH* TODO - MAKE THIS INPUT ARGUMENTS *DH
! DH* TODO - MAKE THIS INPUT ARGUMENTS
use physcons, only : rdgas => con_rd_dyn, &
cp_air => con_cp_dyn
! *DH
Expand Down
4 changes: 2 additions & 2 deletions physics/physcons.F90
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ module physcons
real(kind=kind_phys),parameter:: con_solr_old =1.3660e+3_kind_phys !< solar constant (\f$W/m^{2}\f$)-Liu(2002)
real(kind=kind_phys),parameter:: con_solr =1.3608e+3_kind_phys !< solar constant (\f$W/m^{2}\f$)-nasa-sorce Tim(2008)
! real(kind=kind_phys),parameter:: con_solr =1.36742732e+3_kind_phys ! solar constant (W/m2)-gfdl(1989) - OPR as of Jan 2006
! Selected geophysics/astronomy constants with kind=kind_dyn DH* CHECK IF THIS BREAKS B4B AND IF SO REMOVE _kind_dyn
! Selected geophysics/astronomy constants with kind=kind_dyn
real(kind=kind_dyn), parameter:: con_g_dyn =9.80665e+0_kind_dyn !< gravity (\f$m/s^{2}\f$)

!> \name Thermodynamics constants
Expand All @@ -79,7 +79,7 @@ module physcons
real(kind=kind_phys),parameter:: con_jcal =4.1855E+0_kind_phys !< joules per calorie
real(kind=kind_phys),parameter:: con_rhw0 =1022.0_kind_phys !< sea water reference density (\f$kg/m^{3}\f$)
real(kind=kind_phys),parameter:: con_epsq =1.0E-12_kind_phys !< min q for computing precip type
! Selected thermodynamics constants with kind=kind_dyn DH* CHECK IF THIS BREAKS B4B AND IF SO REMOVE _kind_dyn
! Selected thermodynamics constants with kind=kind_dyn
real(kind=kind_dyn), parameter:: con_rd_dyn =2.8705e+2_kind_dyn !< gas constant air (\f$J/kg/K\f$)
real(kind=kind_dyn), parameter:: con_rv_dyn =4.6150e+2_kind_dyn !< gas constant H2O (\f$J/kg/K\f$)
real(kind=kind_dyn), parameter:: con_cp_dyn =1.0046e+3_kind_dyn !< spec heat air at p (\f$J/kg/K\f$)
Expand Down
1 change: 0 additions & 1 deletion physics/radcons.f90
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ module radcons
!----------------------------
! Module variable definitions
!----------------------------
! DH* CHECK IF THIS IS NEEDED/TRUE?
!CCPP: copy from GFS_driver.F90
real(kind=kind_phys), parameter :: con_24 = 24.0_kind_phys
real(kind=kind_phys), parameter :: con_hr = 3600.0_kind_phys
Expand Down
3 changes: 1 addition & 2 deletions physics/samfshalcnv.f
Original file line number Diff line number Diff line change
Expand Up @@ -1869,13 +1869,12 @@ subroutine samfshalcnv_post_run (im, levs, lssav, shcnvcw, frain,

real(kind=kind_phys), dimension(im), intent(inout) :: rainc,
& cnvprcp, cnvprcpb
! DH* The following arrays may not be allocated, depending on certain flags and microphysics schemes.
! 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.
real(kind=kind_phys), dimension(:,:), intent(inout) ::
& cnvw_phy_f3d, cnvc_phy_f3d
! *DH

character(len=*), intent(out) :: errmsg
integer, intent(out) :: errflg
Expand Down

0 comments on commit 8914f4c

Please sign in to comment.