Skip to content

Commit

Permalink
Merge pull request #95 from GEOS-ESM/develop
Browse files Browse the repository at this point in the history
GMI photolysis cleanup, and mod to aerosol wet-removal
  • Loading branch information
gmao-esherman authored Jul 7, 2020
2 parents b401f5c + 53012b8 commit 5522894
Show file tree
Hide file tree
Showing 87 changed files with 48 additions and 35,569 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
mepo init
mepo clone
mepo develop GEOSgcm_GridComp GEOSgcm_App GEOSchem_GridComp
if [ "${CIRCLE_BRANCH}" != "develop" ] && [ "${CIRCLE_BRANCH}" != "master" ]
if [ "${CIRCLE_BRANCH}" != "develop" ] && [ "${CIRCLE_BRANCH}" != "master" ] && [ "${CIRCLE_BRANCH}" != "main" ]
then
mepo checkout-if-exists ${CIRCLE_BRANCH}
fi
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ subroutine readChemistryResourceFile (self, config, loc_proc, &
!! 0: no photolysis
!! 1: set all qj values to qj_init_val
!! 2: read in qj values
!! 3: use fastj routine (for fastJ, fastJx, fastJx53b)
!! 3: use fastj routine (for fastJX65 or CloudJ)
!! This option should be combined with fastj_opt.
!! 4: lookup table for qj (Kawa style)
!! 5: lookup table for qj (Kawa style) +
Expand Down Expand Up @@ -355,7 +355,7 @@ subroutine readChemistryResourceFile (self, config, loc_proc, &

call CheckNamelistOptionRange ('chem_opt', self%chem_opt, 0, 8)
call CheckNamelistOptionRange ('h2oclim_opt', self%h2oclim_opt, 1, 3)
call CheckNamelistOptionRange ('phot_opt', self%phot_opt, 0, 7)
call CheckNamelistOptionRange ('phot_opt', self%phot_opt, 0, 3)
call CheckNamelistOptionRange ('sad_opt', self%sad_opt, 0, 3)
call CheckNamelistOptionRange ('oz_eq_synoz_opt', self%oz_eq_synoz_opt, 0, 1)
call CheckNamelistOptionRange ('cloudDroplet_opt', self%cloudDroplet_opt, 1, 4)
Expand Down Expand Up @@ -517,8 +517,6 @@ subroutine InitializeChemistry (self, gmiGrid, config, loc_proc,&
use GmiGrid_mod , only : Get_i1, Get_i2, Get_ju1, Get_j2, Get_k1, Get_k2
use ReadForcedBC_mod, only : readForcedBcData
!
# include "phot_lookup.h"
# include "phot_monthly.h"
!
! !INPUT PARAMETERS:
type (t_gmiGrid), intent(in) :: gmiGrid
Expand Down Expand Up @@ -599,8 +597,6 @@ end subroutine InitializeChemistry
subroutine initReadChemistry(self, gmiGrid, loc_proc)
!

# include "phot_lookup.h"
# include "phot_monthly.h"
!
! !INPUT PARAMETERS:
type (t_gmiGrid ), intent(in) :: gmiGrid
Expand Down
122 changes: 3 additions & 119 deletions GMIchem_GridComp/GMI_GridComp/GmiChemistry/GmiFastJX_includeMod.F90
Original file line number Diff line number Diff line change
@@ -1,131 +1,15 @@

module GmiFastJX_includeMod

USE GmiFastJX_ParametersMod

private
PUBLIC :: t_fastJXbundle

!!fast_JX_cmn_t.h
!PUBLIC :: nslat, nslon
!
!!fast_JX_jv_mie.h
!PUBLIC :: A,B,C1,H,AA,CC,S,W,U1,V1,WT,EMU,PM,PM0,POMEGA
!PUBLIC :: ZTAU,FZ,FJ,DD,RR,ZREFL,ZFLUX,RADIUS,ZU0
!PUBLIC :: ND,N,M,MFIT
!
!!fast_JX_cmn_w.h
!PUBLIC :: P,T,OD,SA, optaer, optdust
!!
!fast_JX_cmn_h.h
!!PUBLIC :: lpar, jpnl, jppj
!PUBLIC :: xgrd,ygrd,ydgrd,etaa,etab
!PUBLIC :: tau,month,iday
!PUBLIC :: do_model_clima
!
!!fast_JX_jv_cmn.h
!PUBLIC :: ncat_acetone_trop,ncat_acetone_stra
!!PUBLIC :: ncat_met_vinyl_ketone
!PUBLIC :: ncat_met_ethyl_ketone
!PUBLIC :: ncat_methyl_glyoxal
!PUBLIC :: dtaumax,szamax
!PUBLIC :: zj,jfacta,zpdep,npdep,jpdep,jind,jlabel
!PUBLIC :: jadsub,dtausub,dsubdiv
!PUBLIC :: TITLE0,TITLEJ,TITLEA
!PUBLIC :: WBIN, WL, FL, QO2, QO3, Q1D, QQQ, QRAYL, TQQ, FFF
!PUBLIC :: VALJ, WAA, QAA, PAA, RAA, SSA, QBC
!PUBLIC :: TJ, PJ, DM, DO3, DBC, Z, AER, AMF
!PUBLIC :: TREF, OREF, BREF
!PUBLIC :: NJVAL,NW1,NW2,MIEDX,NAA,NLBATM
!PUBLIC :: RAD,RFLECT,SZA,U0,TANHT,ZZHT
!
!PUBLIC :: LPAR_MAX, JPNL_MAX, JPPJ_MAX, IPAR, JPAR, LDEG45
!!PUBLIC :: NB, NC, NS, NW, NP, NH, MX
!PUBLIC :: M__, N__, NL

# include "gmi_AerDust_const.h"
# include "setkin_par.h"
# include "parm_MIE_fastJX65.h"

TYPE t_fastJXbundle
!----------------------------------------------------------------------------
! fast_JX_jv_cmn.h
! NB Number of levels in CTM plus one for above model top
! NC Number of levels in the fundamental Fast-J grid
!-----------------------------------------------------------------------
INTEGER NB, NC
integer :: ncat_acetone_trop,ncat_acetone_stra ! Added for GMI to {AOO, 8/04}
integer :: ncat_met_vinyl_ketone ! Added for GMI to {AOO, 8/04}
integer :: ncat_met_ethyl_ketone ! Added for GMI to {AOO, 8/04}
integer :: ncat_methyl_glyoxal ! Added for GMI to {AOO, 8/04}
CHARACTER*20 TITLEA(NP)
CHARACTER*78 TITLE0
CHARACTER*7 TITLEJ(3,NS), jlabel(jppj_max), hzlab(nh)
INTEGER jind(jppj_max),jadsub(nc_max),nhz,hzind(nh)
INTEGER NJVAL,NW1,NW2,MIEDX(MX),NAA,NLBATM,npdep,jpdep(NS)
REAL*8 dtaumax,szamax,zj(jpnl_max,jppj_max),jfacta(jppj_max)
REAL*8 dtausub,dsubdiv
REAL*8 :: RAD,RFLECT,SZA,U0,TANHT,ZZHT
REAL*8 :: TREF(51,18,12),OREF(51,18,12),BREF(51)
REAL*8 :: TJ(NB_MAX),PJ(NB_MAX+1),DM(NB_MAX),DO3(NB_MAX), &
& DBC(NB_MAX),Z(NB_MAX),AER(MX,NB_MAX), &
& AMF(NB_MAX,NB_MAX)
REAL*8 zpdep(NW,3)
REAL*8 :: WBIN(NW+1),WL(NW),FL(NW),QO2(NW,3),QO3(NW,3), &
Q1D(NW,3),QQQ(NW,2,NS-3),QRAYL(NW+1),TQQ(3,NS), &
FFF(NW,jpnl_max),VALJ(NS),WAA(4,NP),QAA(4,NP), &
PAA(8,4,NP),RAA(4,NP),SSA(4,NP),QBC(NW)

!----------------------------------------------------------------------------
!fast_JX_cmn_h.h

integer lpar
integer jpnl, jppj
real*8 xgrd(ipar) ! Longitude (midpoint, radians)
real*8 ygrd(jpar) ! Latitude (midpoint, radians)
real*8 ydgrd(jpar) ! Latitude (midpoint, degrees)
real*8 etaa(lpar_max+1) ! Eta(a) value for level boundaries
real*8 etab(lpar_max+1) ! Eta(b) value for level boundaries
real*8 tau ! Time of Day (hours, GMT)
integer month ! Number of month (1-12)
integer iday ! Day of year
logical do_model_clima ! determines if climatology data come
! from the model.

!----------------------------------------------------------------------------
! fast_JX_cmn_w.h

real*8 P(ipar,jpar) ! Surface pressure
real*8 T(ipar,jpar,lpar_max+1) ! Temperature profile
!
real*8 OD(ipar,jpar,lpar_max) ! Optical Depth profile
real*8 SA(ipar,jpar) ! Surface Albedo
!
real*8 optaer(lpar_max,NSADaer*nrh_b) ! Opt. Depth profile for aerosols
real*8 optdust(lpar_max,NSADdust) ! Opt. Depth profile for dust
!
!----------------------------------------------------------------------------
! fast_JX_jv_mie.h

REAL*8 :: ZREFL,ZFLUX,RADIUS,ZU0
INTEGER :: ND,N,M,MFIT

REAL*8 :: A(M__), B(M__,M__), C1(M__), H(M__), AA(M__,M__)
REAL*8 :: CC(M__,M__), S(M__,M__), W(M__,M__), U1(M__,M__)
REAL*8 :: V1(M__), WT(M__), EMU(M__), PM(M__,2*M__), PM0(2*M__)
REAL*8 :: POMEGA(2*M__,N__), ZTAU(N__), FZ(N__), FJ(N__)
REAL*8 :: DD(M__,M__,N__), RR(M__,N__)

!----------------------------------------------------------------------------
!fast_JX_cmn_t.h

integer nslat ! Latitude of current profile point
integer nslon ! Longitude of current profile point

!----------------------------------------------------------------------------
!----------------------------------------------------------------------------
!solar cycle capability
!... solar cycle capability

REAL*8 :: fjx_solar_cycle_param(NW)
REAL*8 :: fjx_solar_cycle_param(W_)

!----------------------------------------------------------------------------

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,6 @@
module GmiPhotRateConst_mod
!
! !USES:
use fastj , only : Control_Fastj, GetQAA_RAAinFastj
use fast_JX , only : Control_Fast_JX, GetQAA_RAAinFastJX
use fast_JX53b , only : Control_Fast_JX53b
use fast_JX53b , only : GetQAA_RAAinFastJX53b
use fast_JX53c , only : Control_Fast_JX53c
use fast_JX53c , only : GetQAA_RAAinFastJX53c
use fastJX65_mod , only : controlFastJX65
use fastJX65_mod , only : getQAA_RAAinFastJX65
use CloudJ_mod , only : controlFastJX74
Expand Down Expand Up @@ -94,8 +88,6 @@ subroutine calcPhotolysisRateConstants( JXbundle, chem_mecha, tropp, &
!
# include "gmi_phys_constants.h"
# include "gmi_time_constants.h"
# include "phot_lookup.h"
# include "phot_monthly.h"
# include "setkin_par.h"
# include "gmi_AerDust_const.h"
!
Expand Down Expand Up @@ -172,6 +164,7 @@ subroutine calcPhotolysisRateConstants( JXbundle, chem_mecha, tropp, &
integer :: il, ij, it, ic, n
integer :: jday, ich4_num
integer :: month_gmi
integer, parameter :: four = 4
real*8 :: time_sec, sza_ij, lat_ij
real*8 :: overheadO3col_ij (k1:k2)
real*8 :: kel_ij (k1:k2)
Expand Down Expand Up @@ -207,47 +200,19 @@ subroutine calcPhotolysisRateConstants( JXbundle, chem_mecha, tropp, &
& (TRIM(chem_mecha) == 'strat_trop') .OR. &
& (TRIM(chem_mecha) == 'strat_trop_aerosol')) THEN
if (do_AerDust_Calc) then
if (fastj_opt == 0) then
call GetQAA_RAAinFastj (RAA_b, QAA_b)
end if
if (fastj_opt == 1) then
call GetQAA_RAAinFastJX (JXbundle, RAA_b, QAA_b)
end if
if (fastj_opt == 2) then
call GetQAA_RAAinFastJX53b (RAA_b, QAA_b)
end if
if (fastj_opt == 3) then
call GetQAA_RAAinFastJX53c (RAA_b, QAA_b)
end if
if (fastj_opt == 4) then
call GetQAA_RAAinFastJX65 (RAA_b, QAA_b)
call GetQAA_RAAinFastJX65 (RAA_b, QAA_b, four, NP_b)
end if
end if
end if
end if

! end if

! ==================
if (phot_opt == 2) then
! ==================

if (qj_timpyr == MONTHS_PER_YEAR) then
call GmiSplitDateTime (nymd, idumyear, month_gmi, idumday)
it = month_gmi
else
it = 1
endif

do ic = 1, num_qjs
qjgmi(ic)%pArray3D(i1:i2,ju1:j2,k1:k2) = &
& qjmon(i1:i2,ju1:j2,k1:k2,ic,it)
end do

!
! ==================
elseif (phot_opt == 3) then
if (phot_opt == 3) then
! ==================

!
! --------------------------------------------------------------
! First form some non-grid dependent arguments needed for Fastj.
! --------------------------------------------------------------
Expand Down Expand Up @@ -344,62 +309,7 @@ subroutine calcPhotolysisRateConstants( JXbundle, chem_mecha, tropp, &
cldOD_ij(:) = tau_cloud(il,ij,:)
endif
!
if (fastj_opt == 0) then

! ==================
call Control_Fastj &
! ==================
& (k1, k2, chem_mask_khi, &
& num_qjs, month_gmi, jday, time_sec, fastj_offset_sec, &
& sza_ij, pres3e(il,ij,k1-1:k2), &
& kel_ij, cldOD_ij, surf_alb_uv(il,ij), qjgmi_ij, overheadO3col_ij, &
& ODAER_ij, ODMDUST_ij)

elseif (fastj_opt == 1) then
if (.not. do_ozone_inFastJX) then
! ==================
call Control_Fast_JX &
! ==================
& (JXbundle, k1, k2, chem_mask_khi, &
& num_qjs, month_gmi, jday, time_sec, fastj_offset_sec, &
& sza_ij, pres3e(il,ij,k1:k2), pctm2(il,ij), &
& kel_ij, cldOD_ij, surf_alb_uv(il,ij), qjgmi_ij, overheadO3col_ij, &
& ODAER_ij, ODMDUST_ij, ozone_ij)
else
! ==================
call Control_Fast_JX &
! ==================
& (JXbundle, k1, k2, chem_mask_khi, &
& num_qjs, month_gmi, jday, time_sec, fastj_offset_sec, &
& sza_ij, pres3e(il,ij,k1:k2), pctm2(il,ij), &
& kel_ij, cldOD_ij, surf_alb_uv(il,ij), qjgmi_ij, overheadO3col_ij, &
& ODAER_ij, ODMDUST_ij)
endif
elseif (fastj_opt == 2) then
! ==================
call Control_Fast_JX53b &
! ==================
& (k1, k2, chem_mask_khi, &
& num_qjs, month_gmi, jday, time_sec, &
& sza_ij, pres3e(il,ij,k1:k2), pctm2(il,ij), &
& kel_ij, cldOD_ij, surf_alb_uv(il,ij), qjgmi_ij, overheadO3col_ij, &
& ozone_ij)
elseif (fastj_opt == 3) then
! ==================
call Control_Fast_JX53c &
! ==================
& (k1, k2, chem_mask_khi, num_qjs, month_gmi, jday, time_sec, &
& sza_ij, pres3e(il,ij,k1:k2), pctm2(il,ij), &
& kel_ij, cldOD_ij, surf_alb_uv(il,ij), qjgmi_ij, overheadO3col_ij, &
& ODAER_ij, ODMDUST_ij, ozone_ij)
!! ==================
! call RunFastJX53c &
!! ==================
! & (k1, k2, jday, time_sec, month_gmi, &
! & sza_ij, pres3e(il,ij,k1:k2), pctm2(il,ij), &
! & kel_ij, cldOD_ij, surf_alb_uv(il,ij), qjgmi_ij, &
! & ozone_ij)
elseif (fastj_opt == 4) then
if (fastj_opt == 4) then
if (.not. do_ozone_inFastJX) then
call controlFastJX65 (k1, k2, chem_mask_khi, num_qjs, month_gmi, &
& jday, time_sec, sza_ij, do_clear_sky, &
Expand All @@ -418,7 +328,7 @@ subroutine calcPhotolysisRateConstants( JXbundle, chem_mecha, tropp, &
& JXbundle%fjx_solar_cycle_param)
endif
!
!... use CloudJ (aka FastJX7.4
!... use CloudJ (aka FastJX7.4)
elseif (fastj_opt == 5) then
cldOD_ij(:) = MAPL_UNDEF
eradius_ij(:,:) = 0.0d0
Expand Down Expand Up @@ -505,45 +415,6 @@ subroutine calcPhotolysisRateConstants( JXbundle, chem_mecha, tropp, &
end do
end do

! ==============================================
else if ((phot_opt == 4) .or. (phot_opt == 5)) then
! ==============================================

! ==============
call Lookup_Qj &
! ==============
& (chem_mecha, do_clear_sky, phot_opt, io3_num, nymd, photintv, &
& rsec_jan1, pres3c, temp3, concentration, solarZenithAngle, &
& mcor, mass3, fracCloudCover, qjgmi, &
& pr_diag, loc_proc, num_species, num_qjs, num_qjo, &
& ilo, ihi, julo, jhi, i1, i2, ju1, j2, k1, k2)

end if

if (TRIM(chem_mecha) == 'troposphere') then
! ----------------------------------------------------------------------
! Check to see if the mechanism has a photolysis reaction O3 + hv = 2OH.
! If so, save the rate in the last entry of qjgmi and then the real rate
! needs to be adjusted. Updated to JPL 06-2 (Bryan Duncan 10/2006).
! ----------------------------------------------------------------------

if (n_qj_O3_2OH > 0) then

n2adj(:,:,:) = 2.15d-11 * Exp (110.0d0 / temp3(i1:i2,ju1:j2,:)) * MXRN2
o2adj(:,:,:) = 3.30d-11 * Exp ( 55.0d0 / temp3(i1:i2,ju1:j2,:)) * MXRO2

if (pr_qj_o3_o1d) then
qjgmi(num_qjs+1)%pArray3D(:,:,:) = &
qjgmi(n_qj_O3_2OH)%pArray3D(:,:,:)
end if

qjgmi(n_qj_O3_2OH)%pArray3D(:,:,:) = &
qjgmi(n_qj_O3_2OH)%pArray3D(:,:,:) / &
& (1.0d0 + ((n2adj(:,:,:) + o2adj(:,:,:)) / &
& (1.63d-10 * Exp(60.0d0/temp3(i1:i2,ju1:j2,:)) &
& * concentration(ih2o_num)%pArray3D(:,:,:))))

end if
end if

!! ----------------------------------------------------------------------
Expand Down
Loading

0 comments on commit 5522894

Please sign in to comment.