Skip to content

Commit

Permalink
First set of changes to use chuck's mods
Browse files Browse the repository at this point in the history
        modified:   bld/namelist_files/namelist_defaults_cam.xml
        modified:   bld/namelist_files/use_cases/carma_trop_strat_cam6.xml
        modified:   src/chemistry/aerosol/aerosol_properties_mod.F90
        modified:   src/chemistry/aerosol/aerosol_state_mod.F90
        modified:   src/chemistry/aerosol/carma_aerosol_properties_mod.F90
        modified:   src/chemistry/aerosol/carma_aerosol_state_mod.F90
        modified:   src/chemistry/aerosol/hygrocoreshell_aerosol_optics_mod.F90
        modified:   src/chemistry/aerosol/hygrowghtpct_aerosol_optics_mod.F90
        modified:   src/chemistry/aerosol/modal_aerosol_properties_mod.F90
        modified:   src/chemistry/aerosol/modal_aerosol_state_mod.F90
        modified:   src/chemistry/carma_aero/aero_model.F90
        modified:   src/chemistry/carma_aero/carma_aero_convproc.F90
        modified:   src/physics/cam/carma_fixer_mod.F90
        modified:   src/physics/cam/rad_constituents.F90
        modified:   src/physics/carma/cam/carma_intr.F90
        modified:   src/physics/carma/models/trop_strat_soa1/carma_model_mod.F90
        modified:   src/physics/carma/models/trop_strat_soa5/carma_model_mod.F90

    disabled:
        aero_state%wghtpct function -- used in hygrowghtpct optics
	carma processes:
	  aero_model_wetdep
	  aero_model_gasaerexch
	  surf_area_dens
  • Loading branch information
fvitt committed Oct 17, 2023
1 parent fd92b3d commit 7837e39
Show file tree
Hide file tree
Showing 17 changed files with 412 additions and 552 deletions.
242 changes: 81 additions & 161 deletions bld/namelist_files/namelist_defaults_cam.xml

Large diffs are not rendered by default.

4 changes: 0 additions & 4 deletions bld/namelist_files/use_cases/carma_trop_strat_cam6.xml
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,6 @@
<fincl1>
'EXTINCT', 'EXTINCTUV', 'EXTINCTNIR','ABSORB', 'AODVIS', 'AODABS','SAD_STRAT','SAD_SULFC','SAD_LNAT','SAD_ICE',
'O3','CO','OH','NO2','SSAVIS','AODNIR','AODVISst','AODNIRst','AODUVst',,'TMSO2','TMH2SO4','TMOCS',
'TMMXAER01','TMMXAER02','TMMXAER03','TMMXAER04','TMMXAER05','TMMXAER06','TMMXAER07','TMMXAER08','TMMXAER09','TMMXAER10',
'TMMXAER11','TMMXAER12','TMMXAER13','TMMXAER14','TMMXAER15','TMMXAER16','TMMXAER17','TMMXAER18','TMMXAER19','TMMXAER20',
'TMPRSUL01','TMPRSUL02','TMPRSUL03','TMPRSUL04','TMPRSUL05','TMPRSUL06','TMPRSUL07','TMPRSUL08','TMPRSUL09','TMPRSUL10',
'TMPRSUL11','TMPRSUL12','TMPRSUL13','TMPRSUL14','TMPRSUL15','TMPRSUL16','TMPRSUL17','TMPRSUL18','TMPRSUL19','TMPRSUL20',
'TMMXOC01','TMMXOC02','TMMXOC03','TMMXOC04','TMMXOC05','TMMXOC06','TMMXOC07','TMMXOC08','TMMXOC09','TMMXOC10',
'TMMXOC11','TMMXOC12','TMMXOC13','TMMXOC14','TMMXOC15','TMMXOC16','TMMXOC17','TMMXOC18','TMMXOC19','TMMXOC20',
'TMMXBC01','TMMXBC02','TMMXBC03','TMMXBC04','TMMXBC05','TMMXBC06','TMMXBC07','TMMXBC08','TMMXBC09','TMMXBC10',
Expand Down
13 changes: 13 additions & 0 deletions src/chemistry/aerosol/aerosol_properties_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ module aerosol_properties_mod
procedure(aero_min_mass_mean_rad), deferred :: min_mass_mean_rad
procedure(aero_optics_params), deferred :: optics_params
procedure(aero_bin_name), deferred :: bin_name
procedure(aero_scav_radius), deferred :: scav_radius

procedure :: final=>aero_props_final
end type aerosol_properties
Expand Down Expand Up @@ -378,6 +379,18 @@ function aero_bin_name(self, list_ndx, bin_ndx) result(name)

end function aero_bin_name

!------------------------------------------------------------------------------
! returns scavenging radius for a given aerosol bin number
!------------------------------------------------------------------------------
function aero_scav_radius(self, bin_ndx) result(radius)
import :: aerosol_properties, r8
class(aerosol_properties), intent(in) :: self
integer, intent(in) :: bin_ndx ! bin number

real(r8) :: radius

end function aero_scav_radius

end interface

contains
Expand Down
6 changes: 3 additions & 3 deletions src/chemistry/aerosol/aerosol_state_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -220,15 +220,15 @@ end function aero_hetfrz_size_wght
! returns hygroscopicity for a given radiation diagnostic list number and
! bin number
!------------------------------------------------------------------------------
function aero_hygroscopicity(self, list_ndx, bin_ndx) result(kappa)
subroutine aero_hygroscopicity(self, list_ndx, bin_ndx, kappa)
import :: aerosol_state, r8
class(aerosol_state), intent(in) :: self
integer, intent(in) :: list_ndx ! rad climate/diagnostic list index
integer, intent(in) :: bin_ndx ! bin number

real(r8), pointer :: kappa(:,:) ! hygroscopicity (ncol,nlev)
real(r8), intent(out) :: kappa(:,:) ! hygroscopicity (ncol,nlev)

end function aero_hygroscopicity
end subroutine aero_hygroscopicity

!------------------------------------------------------------------------------
! returns aerosol wet diameter and aerosol water concentration for a given
Expand Down
59 changes: 44 additions & 15 deletions src/chemistry/aerosol/carma_aerosol_properties_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ module carma_aerosol_properties_mod
procedure :: soluble
procedure :: min_mass_mean_rad
procedure :: bin_name
procedure :: scav_radius

final :: destructor
end type carma_aerosol_properties
Expand Down Expand Up @@ -96,8 +97,8 @@ function constructor() result(newobj)

do m = 1, nbins
call rad_cnst_get_info_by_bin(0, m, nspec=nspecies(m))
ncnst_tot = ncnst_tot + nspecies(m) + 2
nmasses(m) = nspecies(m) + 1
ncnst_tot = ncnst_tot + nspecies(m) + 1
nmasses(m) = nspecies(m)
end do

alogsig(:) = log(2._r8) !!!! ???? IS THIS RIGHT ???? !!!
Expand Down Expand Up @@ -352,11 +353,7 @@ subroutine mmr_names(self, bin_ndx, species_ndx, name_a, name_c)
character(len=*), intent(out) :: name_a ! constituent name of ambient aerosol MMR
character(len=*), intent(out) :: name_c ! constituent name of cloud-borne aerosol MMR

if (species_ndx>1) then
call rad_cnst_get_info_by_bin_spec(0, bin_ndx, species_ndx-1, spec_name=name_a, spec_name_cw=name_c)
else
call rad_cnst_get_info_by_bin(0, bin_ndx, mmr_name=name_a, mmr_name_cw=name_c)
end if
call rad_cnst_get_info_by_bin_spec(0, bin_ndx, species_ndx, spec_name=name_a, spec_name_cw=name_c)

end subroutine mmr_names

Expand All @@ -381,11 +378,7 @@ subroutine amb_mmr_name(self, bin_ndx, species_ndx, name)
integer, intent(in) :: species_ndx ! species number
character(len=*), intent(out) :: name ! constituent name of ambient aerosol MMR

if (species_ndx>0) then
call rad_cnst_get_info_by_bin_spec(0, bin_ndx, species_ndx, spec_name=name)
else
call rad_cnst_get_info_by_bin(0, bin_ndx, mmr_name=name)
end if
call rad_cnst_get_info_by_bin_spec(0, bin_ndx, species_ndx, spec_name=name)

end subroutine amb_mmr_name

Expand Down Expand Up @@ -438,9 +431,7 @@ function icenuc_updates_mmr(self, bin_ndx, species_ndx) result(res)

res = .false.

if (species_ndx==0) then
res = self%icenuc_updates_num(bin_ndx)
else
if (species_ndx>0) then
call self%species_type( bin_ndx, species_ndx, spectype)
if (trim(spectype)=='dust') res = .true.
if (trim(spectype)=='sulfate') res = .true.
Expand Down Expand Up @@ -564,4 +555,42 @@ function bin_name(self, list_ndx, bin_ndx) result(name)

end function bin_name

!------------------------------------------------------------------------------
! returns scavenging radius (cm) for a given aerosol bin number
!------------------------------------------------------------------------------
function scav_radius(self, bin_ndx) result(radius)

use carma_model_mod, only: NBIN
use carma_intr, only :carma_get_bin_rmass

class(carma_aerosol_properties), intent(in) :: self
integer, intent(in) :: bin_ndx ! bin number

real(r8) :: radius ! cm

real(r8) :: mass ! the bin mass (g)
real(r8) :: rho ! density (kg/m3)
integer :: igroup, ibin, rc, ispec
character(len=32) :: spectype

ibin = bin_ndx
igroup = 1
if (bin_ndx>NBIN) then
igroup = 2
ibin = ibin-NBIN
end if

call carma_get_bin_rmass(igroup, ibin, mass, rc)

do ispec = 1, self%nspecies(bin_ndx)
call self%species_type(bin_ndx,ispec, spectype)
if (trim(spectype) == 'sulfate') then
call self%get(bin_ndx,ispec,density=rho)
end if
end do

radius = (0.75*mass / pi / (1.0e-3_r8*rho)) **(0.33_r8) ! specdens kg/m3 to g/cm3, convert from radiust to diameter

end function scav_radius

end module carma_aerosol_properties_mod
Loading

0 comments on commit 7837e39

Please sign in to comment.