Skip to content

Commit

Permalink
Merge branch 'develop' into feature/esherman/gocart2g_develop_MAPLconst
Browse files Browse the repository at this point in the history
  • Loading branch information
gmao-esherman authored Mar 5, 2021
2 parents b78eb55 + cd6c1f2 commit a3fd728
Show file tree
Hide file tree
Showing 6 changed files with 95 additions and 72 deletions.
7 changes: 4 additions & 3 deletions ESMF/GOCART2G_GridComp/CA2G_GridComp/CA2G_GridCompMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -565,7 +565,8 @@ subroutine Initialize (GC, import, export, clock, RC)
allocate (self%diag_MieTable(instance)%mie_aerosol, __STAT__)
self%diag_MieTable(instance)%mie_aerosol = Chem_MieTableCreate (self%diag_MieTable(instance)%optics_file, __RC__ )
call Chem_MieTableRead (self%diag_MieTable(instance)%mie_aerosol, self%diag_MieTable(instance)%nch, &
self%diag_MieTable(instance)%channels, rc, nmom=self%diag_MieTable(instance)%nmom)
self%diag_MieTable(instance)%channels, rc=status, nmom=self%diag_MieTable(instance)%nmom)
VERIFY_(status)

! Finish creating AERO state
! --------------------------
Expand Down Expand Up @@ -840,7 +841,7 @@ subroutine Run1 (GC, import, export, clock, RC)
nymd=nymd, nhms=120000 )
call ReadPointEmissions (nymd, fname, self%nPts, self%pLat, self%pLon, &
self%pBase, self%pTop, self%pEmis, self%pStart, &
self%pEnd, label='source')
self%pEnd, label='source', __RC__)
endif

! Get indices for point emissions
Expand Down Expand Up @@ -1014,7 +1015,7 @@ subroutine Run2 (GC, import, export, clock, RC)
fwet = 1.
call WetRemovalGOCART2G (self%km, self%klid, self%nbins, self%nbins, 2, self%cdt, GCsuffix, &
KIN, MAPL_GRAV, fwet, CAphilic, ple, t, airdens, &
pfl_lsan, pfi_lsan, cn_prcp, ncn_prcp, CAWT, rc)
pfl_lsan, pfi_lsan, cn_prcp, ncn_prcp, CAWT, __RC__)

! Compute diagnostics
! -------------------
Expand Down
10 changes: 6 additions & 4 deletions ESMF/GOCART2G_GridComp/DU2G_GridComp/DU2G_GridCompMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -521,7 +521,8 @@ subroutine Initialize (GC, import, export, clock, RC)
allocate (self%diag_MieTable(instance)%mie_aerosol, __STAT__)
self%diag_MieTable(instance)%mie_aerosol = Chem_MieTableCreate (self%diag_MieTable(instance)%optics_file, __RC__ )
call Chem_MieTableRead (self%diag_MieTable(instance)%mie_aerosol, self%diag_MieTable(instance)%nch, &
self%diag_MieTable(instance)%channels, rc, nmom=self%diag_MieTable(instance)%nmom)
self%diag_MieTable(instance)%channels, rc=status, nmom=self%diag_MieTable(instance)%nmom)
VERIFY_(status)

! Mie Table instance/index
call ESMF_AttributeSet (aero, name='mie_table_instance', value=instance, __RC__)
Expand Down Expand Up @@ -726,7 +727,7 @@ subroutine Run1 (GC, import, export, clock, RC)
nymd=nymd, nhms=120000 )
call ReadPointEmissions (nymd, fname, self%nPts, self%pLat, self%pLon, &
self%pBase, self%pTop, self%pEmis, self%pStart, &
self%pEnd, label='source')
self%pEnd, label='source', __RC__)
end if
end if

Expand All @@ -753,7 +754,7 @@ subroutine Run1 (GC, import, export, clock, RC)
! --------------------
call UpdateAerosolState (emissions, emissions_surface, emissions_point, &
self%sfrac, self%nPts, self%km, self%CDT, MAPL_GRAV, &
self%nbins, delp, DU, rc)
self%nbins, delp, DU, __RC__)

if (associated(DUEM)) then
DUEM = sum(emissions, dim=3)
Expand Down Expand Up @@ -859,8 +860,9 @@ subroutine Run2 (GC, import, export, clock, RC)
do n = 1, self%nbins
drydepositionfrequency = 0.
call DryDeposition(self%km, t, airdens, zle, lwi, ustar, zpbl, sh,&
MAPL_KARMAN, cpd, MAPL_GRAV, z0h, drydepositionfrequency, rc, &
MAPL_KARMAN, cpd, MAPL_GRAV, z0h, drydepositionfrequency, status, &
self%radius(n)*1.e-6, self%rhop(n), u10m, v10m, frlake, wet1)
VERIFY_(status)

dqa = 0.
dqa = max(0.0, DU(:,:,self%km,n)*(1.-exp(-drydepositionfrequency*self%cdt)))
Expand Down
25 changes: 13 additions & 12 deletions ESMF/GOCART2G_GridComp/NI2G_GridComp/NI2G_GridCompMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -522,7 +522,8 @@ subroutine Initialize (GC, IMPORT, EXPORT, CLOCK, RC)
allocate (self%diag_MieTable(instance)%mie_aerosol, __STAT__)
self%diag_MieTable(instance)%mie_aerosol = Chem_MieTableCreate (self%diag_MieTable(instance)%optics_file, __RC__ )
call Chem_MieTableRead (self%diag_MieTable(instance)%mie_aerosol, self%diag_MieTable(instance)%nch, &
self%diag_MieTable(instance)%channels, rc, nmom=self%diag_MieTable(instance)%nmom)
self%diag_MieTable(instance)%channels, rc=status, nmom=self%diag_MieTable(instance)%nmom)
VERIFY_(status)

! Mie Table instance/index
call ESMF_AttributeSet(aero, name='mie_table_instance', value=instance, __RC__)
Expand Down Expand Up @@ -827,7 +828,7 @@ subroutine Run2 (GC, import, export, clock, RC)
!if(mapl_am_i_root()) print*,'NI2G before sum(SO4) = ',sum(SO4)

call NIthermo (self%km, self%klid, self%cdt, MAPL_GRAV, delp, airdens, t, rh2, fMassHNO3, MAPL_AIRMW, &
SO4, NH3, NO3an1, NH4a, self%xhno3, NIPNO3AQ, NIPNH4AQ, NIPNH3AQ, rc)
SO4, NH3, NO3an1, NH4a, self%xhno3, NIPNO3AQ, NIPNH4AQ, NIPNH3AQ, __RC__)

!if(mapl_am_i_root()) print*,'NI2G after thermo sum(NH3) = ',sum(NH3)
!if(mapl_am_i_root()) print*,'NI2G after thermo sum(NO3an1) = ',sum(NO3an1)
Expand All @@ -848,7 +849,7 @@ subroutine Run2 (GC, import, export, clock, RC)
airdens, t, rh2, delp, DU, SS, self%rmedDU*1.e-6, self%rmedSS*1.e-6, &
self%fnumDU, self%fnumSS, 5, 5, self%km, self%klid, self%cdt, MAPL_GRAV, fMassHNO3, &
fMassNO3, NO3an1, NO3an2, NO3an3, HNO3CONC, HNO3SMASS, &
HNO3CMASS, rc)
HNO3CMASS, __RC__)

!if(mapl_am_i_root()) print*,'NI2G sum(NIHT(:,:,1)) = ',sum(NIHT(:,:,1))
!if(mapl_am_i_root()) print*,'NI2G sum(NIHT(:,:,2)) = ',sum(NIHT(:,:,2))
Expand Down Expand Up @@ -878,7 +879,7 @@ subroutine Run2 (GC, import, export, clock, RC)
rhflag = 3
call Chem_SettlingSimpleOrig (self%km, self%klid, rhflag, MAPL_GRAV, self%cdt, &
1.e-6*self%radius(nNH4a), self%rhop(nNH4a), &
NH4a, t, airdens, rh2, delp, zle, NH4SD, rc)
NH4a, t, airdens, rh2, delp, zle, NH4SD, __RC__)

!if(mapl_am_i_root()) print*,'NI2G sum(NH4SD) = ',sum(NH4SD)
!if(mapl_am_i_root()) print*,'NI2G sum(NH4a) = ',sum(NH4a)
Expand All @@ -892,7 +893,7 @@ subroutine Run2 (GC, import, export, clock, RC)
fluxout = 0.
call Chem_SettlingSimpleOrig (self%km, self%klid, rhFlag, MAPL_GRAV, self%cdt, &
1.e-6*self%radius(nNO3an1), self%rhop(nNO3an1), &
NO3an1, t, airdens, rh2, delp, zle, fluxout, rc)
NO3an1, t, airdens, rh2, delp, zle, fluxout, __RC__)
if (associated(NISD)) NISD(:,:,1) = fluxout
!if(mapl_am_i_root()) print*,'NI2G sum(NISD(:,:,1)) = ',sum(NISD(:,:,1))
!if(mapl_am_i_root()) print*,'NI2G sum(NO3an1) = ',sum(NO3an1)
Expand All @@ -902,7 +903,7 @@ subroutine Run2 (GC, import, export, clock, RC)
fluxout = 0.
call Chem_SettlingSimpleOrig (self%km, self%klid, rhFlag, MAPL_GRAV, self%cdt, &
1.e-6*self%radius(nNO3an2), self%rhop(nNO3an2), &
NO3an2, t, airdens, rh2, delp, zle, fluxout, rc)
NO3an2, t, airdens, rh2, delp, zle, fluxout, __RC__)
if (associated(NISD)) NISD(:,:,2) = fluxout
!if(mapl_am_i_root()) print*,'NI2G sum(NISD(:,:,2)) = ',sum(NISD(:,:,2))
!if(mapl_am_i_root()) print*,'NI2G sum(NO3an2) = ',sum(NO3an2)
Expand All @@ -912,7 +913,7 @@ subroutine Run2 (GC, import, export, clock, RC)
fluxout = 0.
call Chem_SettlingSimpleOrig (self%km, self%klid, rhFlag, MAPL_GRAV, self%cdt, &
1.e-6*self%radius(nNO3an3), self%rhop(nNO3an3), &
NO3an3, t, airdens, rh2, delp, zle, fluxout, rc)
NO3an3, t, airdens, rh2, delp, zle, fluxout, __RC__)
if (associated(NISD)) NISD(:,:,3) = fluxout
!if(mapl_am_i_root()) print*,'NI2G sum(NISD(:,:,3)) = ',sum(NISD(:,:,3))
!if(mapl_am_i_root()) print*,'NI2G ChemSet sum(NO3an3) = ',sum(NO3an3)
Expand Down Expand Up @@ -995,7 +996,7 @@ subroutine Run2 (GC, import, export, clock, RC)
fwet = 1.
call WetRemovalGOCART2G (self%km, self%klid, self%nbins, self%nbins, 1, self%cdt, 'NH3', &
KIN, MAPL_GRAV, fwet, NH3, ple, t, airdens, &
pfl_lsan, pfi_lsan, cn_prcp, ncn_prcp, fluxoutWT, rc)
pfl_lsan, pfi_lsan, cn_prcp, ncn_prcp, fluxoutWT, __RC__)
if (associated(NH3WT)) NH3WT = fluxoutWT(:,:,1)
!if(mapl_am_i_root()) print*,'NI2G sum(NH3WT) = ',sum(NH3WT)
!if(mapl_am_i_root()) print*,'NI2G sum(NH3) = ',sum(NH3)
Expand All @@ -1006,7 +1007,7 @@ subroutine Run2 (GC, import, export, clock, RC)
fwet = 1.
call WetRemovalGOCART2G(self%km, self%klid, self%nbins, self%nbins, 1, self%cdt, 'NH4a', &
KIN, MAPL_GRAV, fwet, NH4a, ple, t, airdens, &
pfl_lsan, pfi_lsan, cn_prcp, ncn_prcp, fluxoutWT, rc)
pfl_lsan, pfi_lsan, cn_prcp, ncn_prcp, fluxoutWT, __RC__)
if (associated(NH4WT)) NH4WT = fluxoutWT(:,:,1)
!if(mapl_am_i_root()) print*,'NI2G sum(NH4WT) = ',sum(NH4WT)
!if(mapl_am_i_root()) print*,'NI2G sum(NH4) = ',sum(NH4a)
Expand All @@ -1015,20 +1016,20 @@ subroutine Run2 (GC, import, export, clock, RC)
fwet = 1.
call WetRemovalGOCART2G(self%km, self%klid, self%nbins, self%nbins, 1, self%cdt, 'nitrate', &
KIN, MAPL_GRAV, fwet, NO3an1, ple, t, airdens, &
pfl_lsan, pfi_lsan, cn_prcp, ncn_prcp, NIWT, rc)
pfl_lsan, pfi_lsan, cn_prcp, ncn_prcp, NIWT, __RC__)
!if(mapl_am_i_root()) print*,'NI2G sum(NIWT(:,:,1)) = ',sum(NIWT(:,:,1))
KIN = .true.
fwet = 1.
call WetRemovalGOCART2G(self%km, self%klid, self%nbins, self%nbins, 2, self%cdt, 'nitrate', &
KIN, MAPL_GRAV, fwet, NO3an2, ple, t, airdens, &
pfl_lsan, pfi_lsan, cn_prcp, ncn_prcp, NIWT, rc)
pfl_lsan, pfi_lsan, cn_prcp, ncn_prcp, NIWT, __RC__)
!if(mapl_am_i_root()) print*,'NI2G sum(NIWT(:,:,2)) = ',sum(NIWT(:,:,2))

KIN = .true.
fwet = 0.3
call WetRemovalGOCART2G(self%km, self%klid, self%nbins, self%nbins, 3, self%cdt, 'nitrate', &
KIN, MAPL_GRAV, fwet, NO3an3, ple, t, airdens, &
pfl_lsan, pfi_lsan, cn_prcp, ncn_prcp, NIWT, rc)
pfl_lsan, pfi_lsan, cn_prcp, ncn_prcp, NIWT, __RC__)
!if(mapl_am_i_root()) print*,'NI2G sum(NIWT(:,:,3)) = ',sum(NIWT(:,:,3))
!if(mapl_am_i_root()) print*,'NI2G WetRemoval sum(NO3an3) = ',sum(NO3an3)

Expand Down
7 changes: 4 additions & 3 deletions ESMF/GOCART2G_GridComp/SS2G_GridComp/SS2G_GridCompMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -515,7 +515,8 @@ subroutine Initialize (GC, IMPORT, EXPORT, CLOCK, RC)
allocate (self%diag_MieTable(instance)%mie_aerosol, __STAT__)
self%diag_MieTable(instance)%mie_aerosol = Chem_MieTableCreate (self%diag_MieTable(instance)%optics_file, __RC__ )
call Chem_MieTableRead (self%diag_MieTable(instance)%mie_aerosol, self%diag_MieTable(instance)%nch, &
self%diag_MieTable(instance)%channels, rc, nmom=self%diag_MieTable(instance)%nmom)
self%diag_MieTable(instance)%channels, rc=status, nmom=self%diag_MieTable(instance)%nmom)
VERIFY_(status)

! Mie Table instance/index
call ESMF_AttributeSet(aero, name='mie_table_instance', value=instance, __RC__)
Expand Down Expand Up @@ -544,7 +545,7 @@ subroutine Initialize (GC, IMPORT, EXPORT, CLOCK, RC)
! Mask to prevent emissions from the Great Lakes and the Caspian Sea
! ------------------------------------------------------------------
allocate(self%deep_lakes_mask(ubound(lons, 1),ubound(lons, 2)), __STAT__)
call deepLakesMask (lons, lats, real(MAPL_RADIANS_TO_DEGREES), self%deep_lakes_mask, rc)
call deepLakesMask (lons, lats, real(MAPL_RADIANS_TO_DEGREES), self%deep_lakes_mask, __RC__)

RETURN_(ESMF_SUCCESS)

Expand Down Expand Up @@ -830,7 +831,7 @@ subroutine Run2 (GC, import, export, clock, RC)
fwet = 1.
call WetRemovalGOCART2G(self%km, self%klid, self%nbins, self%nbins, n, self%cdt, 'sea_salt', &
KIN, MAPL_GRAV, fwet, SS(:,:,:,n), ple, t, airdens, &
pfl_lsan, pfi_lsan, cn_prcp, ncn_prcp, SSWT, rc)
pfl_lsan, pfi_lsan, cn_prcp, ncn_prcp, SSWT, __RC__)
end do

! Compute diagnostics
Expand Down
21 changes: 11 additions & 10 deletions ESMF/GOCART2G_GridComp/SU2G_GridComp/SU2G_GridCompMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -636,7 +636,8 @@ subroutine Initialize (GC, IMPORT, EXPORT, CLOCK, RC)
allocate (self%diag_MieTable(instance)%mie_aerosol, __STAT__)
self%diag_MieTable(instance)%mie_aerosol = Chem_MieTableCreate (self%diag_MieTable(instance)%optics_file, __RC__ )
call Chem_MieTableRead (self%diag_MieTable(instance)%mie_aerosol, self%diag_MieTable(instance)%nch, &
self%diag_MieTable(instance)%channels, rc, nmom=self%diag_MieTable(instance)%nmom)
self%diag_MieTable(instance)%channels, rc=status, nmom=self%diag_MieTable(instance)%nmom)
VERIFY_(status)

! Mie Table instance/index
call ESMF_AttributeSet(aero, name='mie_table_instance', value=instance, __RC__)
Expand Down Expand Up @@ -861,7 +862,7 @@ subroutine Run1 (GC, import, export, clock, RC)
nymd=nymd, nhms=120000 )
call ReadPointEmissions (nymd, fname, self%nVolc, self%vLat, self%vLon, &
self%vElev, self%vCloud, self%vSO2, self%vStart, &
self%vEnd, label='volcano')
self%vEnd, label='volcano', __RC__)
self%vSO2 = self%vSO2 * fMassSO2 / fMassSulfur
! Special possible case
if(self%volcano_srcfilen(1:9) == '/dev/null') self%nVolc = 0
Expand Down Expand Up @@ -914,11 +915,11 @@ subroutine Run1 (GC, import, export, clock, RC)
self%aviation_layers, &
aviation_lto_src, &
aviation_cds_src, &
aviation_crs_src, rc)
aviation_crs_src, __RC__)

if (associated(dms)) then
call DMSemission (self%km, self%cdt, MAPL_GRAV, t, u10m, v10m, lwi, delp, &
fMassDMS, SU_DMSO, dms, SUEM, nDMS, rc)
fMassDMS, SU_DMSO, dms, SUEM, nDMS, __RC__)
end if

! Read any pointwise emissions, if requested
Expand All @@ -928,7 +929,7 @@ subroutine Run1 (GC, import, export, clock, RC)
nymd=nymd, nhms=120000 )
call ReadPointEmissions (nymd, fname, self%nPts, self%pLat, self%pLon, &
self%pBase, self%pTop, self%pEmis, self%pStart, &
self%pEnd, label='source')
self%pEnd, label='source', __RC__)

endif

Expand Down Expand Up @@ -1074,7 +1075,7 @@ subroutine Run2 (GC, import, export, clock, RC)
self%nymd_oxidants, MAPL_UNDEF, real(MAPL_RADIANS_TO_DEGREES), &
MAPL_AVOGAD/1000., MAPL_PI, MAPL_AIRMW, &
oh, no3, h2o2, &
xoh, xno3, xh2o2, self%recycle_h2o2, rc)
xoh, xno3, xh2o2, self%recycle_h2o2, __RC__)

!if(mapl_am_i_root()) print*,'SU2G Run2 UpdateOxidants sum(xh2o2) = ',sum(xh2o2)
!if(mapl_am_i_root()) print*,'SU2G Run2 UpdateOxidants sum(self%h2o2_init) = ',sum(self%h2o2_init)
Expand All @@ -1088,7 +1089,7 @@ subroutine Run2 (GC, import, export, clock, RC)

call Chem_Settling2Gorig (self%km, self%klid, self%rhFlag, n, int_ptr, MAPL_GRAV, delp, &
self%radius(n)*1.e-6, self%rhop(n), self%cdt, t, airdens, &
rh2, zle, SUSD, rc=rc)
rh2, zle, SUSD, __RC__)
end do

allocate(drydepositionf, mold=lwi, __STAT__)
Expand All @@ -1104,7 +1105,7 @@ subroutine Run2 (GC, import, export, clock, RC)
SUDP, SUPSO2, SUPMSA, &
SUPSO4, SUPSO4g, SUPSO4aq, &
pso2, pmsa, pso4, pso4g, pso4aq, drydepositionf, & ! 3d diagnostics
rc)
__RC__)

!if(mapl_am_i_root()) print*,'SU2G Run2 ChemDriver sum(xh2o2) = ',sum(xh2o2)
!if(mapl_am_i_root()) print*,'SU2G Run2 ChemDriver sum(self%h2o2_init) = ',sum(self%h2o2_init)
Expand All @@ -1117,7 +1118,7 @@ subroutine Run2 (GC, import, export, clock, RC)
delp, fMassSO4, fMassSO2, &
self%h2o2_init, ple, airdens, cn_prcp, ncn_prcp, pfl_lsan, pfi_lsan, t, &
nDMS, nSO2, nSO4, nMSA, DMS, SO2, SO4, dummyMSA, &
SUWT, SUPSO4, SUPSO4WT, PSO4, PSO4WET, rc )
SUWT, SUPSO4, SUPSO4WT, PSO4, PSO4WET, __RC__ )

!if(mapl_am_i_root()) print*,'SU2G Run2 WetRemoval sum(xh2o2) = ',sum(xh2o2)
!if(mapl_am_i_root()) print*,'SU2G Run2 WetRemoval sum(self%h2o2_init) = ',sum(self%h2o2_init)
Expand All @@ -1132,7 +1133,7 @@ subroutine Run2 (GC, import, export, clock, RC)
SO2SMASS, SO2CMASS, &
SO4SMASS, SO4CMASS, &
SUEXTTAU, SUSCATAU, SO4MASS, SUCONC, SUEXTCOEF, &
SUSCACOEF, SUANGSTR, SUFLUXU, SUFLUXV, SO4SAREA, SO4SNUM, rc)
SUSCACOEF, SUANGSTR, SUFLUXU, SUFLUXV, SO4SAREA, SO4SNUM, __RC__)

!if(mapl_am_i_root()) print*,'SU2G Run2 E size(suexttau) = ',size(suexttau)
!if(mapl_am_i_root()) print*,'SU2G Run2 E size(suescaau) = ',size(suscatau)
Expand Down
Loading

0 comments on commit a3fd728

Please sign in to comment.