Skip to content

Commit

Permalink
fix spcam -- constistent setsox interfacing
Browse files Browse the repository at this point in the history
	modified:   src/chemistry/aerosol/mo_setsox.F90
	modified:   src/chemistry/bulk_aero/aero_model.F90
	modified:   src/chemistry/bulk_aero/sox_cldaero_mod.F90
	modified:   src/chemistry/carma_aero/aero_model.F90
	modified:   src/chemistry/carma_aero/sox_cldaero_mod.F90
	modified:   src/chemistry/modal_aero/aero_model.F90
	modified:   src/chemistry/modal_aero/sox_cldaero_mod.F90
	modified:   src/physics/spcam/ecpp/ecpp_modal_cloudchem.F90
	modified:   src/physics/spcam/ecpp/module_ecpp_ppdriver2.F90
	modified:   src/physics/spcam/ecpp/module_ecpp_td2clm.F90
  • Loading branch information
fvitt committed Dec 17, 2024
1 parent 4ebb0c8 commit 03de1a4
Show file tree
Hide file tree
Showing 10 changed files with 81 additions and 89 deletions.
13 changes: 4 additions & 9 deletions src/chemistry/aerosol/mo_setsox.F90
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@ module mo_setsox

use shr_kind_mod, only : r8 => shr_kind_r8
use cam_logfile, only : iulog
use physics_buffer,only: physics_buffer_desc, pbuf_get_index, pbuf_add_field, dtype_r8
use physics_types, only: physics_state
use physics_types,only : physics_state

implicit none

Expand Down Expand Up @@ -134,7 +133,6 @@ end subroutine sox_inti
!-----------------------------------------------------------------------
!-----------------------------------------------------------------------
subroutine setsox( state, &
pbuf, &
ncol, &
lchnk, &
loffset,&
Expand Down Expand Up @@ -187,6 +185,7 @@ subroutine setsox( state, &
!-----------------------------------------------------------------------
! ... Dummy arguments
!-----------------------------------------------------------------------
type(physics_state), intent(in) :: state ! Physics state variables
integer, intent(in) :: ncol ! num of columns in chunk
integer, intent(in) :: lchnk ! chunk id
integer, intent(in) :: loffset ! offset of chem tracers in the advected tracers array
Expand All @@ -212,10 +211,6 @@ subroutine setsox( state, &
real(r8), intent(out), optional :: aqso4_h2o2_3d(:, :) ! 3D SO4 aqueous phase chemistry due to H2O2 (kg/m2)
real(r8), intent(out), optional :: aqso4_o3_3d(:, :) ! 3D SO4 aqueous phase chemistry due to O3 (kg/m2)

type(physics_state), intent(in) :: state ! Physics state variables

type(physics_buffer_desc), pointer :: pbuf(:)

!-----------------------------------------------------------------------
! ... Local variables
!
Expand Down Expand Up @@ -864,8 +859,8 @@ subroutine setsox( state, &
end do col_loop1
end do ver_loop1

call sox_cldaero_update( state, &
pbuf, ncol, lchnk, loffset, dtime, mbar, pdel, press, tfld, cldnum, cldfrc, cfact, cldconc%xlwc, &
call sox_cldaero_update( &
state, ncol, lchnk, loffset, dtime, mbar, pdel, press, tfld, cldnum, cldfrc, cfact, cldconc%xlwc, &
xdelso4hp, xh2so4, xso4, xso4_init, nh3g, hno3g, xnh3, xhno3, xnh4c, xno3c, xmsa, xso2, xh2o2, qcw, qin, &
aqso4, aqh2so4, aqso4_h2o2, aqso4_o3, aqso4_h2o2_3d=aqso4_h2o2_3d, aqso4_o3_3d=aqso4_o3_3d )

Expand Down
1 change: 0 additions & 1 deletion src/chemistry/bulk_aero/aero_model.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1067,7 +1067,6 @@ subroutine aero_model_gasaerexch( state, loffset, ncol, lchnk, troplev, delt, re

if( has_sox ) then
call setsox( state, &
pbuf, &
ncol, &
lchnk, &
loffset, &
Expand Down
8 changes: 3 additions & 5 deletions src/chemistry/bulk_aero/sox_cldaero_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ module sox_cldaero_mod
use ppgrid, only : pcols, pver
use mo_chem_utls, only : get_spc_ndx
use cldaero_mod, only : cldaero_conc_t, cldaero_allocate, cldaero_deallocate
use physics_buffer, only : physics_buffer_desc

implicit none
private
Expand Down Expand Up @@ -61,16 +60,15 @@ end function sox_cldaero_create_obj
!----------------------------------------------------------------------------------
! Update the mixing ratios
!----------------------------------------------------------------------------------
subroutine sox_cldaero_update( state, &
pbuf, ncol, lchnk, loffset, dtime, mbar, pdel, press, tfld, cldnum, cldfrc, cfact, xlwc, &
subroutine sox_cldaero_update( &
state, ncol, lchnk, loffset, dtime, mbar, pdel, press, tfld, cldnum, cldfrc, cfact, xlwc, &
delso4_hprxn, xh2so4, xso4, xso4_init, nh3g, hno3g, xnh3, xhno3, xnh4c, xno3c, xmsa, xso2, xh2o2, qcw, qin, &
aqso4, aqh2so4, aqso4_h2o2, aqso4_o3, aqso4_h2o2_3d, aqso4_o3_3d )
use physics_types, only: physics_state

! args

type(physics_state), intent(in) :: state ! Physics state variables
type(physics_buffer_desc), pointer :: pbuf(:)
type(physics_state), intent(in) :: state ! Physics state variables
integer, intent(in) :: ncol
integer, intent(in) :: lchnk ! chunk id
integer, intent(in) :: loffset
Expand Down
1 change: 0 additions & 1 deletion src/chemistry/carma_aero/aero_model.F90
Original file line number Diff line number Diff line change
Expand Up @@ -767,7 +767,6 @@ subroutine aero_model_gasaerexch( state, loffset, ncol, lchnk, troplev, delt, re

if( has_sox ) then
call setsox( state, &
pbuf, &
ncol, &
lchnk, &
loffset, &
Expand Down
12 changes: 5 additions & 7 deletions src/chemistry/carma_aero/sox_cldaero_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
!----------------------------------------------------------------------------------
module sox_cldaero_mod

use physics_buffer, only : physics_buffer_desc, pbuf_get_index, pbuf_get_field, dtype_r8
use shr_kind_mod, only : r8 => shr_kind_r8
use cam_abortutils, only : endrun
use ppgrid, only : pcols, pver
Expand All @@ -19,7 +18,6 @@ module sox_cldaero_mod
use cldaero_mod, only : cldaero_uptakerate
use chem_mods, only : gas_pcnst
use rad_constituents, only: rad_cnst_get_info, rad_cnst_get_info_by_bin, rad_cnst_get_bin_props_by_idx
use spmd_utils, only: masterproc

implicit none
private
Expand Down Expand Up @@ -168,19 +166,19 @@ end function sox_cldaero_create_obj
!----------------------------------------------------------------------------------
! Update the mixing ratios
!----------------------------------------------------------------------------------
subroutine sox_cldaero_update( state, &
pbuf, ncol, lchnk, loffset, dtime, mbar, pdel, press, tfld, cldnum, cldfrc, cfact, xlwc, &
subroutine sox_cldaero_update( &
state, ncol, lchnk, loffset, dtime, mbar, pdel, press, tfld, cldnum, cldfrc, cfact, xlwc, &
delso4_hprxn, xh2so4, xso4, xso4_init, nh3g, hno3g, xnh3, xhno3, xnh4c, xno3c, xmsa, xso2, xh2o2, qcw, qin, &
aqso4, aqh2so4, aqso4_h2o2, aqso4_o3, aqso4_h2o2_3d, aqso4_o3_3d)

use aerosol_properties_mod, only: aero_name_len
use physics_types, only: physics_state
use physics_types, only: physics_state
use carma_intr, only: carma_get_group_by_name, carma_get_dry_radius

! args

type(physics_state), intent(in) :: state ! Physics state variables
type(physics_buffer_desc), pointer :: pbuf(:)
type(physics_state), intent(in) :: state ! Physics state variables

integer, intent(in) :: ncol
integer, intent(in) :: lchnk ! chunk id
integer, intent(in) :: loffset
Expand Down
1 change: 0 additions & 1 deletion src/chemistry/modal_aero/aero_model.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1063,7 +1063,6 @@ subroutine aero_model_gasaerexch( state, loffset, ncol, lchnk, troplev, delt, re

if( has_sox ) then
call setsox( state, &
pbuf, &
ncol, &
lchnk, &
loffset, &
Expand Down
13 changes: 6 additions & 7 deletions src/chemistry/modal_aero/sox_cldaero_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ module sox_cldaero_mod
use phys_control, only : phys_getopts, cam_chempkg_is
use cldaero_mod, only : cldaero_uptakerate
use chem_mods, only : gas_pcnst
use physics_buffer, only : physics_buffer_desc

implicit none
private
Expand Down Expand Up @@ -152,17 +151,17 @@ end function sox_cldaero_create_obj
!----------------------------------------------------------------------------------
! Update the mixing ratios
!----------------------------------------------------------------------------------
subroutine sox_cldaero_update( state, &
pbuf, ncol, lchnk, loffset, dtime, mbar, pdel, press, tfld, cldnum, cldfrc, cfact, xlwc, &
subroutine sox_cldaero_update( &
state, ncol, lchnk, loffset, dtime, mbar, pdel, press, tfld, cldnum, cldfrc, cfact, xlwc, &
delso4_hprxn, xh2so4, xso4, xso4_init, nh3g, hno3g, xnh3, xhno3, xnh4c, xno3c, xmsa, xso2, xh2o2, qcw, qin, &
aqso4, aqh2so4, aqso4_h2o2, aqso4_o3, aqso4_h2o2_3d, aqso4_o3_3d)

use physics_types, only: physics_state
use physics_types, only: physics_state

! args

type(physics_state), intent(in) :: state ! Physics state variables
type(physics_buffer_desc), pointer :: pbuf(:)
type(physics_state), intent(in) :: state ! Physics state variables

integer, intent(in) :: ncol
integer, intent(in) :: lchnk ! chunk id
integer, intent(in) :: loffset
Expand Down Expand Up @@ -236,7 +235,7 @@ subroutine sox_cldaero_update( state, &

! Avoid double counting in-cloud sulfur oxidation when running with
! GEOS-Chem. If running with GEOS-Chem then sulfur oxidation
! is performed internally to GEOS-Chem. Here, we just return to the
! is performed internally to GEOS-Chem. Here, we just return to the
! parent routine and thus we do not apply tendencies calculated by MAM.
if ( cam_chempkg_is('geoschem_mam4') ) return

Expand Down
Loading

0 comments on commit 03de1a4

Please sign in to comment.