Skip to content

Commit

Permalink
Merge pull request #148 from mvertens/feature/add_sum_diagnostics
Browse files Browse the repository at this point in the history
Update the Externals_CAM.cfg to incorporate the new oslo-aero tag.
Add new sum diagnostics for enhanced comparison to oslo-aero code.

Testing:
Successfully ran the aux_cam_noresm test suite on betzy:

using codebase branch feature/noresm2_5_alpha02_v5 in https://github.com/mvertens/OSLO_AERO
generated new baseline directory noresm2_5_alpha02_v5_cam

fixes #144 (Addition of new sum diagnostics for aerosols)
  • Loading branch information
gold2718 authored May 29, 2024
2 parents 802abfc + fb9e751 commit e311347
Show file tree
Hide file tree
Showing 3 changed files with 79 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Externals_CAM.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ required = True

[oslo_aero]
protocol = git
tag = 90e657f
tag = noresm_oslo_aero_v1
repo_url = https://github.com/NorESMhub/OSLO_AERO
local_path = src/chemistry/oslo_aero
required = True
Expand Down
6 changes: 3 additions & 3 deletions cime_config/testdefs/testlist_cam.xml
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,15 @@
<machine name="betzy" compiler="intel" category="aux_cam_noresm"/>
</machines>
<options>
<option name="wallclock">00:10:00</option>
<option name="wallclock">00:30:00</option>
</options>
</test>
<test compset="NF2000tropmam4" grid="ne30pg3_ne30pg3_mtn14" name="ERP_Ln9" testmods="cam/outfrq9s">
<machines>
<machine name="betzy" compiler="intel" category="aux_cam_noresm"/>
</machines>
<options>
<option name="wallclock">00:10:00</option>
<option name="wallclock">00:30:00</option>
</options>
</test>

Expand Down Expand Up @@ -89,7 +89,7 @@
<machine name="betzy" compiler="intel" category="prealpha_noresm"/>
</machines>
<options>
<option name="wallclock">00:10:00</option>
<option name="wallclock">00:30:00</option>
</options>
</test>

Expand Down
76 changes: 75 additions & 1 deletion src/chemistry/mozart/mo_chm_diags.F90
Original file line number Diff line number Diff line change
Expand Up @@ -484,6 +484,22 @@ subroutine chm_diags_inti
call addfld( 'MASS', (/ 'lev' /), 'A', 'kg', 'mass of grid box' )
call addfld( 'AREA', horiz_only, 'A', 'm2', 'area of grid box' )

call addfld('sum_SO4' , (/ 'lev' /), 'A', 'kg/kg ', 'sum of SO4 concentrations')
call addfld('sum_BC' , (/ 'lev' /), 'A', 'kg/kg ', 'sum of BC concentrations')
call addfld('sum_OM' , (/ 'lev' /), 'A', 'kg/kg ', 'sum of OM concentrations')
call addfld('sum_DST' , (/ 'lev' /), 'A', 'kg/kg ', 'sum of DST concentrations')
call addfld('sum_SS' , (/ 'lev' /), 'A', 'kg/kg ', 'sum of SS concentrations')
call addfld('sum_SOA' , (/ 'lev' /), 'A', 'kg/kg ', 'sum of SOA concentrations')
call addfld('sum_num' , (/ 'lev' /), 'A', 'kg/kg ', 'sum of num ')

call add_default('sum_SO4' , 1, ' ')
call add_default('sum_BC' , 1, ' ')
call add_default('sum_OM' , 1, ' ')
call add_default('sum_DST' , 1, ' ')
call add_default('sum_SS' , 1, ' ')
call add_default('sum_SOA' , 1, ' ')
call add_default('sum_num' , 1, ' ')

call addfld( 'dry_deposition_NOy_as_N', horiz_only, 'I', 'kg/m2/s', 'NOy dry deposition flux ' )
call addfld( 'DF_SOX', horiz_only, 'I', 'kg/m2/s', 'SOx dry deposition flux ' )
call addfld( 'dry_deposition_NHx_as_N', horiz_only, 'I', 'kg/m2/s', 'NHx dry deposition flux ' )
Expand Down Expand Up @@ -555,6 +571,16 @@ subroutine chm_diags( lchnk, ncol, vmr, mmr, rxt_rates, invariants, depvel, depf
real(r8), dimension(ncol) :: wd_noy, wd_nhx
real(r8), dimension(ncol,pver) :: vmr_hox

character(len=16) :: jname, spc_name, attr

real(r8) :: sum_so4(ncol,pver)
real(r8) :: sum_bc(ncol,pver)
real(r8) :: sum_om(ncol,pver)
real(r8) :: sum_dst(ncol,pver)
real(r8) :: sum_ss(ncol,pver)
real(r8) :: sum_soa(ncol,pver)
real(r8) :: sum_num(ncol,pver)

real(r8) :: area(ncol), mass(ncol,pver)
real(r8) :: wgt

Expand Down Expand Up @@ -748,8 +774,56 @@ subroutine chm_diags( lchnk, ncol, vmr, mmr, rxt_rates, invariants, depvel, depf
call outfld('DO3CHM_LMS',do3chm_lms(:ncol), ncol, lchnk )
end if
!
enddo
enddo ! end loop from m=1,gas_pcnst

! Generate compund sum

! so4_a1,so4_a2,so4_a3
sum_so4(:,:) = 0._r8

! bc_a1,bc_a4
sum_bc(:,:) = 0._r8

! pom_a1,pom_a4
sum_om(:,:) = 0._r8

! dst
sum_dst(:,:) = 0._r8

! ncl_a1,ncl_a2,ncl_a3
sum_ss(:,:) = 0._r8

! soa_a1,soa_a2
sum_soa(:,:) = 0._r8

! num_a1,num_a2,num_a3,num_a4
sum_num(:,:) = 0._r8

do m = 1,gas_pcnst
spc_name = trim(solsym(m))
if (spc_name(1:4) == 'so4_') then
sum_so4(:ncol,:) = sum_so4(:ncol,:) + mmr(:ncol,:,m)
else if (spc_name(1:3) == 'bc_') then
sum_bc(:ncol,:) = sum_bc(:ncol,:) + mmr(:ncol,:,m)
else if (spc_name(1:4) == 'pom_') then
sum_om(:ncol,:) = sum_om(:ncol,:) + mmr(:ncol,:,m)
else if (spc_name(1:4) == 'dst_') then
sum_dst(:ncol,:) = sum_dst(:ncol,:) + mmr(:ncol,:,m)
else if (spc_name(1:4) == 'ncl_') then
sum_ss(:ncol,:) = sum_ss(:ncol,:) + mmr(:ncol,:,m)
else if (spc_name(1:4) == 'soa_') then
sum_soa(:ncol,:) = sum_soa(:ncol,:) + mmr(:ncol,:,m)
else if (spc_name(1:4) == 'num_') then
sum_num(:ncol,:) = sum_num(:ncol,:) + mmr(:ncol,:,m)
end if
end do
call outfld( 'sum_SO4', sum_so4(:ncol,:), ncol ,lchnk )
call outfld( 'sum_BC' , sum_bc(:ncol,:) , ncol ,lchnk )
call outfld( 'sum_OM' , sum_om(:ncol,:) , ncol ,lchnk )
call outfld( 'sum_DST', sum_dst(:ncol,:), ncol ,lchnk )
call outfld( 'sum_SS' , sum_ss(:ncol,:) , ncol ,lchnk )
call outfld( 'sum_SOA', sum_soa(:ncol,:), ncol ,lchnk )
call outfld( 'sum_num', sum_num(:ncol,:), ncol ,lchnk )

call outfld( 'NOX', vmr_nox (:ncol,:), ncol, lchnk )
call outfld( 'NOY', vmr_noy (:ncol,:), ncol, lchnk )
Expand Down

0 comments on commit e311347

Please sign in to comment.