Skip to content

Commit

Permalink
Added aerosol and cloud-sampling schemes.
Browse files Browse the repository at this point in the history
  • Loading branch information
dustinswales committed Dec 12, 2019
1 parent 9bd2dbb commit 9a47ad3
Show file tree
Hide file tree
Showing 17 changed files with 1,039 additions and 331 deletions.
24 changes: 1 addition & 23 deletions physics/GFS_rrtmgp_lw_pre.F90
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,6 @@ module GFS_rrtmgp_lw_pre
GFS_radtend_type ! Radiation tendencies needed in physics
use module_radiation_surface, only: &
setemis ! Routine to compute surface-emissivity
use module_radiation_aerosols, only: &
NF_AESW, & ! Number of optical-fields in SW output (3=tau+g+omega)
NF_AELW, & ! Number of optical-fields in LW output (3=tau+g+omega)
setaer, & ! Routine to compute aerosol radiative properties (tau,g,omega)
NSPC1 ! Number of species for vertically integrated aerosol optical-depth
use mo_gas_optics_rrtmgp, only: &
ty_gas_optics_rrtmgp

Expand All @@ -35,8 +30,7 @@ end subroutine GFS_rrtmgp_lw_pre_init
!! \htmlinclude GFS_rrtmgp_lw_pre.html
!!
subroutine GFS_rrtmgp_lw_pre_run (Model, Grid, Sfcprop, Statein, ncol, p_lay, p_lev, &
tv_lay, relhum, tracer, lw_gas_props, Radtend, aerosolslw, aerodp, sfc_emiss_byband, &
errmsg, errflg)
tv_lay, relhum, tracer, lw_gas_props, Radtend, sfc_emiss_byband, errmsg, errflg)

! Inputs
type(GFS_control_type), intent(in) :: &
Expand All @@ -63,21 +57,13 @@ subroutine GFS_rrtmgp_lw_pre_run (Model, Grid, Sfcprop, Statein, ncol, p_lay,
! Outputs
type(GFS_radtend_type), intent(inout) :: &
Radtend ! DDT: FV3-GFS radiation tendencies
real(kind_phys), dimension(ncol,Model%levs,lw_gas_props%get_nband(),NF_AELW), intent(out) ::&
aerosolslw ! Aerosol radiative properties in each SW band.
real(kind_phys), dimension(ncol,NSPC1), intent(inout) :: &
aerodp ! Vertical integrated optical depth for various aerosol species
real(kind_phys), dimension(lw_gas_props%get_nband(),ncol), intent(out) :: &
sfc_emiss_byband ! Surface emissivity in each band
character(len=*), intent(out) :: &
errmsg ! Error message
integer, intent(out) :: &
errflg ! Error flag

! Local
real(kind_phys), dimension(ncol, Model%levs, Model%rrtmgp_nBandsSW, NF_AESW) :: &
aerosolssw2

! Initialize CCPP error handling variables
errmsg = ''
errflg = 0
Expand All @@ -95,14 +81,6 @@ subroutine GFS_rrtmgp_lw_pre_run (Model, Grid, Sfcprop, Statein, ncol, p_lay,
sfc_emiss_byband(iBand,1:NCOL) = Radtend%semis(1:NCOL)
enddo

! #######################################################################################
! Call module_radiation_aerosols::setaer(),to setup aerosols property profile
! #######################################################################################
call setaer(p_lev, p_lay, Statein%prslk(1:NCOL,:), tv_lay, relhum, &
Sfcprop%slmsk, tracer, Grid%xlon, Grid%xlat, ncol, Model%levs, Model%levs+1, &
.true., Model%lslwr, aerosolssw2, aerosolslw, aerodp)


end subroutine GFS_rrtmgp_lw_pre_run

! #########################################################################################
Expand Down
18 changes: 0 additions & 18 deletions physics/GFS_rrtmgp_lw_pre.meta
Original file line number Diff line number Diff line change
Expand Up @@ -102,24 +102,6 @@
type = ty_gas_optics_rrtmgp
intent = in
optional = F
[aerodp]
standard_name = atmosphere_optical_thickness_due_to_ambient_aerosol_particles
long_name = vertical integrated optical depth for various aerosol species
units = none
dimensions = (horizontal_dimension,number_of_species_for_aerosol_optical_depth)
type = real
kind = kind_phys
intent = inout
optional = F
[aerosolslw]
standard_name = RRTMGP_aerosol_optical_properties_for_longwave_bands_01_16
long_name = aerosol optical properties for longwave bands 01-16
units = various
dimensions = (horizontal_dimension,vertical_dimension, number_of_lw_bands_rrtmgp,number_of_aerosol_output_fields_for_longwave_radiation)
type = real
kind = kind_phys
intent = out
optional = F
[sfc_emiss_byband]
standard_name = surface_emissivity_in_each_RRTMGP_LW_band
long_name = surface emissivity in each RRTMGP LW band
Expand Down
44 changes: 22 additions & 22 deletions physics/GFS_rrtmgp_pre.F90
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ subroutine GFS_rrtmgp_pre_run (Model, Grid, Statein, Coupling, Radtend, Sfcprop,
relhum(iCol,iLay) = max( 0._kind_phys, min( 1._kind_phys, max(QMIN, q_lay(iCol,iLay))/qs ) )
qs_lay(iCol,iLay) = qs
tv_lay(iCol,iLay) = t_lay(iCol,iLay) * (1._kind_phys + fvirt*q_lay(iCol,iLay))
deltaZ(iCol,iLay) = (rog) * abs(log(p_lev(iCol,iLay)) - log(p_lev(iCol,iLay+1))) * tv_lay(iCol,iLay)
deltaZ(iCol,iLay) = (rog*0.001) * abs(log(p_lev(iCol,iLay)) - log(p_lev(iCol,iLay+1))) * tv_lay(iCol,iLay)
enddo
enddo

Expand Down Expand Up @@ -347,29 +347,29 @@ subroutine cloud_microphysics(Model, Tbd, Grid, Sfcprop, ncol, tracer, p_lay, t_
integer, intent(in) :: &
ncol ! Number of horizontal gridpoints
real(kind_phys), dimension(ncol, Model%levs, 2:Model%ntrac),intent(in) :: &
tracer !
tracer ! Cloud condensate amount in layer by type ()
real(kind_phys), dimension(ncol,Model%levs), intent(in) :: &
p_lay, & !
t_lay, & !
tv_lay, & !
relhum, & !
qs_lay, & !
q_lay, & !
deltaZ, & !
deltaP
p_lay, & ! Pressure @ model layer centers (Pa)
t_lay, & ! Temperature @ layer centers (K)
tv_lay, & ! Virtual temperature @ layer centers (K)
relhum, & ! Relative humidity @ layer centers(1)
qs_lay, & ! Saturation specific humidity @ layer center (kg/kg)
q_lay, & ! Specific humidity @ layer centers(kg/kg)
deltaZ, & ! Layer thickness (km)
deltaP ! Layer thickness (Pa)
real(kind_phys), dimension(ncol,Model%levs+1), intent(in) :: &
p_lev !
p_lev ! Pressure @ model layer interface (Pa)

! Outputs
real(kind_phys), dimension(ncol, Model%levs, NF_CLDS),intent(out) :: &
clouds !
clouds ! Cloud properties (NCOL,Model%levs,NF_CLDS)
integer,dimension(ncol,3), intent(out) :: &
mbota, & !
mtopa !
mbota, & ! Vertical indices for low, mid, hi cloud bases (NCOL,3)
mtopa ! Vertical indices for low, mid, hi cloud tops (NCOL,3)
real(kind_phys), dimension(ncol), intent(out) ::&
de_lgth !
de_lgth ! Clouds decorrelation length (km)
real(kind_phys), dimension(ncol, 5), intent(out) :: &
cldsa !
cldsa ! Fraction of clouds for low, mid, hi, tot, bl (NCOL,5)

! Local variables
real(kind_phys), dimension(ncol, Model%levs, Model%ncnd) :: cld_condensate
Expand Down Expand Up @@ -499,7 +499,7 @@ subroutine cloud_microphysics(Model, Tbd, Grid, Sfcprop, ncol, tracer, p_lay, t_
Grid%xlat, & ! IN - Latitude (radians)
Grid%xlon, & ! IN - Longitude (radians)
Sfcprop%slmsk, & ! IN - Land/Sea mask ()
deltaZ, & ! IN - Layer thickness (m)
deltaZ, & ! IN - Layer thickness (km)
deltaP/100., & ! IN - Layer thickness (hPa)
NCOL, & ! IN - Number of horizontal gridpoints
MODEL%LEVS, & ! IN - Number of model layers
Expand Down Expand Up @@ -529,7 +529,7 @@ subroutine cloud_microphysics(Model, Tbd, Grid, Sfcprop, ncol, tracer, p_lay, t_
Grid%xlat, & ! IN - Latitude (radians)
Grid%xlon, & ! IN - Longitude (radians)
Sfcprop%slmsk, & ! IN - Land/Sea mask ()
deltaZ, & ! IN - Layer thickness (m)
deltaZ, & ! IN - Layer thickness (km)
deltaP/100., & ! IN - Layer thickness (hPa)
NCOL, & ! IN - Number of horizontal gridpoints
MODEL%LEVS, & ! IN - Number of model layers
Expand Down Expand Up @@ -565,7 +565,7 @@ subroutine cloud_microphysics(Model, Tbd, Grid, Sfcprop, ncol, tracer, p_lay, t_
Grid%xlat, & ! IN - Latitude (radians)
Grid%xlon, & ! IN - Longitude (radians)
Sfcprop%slmsk, & ! IN - Land/Sea mask ()
deltaZ, & ! IN - Layer thickness (m)
deltaZ, & ! IN - Layer thickness (km)
deltaP/100., & ! IN - Layer thickness (hPa)
NCOL, & ! IN - Number of horizontal gridpoints
MODEL%LEVS, & ! IN - Number of model layers
Expand Down Expand Up @@ -597,7 +597,7 @@ subroutine cloud_microphysics(Model, Tbd, Grid, Sfcprop, ncol, tracer, p_lay, t_
Grid%xlon, & ! IN - Longitude (radians)
Sfcprop%slmsk, & ! IN - Land/Sea mask ()
cldcov, & ! IN - Layer cloud fraction (used if uni_cld=.true.)
deltaZ, & ! IN - Layer thickness (m)
deltaZ, & ! IN - Layer thickness (km)
deltaP/100., & ! IN - Layer thickness (hPa)
NCOL, & ! IN - Number of horizontal gridpoints
MODEL%LEVS, & ! IN - Number of model layers
Expand All @@ -618,7 +618,7 @@ subroutine cloud_microphysics(Model, Tbd, Grid, Sfcprop, ncol, tracer, p_lay, t_
Grid%xlat, & ! IN - Latitude (radians)
Grid%xlon, & ! IN - Longitude (radians)
Sfcprop%slmsk, & ! IN - Land/Sea mask ()
deltaZ, & ! IN - Layer thickness (m)
deltaZ, & ! IN - Layer thickness (km)
deltaP/100., & ! IN - Layer thickness (hPa)
NCOL, & ! IN - Number of horizontal gridpoints
MODEL%LEVS, & ! IN - Number of model layers
Expand Down Expand Up @@ -649,7 +649,7 @@ subroutine cloud_microphysics(Model, Tbd, Grid, Sfcprop, ncol, tracer, p_lay, t_
Grid%xlat, & ! IN - Latitude (radians)
Grid%xlon, & ! IN - Longitude (radians)
Sfcprop%slmsk, & ! IN - Land/Sea mask ()
deltaZ, & ! IN - Layer thickness (m)
deltaZ, & ! IN - Layer thickness (km)
deltaP/100., & ! IN - Layer thickness (hPa)
Model%ntrac-1, & ! IN - Number of tracers
Model%ntcw-1, & ! IN - Tracer index for cloud condensate (or liquid water)
Expand Down
37 changes: 2 additions & 35 deletions physics/GFS_rrtmgp_sw_pre.F90
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,6 @@ module GFS_rrtmgp_sw_pre
use module_radiation_surface, only: &
NF_ALBD, & ! Number of surface albedo categories (4; nir-direct, nir-diffuse, uvvis-direct, uvvis-diffuse)
setalb ! Routine to compute surface albedo
! DJS2019: This radiation_aerosols_module is a whole-lotta mess that needs some love. As it stands now, it's
! entirely dependent on RRTMG legacy code.
use module_radiation_aerosols, only: &
NF_AESW, & ! Number of optical-fields in SW output (3=tau+g+omega)
NF_AELW, & ! Number of optical-fields in LW output (3=tau+g+omega)
setaer, & ! Routine to compute aerosol radiative properties (tau,g,omega)
NSPC1 ! Number of species for vertically integrated aerosol optical-depth
use surface_perturbation, only: &
cdfnor ! Routine to compute CDF (used to compute percentiles)
use mo_gas_optics_rrtmgp, only: &
Expand All @@ -44,8 +37,8 @@ end subroutine GFS_rrtmgp_sw_pre_init
!!
subroutine GFS_rrtmgp_sw_pre_run(Model, Grid, Sfcprop, Statein, ncol, p_lay, p_lev, &
tv_lay, relhum, tracer, sw_gas_props, nday, idxday, alb1d, sfc_alb_nir_dir, &
sfc_alb_nir_dif, sfc_alb_uvvis_dir, sfc_alb_uvvis_dif, RadTend, Coupling, aerosolssw,&
aerodp, errmsg, errflg)
sfc_alb_nir_dif, sfc_alb_uvvis_dir, sfc_alb_uvvis_dif, RadTend, Coupling, &
errmsg, errflg)

! Inputs
type(GFS_control_type), intent(in) :: &
Expand Down Expand Up @@ -85,10 +78,6 @@ subroutine GFS_rrtmgp_sw_pre_run(Model, Grid, Sfcprop, Statein, ncol, p_lay, p_
Radtend ! DDT: FV3-GFS radiation tendencies
type(GFS_coupling_type), intent(inout) :: &
Coupling ! DDT: FV3-GFS coupling arrays
real(kind_phys), dimension(ncol,Model%levs,sw_gas_props%get_nband(),NF_AESW), intent(out) ::&
aerosolssw ! Aerosol radiative properties in each SW band.
real(kind_phys), dimension(ncol,NSPC1), intent(inout) :: &
aerodp ! Vertical integrated optical depth for various aerosol species
character(len=*), intent(out) :: &
errmsg ! Error message
integer, intent(out) :: &
Expand All @@ -97,10 +86,6 @@ subroutine GFS_rrtmgp_sw_pre_run(Model, Grid, Sfcprop, Statein, ncol, p_lay, p_
! Local variables
integer :: i, j, iCol, iBand, iLay
real(kind_phys), dimension(ncol, NF_ALBD) :: sfcalb
real(kind_phys), dimension(ncol, Model%levs, sw_gas_props%get_nband(), NF_AESW) :: &
aerosolssw2
real(kind_phys), dimension(ncol, Model%levs, Model%rrtmgp_nBandsLW, NF_AELW) :: &
aerosolslw

! Initialize CCPP error handling variables
errmsg = ''
Expand Down Expand Up @@ -159,24 +144,6 @@ subroutine GFS_rrtmgp_sw_pre_run(Model, Grid, Sfcprop, Statein, ncol, p_lay, p_
sfc_alb_uvvis_dif(iBand,1:NCOL) = sfcalb(1:NCOL,4)
enddo

! #######################################################################################
! Call module_radiation_aerosols::setaer(),to setup aerosols property profile
! #######################################################################################
call setaer(p_lev, p_lay, Statein%prslk(1:NCOL,:), tv_lay, relhum, Sfcprop%slmsk, tracer, &
Grid%xlon, Grid%xlat, NCOL, Model%levs, Model%levs+1, Model%lsswr, .true., &
aerosolssw2, aerosolslw, aerodp)

! Store aerosol optical properties
! SW.
! For RRTMGP SW the bands are now ordered from [IR(band) -> nIR -> UV], in RRTMG the
! band ordering was [nIR -> UV -> IR(band)]
aerosolssw(1:NCOL,:,1,1) = aerosolssw2(1:NCOL,:,sw_gas_props%get_nband(),1)
aerosolssw(1:NCOL,:,1,2) = aerosolssw2(1:NCOL,:,sw_gas_props%get_nband(),2)
aerosolssw(1:NCOL,:,1,3) = aerosolssw2(1:NCOL,:,sw_gas_props%get_nband(),3)
aerosolssw(1:NCOL,:,2:sw_gas_props%get_nband(),1) = aerosolssw2(1:NCOL,:,1:sw_gas_props%get_nband()-1,1)
aerosolssw(1:NCOL,:,2:sw_gas_props%get_nband(),2) = aerosolssw2(1:NCOL,:,1:sw_gas_props%get_nband()-1,2)
aerosolssw(1:NCOL,:,2:sw_gas_props%get_nband(),3) = aerosolssw2(1:NCOL,:,1:sw_gas_props%get_nband()-1,3)

end subroutine GFS_rrtmgp_sw_pre_run

! #########################################################################################
Expand Down
17 changes: 0 additions & 17 deletions physics/GFS_rrtmgp_sw_pre.meta
Original file line number Diff line number Diff line change
Expand Up @@ -171,23 +171,6 @@
type = integer
intent = out
optional = F
[aerosolssw]
standard_name = RRTMGP_aerosol_optical_properties_for_shortwave_bands_01_16
long_name = aerosol optical properties for shortwave bands 01-16
units = various
dimensions = (horizontal_dimension,vertical_dimension, number_of_sw_bands_rrtmgp, number_of_aerosol_output_fields_for_shortwave_radiation)
type = real
intent = out
kind = kind_phys
[aerodp]
standard_name = atmosphere_optical_thickness_due_to_ambient_aerosol_particles
long_name = vertical integrated optical depth for various aerosol species
units = none
dimensions = (horizontal_dimension,number_of_species_for_aerosol_optical_depth)
type = real
kind = kind_phys
intent = inout
optional = F
[errmsg]
standard_name = ccpp_error_message
long_name = error message for error handling in CCPP
Expand Down
Loading

0 comments on commit 9a47ad3

Please sign in to comment.