CCPP SciDoc v7.0.0  v7.0.0
Common Community Physics Package Developed at DTC
 
Loading...
Searching...
No Matches
rrtmgp_aerosol_optics.F90
1
3
6 use machine, only: kind_phys
7 use radiation_tools, only: check_error_msg
8 use rrtmgp_sw_gas_optics, only: sw_gas_props
9 use rrtmgp_lw_gas_optics, only: lw_gas_props
10 use module_radiation_aerosols, only: setaer
11 use netcdf
12
13 implicit none
14
15 public rrtmgp_aerosol_optics_run
16
17contains
18
22 subroutine rrtmgp_aerosol_optics_run(doSWrad, doLWrad, nCol, nLev, nDay, idxday, p_lev, &
23 p_lay, p_lk, tv_lay, relhum, lsmask, tracer, aerfld, lon, lat, iaermdl, iaerflg, &
24 top_at_1, con_pi, con_rd, con_g, aerodp, aerlw_tau, aerlw_ssa, aerlw_g, aersw_tau, &
25 aersw_ssa, aersw_g, ext550, errmsg, errflg )
26
27 ! Inputs
28 logical, intent(in) :: &
29 doswrad, & ! Logical flag for shortwave radiation call
30 dolwrad, & ! Logical flag for longwave radiation call
31 top_at_1 ! Logical flag for vertical grid direcetion
32 integer, intent(in) :: &
33 ncol, & ! Number of horizontal grid points
34 nday, & ! Number of daylit points
35 nlev, & ! Number of vertical layers
36 iaermdl, & ! Aerosol model scheme flag
37 iaerflg ! Aerosol effects to include
38 integer,intent(in),dimension(:) :: &
39 idxday ! Indices for daylit points.
40 real(kind_phys),intent(in) :: &
41 con_pi, & ! Physical constant (pi)
42 con_rd, & ! Physical constant (gas constant for dry-air)
43 con_g ! Physical constant (gravitational constant)
44 real(kind_phys), dimension(:), intent(in) :: &
45 lon, & ! Longitude
46 lat, & ! Latitude
47 lsmask ! Land/sea/sea-ice mask
48 real(kind_phys), dimension(:,:),intent(in), optional :: &
49 p_lay, & ! Pressure @ layer-centers (Pa)
50 tv_lay, & ! Virtual-temperature @ layer-centers (K)
51 relhum ! Relative-humidity @ layer-centers
52 real(kind_phys), dimension(:,:),intent(in) :: &
53 p_lk ! Exner function @ layer-centers (1)
54 real(kind_phys), dimension(:, :,:),intent(in) :: &
55 tracer ! trace gas concentrations
56 real(kind_phys), dimension(:, :,:),intent(in) :: &
57 aerfld ! aerosol input concentrations
58 real(kind_phys), dimension(:,:),intent(in), optional :: &
59 p_lev ! Pressure @ layer-interfaces (Pa)
60 real (kind=kind_phys), dimension(:,:), intent(out) :: &
61 ext550 ! 3d optical extinction for total aerosol species
62
63 ! Outputs
64 real(kind_phys), dimension(:,:), intent(out) :: &
65 aerodp ! Vertical integrated optical depth for various aerosol species
66 real(kind_phys), dimension(:,:,:), intent(out) :: &
67 aerlw_tau, & ! Longwave aerosol optical depth
68 aerlw_ssa, & ! Longwave aerosol single scattering albedo
69 aerlw_g, & ! Longwave aerosol asymmetry parameter
70 aersw_tau, & ! Shortwave aerosol optical depth
71 aersw_ssa, & ! Shortwave aerosol single scattering albedo
72 aersw_g ! Shortwave aerosol asymmetry parameter
73 integer, intent(out) :: &
74 errflg ! CCPP error flag
75 character(len=*), intent(out) :: &
76 errmsg ! CCPP error message
77
78 ! Local variables
79 real(kind_phys), dimension(nCol, nLev, lw_gas_props%get_nband(), 3) :: &
80 aerosolslw !
81 real(kind_phys), dimension(nCol, nLev, sw_gas_props%get_nband(), 3) :: &
82 aerosolssw, aerosolssw2
83 integer :: iband
84
85 ! Initialize CCPP error handling variables
86 errmsg = ''
87 errflg = 0
88
89 if (.not. (doswrad .or. dolwrad)) return
90
91 ! Call module_radiation_aerosols::setaer(),to setup aerosols property profile
92 call setaer(p_lev*0.01, p_lay*0.01, p_lk, tv_lay, relhum, lsmask, tracer, aerfld, lon, lat, ncol, nlev, &
93 nlev+1, .true., .true., iaermdl, iaerflg, top_at_1, con_pi, con_rd, con_g, aerosolssw2, aerosolslw, &
94 aerodp, ext550, errflg, errmsg)
95
96 ! Shortwave
97 if (doswrad .and. (nday .gt. 0)) then
98 ! Store aerosol optical properties
99 ! SW.
100 ! For RRTMGP SW the bands are now ordered from [IR(band) -> nIR -> UV], in RRTMG the
101 ! band ordering was [nIR -> UV -> IR(band)]
102 aerosolssw(1:ncol,:,1,1) = aerosolssw2(1:ncol,:,sw_gas_props%get_nband(),1)
103 aerosolssw(1:ncol,:,1,2) = aerosolssw2(1:ncol,:,sw_gas_props%get_nband(),2)
104 aerosolssw(1:ncol,:,1,3) = aerosolssw2(1:ncol,:,sw_gas_props%get_nband(),3)
105 aerosolssw(1:ncol,:,2:sw_gas_props%get_nband(),1) = aerosolssw2(1:ncol,:,1:sw_gas_props%get_nband()-1,1)
106 aerosolssw(1:ncol,:,2:sw_gas_props%get_nband(),2) = aerosolssw2(1:ncol,:,1:sw_gas_props%get_nband()-1,2)
107 aerosolssw(1:ncol,:,2:sw_gas_props%get_nband(),3) = aerosolssw2(1:ncol,:,1:sw_gas_props%get_nband()-1,3)
108
109 ! Copy aerosol optical information/
110 aersw_tau = aerosolssw(:,:,:,1)
111 aersw_ssa = aerosolssw(:,:,:,2)
112 aersw_g = aerosolssw(:,:,:,3)
113 endif
114
115 ! Longwave
116 if (dolwrad) then
117 aerlw_tau = aerosolslw(:,:,:,1)
118 aerlw_ssa = aerosolslw(:,:,:,2)
119 aerlw_g = aerosolslw(:,:,:,3)
120 endif
121
122 end subroutine rrtmgp_aerosol_optics_run
123end module rrtmgp_aerosol_optics
This module contains climatological atmospheric aerosol schemes for radiation computations.
This module contains tools for radiation.
This module contains aerosol optics properties for RRTMGP.
This module contains two routines: One to initialize the k-distribution data and functions needed to ...
This module contains a routine to initialize the k-distribution data used by the RRTMGP shortwave rad...