Skip to content
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
2 changes: 1 addition & 1 deletion Registry/Registry.EM_COMMON
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ state real xkmv_meso ikj dyn_em 1 - - "XK
# Pressure and Density
state real p ikj dyn_em 1 - irh "p" "perturbation pressure" "Pa"
state real al ikj dyn_em 1 - ir "al" "inverse perturbation density" "m3 kg-1"
state real alt ikj dyn_em 1 - r "alt" "inverse density" "m3 kg-1"
state real alt ikj dyn_em 1 - rh "alt" "inverse density" "m3 kg-1"
state real alb ikj dyn_em 1 - irdus "alb" "inverse base density" "m3 kg-1"
state real zx ikj dyn_em 1 XZ - " " " " " "
state real zy ikj dyn_em 1 YZ - " " " " " "
Expand Down
113 changes: 86 additions & 27 deletions Registry/registry.chem

Large diffs are not rendered by default.

532 changes: 532 additions & 0 deletions chem/Makefile

Large diffs are not rendered by default.

13 changes: 8 additions & 5 deletions chem/chem_driver.F
Original file line number Diff line number Diff line change
Expand Up @@ -643,7 +643,7 @@ end SUBROUTINE sum_pm_driver
CALL wrf_debug(15,'Volcanic Ash mode: only doing emissions, settling, and subgrid transport in chem_driver')
CASE (DUST)
CALL wrf_debug(15,'Dust only mode: only doing emissions, settling, and subgrid transport chem_driver')
CASE (CO2_TRACER,GHG_TRACER)
CASE (CO2_TRACER,GHG_TRACER,GHG_ISOTOPE) !JianHe
CALL wrf_debug(15,'Greenhouse gas mode: fluxes and transport of GHG')
CASE DEFAULT
if(config_flags%tracer_opt > 0 )then
Expand Down Expand Up @@ -876,7 +876,7 @@ end SUBROUTINE sum_pm_driver
grid%TSLB, wet_in,grid%RAINC,grid%RAINNC, &
grid%potevp,grid%SFCEVP,grid%LU_INDEX, &
grid%biomt_par,grid%emit_par,grid%ebio_co2oce, &
eghg_bio, &
eghg_bio,grid%ghg_oh, & !JianHe
grid%seas_flux, &
ids,ide, jds,jde, kds,kde, &
ims,ime, jms,jme, kms,kme, &
Expand Down Expand Up @@ -913,7 +913,8 @@ end SUBROUTINE sum_pm_driver
config_flags%chem_opt /= DUST .and. &
config_flags%chem_opt /= CHEM_TRACE2 .and. &
config_flags%chem_opt /= CO2_TRACER .and. &
config_flags%chem_opt /= GHG_TRACER ) then
config_flags%chem_opt /= GHG_TRACER .and. &
config_flags%chem_opt /= GHG_ISOTOPE ) then !JianHe
call wrf_debug(15,'calling optical driver')
call optical_driver (grid%id,curr_secs,grid%dt,config_flags,haveaer, &
chem,dz8w,rri,rh, &
Expand Down Expand Up @@ -951,7 +952,8 @@ end SUBROUTINE sum_pm_driver
config_flags%chem_opt /= DUST .and. &
config_flags%chem_opt /= CHEM_TRACE2 .and. &
config_flags%chem_opt /= CO2_TRACER .and. &
config_flags%chem_opt /= GHG_TRACER ) then
config_flags%chem_opt /= GHG_TRACER .and. &
config_flags%chem_opt /= GHG_ISOTOPE ) then !JianHe
call wrf_debug(15,'calling photolysis driver')
call photolysis_driver (grid%id,curr_secs,ktau,grid%dt, &
config_flags,haveaer, &
Expand Down Expand Up @@ -1216,7 +1218,8 @@ end SUBROUTINE sum_pm_driver
config_flags%chem_opt /= DUST .and. &
config_flags%chem_opt /= CHEM_TRACE2 .and. &
config_flags%chem_opt /= CO2_TRACER .and. &
config_flags%chem_opt /= GHG_TRACER ) then
config_flags%chem_opt /= GHG_TRACER .and. &
config_flags%chem_opt /= GHG_ISOTOPE ) then ! JianHe

!
! chemical mechanisms
Expand Down
105 changes: 88 additions & 17 deletions chem/chemics_init.F
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
!WRF:MODEL_LAYER:INITIALIZATION
!
subroutine chem_init (id,chem,emis_ant,scalar,dt,bioemdt,photdt,chemdt,stepbioe, &
subroutine chem_init (id,chem,emis_ant,ghg_oh, & !JianHe
scalar,dt,bioemdt,photdt,chemdt,stepbioe, &
stepphot,stepchem,stepfirepl,plumerisefire_frq,z_at_w,xlat,xlong, &
g,aerwrf,config_flags,grid,alt,t,p,CONVFAC,ttday,tcosz,julday,gmt, &
tauaer1,tauaer2,tauaer3,tauaer4, &
Expand Down Expand Up @@ -124,6 +125,11 @@ subroutine chem_init (id,chem,emis_ant,scalar,dt,bioemdt,photdt,chemdt,stepbioe,
REAL, DIMENSION( ims:ime , 1:kemit , jms:jme, num_emis_ant ) , &
INTENT(INOUT ) :: &
emis_ant
!JianHe:
REAL, DIMENSION( ims:ime , kms:kme , jms:jme ) , &
INTENT(INOUT ) :: &
ghg_oh

REAL, DIMENSION( ims:ime , kms:kme , jms:jme, num_scalar ) , &
INTENT(INOUT ) :: &
scalar
Expand Down Expand Up @@ -236,7 +242,7 @@ subroutine chem_init (id,chem,emis_ant,scalar,dt,bioemdt,photdt,chemdt,stepbioe,
numgas_mam = numgas
CALL wrf_debug(15,'calling RACM/MADE/SOA-VBS with AQCHEM chemistry from chem_driver')
! call wrf_message("WARNING: RACM_SOA_VBS_AQCHEM_KPP chemistry option is highly experimental and not recommended for use.")
CASE (CO2_TRACER, GHG_TRACER )
CASE (CO2_TRACER, GHG_TRACER, GHG_ISOTOPE ) !JianHe
call wrf_message("WARNING: Users interested in the GHG options should check the comments/references in header of module_ghg_fluxes")
CASE (CBMZ_CAM_MAM3_NOAQ)
numgas_mam = numgas
Expand Down Expand Up @@ -279,7 +285,7 @@ subroutine chem_init (id,chem,emis_ant,scalar,dt,bioemdt,photdt,chemdt,stepbioe,
CALL wrf_debug(15,'calling biomass burning')
endif

if ( config_flags%biomass_burn_opt == 5 ) then
if ( config_flags%biomass_burn_opt == 5 .or. config_flags%biomass_burn_opt == 6) then !JianHe
CALL wrf_debug(15,'calling biomass burning for GHGs')
endif

Expand Down Expand Up @@ -596,7 +602,7 @@ subroutine chem_init (id,chem,emis_ant,scalar,dt,bioemdt,photdt,chemdt,stepbioe,
! for diagnostics purposes only!
!write(6,*)'config_flags%chem_opt, CO2_TRACER', config_flags%chem_opt, CO2_TRACER

if ( config_flags%chem_opt==CO2_TRACER .OR. config_flags%chem_opt==GHG_TRACER ) then
if ( config_flags%chem_opt==CO2_TRACER .OR. config_flags%chem_opt==GHG_TRACER ) then
call VPRM_par_initialize ( grid%rad_vprm, grid%lambda_vprm, grid%alpha_vprm, grid%resp_vprm, config_flags )
call wrf_message("Warning: the VPRM parameters may need to be optimized depending on the season, year and region!")
call wrf_message("The parameters provided here should be used for testing purposes only!")
Expand All @@ -605,6 +611,17 @@ subroutine chem_init (id,chem,emis_ant,scalar,dt,bioemdt,photdt,chemdt,stepbioe,
if (config_flags%chem_opt .EQ. GHG_TRACER) then
CALL termite_initialize(grid%biomt_par,grid%emit_par,config_flags)
end if

!JianHe: for ghg_oh
if ( config_flags%chem_opt==GHG_ISOTOPE) then
do j=jts,jte
do k=kts,kte
do i=its,ite
ghg_oh(i,k,j) = 0.
end do
end do
end do
end if
!--------------------------------------------------------------------------------------------------------
!
! RETURN IF CHEMISTRY IS NOT RUNNING
Expand Down Expand Up @@ -1625,19 +1642,20 @@ subroutine chem_init (id,chem,emis_ant,scalar,dt,bioemdt,photdt,chemdt,stepbioe,
do j=jts,jte
do k=kts,kte
do i=its,ite
chem(i,k,j,p_co2_bck)=380. ! background CO2 tracer
chem(i,k,j,p_co2_bio)=380. ! A user should subtract this from the output fields!
chem(i,k,j,p_co2_oce)=380. ! A user should subtract this from the output fields!
chem(i,k,j,p_co2_ant)=380. ! A user should subtract this from the output fields!
chem(i,k,j,p_co2_tst)=380. ! A user should subtract this from the output fields!
chem(i,k,j,p_co2_bck)=420. ! background CO2 tracer
chem(i,k,j,p_co2_bio)=420. ! A user should subtract this from the output fields!
chem(i,k,j,p_co2_oce)=420. ! A user should subtract this from the output fields!
chem(i,k,j,p_co2_ant)=420. ! A user should subtract this from the output fields!
chem(i,k,j,p_co2_tst)=420. ! A user should subtract this from the output fields!

if (p_co2_bbu>1) chem(i,k,j,p_co2_bbu)=380. ! A user should subtract this from the output fields!
if (p_co2_bbu>1) chem(i,k,j,p_co2_bbu)=420. ! A user should subtract this from the output fields!

enddo
enddo
enddo

! CO tracers:
if (p_co_bck.gt.1) then
do j=jts,jte
do k=kts,kte
do i=its,ite
Expand All @@ -1648,22 +1666,75 @@ subroutine chem_init (id,chem,emis_ant,scalar,dt,bioemdt,photdt,chemdt,stepbioe,
enddo
enddo
enddo
end if

! CH4 tracers:
!JH: skip if we have ic/bc
IF ((p_ch4_bck.gt.1) .AND. (.not. config_flags%have_bcs_chem )) THEN
do j=jts,jte
do k=kts,kte
do i=its,ite
chem(i,k,j,p_ch4_bck)=1.9 ! background CH4 tracer
chem(i,k,j,p_ch4_bio)=1.9 ! A user should subtract this from the output fields!
chem(i,k,j,p_ch4_ant)=1.9 ! A user should subtract this from the output fields!
chem(i,k,j,p_ch4_tst)=1.9 ! A user should subtract this from the output fields!
if (p_ch4_bbu > 1) chem(i,k,j,p_ch4_bbu)=1.9 ! A user should subtract this from the output fields!
enddo
enddo
enddo
ENDIF

!JianHe:
IF ((p_ch4_ong.gt.1) .AND. (.not. config_flags%have_bcs_chem )) THEN
do j=jts,jte
do k=kts,kte
do i=its,ite
chem(i,k,j,p_ch4_ong)=1.9 ! background CH4 tracer
chem(i,k,j,p_ch4_agr)=1.9 ! A user should subtract this from the output fields!
chem(i,k,j,p_ch4_wst)=1.9 ! A user should subtract this from the output fields!
chem(i,k,j,p_ch4_wet)=1.9 ! A user should subtract this from the output fields!
enddo
enddo
enddo
ENDIF

IF ((p_c13_bck.gt.1) .AND. (.not. config_flags%have_bcs_chem )) THEN
do j=jts,jte
do k=kts,kte
do i=its,ite
chem(i,k,j,p_c13_bck)=0.02 ! background CH4 tracer
chem(i,k,j,p_c13_bio)=0.02 ! A user should subtract this from the output fields!
chem(i,k,j,p_c13_ant)=0.02 ! A user should subtract this from the output fields!
chem(i,k,j,p_c13_tst)=0.02 ! A user should subtract this from the output fields!
chem(i,k,j,p_c13_ong)=0.02 ! A user should subtract this from the output fields!
chem(i,k,j,p_c13_agr)=0.02 ! A user should subtract this from the output fields!
chem(i,k,j,p_c13_wst)=0.02 ! A user should subtract this from the output fields!
chem(i,k,j,p_c13_wet)=0.02
if (p_c13_bbu >1) chem(i,k,j,p_c13_bbu)=0.02 ! A user should subtract this from the output fields!

enddo
enddo
enddo
ENDIF


! CH4 tracers:
IF (p_ch4_bck.gt.1) THEN
IF ((p_eth_bck.gt.1) .AND. (.not. config_flags%have_bcs_chem )) THEN
do j=jts,jte
do k=kts,kte
do i=its,ite
chem(i,k,j,p_ch4_bck)=1.77 ! background CH4 tracer
chem(i,k,j,p_ch4_bio)=1.77 ! A user should subtract this from the output fields!
chem(i,k,j,p_ch4_ant)=1.77 ! A user should subtract this from the output fields!
chem(i,k,j,p_ch4_bbu)=1.77 ! A user should subtract this from the output fields!
chem(i,k,j,p_ch4_tst)=1.77 ! A user should subtract this from the output fields!
chem(i,k,j,p_eth_bck)=0.001 ! background eth tracer
chem(i,k,j,p_eth_bio)=0.001 ! A user should subtract this from the output fields!
chem(i,k,j,p_eth_ant)=0.001 ! A user should subtract this from the output fields!
chem(i,k,j,p_eth_tst)=0.001 ! A user should subtract this from the output fields!
chem(i,k,j,p_eth_ong)=0.001 ! A user should subtract this from the output fields!
if (p_eth_bbu > 1) chem(i,k,j,p_eth_bbu)=0.001 ! A user should subtract this from the output fields!

enddo
enddo
enddo
ENDIF


ENDIF
ENDIF ghg_block
!!
Expand Down
4 changes: 3 additions & 1 deletion chem/depend.chem
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,9 @@ module_vertmx_wrf.o:

module_emissions_anthropogenics.o: module_aerosols_sorgam.o module_aerosols_soa_vbs.o module_aerosols_soa_vbs_het.o

module_ghg_fluxes.o:
module_ghg_fluxes.o: module_ghg_chem.o

module_ghg_chem.o:

module_data_sorgam.o: module_data_radm2.o

Expand Down
1 change: 1 addition & 0 deletions chem/dry_dep_driver.F
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,7 @@ subroutine dry_dep_driver(id,curr_secs,ktau,dtstep,config_flags, &
config_flags%chem_opt /= CHEM_TRACE2 .and. &
config_flags%chem_opt /= CO2_TRACER .and. &
config_flags%chem_opt /= GHG_TRACER .and. &
config_flags%chem_opt /= GHG_ISOTOPE .and. & !JianHe
config_flags%chem_opt /= CHEM_VASH .and. &
config_flags%chem_opt /= CHEM_VOLC_4BIN .and. &
config_flags%chem_opt /= DUST .and. &
Expand Down
27 changes: 23 additions & 4 deletions chem/emissions_driver.F
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ subroutine emissions_driver(id,ktau,dtstep,DX, &
! stuff for GHG fluxes
vprm_in,rad_vprm,lambda_vprm,alpha_vprm,resp_vprm, &
xtime,tslb,wet_in,rainc,rainnc,potevp,sfcevp,lu_index, &
biomt_par,emit_par,ebio_co2oce,eghg_bio, &
biomt_par,emit_par,ebio_co2oce,eghg_bio,ghg_oh, & !JianHe
seas_flux, &
ids,ide, jds,jde, kds,kde, &
ims,ime, jms,jme, kms,kme, &
Expand Down Expand Up @@ -133,6 +133,9 @@ subroutine emissions_driver(id,ktau,dtstep,DX, &
REAL, DIMENSION( ims:ime, 1:config_flags%kemit, jms:jme,num_emis_ant),&
INTENT(IN ) :: &
emis_ant
!JianHe
REAL, DIMENSION( ims:ime, kms:kme, jms:jme), &
INTENT(IN ) :: ghg_oh
REAL, DIMENSION( ims:ime, kms:kme, jms:jme,num_emis_vol), &
INTENT(INOUT ) :: &
emis_vol
Expand Down Expand Up @@ -632,6 +635,7 @@ subroutine emissions_driver(id,ktau,dtstep,DX, &
config_flags%biomass_burn_opt == BIOMASSB_T1_MOZCART .OR. &
config_flags%biomass_burn_opt == BIOMASSB_MOZ .OR. &
config_flags%biomass_burn_opt == BIOMASSB_GHG .OR. &
config_flags%biomass_burn_opt == BIOMASSB_GHG2 .OR. & !JianHe
config_flags%biomass_burn_opt == BIOMASSB ) then
IF ( ktau==1 ) then
do_plumerisefire = .true.
Expand Down Expand Up @@ -784,7 +788,7 @@ subroutine emissions_driver(id,ktau,dtstep,DX, &
!!! *********** FIRE AND CHEM ****************************************
!
fire_select: SELECT CASE(config_flags%biomass_burn_opt)
CASE (BIOMASSB,BIOMASSB_MOZC,BIOMASSB_MOZ,BIOMASSB_T1_MOZCART,BIOMASSB_GHG)
CASE (BIOMASSB,BIOMASSB_MOZC,BIOMASSB_MOZ,BIOMASSB_T1_MOZCART,BIOMASSB_GHG,BIOMASSB_GHG2) !JianHe
! if( do_plumerisefire )then
! CALL wrf_debug(15,'fire emissions: calling biomassb')
! write(0,*)ktau,stepfirepl
Expand Down Expand Up @@ -1078,7 +1082,7 @@ subroutine emissions_driver(id,ktau,dtstep,DX, &
end do
end do
!
CASE(CO2_TRACER,GHG_TRACER) ! for ghg_tracer package
CASE(CO2_TRACER,GHG_TRACER) ! for ghg_tracer package

! Update the biospheric CO2 fluxes
CALL VPRM( ids,ide, jds,jde, &
Expand Down Expand Up @@ -1126,9 +1130,24 @@ subroutine emissions_driver(id,ktau,dtstep,DX, &
CALL add_ghg_fluxes( ids,ide, jds,jde, kds,kde, &
ims,ime, jms,jme, kms,kme, &
its,ite, jts,jte, kts,kte, &
dtstep,dz8w,config_flags,rho_phy, &
t_phy,chem,emis_ant, &
eghg_bio=eghg_bio, &
ebio_co2oce=ebio_co2oce )
END IF

!JianHe: currently, we do not include vprm for this option
!Maybe in the future, we can???
CASE(GHG_ISOTOPE)
! Add all the GHG fluxes to chem species, this step is for both
! anthropogenic and biospheric fluxes
IF (config_flags%emiss_inpt_opt==16) THEN
CALL add_ghg_fluxes( ids,ide, jds,jde, kds,kde, &
ims,ime, jms,jme, kms,kme, &
its,ite, jts,jte, kts,kte, &
dtstep,dz8w,config_flags,rho_phy, &
chem,emis_ant,eghg_bio,ebio_co2oce )
t_phy,chem,emis_ant, &
ghg_oh=ghg_oh )
END IF
!**************************************************************************************************
CASE (SAPRC99_KPP) !FIX FOR SAPRC07A
Expand Down
15 changes: 15 additions & 0 deletions chem/module_add_emiss_burn.F
Original file line number Diff line number Diff line change
Expand Up @@ -448,6 +448,21 @@ subroutine add_emis_burn(id,dtstep,ktau,dz8w,rho_phy,chem, &
enddo
enddo
endif
CASE (GHG_ISOTOPE) !JianHe
if( biomass_burn_opt == BIOMASSB_GHG2 ) then
do j=jts,jte
do k=kts,kte
do i=its,ite
conv_rho=r_q*4.828e-4/rho_phy(i,k,j)*dtstep/60./dz8w(i,k,j)
chem(i,k,j,p_co_bbu) = chem(i,k,j,p_co_bbu)+ebu(i,k,j,p_ebu_co)*conv_rho
chem(i,k,j,p_eth_bbu) = chem(i,k,j,p_eth_bbu)+ebu(i,k,j,p_ebu_eth)*conv_rho
chem(i,k,j,p_ch4_bbu) = chem(i,k,j,p_ch4_bbu)+ebu(i,k,j,p_ebu_ch4)*conv_rho
chem(i,k,j,p_c13_bbu) = chem(i,k,j,p_c13_bbu)+ebu(i,k,j,p_ebu_c13)*conv_rho
enddo
enddo
enddo
endif

CASE DEFAULT
call wrf_debug(15,'nothing done with burn emissions for chem array')
END SELECT emiss_select
Expand Down
Loading