Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUG FIX: chem_opt = 201, 202 ph_diag #1813

Merged
merged 1 commit into from
Jan 31, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions chem/aerosol_driver.F
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,7 @@ SUBROUTINE aerosols_driver (id,curr_secs,ktau,dtstep,ktauc, &

! output of aerosol pH from MOSAIC 4-bin
REAL, DIMENSION( ims:ime , kms:kme , jms:jme ) , &
OPTIONAL, &
INTENT(OUT ) :: &
ph_aer01, ph_aer02, ph_aer03, ph_aer04
!
Expand Down
1 change: 1 addition & 0 deletions chem/cloudchem_driver.F
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ SUBROUTINE cloudchem_driver( &
INTENT(INOUT ) :: gas_aqfrac

REAL, DIMENSION( ims:ime, kms:kme, jms:jme ), &
OPTIONAL, &
INTENT(OUT) :: ph_cw ! ph_cw - pH of cloud water

! LOCAL VAR
Expand Down
10 changes: 6 additions & 4 deletions chem/module_mosaic_cloudchem.F
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ subroutine mosaic_cloudchem_driver( &
! gas_aqfrac - fraction (0-1) of gas that is dissolved in cloud water

real, intent(out), &
OPTIONAL, &
dimension( ims:ime, kms:kme, jms:jme ) :: &
ph_cw

Expand Down Expand Up @@ -148,7 +149,7 @@ subroutine mosaic_cloudchem_driver( &
end if
! following line turns aqueous radical chem off unconditionally
iradical_onoff = 0

if ( config_flags%mozart_ph_diag .eq. 1 ) then
! Initialize pH of CW ph_cw to a FillValue value
do jt = jts, jte
do kt = kts, kte
Expand All @@ -157,7 +158,7 @@ subroutine mosaic_cloudchem_driver( &
end do
end do
end do

end if
do 3920 jt = jts, jte
do 3910 it = its, ite

Expand Down Expand Up @@ -214,9 +215,10 @@ subroutine mosaic_cloudchem_driver( &
num_moist, num_chem, moist, chem, &
t_phy, p_phy, rho_phy )

gas_aqfrac(it,kt,jt,:) = gas_aqfrac_box(:)
gas_aqfrac(it,kt,jt,:) = gas_aqfrac_box(:)
if ( config_flags%mozart_ph_diag .eq. 1 ) then
ph_cw(it,kt,jt) = ph_aq_box

end if
3800 continue

3910 continue
Expand Down
4 changes: 3 additions & 1 deletion chem/module_mosaic_driver.F
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,7 @@ subroutine mosaic_aerchem_driver( &
! (ug/kg for mass species, #/kg for number species)

real, intent(out), &
optional, &
dimension( ims:ime, kms:kme, jms:jme ) :: &
ph_aer01, ph_aer02, ph_aer03, ph_aer04

Expand Down Expand Up @@ -456,7 +457,8 @@ subroutine mosaic_aerchem_driver( &
call aerchemistry( it, jt, kclm_calcbgn, kclm_calcend, &
dtchem, idiagaa_dum, vbs_nbin, &
ph_aer01(it,kms:kme,jt), ph_aer02(it,kms:kme,jt), &
ph_aer03(it,kms:kme,jt), ph_aer04(it,kms:kme,jt), kms,kme )
ph_aer03(it,kms:kme,jt), ph_aer04(it,kms:kme,jt), &
kms,kme,config_flags%mozart_ph_diag )

! note units for aerosol is now ug/m3

Expand Down
8 changes: 5 additions & 3 deletions chem/module_mosaic_therm.F
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ module module_mosaic_therm
!-----------------------------------------------------------------------
subroutine aerchemistry( iclm, jclm, kclm_calcbgn, kclm_calcend, &
dtchem_sngl, idiagaa,vbs_nbin, &
ph_aer1, ph_aer2, ph_aer3, ph_aer4,kms,kme )
ph_aer1, ph_aer2, ph_aer3, ph_aer4,kms,kme,do_ph )

use module_data_mosaic_asect
use module_data_mosaic_other
Expand All @@ -107,7 +107,8 @@ subroutine aerchemistry( iclm, jclm, kclm_calcbgn, kclm_calcend, &
integer iclm, jclm, kclm_calcbgn, kclm_calcend, idiagaa,vbs_nbin(1)
real dtchem_sngl
integer kms, kme
real, intent(out), dimension(kms:kme) :: &
integer, intent(in) :: do_ph
real, optional, intent(out), dimension(kms:kme) :: &
ph_aer1, ph_aer2, ph_aer3, ph_aer4 ! pH of the aerosols
! local variables
real(kind=8) :: dtchem
Expand Down Expand Up @@ -157,11 +158,12 @@ subroutine aerchemistry( iclm, jclm, kclm_calcbgn, kclm_calcend, &
call specialoutaa( iclm, jclm, k, m, 'befor_movesect' )
call move_sections( 1, iclm, jclm, k, m)
call specialoutaa( iclm, jclm, k, m, 'after_movesect' )

if ( do_ph .eq. 1 ) then
ph_aer1(k) = mc(1,1)
ph_aer2(k) = mc(1,2)
ph_aer3(k) = mc(1,3)
ph_aer4(k) = mc(1,4)
end if

100 continue ! k levels

Expand Down