Skip to content

Commit

Permalink
Synced w/ NCAR/ccpp-physics:master
Browse files Browse the repository at this point in the history
  • Loading branch information
dustinswales committed Jul 1, 2019
2 parents 7f8fc0b + 243abfc commit 5ebe4c0
Show file tree
Hide file tree
Showing 73 changed files with 2,741 additions and 2,038 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
7 changes: 4 additions & 3 deletions physics/GFS_MP_generic.F90
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ module GFS_MP_generic_post
subroutine GFS_MP_generic_post_init
end subroutine GFS_MP_generic_post_init

!>\defgroup gfs_calpreciptype GFS/GFDL calpreciptype Main
!>\defgroup gfs_calpreciptype GFS Precipitation Type Diagnostics Module
!! \brief If dominant precip type is requested (i.e., Zhao-Carr MP scheme), 4 more algorithms in calpreciptype()
!! will be called. the tallies are then summed in calwxt_dominant(). For GFDL cloud MP scheme, determine convective
!! rain/snow by surface temperature; and determine explicit rain/snow by rain/snow coming out directly from MP.
Expand Down 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
7 changes: 6 additions & 1 deletion physics/GFS_debug.F90
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,6 @@ subroutine GFS_diagtoscreen_run (Model, Statein, Stateout, Sfcprop, Coupling,
call print_var(mpirank,omprank, blkno, 'Sfcprop%f10m' , Sfcprop%f10m)
call print_var(mpirank,omprank, blkno, 'Sfcprop%tprcp' , Sfcprop%tprcp)
call print_var(mpirank,omprank, blkno, 'Sfcprop%srflag' , Sfcprop%srflag)
call print_var(mpirank,omprank, blkno, 'Sfcprop%sr' , Sfcprop%sr)
call print_var(mpirank,omprank, blkno, 'Sfcprop%slc' , Sfcprop%slc)
call print_var(mpirank,omprank, blkno, 'Sfcprop%smc' , Sfcprop%smc)
call print_var(mpirank,omprank, blkno, 'Sfcprop%stc' , Sfcprop%stc)
Expand Down Expand Up @@ -321,10 +320,16 @@ subroutine GFS_diagtoscreen_run (Model, Statein, Stateout, Sfcprop, Coupling,
call print_var(mpirank,omprank, blkno, 'Diag%epi ', Diag%epi)
call print_var(mpirank,omprank, blkno, 'Diag%smcwlt2 ', Diag%smcwlt2)
call print_var(mpirank,omprank, blkno, 'Diag%smcref2 ', Diag%smcref2)
call print_var(mpirank,omprank, blkno, 'Diag%sr ', Diag%sr)
call print_var(mpirank,omprank, blkno, 'Diag%tdomr ', Diag%tdomr)
call print_var(mpirank,omprank, blkno, 'Diag%tdomzr ', Diag%tdomzr)
call print_var(mpirank,omprank, blkno, 'Diag%tdomip ', Diag%tdomip)
call print_var(mpirank,omprank, blkno, 'Diag%tdoms ', Diag%tdoms)
if (Model%lsm == Model%lsm_ruc) then
call print_var(mpirank,omprank, blkno, 'Diag%wet1 ', Sfcprop%wetness)
else
call print_var(mpirank,omprank, blkno, 'Diag%wet1 ', Diag%wet1)
end if
call print_var(mpirank,omprank, blkno, 'Diag%skebu_wts ', Diag%skebu_wts)
call print_var(mpirank,omprank, blkno, 'Diag%skebv_wts ', Diag%skebv_wts)
call print_var(mpirank,omprank, blkno, 'Diag%sppt_wts ', Diag%sppt_wts)
Expand Down
34 changes: 23 additions & 11 deletions physics/GFS_phys_time_vary.fv3.F90
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@
!! Contains code related to GFS physics suite setup (physics part of time_vary_step)

!>\defgroup mod_GFS_phys_time_vary GFS Physics Time Update
!! This module contains GFS physics time vary subroutines including ozone, h2o, i
!! aerosol and IN&CCN updates.
!! This module contains GFS physics time vary subroutines including ozone, stratospheric water vapor,
!! aerosol, IN&CCN and surface properties updates.
!> @{
module GFS_phys_time_vary

#ifdef OPENMP
Expand Down Expand Up @@ -42,6 +43,8 @@ module GFS_phys_time_vary
!! | 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 |
!!
!>\section gen_GFS_phys_time_vary_init GFS_phys_time_vary_init General Algorithm
!! @{
subroutine GFS_phys_time_vary_init (Data, Model, Interstitial, nthrds, errmsg, errflg)

use GFS_typedefs, only: GFS_control_type, GFS_data_type, GFS_interstitial_type
Expand Down Expand Up @@ -111,6 +114,7 @@ subroutine GFS_phys_time_vary_init (Data, Model, Interstitial, nthrds, errmsg, e
!$OMP sections

!$OMP section
!> - Call read_o3data() to read ozone data
call read_o3data (Model%ntoz, Model%me, Model%master)

! Consistency check that the hardcoded values for levozp and
Expand All @@ -130,6 +134,7 @@ subroutine GFS_phys_time_vary_init (Data, Model, Interstitial, nthrds, errmsg, e
end if

!$OMP section
!> - Call read_h2odata() to read stratospheric water vapor data
call read_h2odata (Model%h2o_phys, Model%me, Model%master)

! Consistency check that the hardcoded values for levh2o and
Expand All @@ -149,6 +154,7 @@ subroutine GFS_phys_time_vary_init (Data, Model, Interstitial, nthrds, errmsg, e
end if

!$OMP section
!> - Call read_aerdata() to read aerosol climatology
if (Model%aero_in) then
! Consistency check that the value for ntrcaerm set in GFS_typedefs.F90
! and used to allocate Tbd%aer_nm matches the value defined in aerclm_def
Expand All @@ -173,6 +179,7 @@ subroutine GFS_phys_time_vary_init (Data, Model, Interstitial, nthrds, errmsg, e
endif

!$OMP section
!> - Call read_cidata() to read IN and CCN data
if (Model%iccn) then
call read_cidata ( Model%me, Model%master)
! No consistency check needed for in/ccn data, all values are
Expand Down Expand Up @@ -204,7 +211,7 @@ subroutine GFS_phys_time_vary_init (Data, Model, Interstitial, nthrds, errmsg, e
end if


!--- read in and initialize ozone
!> - Call setindxoz() to initialize ozone data
if (Model%ntoz > 0) then
!$OMP do schedule (dynamic,1)
do nb = 1, nblks
Expand All @@ -214,7 +221,7 @@ subroutine GFS_phys_time_vary_init (Data, Model, Interstitial, nthrds, errmsg, e
!$OMP end do
endif

!--- read in and initialize stratospheric water
!> - Call setindxh2o() to initialize stratospheric water vapor data
if (Model%h2o_phys) then
!$OMP do schedule (dynamic,1)
do nb = 1, nblks
Expand All @@ -224,7 +231,7 @@ subroutine GFS_phys_time_vary_init (Data, Model, Interstitial, nthrds, errmsg, e
!$OMP end do
endif

!--- read in and initialize aerosols
!> - Call setindxaer() to initialize aerosols data
if (Model%aero_in) then
!$OMP do schedule (dynamic,1)
do nb = 1, nblks
Expand All @@ -236,7 +243,7 @@ subroutine GFS_phys_time_vary_init (Data, Model, Interstitial, nthrds, errmsg, e
!$OMP end do
endif

!--- read in and initialize IN and CCN
!> - Call setindxci() to initialize IN and CCN data
if (Model%iccn) then
!$OMP do schedule (dynamic,1)
do nb = 1, nblks
Expand Down Expand Up @@ -267,6 +274,7 @@ subroutine GFS_phys_time_vary_init (Data, Model, Interstitial, nthrds, errmsg, e
is_initialized = .true.

end subroutine GFS_phys_time_vary_init
!! @}


!> \section arg_table_GFS_phys_time_vary_finalize Argument Table
Expand Down Expand Up @@ -324,6 +332,8 @@ end subroutine GFS_phys_time_vary_finalize
!! | 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 |
!!
!>\section gen_GFS_phys_time_vary_run GFS_phys_time_vary_run General Algorithm
!> @{
subroutine GFS_phys_time_vary_run (Data, Model, nthrds, errmsg, errflg)

use mersenne_twister, only: random_setseed, random_number
Expand Down Expand Up @@ -413,7 +423,7 @@ subroutine GFS_phys_time_vary_run (Data, Model, nthrds, errmsg, errflg)
enddo
endif ! imfdeepcnv, cal_re, random_clds

!--- o3 interpolation
!> - Call ozinterpol() to make ozone interpolation
if (Model%ntoz > 0) then
!$OMP do schedule (dynamic,1)
do nb = 1, nblks
Expand All @@ -424,7 +434,7 @@ subroutine GFS_phys_time_vary_run (Data, Model, nthrds, errmsg, errflg)
!$OMP end do
endif

!--- h2o interpolation
!> - Call h2ointerpol() to make stratospheric water vapor data interpolation
if (Model%h2o_phys) then
!$OMP do schedule (dynamic,1)
do nb = 1, nblks
Expand All @@ -435,7 +445,7 @@ subroutine GFS_phys_time_vary_run (Data, Model, nthrds, errmsg, errflg)
!$OMP end do
endif

!--- aerosol interpolation
!> - Call aerinterpol() to make aerosol interpolation
if (Model%aero_in) then
!$OMP do schedule (dynamic,1)
do nb = 1, nblks
Expand All @@ -450,7 +460,7 @@ subroutine GFS_phys_time_vary_run (Data, Model, nthrds, errmsg, errflg)
!$OMP end do
endif

!--- ICCN interpolation
!> - Call ciinterpol() to make IN and CCN data interpolation
if (Model%iccn) then
!$OMP do schedule (dynamic,1)
do nb = 1, nblks
Expand All @@ -466,7 +476,7 @@ subroutine GFS_phys_time_vary_run (Data, Model, nthrds, errmsg, errflg)

!$OMP end parallel

!--- repopulate specific time-varying sfc properties for AMIP/forecast runs
!> - Call gcycle() to repopulate specific time-varying surface properties for AMIP/forecast runs
if (Model%nscyc > 0) then
if (mod(Model%kdt,Model%nscyc) == 1) THEN
call gcycle (nblks, Model, Data(:)%Grid, Data(:)%Sfcprop, Data(:)%Cldprop)
Expand Down Expand Up @@ -500,5 +510,7 @@ subroutine GFS_phys_time_vary_run (Data, Model, nthrds, errmsg, errflg)
endif

end subroutine GFS_phys_time_vary_run
!> @}

end module GFS_phys_time_vary
!> @}
7 changes: 3 additions & 4 deletions physics/GFS_rad_time_vary.fv3.F90
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,13 @@ module GFS_rad_time_vary

contains

!>\defgroup GFS_rad_time_vary GFS RRTMG Update
!!\ingroup RRTMG
!! @{
!! \section arg_table_GFS_rad_time_vary_init Argument Table
!!
subroutine GFS_rad_time_vary_init
end subroutine GFS_rad_time_vary_init

!>\defgroup mod_GFS_rad_time_vary GFS Radiation Time Update
!> @{
!> \section arg_table_GFS_rad_time_vary_run Argument Table
!! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional |
!! |-------------------|--------------------------------------------------------|-------------------------------------------------------------------------------|----------|------|-----------------------|-----------|--------|----------|
Expand Down Expand Up @@ -105,10 +104,10 @@ subroutine GFS_rad_time_vary_run (Model, Data, nthrds, errmsg, errflg)
endif

end subroutine GFS_rad_time_vary_run
!> @}

!> \section arg_table_GFS_rad_time_vary_finalize Argument Table
!!
subroutine GFS_rad_time_vary_finalize()
end subroutine GFS_rad_time_vary_finalize
!! @}
end module GFS_rad_time_vary
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
20 changes: 11 additions & 9 deletions physics/aer_cloud.F
Original file line number Diff line number Diff line change
Expand Up @@ -158,10 +158,6 @@ end subroutine aer_cloud_init
!!\param dpre_in mass-weighted diameter of prexisting ice crystals (m)
!!\param ccn_diagr8 array of supersaturations for CCN diagnostics (in-out)
!!\param Ndropr8 Current droplet number concentration (\f$Kg^{-1}\f$)
!!\param qc Liquid water mixing ratio (Kg/Kg)
!!\param use_average_v .false. integrate over the updraft distribution. True: use the mean vertical velocity
!!\param CCN_param CCN activation parameterization. 1- Fountoukis and Nenes (2005), 2-Abdul_Razzak and Ghan (2002) (def = 2)
!!\param IN_param IN activation spectrum (default is 5)
!!\param cdncr8 Activated cloud droplet number concentration (Kg-1)
!!\param smaxliqr8 Maximum supersaturation w.r.t liquid during droplet activation
!!\param incr8 Nucleated ice crystal concentration (Kg-1)
Expand All @@ -172,14 +168,20 @@ end subroutine aer_cloud_init
!!\param Ncdepr8 Nucleated nc by deposition ice nucleation (Kg-1)
!!\param Ncdhfr8 Nucleated nc by immersion in aerosol (Kg -1)
!!\param sc_icer8 Critical saturation ratio in cirrus
!!\param fdust_depr8 Fraction of deposition ice nuclei that are dust
!!\param fdust_immr8 Fraction of immersion mixed-phase ice nuclei that are dust
!!\param fdust_depr8 Fraction of deposition ice nuclei that are dust
!!\param fdust_dhfr8 Fraction of immersion ice nuclei that are dust (not mixed-phase)
!!\param nlimr8 Limiting ice nuclei concentration (m-3)

!===================================================================================


!!\param use_average_v .false. integrate over the updraft distribution. True: use the mean vertical velocity
!!\param CCN_param CCN activation parameterization. 1- Fountoukis and Nenes (2005), 2-Abdul_Razzak and Ghan (2002) (def = 2)
!!\param IN_param IN activation spectrum (default is 5)
!!\param fd_dust
!!\param fd_soot
!!\param pfrz_inc_r8
!!\param sigma_nuc
!!\param rhi_cell
!!\param nccn
!!
subroutine aerosol_activate(tparc_in, pparc_in, sigwparc_in, &
& wparc_ls, Aer_Props, npre_in, dpre_in, ccn_diagr8, Ndropr8, &
& cdncr8, smaxliqr8, incr8, smaxicer8, nheticer8, INimmr8, &
Expand Down
Loading

0 comments on commit 5ebe4c0

Please sign in to comment.