Skip to content

Commit

Permalink
corrections for chem none and prescribed bulk aero and emis namelist …
Browse files Browse the repository at this point in the history
…settings

	modified:   bld/build-namelist
	modified:   src/physics/cam/nucleate_ice_cam.F90
  • Loading branch information
fvitt committed Dec 16, 2024
1 parent 5765179 commit 4ebb0c8
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 28 deletions.
9 changes: 7 additions & 2 deletions bld/build-namelist
Original file line number Diff line number Diff line change
Expand Up @@ -2493,7 +2493,7 @@ if ($phys =~ /cam6/ or $phys =~ /cam7/) {
}
}
}
if ($chem !~ /geoschem/) {
if (($chem !~ /geoschem/) and ($chem ne 'none')) {
add_default($nl, 'srf_emis_specifier', 'val'=>$val);
unless (defined $nl->get_value('srf_emis_type')) {
add_default($nl, 'srf_emis_type', 'val'=>'CYCLICAL');
Expand All @@ -2515,6 +2515,11 @@ if ($phys =~ /cam6/ or $phys =~ /cam7/) {
}
# air craft emissions
if ($chem !~ /trop_mam/ and $chem !~ /ghg_mam/ and $chem !~ /waccm_sc/) {
if ($chem !~ /_noaer/) {
%species = (%species,
'bc_a4_ar_ext_file' => 'bc_a4',
'num_a4_ar_ext_file' => 'num_a4' );
}
%species = (%species,
'no2_ar_ext_file' => 'NO2',
'so2_ar_ext_file' => 'SO2' );
Expand Down Expand Up @@ -2564,7 +2569,7 @@ if ($phys =~ /cam6/ or $phys =~ /cam7/) {
$first = 0;
}
}
if ($chem !~ /geoschem/) {
if (($chem !~ /geoschem/) and ($chem ne 'none')) {
add_default($nl, 'ext_frc_specifier', 'val'=>$val);
unless (defined $nl->get_value('ext_frc_type')) {
add_default($nl, 'ext_frc_type', 'val'=>"'CYCLICAL'");
Expand Down
54 changes: 28 additions & 26 deletions src/physics/cam/nucleate_ice_cam.F90
Original file line number Diff line number Diff line change
Expand Up @@ -485,17 +485,19 @@ subroutine nucleate_ice_cam_calc( &
qi => state%q(:,:,cldice_idx)
ni => state%q(:,:,numice_idx)
pmid => state%pmid
nbins = aero_props%nbins()
nmaxspc = maxval(aero_props%nspecies())

allocate(size_wght(ncol,pver,nbins,nmaxspc))
allocate(amb_num_bins(ncol,pver,nbins))
if (present(aero_props)) then
nbins = aero_props%nbins()
nmaxspc = maxval(aero_props%nspecies())

do k = 1, pver
do i = 1, ncol
rho(i,k) = pmid(i,k)/(rair*t(i,k))
end do
end do
allocate(size_wght(ncol,pver,nbins,nmaxspc))
allocate(amb_num_bins(ncol,pver,nbins))
else
nbins = 0
nmaxspc = 0
endif

rho(:ncol,:) = pmid(:ncol,:)/(rair*t(:ncol,:))

if (clim_modal_carma) then

Expand Down Expand Up @@ -618,6 +620,17 @@ subroutine nucleate_ice_cam_calc( &
call aero_state%nuclice_get_numdens( aero_props, use_preexisting_ice, ncol, pver, rho, &
dust_num_col, sulf_num_col, soot_num_col, sulf_num_tot_col )

do m = 1, aero_props%nbins()
call aero_state%get_ambient_num(m, amb_num)
amb_num_bins(:ncol,:,m) = amb_num(:ncol,:)
do l = 1, aero_props%nspecies(m)
call aero_props%species_type(m, l, spectype)
call aero_state%icenuc_size_wght( m, ncol, pver, spectype, use_preexisting_ice, size_wght(:,:,m,l))

!size_wght(:ncol,:,m,l) = wght(:ncol,:)
end do
end do

else
! for bulk model
dust_num_col(:ncol,:) = naer2(:ncol,:,idxdst1)/25._r8 * per_cm3 & ! #/cm3
Expand All @@ -628,21 +641,6 @@ subroutine nucleate_ice_cam_calc( &
soot_num_col(:ncol,:) = naer2(:ncol,:,idxbcphi)/25._r8 * per_cm3
endif

do m = 1, aero_props%nbins()
call aero_state%get_ambient_num(m, amb_num)
amb_num_bins(:ncol,:,m) = amb_num(:ncol,:)
end do

do m = 1, aero_props%nbins()
do l = 1, aero_props%nspecies(m)
call aero_props%species_type(m, l, spectype)
call aero_state%icenuc_size_wght( m, ncol, pver, spectype, use_preexisting_ice, size_wght(:,:,m,l))

!size_wght(:ncol,:,m,l) = wght(:ncol,:)
end do
end do


kloop: do k = top_lev, pver
iloop: do i = 1, ncol

Expand Down Expand Up @@ -926,8 +924,12 @@ subroutine nucleate_ice_cam_calc( &
call outfld('INFreIN ',INFreIN, pcols,lchnk)
end if

deallocate(size_wght)
deallocate(amb_num_bins)
if (allocated(size_wght)) then
deallocate(size_wght)
end if
if (allocated(amb_num_bins)) then
deallocate(amb_num_bins)
end if

end subroutine nucleate_ice_cam_calc

Expand Down

0 comments on commit 4ebb0c8

Please sign in to comment.