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

Partially-tested CO changes #2

Draft
wants to merge 10 commits into
base: ca-sgs-emis
Choose a base branch
from
24 changes: 12 additions & 12 deletions gsdchem/dep_dry_gocart_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,15 @@ subroutine gocart_drydep_driver(numgas, &
num_moist,num_chem, &
its,ite, jts,jte, kts,kte,numgas
REAL(kind_phys), INTENT(IN ) :: g
REAL(kind_phys), DIMENSION( ims:ime, kms:kme, jms:jme, num_moist ),&
REAL(kind_phys), DIMENSION( :, :, :, : ),&
INTENT(IN ) :: moist
REAL(kind_phys), DIMENSION( ims:ime, kms:kme, jms:jme, num_chem ) ,&
REAL(kind_phys), DIMENSION( :, :, :, : ) ,&
INTENT(INOUT) :: chem
REAL(kind_phys), DIMENSION( ims:ime , kms:kme , jms:jme ) ,&
REAL(kind_phys), DIMENSION( : , : , : ) ,&
INTENT(IN ) :: dz8w, p8w,rho_phy
INTEGER, DIMENSION( ims:ime , jms:jme ) ,&
INTEGER, DIMENSION( : , : ) ,&
INTENT(IN ) :: ivgtyp
REAL(kind_phys), DIMENSION( ims:ime , jms:jme ) ,&
REAL(kind_phys), DIMENSION( : , : ) ,&
INTENT(INOUT) :: tsk, &
pbl, &
ust, &
Expand Down Expand Up @@ -133,14 +133,14 @@ SUBROUTINE depvel_gocart( &
IMPLICIT NONE

INTEGER, INTENT(IN) :: imx,jmx,lmx
REAL(kind_phys), INTENT(IN) :: airden(imx,jmx), delz_sfc(imx,jmx)
REAL(kind_phys), INTENT(IN) :: hflux(imx,jmx), ts(imx,jmx)
REAL(kind_phys), INTENT(IN) :: ustar(imx,jmx), pblz(imx,jmx)
REAL(kind_phys), INTENT(IN) :: ps(imx,jmx)
INTEGER, INTENT(IN) :: ilwi(imx,jmx)
REAL(kind_phys), INTENT(IN) :: z0(imx,jmx)
REAL(kind_phys), INTENT(IN) :: airden(:,:), delz_sfc(:,:)
REAL(kind_phys), INTENT(IN) :: hflux(:,:), ts(:,:)
REAL(kind_phys), INTENT(IN) :: ustar(:,:), pblz(:,:)
REAL(kind_phys), INTENT(IN) :: ps(:,:)
INTEGER, INTENT(IN) :: ilwi(:,:)
REAL(kind_phys), INTENT(IN) :: z0(:,:)
REAL, INTENT(IN) :: g0
REAL(kind_phys), INTENT(OUT) :: dvel(imx,jmx), drydf(imx,jmx)
REAL(kind_phys), INTENT(OUT) :: dvel(:,:), drydf(:,:)

REAL(kind_phys) :: obk, vds, czh, rttl, frac, logmfrac, psi_h, cz, eps
REAL(kind_phys) :: vd, ra, rb, rs
Expand Down
34 changes: 22 additions & 12 deletions gsdchem/dep_dry_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ module dep_dry_mod

use machine , only : kind_phys
use gsd_chem_config, only : epsilc, GOCART_SIMPLE => CHEM_OPT_GOCART, CTRA_OPT_NONE, &
GOCARTRACM_KPP,RADM2SORG_AQ,RACMSORG_AQ, &
CHEM_OPT_GOCART_CO,GOCARTRACM_KPP,RADM2SORG_AQ,RACMSORG_AQ, &
CBMZ_MOSAIC_4BIN, CBMZ_MOSAIC_8BIN, CBMZ_MOSAIC_4BIN_AQ, &
CBMZ_MOSAIC_8BIN_AQ
! use chem_tracers_mod, only : p_o3,p_dust_1,p_vash_1,p_vash_4,p_vash_10,p_dms,
Expand Down Expand Up @@ -68,33 +68,33 @@ subroutine dry_dep_driver(ktau,dtstep,julday,current_month,t_phy,p_phy, &
its,ite, jts,jte, kts,kte
INTEGER, INTENT(IN ) :: &
ktau
REAL(kind_phys), DIMENSION( ims:ime, kms:kme, jms:jme, num_moist ), &
REAL(kind_phys), DIMENSION( :, :, :, : ), &
INTENT(IN ) :: moist
REAL(kind_phys), DIMENSION( ims:ime, kms:kme, jms:jme, num_chem ), &
REAL(kind_phys), DIMENSION( :, :, :, : ), &
INTENT(INOUT ) :: chem

INTEGER, INTENT(IN ) :: kemit
REAL(kind_phys), DIMENSION( ims:ime, kms:kemit, jms:jme ), &
REAL(kind_phys), DIMENSION( :, :, : ), &
INTENT(IN ) :: &
e_co




REAL(kind_phys), DIMENSION( ims:ime , kms:kme , jms:jme ) , &
REAL(kind_phys), DIMENSION( : , : , : ) , &
INTENT(IN ) :: &
alt, &
t8w, &
dz8w, &
p8w,z_at_w , &
exch_h,rho_phy,z
REAL(kind_phys), DIMENSION( ims:ime , kms:kme , jms:jme ) , &
REAL(kind_phys), DIMENSION( : , : , : ) , &
INTENT(INOUT) :: &
h2oaj,h2oai,nu3,ac3,cor3,asulf,ahno3,anh3
INTEGER,DIMENSION( ims:ime , jms:jme ) , &
INTEGER,DIMENSION( : , : ) , &
INTENT(IN ) :: &
ivgtyp
REAL(kind_phys), DIMENSION( ims:ime , jms:jme ) , &
REAL(kind_phys), DIMENSION( : , : ) , &
INTENT(INOUT) :: &
tsk, &
gsw, &
Expand All @@ -108,12 +108,12 @@ subroutine dry_dep_driver(ktau,dtstep,julday,current_month,t_phy,p_phy, &
xlat, &
xlong, &
znt,rmol
REAL(kind_phys), DIMENSION( ims:ime, jms:jme, num_chem ), &
REAL(kind_phys), DIMENSION( :, :, : ), &
INTENT(OUT ) :: ddep
REAL(kind_phys), DIMENSION( ims:ime , jms:jme ) , &
REAL(kind_phys), DIMENSION( : , : ) , &
INTENT(OUT) :: &
dep_vel_o3
REAL(kind_phys), DIMENSION( ims:ime , kms:kme , jms:jme ), &
REAL(kind_phys), DIMENSION( : , : , : ), &
INTENT(IN ) :: &
p_phy, &
t_phy
Expand Down Expand Up @@ -181,7 +181,7 @@ subroutine dry_dep_driver(ktau,dtstep,julday,current_month,t_phy,p_phy, &
!
! CALL wrf_debug(15,'DOING DRY DEP VELOCITIES WITH WESELY METHOD')

IF( chem_opt /= GOCART_SIMPLE ) THEN
IF( chem_opt /= GOCART_SIMPLE .AND. chem_opt /= CHEM_OPT_GOCART_CO ) THEN
call wesely_driver(ktau,dtstep, &
current_month, &
gmt,julday,t_phy,moist,p8w,t8w,raincv, &
Expand All @@ -193,6 +193,7 @@ subroutine dry_dep_driver(ktau,dtstep,julday,current_month,t_phy,p_phy, &
its,ite, jts,jte, kts,kte )
ENDIF
IF (( chem_opt == GOCART_SIMPLE ) .or. &
( chem_opt == CHEM_OPT_GOCART_CO ) .or. &
( chem_opt == GOCARTRACM_KPP) .or. &
( chem_opt == 316) .or. &
( chem_opt == 317) .or. &
Expand All @@ -209,6 +210,15 @@ subroutine dry_dep_driver(ktau,dtstep,julday,current_month,t_phy,p_phy, &
ids,ide, jds,jde, kds,kde, &
ims,ime, jms,jme, kms,kme, &
its,ite, jts,jte, kts,kte )

IF (chem_opt == CHEM_OPT_GOCART_CO) then
do j=jts,jte
do i=its,ite
ddvel(i,j,p_co)=0.
enddo
enddo
ENDIF

ELSE if (chem_opt == 501 ) then
! for caesium .1cm/s
!
Expand Down
44 changes: 29 additions & 15 deletions gsdchem/dep_simple_mod.F90
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
module dep_simple_mod

use gsd_chem_config, GOCART_SIMPLE => CHEM_OPT_GOCART, chem_opt=>chem_opt
use gsd_chem_config, GOCART_SIMPLE => CHEM_OPT_GOCART, chem_opt=>chem_opt, &
CHEM_OPT_GOCART_CO=>CHEM_OPT_GOCART_CO
! use chem_tracers_mod, config_flags => chem_config

! USE module_data_sorgam
Expand Down Expand Up @@ -104,22 +105,22 @@ SUBROUTINE wesely_driver( ktau, dtstep, current_month, &
!--------------------------------------------------
! advected moisture variables
!--------------------------------------------------
REAL, DIMENSION( ims:ime, kms:kme, jms:jme, num_moist ), INTENT(IN ) :: &
REAL, DIMENSION( :, :, :, : ), INTENT(IN ) :: &
moist
!--------------------------------------------------
! advected chemical species
!--------------------------------------------------
REAL, DIMENSION( ims:ime, kms:kme, jms:jme, num_chem ), INTENT(INOUT ) :: &
REAL, DIMENSION( :, :, :, : ), INTENT(INOUT ) :: &
chem
!--------------------------------------------------
! deposition velocities
!--------------------------------------------------
REAL, DIMENSION( its:ite, jts:jte, num_chem ), INTENT(INOUT ) :: &
REAL, DIMENSION( :, :, : ), INTENT(INOUT ) :: &
ddvel
!--------------------------------------------------
! input from met model
!--------------------------------------------------
REAL, DIMENSION( ims:ime , kms:kme , jms:jme ), INTENT(IN ) :: &
REAL, DIMENSION( : , : , : ), INTENT(IN ) :: &
t_phy, &
p_phy, &
dz8w, &
Expand All @@ -128,9 +129,9 @@ SUBROUTINE wesely_driver( ktau, dtstep, current_month, &
p8w, &
z_at_w, &
rho_phy
INTEGER,DIMENSION( ims:ime , jms:jme ), INTENT(IN ) :: &
INTEGER,DIMENSION( : , : ), INTENT(IN ) :: &
ivgtyp
REAL, DIMENSION( ims:ime , jms:jme ), INTENT(INOUT ) :: &
REAL, DIMENSION( : , : ), INTENT(INOUT ) :: &
tsk, &
gsw, &
vegfra, &
Expand All @@ -141,9 +142,9 @@ SUBROUTINE wesely_driver( ktau, dtstep, current_month, &
xlong, &
raincv, &
znt
REAL, intent(inout) :: aer_res_def(its:ite,jts:jte)
REAL, intent(inout) :: aer_res_zcen(its:ite,jts:jte)
REAL, INTENT(IN) :: snowh(ims:ime,jms:jme)
REAL, intent(inout) :: aer_res_def(:,:)
REAL, intent(inout) :: aer_res_zcen(:,:)
REAL, INTENT(IN) :: snowh(:,:)

!--------------------------------------------------
! .. Local Scalars
Expand Down Expand Up @@ -443,6 +444,19 @@ SUBROUTINE wesely_driver( ktau, dtstep, current_month, &
end do
end do
end if

if (chem_opt == CHEM_OPT_GOCART_CO ) then
DO j=jts,jte
DO i=its,ite
ddvel(i,j,p_msa) = ddvel(i,j,p_sulf)
ddvel(i,j,p_sulf) = 0.
ddvel(i,j,p_dms) = 0.
ddvel(i,j,p_co) = 0.
end do
end do
end if


!-----------------------------------------------------------
! For mozart
!-----------------------------------------------------------
Expand Down Expand Up @@ -867,7 +881,7 @@ SUBROUTINE rc( rcx, t, rad, rh, iland, &
REAL, intent(in) :: t ! surface temp (K)
REAL, intent(in) :: p_srf ! surface pressure (Pa)
REAL, intent(in) :: spec_hum ! surface specific humidity (kg/kg)
real, intent(out) :: rcx(numgas)
real, intent(out) :: rcx(:)
LOGICAL, intent(in) :: highnh3, rainflag, wetflag

!----------------------------------------------------------------------
Expand Down Expand Up @@ -1357,8 +1371,8 @@ SUBROUTINE landusevg( vgs, ustar, rmol, z0, zz, &
!--------------------------------------------------
! .. Array Arguments ..
!--------------------------------------------------
REAL, intent(in) :: srfres(numgas)
REAL, intent(out) :: vgs(numgas)
REAL, intent(in) :: srfres(:)
REAL, intent(out) :: vgs(:)

!--------------------------------------------------
! .. Local Scalars ..
Expand Down Expand Up @@ -1440,7 +1454,7 @@ SUBROUTINE cellvg( vgtemp, ustar, dz, zr, rmol, nspec )
!--------------------------------------------------
! .. Array Arguments ..
!--------------------------------------------------
REAL, intent(out) :: vgtemp(nspec)
REAL, intent(out) :: vgtemp(:)
!--------------------------------------------------
! .. Local Scalars ..
!--------------------------------------------------
Expand Down Expand Up @@ -1529,7 +1543,7 @@ SUBROUTINE depvel( numgas, rmol, zr, z0, ustar, &
!--------------------------------------------------
! .. Array Arguments ..
!--------------------------------------------------
REAL, intent(out) :: depv(numgas)
REAL, intent(out) :: depv(:)
!--------------------------------------------------
! .. Local Scalars ..
!--------------------------------------------------
Expand Down
24 changes: 12 additions & 12 deletions gsdchem/dep_vertmx_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ SUBROUTINE vertmx( dt, phi, kt_turb, dryrho, &
REAL, INTENT(IN) :: dt, vd
! ..
! .. Array Arguments ..
REAL, INTENT(IN), DIMENSION (kts:ktem1+1) :: kt_turb, zsigma
REAL, INTENT(IN), DIMENSION (kts:ktem1) :: dryrho, zsigma_half
REAL, INTENT(INOUT), DIMENSION (kts:ktem1) :: phi
REAL, INTENT(IN), DIMENSION (:) :: kt_turb, zsigma
REAL, INTENT(IN), DIMENSION (:) :: dryrho, zsigma_half
REAL, INTENT(INOUT), DIMENSION (:) :: phi
! ..
! .. Local Scalars ..
INTEGER :: k
Expand Down Expand Up @@ -79,11 +79,11 @@ SUBROUTINE rlhside( kts, ktem1, k_turb, dryrho, a_coeff, b_coeff, &
REAL, INTENT(IN) :: dt, vd
! ..
! .. Array Arguments ..
REAL, INTENT(IN), DIMENSION (kts:ktem1+1) :: k_turb
REAL, INTENT(IN), DIMENSION (:) :: k_turb
REAL, INTENT(IN), DIMENSION (kts+1:ktem1) :: a_coeff
REAL, INTENT(IN), DIMENSION (kts:ktem1) :: b_coeff, dryrho
REAL, INTENT(IN), DIMENSION (kts:ktem1) :: phi
REAL, INTENT(OUT), DIMENSION (kts:ktem1) :: lhs1, lhs2, lhs3, rhs
REAL, INTENT(IN), DIMENSION (:) :: b_coeff, dryrho
REAL, INTENT(IN), DIMENSION (:) :: phi
REAL, INTENT(OUT), DIMENSION (:) :: lhs1, lhs2, lhs3, rhs
! ..
! .. Local Scalars ..
!REAL :: a1, a2, alfa_explicit = .25, beta_implicit = .75
Expand Down Expand Up @@ -139,8 +139,8 @@ SUBROUTINE tridiag( kts, ktem1, a, b, c, f )
INTEGER, INTENT(IN) :: kts,ktem1
! ..
! .. Array Arguments ..
REAL, INTENT(IN), DIMENSION (kts:ktem1) :: a, b, c
REAL, INTENT(INOUT), DIMENSION (kts:ktem1) :: f
REAL, INTENT(IN), DIMENSION (:) :: a, b, c
REAL, INTENT(INOUT), DIMENSION (:) :: f
! ..
! .. Local Scalars ..
REAL :: p
Expand Down Expand Up @@ -179,10 +179,10 @@ SUBROUTINE coeffs( kts, ktem1, dryrho, &
INTEGER, INTENT(IN) :: kts,ktem1
! ..
! .. Array Arguments ..
REAL, INTENT(IN), DIMENSION (kts:ktem1+1) :: z_sigma
REAL, INTENT(IN), DIMENSION (kts:ktem1) :: z_sigma_half, dryrho
REAL, INTENT(IN), DIMENSION (:) :: z_sigma
REAL, INTENT(IN), DIMENSION (:) :: z_sigma_half, dryrho
REAL, INTENT(OUT), DIMENSION (kts+1:ktem1) :: a_coeff
REAL, INTENT(OUT), DIMENSION (kts:ktem1) :: b_coeff
REAL, INTENT(OUT), DIMENSION (:) :: b_coeff
! ..
! .. Local Scalars ..
INTEGER :: i
Expand Down
43 changes: 34 additions & 9 deletions gsdchem/dep_wet_ls_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ subroutine dep_wet_ls_init()
select case (chem_opt)
case (CHEM_OPT_GOCART)
alpha = 1.0
case (CHEM_OPT_GOCART_CO)
alpha = 1.0
alpha(p_co) = 0.
case (CHEM_OPT_GOCART_RACM)
alpha = 1.0
! alpha(p_h2o2) = 0.5
Expand Down Expand Up @@ -98,6 +101,28 @@ subroutine dep_wet_ls_init()
alpha(p_seas_4) = 1.
alpha(p_seas_5) = 1.
alpha(p_p10 ) = 1.
case (CHEM_OPT_GOCART_CO)
alpha(p_so2 ) = 0.
alpha(p_sulf ) = 1.5
alpha(p_dms ) = 0.
alpha(p_msa ) = 0.
alpha(p_co ) = 0.
alpha(p_p25 ) = 1.
alpha(p_bc1 ) = 0.7
alpha(p_bc2 ) = 0.7
alpha(p_oc1 ) = 1.
alpha(p_oc2 ) = 1.
alpha(p_dust_1) = 1.
alpha(p_dust_2) = 1.
alpha(p_dust_3) = 1.
alpha(p_dust_4) = 1.
alpha(p_dust_5) = 1.
alpha(p_seas_1) = 1.
alpha(p_seas_2) = 1.
alpha(p_seas_3) = 1.
alpha(p_seas_4) = 1.
alpha(p_seas_5) = 1.
alpha(p_p10 ) = 1.
case default
! -- NGAC large scale wet deposition only works with GOCART
end select
Expand Down Expand Up @@ -128,15 +153,15 @@ subroutine wetdep_ls(dt,var,rain,moist,rho,var_rmv, &
ims,ime, jms,jme, kms,kme, &
its,ite, jts,jte, kts,kte
real(kind_phys), INTENT(IN ) :: dt
REAL(kind_phys), DIMENSION( ims:ime, kms:kme, jms:jme, num_moist ), &
REAL(kind_phys), DIMENSION( :, :, :, : ), &
INTENT(IN ) :: moist
REAL(kind_phys), DIMENSION( ims:ime , kms:kme , jms:jme ), &
REAL(kind_phys), DIMENSION( : , : , : ), &
INTENT(IN ) :: rho,dz8w,vvel
REAL(kind_phys), DIMENSION( ims:ime , kms:kme , jms:jme ,1:num_chem), &
REAL(kind_phys), DIMENSION( : , : , : ,:), &
INTENT(INOUT) :: var
REAL(kind_phys), DIMENSION( ims:ime, jms:jme ), &
REAL(kind_phys), DIMENSION( :, : ), &
INTENT(IN ) :: rain
REAL(kind_phys), DIMENSION( ims:ime , jms:jme,num_chem ), &
REAL(kind_phys), DIMENSION( : , :, : ), &
INTENT(INOUT ) :: var_rmv
REAL(kind_phys), DIMENSION( its:ite , jts:jte ) :: var_sum
REAL(kind_phys), DIMENSION( its:ite , kts:kte, jts:jte ) :: var_rmvl
Expand Down Expand Up @@ -231,13 +256,13 @@ subroutine WetRemovalGOCART ( i1, i2, j1, j2, k1, k2, n1, n2, cdt, &
integer, intent(in) :: i1, i2, j1, j2, k1, k2, n1, n2, num_chem, &
ims, ime, jms, jme, kms, kme
real(kind_phys), intent(in) :: cdt
REAL(kind_phys), DIMENSION( ims:ime , kms:kme , jms:jme ,1:num_chem),&
REAL(kind_phys), DIMENSION( : , : , : ,:),&
INTENT(INOUT) :: chem
REAL(kind_phys), DIMENSION( ims:ime , jms:jme,num_chem ), &
REAL(kind_phys), DIMENSION( : , :, : ), &
INTENT(INOUT ) :: var_rmv !! tracer loss flux [kg m-2 s-1]
real(kind_phys), dimension(ims:ime, kms:kme, jms:jme),&
real(kind_phys), dimension(:, :, :),&
INTENT(IN) :: ple, tmpu, rhoa, dqcond
real(kind_phys), dimension(ims:ime , jms:jme) , &
real(kind_phys), dimension(: , :) , &
INTENT(IN) :: precc, precl ! cv, ls precip [mm day-1]

! !OUTPUT PARAMETERS:
Expand Down
Loading