Skip to content

Commit

Permalink
Merge pull request NCAR#956 from dustinswales/accumulated_cleanup
Browse files Browse the repository at this point in the history
Accumulated cleanup
  • Loading branch information
dustinswales committed Feb 8, 2023
1 parent fb066dd commit f3499e3
Show file tree
Hide file tree
Showing 64 changed files with 2,605 additions and 2,023 deletions.
301 changes: 186 additions & 115 deletions CODEOWNERS

Large diffs are not rendered by default.

80 changes: 39 additions & 41 deletions physics/GFS_cloud_diagnostics.F90
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

module GFS_cloud_diagnostics
use machine, only: kind_phys
use physparam, only: icldflg
use module_radiation_clouds, only: gethml

! Module parameters (imported directly from radiation_cloud.f)
Expand All @@ -19,10 +18,6 @@ module GFS_cloud_diagnostics

! Version tag and last revision date
character(40), parameter :: VTAGCLD='UFS-cloud-diagnostics vX.x May 2020 '

! Module variables
integer :: &
llyr = 2 ! Upper limit of boundary layer clouds

public GFS_cloud_diagnostics_run

Expand All @@ -36,51 +31,54 @@ module GFS_cloud_diagnostics
!> \section arg_table_GFS_cloud_diagnostics_run
!! \htmlinclude GFS_cloud_diagnostics_run.html
!!
subroutine GFS_cloud_diagnostics_run(nCol, nLev, iovr_rand, iovr_maxrand, iovr_max, &
iovr_dcorr, iovr_exp, iovr_exprand, lsswr, lslwr, lat, de_lgth, p_lay, &
subroutine GFS_cloud_diagnostics_run(nCol, nLev, iovr, iovr_rand, iovr_maxrand, &
iovr_max, iovr_dcorr, iovr_exp, iovr_exprand, lsswr, lslwr, lat, de_lgth, p_lay, &
cld_frac, p_lev, deltaZ, cloud_overlap_param, precip_overlap_param, con_pi, &
mtopa, mbota, cldsa, errmsg, errflg)
top_at_1, si, mtopa, mbota, cldsa, errmsg, errflg)
implicit none

! Inputs
integer, intent(in) :: &
nCol, & ! Number of horizontal grid-points
nLev ! Number of vertical-layers
integer, intent(in) :: &
iovr_rand, & ! Flag for random cloud overlap method
iovr_maxrand, & ! Flag for maximum-random cloud overlap method
iovr_max, & ! Flag for maximum cloud overlap method
iovr_dcorr, & ! Flag for decorrelation-length cloud overlap method
iovr_exp, & ! Flag for exponential cloud overlap method
iovr_exprand ! Flag for exponential-random cloud overlap method
logical, intent(in) :: &
lsswr, & ! Call SW radiation?
lslwr ! Call LW radiation
real(kind_phys), intent(in) :: &
con_pi ! Physical constant: pi
integer, intent(in) :: &
nCol, & ! Number of horizontal grid-points
nLev ! Number of vertical-layers
integer, intent(in) :: &
iovr, & ! Choice of cloud-overlap method
iovr_rand, & ! Flag for random cloud overlap method
iovr_maxrand, & ! Flag for maximum-random cloud overlap method
iovr_max, & ! Flag for maximum cloud overlap method
iovr_dcorr, & ! Flag for decorrelation-length cloud overlap method
iovr_exp, & ! Flag for exponential cloud overlap method
iovr_exprand ! Flag for exponential-random cloud overlap method
logical, intent(in) :: &
lsswr, & ! Call SW radiation?
lslwr, & ! Call LW radiation?
top_at_1 ! Vertical ordering flag
real(kind_phys), intent(in) :: &
con_pi ! Physical constant: pi
real(kind_phys), dimension(:), intent(in) :: &
lat, & ! Latitude
de_lgth ! Decorrelation length
lat, & ! Latitude
de_lgth, & ! Decorrelation length
si ! Vertical sigma coordinate
real(kind_phys), dimension(:,:), intent(in) :: &
p_lay, & ! Pressure at model-layer
cld_frac ! Total cloud fraction
p_lay, & ! Pressure at model-layer
cld_frac ! Total cloud fraction
real(kind_phys), dimension(:,:), intent(in) :: &
p_lev ! Pressure at model interfaces
p_lev ! Pressure at model interfaces
real(kind_phys), dimension(:,:), intent(in) :: &
deltaZ, & ! Layer thickness (m)
cloud_overlap_param, & ! Cloud-overlap parameter
precip_overlap_param ! Precipitation overlap parameter
deltaZ, & ! Layer thickness (m)
cloud_overlap_param, & ! Cloud-overlap parameter
precip_overlap_param ! Precipitation overlap parameter

! Outputs
character(len=*), intent(out) :: &
errmsg ! Error message
integer, intent(out) :: &
errflg ! Error flag
integer,dimension(:,:),intent(out) :: &
mbota, & ! Vertical indices for cloud tops
mtopa ! Vertical indices for cloud bases
character(len=*), intent(out) :: &
errmsg ! Error message
integer, intent(out) :: &
errflg ! Error flag
integer,dimension(:,:),intent(out) :: &
mbota, & ! Vertical indices for cloud tops
mtopa ! Vertical indices for cloud bases
real(kind_phys),dimension(:,:), intent(out) :: &
cldsa ! Fraction of clouds for low, middle, high, total and BL
cldsa ! Fraction of clouds for low, middle, high, total and BL

! Local variables
integer i,id,iCol,iLay,icld
Expand Down Expand Up @@ -111,8 +109,8 @@ subroutine GFS_cloud_diagnostics_run(nCol, nLev, iovr_rand, iovr_maxrand, iovr_m
! defined by ptopc. The cloud overlapping method is defined by control flag 'iovr', which may
! be different for lw and sw radiation programs.
call gethml(p_lay*0.01, ptop1, cld_frac, cldcnv, deltaZ, de_lgth, cloud_overlap_param,&
nCol, nLev, iovr_rand, iovr_maxrand, iovr_max, iovr_dcorr, iovr_exp, &
iovr_exprand, cldsa, mtopa, mbota)
nCol, nLev, iovr, iovr_rand, iovr_maxrand, iovr_max, iovr_dcorr, iovr_exp, &
iovr_exprand, top_at_1, si, cldsa, mtopa, mbota)

end subroutine GFS_cloud_diagnostics_run
!> @}
Expand Down
23 changes: 23 additions & 0 deletions physics/GFS_cloud_diagnostics.meta
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
[ccpp-table-properties]
name = GFS_cloud_diagnostics
type = scheme
dependencies = machine.F,radiation_clouds.f

########################################################################
[ccpp-arg-table]
Expand All @@ -20,6 +21,13 @@
dimensions = ()
type = integer
intent = in
[iovr]
standard_name = flag_for_cloud_overlap_method_for_radiation
long_name = max-random overlap clouds
units = flag
dimensions = ()
type = integer
intent = in
[iovr_rand]
standard_name = flag_for_random_cloud_overlap_method
long_name = choice of random cloud overlap method
Expand Down Expand Up @@ -148,6 +156,21 @@
type = real
kind = kind_phys
intent = in
[top_at_1]
standard_name = flag_for_vertical_ordering_in_radiation
long_name = flag for vertical ordering in radiation
units = flag
dimensions = ()
type = logical
intent = in
[si]
standard_name = sigma_pressure_hybrid_vertical_coordinate
long_name = vertical sigma coordinate for radiation initialization
units = none
dimensions = (vertical_interface_dimension)
type = real
kind = kind_phys
intent = in
[mtopa]
standard_name = model_layer_number_at_cloud_top
long_name = vertical indices for low, middle and high cloud tops
Expand Down
14 changes: 7 additions & 7 deletions physics/GFS_phys_time_vary.fv3.F90
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ module GFS_phys_time_vary
!--- variables needed for calculating 'sncovr'
use namelist_soilveg, only: salp_data, snupx
use set_soilveg_mod, only: set_soilveg
use physparam, only : iaermdl

! --- needed for Noah MP init
use noahmp_tables, only: laim_table,saim_table,sla_table, &
Expand Down Expand Up @@ -67,7 +66,7 @@ module GFS_phys_time_vary
!>\section gen_GFS_phys_time_vary_init GFS_phys_time_vary_init General Algorithm
!> @{
subroutine GFS_phys_time_vary_init ( &
me, master, ntoz, h2o_phys, iaerclm, iccn, iflip, im, levs, &
me, master, ntoz, h2o_phys, iaerclm, iccn, iaermdl, iflip, im, levs, &
nx, ny, idate, xlat_d, xlon_d, &
jindx1_o3, jindx2_o3, ddy_o3, ozpl, jindx1_h, jindx2_h, ddy_h, h2opl,fhour, &
jindx1_aer, jindx2_aer, ddy_aer, iindx1_aer, iindx2_aer, ddx_aer, aer_nm, &
Expand All @@ -86,7 +85,7 @@ subroutine GFS_phys_time_vary_init (
implicit none

! Interface variables
integer, intent(in) :: me, master, ntoz, iccn, iflip, im, nx, ny, levs
integer, intent(in) :: me, master, ntoz, iccn, iflip, im, nx, ny, levs, iaermdl
logical, intent(in) :: h2o_phys, iaerclm, lsm_cold_start
integer, intent(in) :: idate(:)
real(kind_phys), intent(in) :: fhour
Expand Down Expand Up @@ -288,7 +287,7 @@ subroutine GFS_phys_time_vary_init (

!$OMP section
!> - Initialize soil vegetation (needed for sncovr calculation further down)
call set_soilveg(me, isot, ivegsrc, nlunit)
call set_soilveg(me, isot, ivegsrc, nlunit, errmsg, errflg)

!$OMP end sections

Expand Down Expand Up @@ -712,7 +711,7 @@ subroutine GFS_phys_time_vary_timestep_init (
imfdeepcnv, cal_pre, random_clds, nscyc, ntoz, h2o_phys, iaerclm, iccn, clstp, &
jindx1_o3, jindx2_o3, ddy_o3, ozpl, jindx1_h, jindx2_h, ddy_h, h2opl, iflip, &
jindx1_aer, jindx2_aer, ddy_aer, iindx1_aer, iindx2_aer, ddx_aer, aer_nm, &
jindx1_ci, jindx2_ci, ddy_ci, iindx1_ci, iindx2_ci, ddx_ci, in_nm, ccn_nm, &
jindx1_ci, jindx2_ci, ddy_ci, iindx1_ci, iindx2_ci, ddx_ci, in_nm, ccn_nm, fn_nml, &
imap, jmap, prsl, seed0, rann, nthrds, nx, ny, nsst, tile_num, nlunit, lsoil, lsoil_lsm,&
kice, ialb, isot, ivegsrc, input_nml_file, use_ufo, nst_anl, frac_grid, fhcyc, phour, &
lakefrac, min_seaice, min_lakeice, smc, slc, stc, smois, sh2o, tslb, tiice, tg3, tref, &
Expand Down Expand Up @@ -753,6 +752,7 @@ subroutine GFS_phys_time_vary_timestep_init (
integer, intent(in) :: nthrds, nx, ny, nsst, tile_num, nlunit, lsoil
integer, intent(in) :: lsoil_lsm, kice, ialb, isot, ivegsrc
character(len=*), intent(in) :: input_nml_file(:)
character(len=*), intent(in) :: fn_nml
logical, intent(in) :: use_ufo, nst_anl, frac_grid
real(kind_phys), intent(in) :: fhcyc, phour, lakefrac(:), min_seaice, min_lakeice, &
xlat_d(:), xlon_d(:), landfrac(:)
Expand Down Expand Up @@ -893,14 +893,14 @@ subroutine GFS_phys_time_vary_timestep_init (
!> - Call gcycle() to repopulate specific time-varying surface properties for AMIP/forecast runs
if (nscyc > 0) then
if (mod(kdt,nscyc) == 1) THEN
call gcycle (me, nthrds, nx, ny, isc, jsc, nsst, tile_num, nlunit, &
call gcycle (me, nthrds, nx, ny, isc, jsc, nsst, tile_num, nlunit, fn_nml, &
input_nml_file, lsoil, lsoil_lsm, kice, idate, ialb, isot, ivegsrc, &
use_ufo, nst_anl, fhcyc, phour, landfrac, lakefrac, min_seaice, min_lakeice,&
frac_grid, smc, slc, stc, smois, sh2o, tslb, tiice, tg3, tref, tsfc, &
tsfco, tisfc, hice, fice, facsf, facwf, alvsf, alvwf, alnsf, alnwf, &
zorli, zorll, zorlo, weasd, slope, snoalb, canopy, vfrac, vtype, &
stype, shdmin, shdmax, snowd, cv, cvb, cvt, oro, oro_uf, &
xlat_d, xlon_d, slmsk, imap, jmap)
xlat_d, xlon_d, slmsk, imap, jmap, errmsg, errflg)
endif
endif

Expand Down
15 changes: 15 additions & 0 deletions physics/GFS_phys_time_vary.fv3.meta
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,13 @@
dimensions = ()
type = logical
intent = in
[iaermdl]
standard_name = control_for_aerosol_radiation_scheme
long_name = control of aerosol scheme in radiation
units = 1
dimensions = ()
type = integer
intent = in
[iccn]
standard_name = control_for_ice_cloud_condensation_nuclei_forcing
long_name = flag for IN and CCN forcing for morrison gettelman microphysics
Expand Down Expand Up @@ -1285,6 +1292,14 @@
type = real
kind = kind_phys
intent = inout
[fn_nml]
standard_name = filename_of_namelist
long_name = namelist filename
units = none
dimensions = ()
type = character
kind = len=*
intent = in
[imap]
standard_name = map_of_block_column_number_to_global_i_index
long_name = map of local index ix to global index i for this block
Expand Down
2 changes: 1 addition & 1 deletion physics/GFS_phys_time_vary.scm.F90
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ subroutine GFS_phys_time_vary_init (
endif

!> - Initialize soil vegetation (needed for sncovr calculation further down)
call set_soilveg(me, isot, ivegsrc, nlunit)
call set_soilveg(me, isot, ivegsrc, nlunit, errmsg, errflg)

!> - Call setindxoz() to initialize ozone data
if (ntoz > 0) then
Expand Down
8 changes: 4 additions & 4 deletions physics/GFS_rad_time_vary.fv3.F90
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ module GFS_rad_time_vary
!!
subroutine GFS_rad_time_vary_timestep_init (lrseeds, rseeds, &
lslwr, lsswr, isubc_lw, isubc_sw, icsdsw, icsdlw, cnx, cny, isc, jsc, &
imap, jmap, sec, kdt, imp_physics, imp_physics_zhao_carr, ps_2delt, &
ps_1delt, t_2delt, t_1delt, qv_2delt, qv_1delt, t, qv, ps, errmsg, errflg)
imap, jmap, sec, kdt, imp_physics, imp_physics_zhao_carr, ipsd0, ipsdlim,&
ps_2delt, ps_1delt, t_2delt, t_1delt, qv_2delt, qv_1delt, t, qv, ps, &
errmsg, errflg)

use physparam, only: ipsd0, ipsdlim, iaerflg
use mersenne_twister, only: random_setseed, random_index, random_stat
use machine, only: kind_phys
use radcons, only: qmin, con_100
Expand All @@ -32,7 +32,7 @@ subroutine GFS_rad_time_vary_timestep_init (lrseeds, rseeds,
logical, intent(in) :: lrseeds
integer, intent(in) :: rseeds(:,:)
integer, intent(in) :: isubc_lw, isubc_sw, cnx, cny, isc, jsc, kdt
integer, intent(in) :: imp_physics, imp_physics_zhao_carr
integer, intent(in) :: imp_physics, imp_physics_zhao_carr, ipsd0, ipsdlim
logical, intent(in) :: lslwr, lsswr
integer, intent(inout) :: icsdsw(:), icsdlw(:)
integer, intent(in) :: imap(:), jmap(:)
Expand Down
16 changes: 15 additions & 1 deletion physics/GFS_rad_time_vary.fv3.meta
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[ccpp-table-properties]
name = GFS_rad_time_vary
type = scheme
dependencies = machine.F,mersenne_twister.f,physparam.f,radcons.f90
dependencies = machine.F,mersenne_twister.f,radcons.f90

########################################################################
[ccpp-arg-table]
Expand Down Expand Up @@ -134,6 +134,20 @@
dimensions = ()
type = integer
intent = in
[ipsd0]
standard_name = initial_seed_for_mcica
long_name = initial permutaion seed for mcica radiation
units = 1
dimensions = ()
type = integer
intent = in
[ipsdlim]
standard_name = limit_for_initial_seed_for_mcica
long_name = limit for initial permutaion seed for mcica radiation
units = 1
dimensions = ()
type = integer
intent = in
[ps_2delt]
standard_name = surface_air_pressure_two_timesteps_back
long_name = surface air pressure two timesteps back
Expand Down
8 changes: 4 additions & 4 deletions physics/GFS_rad_time_vary.scm.F90
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ module GFS_rad_time_vary
!!
subroutine GFS_rad_time_vary_timestep_init (lrseeds, rseeds, &
lslwr, lsswr, isubc_lw, isubc_sw, icsdsw, icsdlw, cnx, cny, isc, jsc, &
imap, jmap, sec, kdt, imp_physics, imp_physics_zhao_carr, ps_2delt, &
ps_1delt, t_2delt, t_1delt, qv_2delt, qv_1delt, t, qv, ps, errmsg, errflg)
imap, jmap, sec, kdt, imp_physics, imp_physics_zhao_carr, ipsd0, ipsdlim,&
ps_2delt, ps_1delt, t_2delt, t_1delt, qv_2delt, qv_1delt, t, qv, ps, &
errmsg, errflg)

use physparam, only: ipsd0, ipsdlim, iaerflg
use mersenne_twister, only: random_setseed, random_index, random_stat
use machine, only: kind_phys
use radcons, only: qmin, con_100
Expand All @@ -32,7 +32,7 @@ subroutine GFS_rad_time_vary_timestep_init (lrseeds, rseeds,
logical, intent(in) :: lrseeds
integer, intent(in) :: rseeds(:,:)
integer, intent(in) :: isubc_lw, isubc_sw, cnx, cny, isc, jsc, kdt
integer, intent(in) :: imp_physics, imp_physics_zhao_carr
integer, intent(in) :: imp_physics, imp_physics_zhao_carr, ipsd0, ipsdlim
logical, intent(in) :: lslwr, lsswr
integer, intent(inout) :: icsdsw(:), icsdlw(:)
integer, intent(in) :: imap(:), jmap(:)
Expand Down
16 changes: 15 additions & 1 deletion physics/GFS_rad_time_vary.scm.meta
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[ccpp-table-properties]
name = GFS_rad_time_vary
type = scheme
dependencies = machine.F,mersenne_twister.f,physparam.f,radcons.f90
dependencies = machine.F,mersenne_twister.f,radcons.f90

########################################################################
[ccpp-arg-table]
Expand Down Expand Up @@ -134,6 +134,20 @@
dimensions = ()
type = integer
intent = in
[ipsd0]
standard_name = initial_seed_for_mcica
long_name = initial permutaion seed for mcica radiation
units = 1
dimensions = ()
type = integer
intent = in
[ipsdlim]
standard_name = limit_for_initial_seed_for_mcica
long_name = limit for initial permutaion seed for mcica radiation
units = 1
dimensions = ()
type = integer
intent = in
[ps_2delt]
standard_name = surface_air_pressure_two_timesteps_back
long_name = surface air pressure two timesteps back
Expand Down
Loading

0 comments on commit f3499e3

Please sign in to comment.