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

Feature/vbuchard/total aback toa #198

Merged
merged 5 commits into from
Jan 24, 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
8 changes: 6 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ the 'mini' ESMF sates are created. Those arrays are xhno3 for NI2G, h202_init
for SU2G, and deep_lakes_mask for SS2G. All of these arrays have MAPL_RestartSkip
option so they are not written to restart.

- Aerosol single scattering backscatter coefficient for each instances and total at wavelengths_profile
- Total (molecular + aerosols) attenuated backscatter coefficient from TOA and sfc at 532nm

### Fixed

### Changed
Expand All @@ -27,9 +30,10 @@ option so they are not written to restart.

## [2.1.2] - 2022-10-07

### Added
## Added

- Extinction exports with RH=20% and RH=80%
- Extinction/Scattering profile exports at model RH at wavelengths_profile
- Extinction/Scattering profile exports with RH=20% and RH=80% at wavelengths_profile

### Fixed

Expand Down
4 changes: 2 additions & 2 deletions ESMF/GOCART2G_GridComp/CA2G_GridComp/CA2G_GridCompMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1041,8 +1041,8 @@ subroutine Run2 (GC, import, export, clock, RC)
sfcmass=SMASS, colmass=CMASS, mass=MASS,&
exttau=EXTTAU,stexttau=STEXTTAU, scatau=SCATAU, stscatau=STSCATAU,&
fluxu=FLUXU, fluxv=FLUXV, &
conc=CONC, extcoef=EXTCOEF, scacoef=SCACOEF, angstrom=ANGSTR, aerindx=AERIDX,&
NO3nFlag=.false., __RC__)
conc=CONC, extcoef=EXTCOEF, scacoef=SCACOEF, bckcoef=BCKCOEF, angstrom=ANGSTR,&
aerindx=AERIDX, NO3nFlag=.false., __RC__)


i1 = lbound(RH2, 1); i2 = ubound(RH2, 1)
Expand Down
1 change: 1 addition & 0 deletions ESMF/GOCART2G_GridComp/CA2G_GridComp/CA2G_StateSpecs.rc
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ category: EXPORT
*SCACOEF | m-1 | xyz | C | size(self%wavelengths_profile) | Carbonaceous Aerosol Scattering Coefficient
*SCACOEFRH20 | m-1 | xyz | C | size(self%wavelengths_profile) | Carbonaceous Aerosol Scattering Coefficient - Fixed RH=20%
*SCACOEFRH80 | m-1 | xyz | C | size(self%wavelengths_profile) | Carbonaceous Aerosol Scattering Coefficient - Fixed RH=80%
*BCKCOEF | m-1 sr-1 | xyz | C | size(self%wavelengths_profile) | Carbonaceous Aerosol Backscatter Coefficient
#............ | ............ | ..... | ..... | ....... | ............................................
*EM | kg m-2 s-1 | xy | N | nbins | Carbonaceous Aerosol Emission (Bin %d)
*SD | kg m-2 s-1 | xy | N | nbins | Carbonaceous Aerosol Sedimentation (Bin %d)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -981,7 +981,7 @@ subroutine Run2 (GC, import, export, clock, RC)
DUSMASS, DUCMASS, DUMASS, DUEXTTAU, DUSTEXTTAU, DUSCATAU,DUSTSCATAU, &
DUSMASS25, DUCMASS25, DUMASS25, DUEXTT25, DUSCAT25, &
DUFLUXU, DUFLUXV, DUCONC, DUEXTCOEF, DUSCACOEF, &
DUEXTTFM, DUSCATFM, DUANGSTR, DUAERIDX, NO3nFlag=.false., __RC__ )
DUBCKCOEF,DUEXTTFM, DUSCATFM, DUANGSTR, DUAERIDX, NO3nFlag=.false., __RC__ )


i1 = lbound(RH2, 1); i2 = ubound(RH2, 1)
Expand Down
1 change: 1 addition & 0 deletions ESMF/GOCART2G_GridComp/DU2G_GridComp/DU2G_StateSpecs.rc
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ category: EXPORT
DUSCACOEF | m-1 | xyz | C | size(self%wavelengths_profile) | Dust Scattering Coefficient
DUSCACOEFRH20 | m-1 | xyz | C | size(self%wavelengths_profile) | Dust Scattering Coefficient - Fixed RH=20%
DUSCACOEFRH80 | m-1 | xyz | C | size(self%wavelengths_profile) | Dust Scattering Coefficient - Fixed RH=80%
DUBCKCOEF | m-1 sr-1 | xyz | C | size(self%wavelengths_profile) | Dust Backscatter Coefficient
#........................................................................................
DUSMASS | kg m-3 | xy | N | | Dust Surface Mass Concentration
DUCMASS | kg m-2 | xy | N | | Dust Column Mass Density
Expand Down
126 changes: 120 additions & 6 deletions ESMF/GOCART2G_GridComp/GOCART2G_GridCompMod.F90

Large diffs are not rendered by default.

12 changes: 9 additions & 3 deletions ESMF/GOCART2G_GridComp/GOCART2G_StateSpecs.rc
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,13 @@ category: IMPORT
#----------------------------------------------------------------------------------------
# VARIABLE | DIMENSIONS | Additional Metadata
#----------------------------------------------------------------------------------------
NAME | UNITS | DIMS | VLOC | COND | LONG NAME
NAME | UNITS | DIMS | VLOC | RESTART | LONG NAME
#----------------------------------------------------------------------------------------
# DELP | Pa | xyz | C | | pressure_thickness
# RH2 | 1 | xyz | C | | Rel_Hum_after_moist
DELP | Pa | xyz | C | | pressure_thickness
# RH2 | 1 | xyz | C | | Rel_Hum_after_moist
AIRDENS | kg/m^3 | xyz | C | OPT | moist_air_density
T | K | xyz | C | OPT | air_temperature
PLE | Pa | xyz | E | OPT | air_pressure

category: EXPORT
#----------------------------------------------------------------------------------------
Expand All @@ -33,6 +36,9 @@ category: EXPORT
TOTSCACOEF | m-1 | xyz | C | size(self%wavelengths_profile) | Total Aerosol Scattering coefficient
TOTSCACOEFRH20 | m-1 | xyz | C | size(self%wavelengths_profile) | Total Aerosol Scattering coefficient - Fixed RH=20%
TOTSCACOEFRH80 | m-1 | xyz | C | size(self%wavelengths_profile) | Total Aerosol Scattering coefficient - Fixed RH=80%
TOTBCKCOEF | m-1 sr-1 | xyz | C | size(self%wavelengths_profile) | Total Aerosol Single Scattering Backscatter coefficient
TOTABCKTOA | m-1 sr-1 | xyz | C | | Total Attenuated Backscatter Coefficient from TOA [532nm]
TOTABCKSFC | m-1 sr-1 | xyz | C | | Total Attenuated Backscatter Coefficient from surface [532nm]
PM | kg m-3 | xy | N | | Total reconstructed PM
PM_RH35 | kg m-3 | xy | N | | Total reconstructed PM(RH=35%)
PM_RH50 | kg m-3 | xy | N | | Total reconstructed PM(RH=50%)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -991,7 +991,7 @@ subroutine Run2 (GC, import, export, clock, RC)
delp=delp, ple=ple, tropp=tropp,sfcmass=NISMASS, colmass=NICMASS, mass=NIMASS, conc=NICONC, &
exttau=NIEXTTAU, stexttau=NISTEXTTAU,scatau=NISCATAU, stscatau=NISTSCATAU,&
fluxu=NIFLUXU, fluxv=NIFLUXV, extcoef=NIEXTCOEF, scacoef=NISCACOEF, &
angstrom=NIANGSTR, __RC__ )
bckcoef=NIBCKCOEF,angstrom=NIANGSTR, __RC__ )

i1 = lbound(RH2, 1); i2 = ubound(RH2, 1)
j1 = lbound(RH2, 2); j2 = ubound(RH2, 2)
Expand Down
1 change: 1 addition & 0 deletions ESMF/GOCART2G_GridComp/NI2G_GridComp/NI2G_StateSpecs.rc
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ category: EXPORT
NISCACOEF | m-1 | xyz | C | size(self%wavelengths_profile) | Nitrate Scattering Coefficient
NISCACOEFRH20 | m-1 | xyz | C | size(self%wavelengths_profile) | Nitrate Scattering Coefficient - fixed RH=20%
NISCACOEFRH80 | m-1 | xyz | C | size(self%wavelengths_profile) | Nitrate Scattering Coefficient - fixed RH=80%
NIBCKCOEF | m-1 sr-1 | xyz | C | size(self%wavelengths_profile) | Nitrate Backscatter Coefficient
# ............. | ............ | ..... | ..... | ........... | ..................................
NIPNO3AQ | kg m-2 s-1 | xy | N | | Nitrate Production from Aqueous Chemistry
NIPNH4AQ | kg m-2 s-1 | xy | N | | Ammonium Production from Aqueous Chemistry
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -819,7 +819,7 @@ subroutine Run2 (GC, import, export, clock, RC)
self%wavelengths_vertint*1.0e-9, SS, MAPL_GRAV, t, airdens,rh2, u, v, &
delp, ple, tropp,SSSMASS, SSCMASS, SSMASS, SSEXTTAU,SSSTEXTTAU, SSSCATAU,SSSTSCATAU, &
SSSMASS25, SSCMASS25, SSMASS25, SSEXTT25, SSSCAT25, &
SSFLUXU, SSFLUXV, SSCONC, SSEXTCOEF, SSSCACOEF, &
SSFLUXU, SSFLUXV, SSCONC, SSEXTCOEF, SSSCACOEF, SSBCKCOEF, &
SSEXTTFM, SSSCATFM ,SSANGSTR, SSAERIDX, NO3nFlag=.false.,__RC__)

i1 = lbound(RH2, 1); i2 = ubound(RH2, 1)
Expand Down
1 change: 1 addition & 0 deletions ESMF/GOCART2G_GridComp/SS2G_GridComp/SS2G_StateSpecs.rc
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ category: EXPORT
SSSCACOEF | m-1 | xyz | C | size(self%wavelengths_profile) | Sea Salt Scattering Coefficient
SSSCACOEFRH20 | m-1 | xyz | C | size(self%wavelengths_profile) | Sea Salt Scattering Coefficient - Fixed RH=20%
SSSCACOEFRH80 | m-1 | xyz | C | size(self%wavelengths_profile) | Sea Salt Scattering Coefficient - Fixed RH=80%
SSBCKCOEF | m-1 sr-1 | xyz | C | size(self%wavelengths_profile) | Sea Salt Backscatter Coefficient
#............. | ............ | ..... | ..... | ............ | ..................................
SSEM | kg m-2 s-1 | xy | N | self%nbins | Sea Salt Emission (Bin %d)
SSSD | kg m-2 s-1 | xy | N | self%nbins | Sea Salt Sedimentation (Bin %d)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1116,7 +1116,7 @@ subroutine Run2 (GC, import, export, clock, RC)
SO2SMASS, SO2CMASS, &
SO4SMASS, SO4CMASS, &
SUEXTTAU, SUSTEXTTAU,SUSCATAU,SUSTSCATAU, SO4MASS, SUCONC, SUEXTCOEF, &
SUSCACOEF, SUANGSTR, SUFLUXU, SUFLUXV, SO4SAREA, SO4SNUM, __RC__)
SUSCACOEF, SUBCKCOEF,SUANGSTR, SUFLUXU, SUFLUXV, SO4SAREA, SO4SNUM, __RC__)

i1 = lbound(RH2, 1); i2 = ubound(RH2, 1)
j1 = lbound(RH2, 2); j2 = ubound(RH2, 2)
Expand Down
1 change: 1 addition & 0 deletions ESMF/GOCART2G_GridComp/SU2G_GridComp/SU2G_StateSpecs.rc
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ category: EXPORT
SUSCACOEF | m-1 | xyz | C | size(self%wavelengths_profile) | SO4 Scattering Coefficient
SUSCACOEFRH20 | m-1 | xyz | C | size(self%wavelengths_profile) | SO4 Scattering Coefficient - Fixed RH=20%
SUSCACOEFRH80 | m-1 | xyz | C | size(self%wavelengths_profile) | SO4 Scattering Coefficient - Fixed RH=80%
SUBCKCOEF | m-1 sr-1 | xyz | C | size(self%wavelengths_profile) | SO4 Backscatter Coefficient
SUANGSTR | 1 | xy | N | | SO4 Angstrom parameter [470-870 nm]
SUFLUXU | kg m-1 s-1 | xy | N | | SO4 column u-wind mass flux
SUFLUXV | kg m-1 s-1 | xy | N | | SO4 column v-wind mass flux
Expand Down
33 changes: 25 additions & 8 deletions Process_Library/GOCART2G_Process.F90
Original file line number Diff line number Diff line change
Expand Up @@ -3251,7 +3251,7 @@ subroutine Aero_Compute_Diags (mie, km, klid, nbegin, nbins, rlow, rup, &
grav, tmpu, rhoa, rh, u, v, delp, ple,tropp, &
sfcmass, colmass, mass, exttau, stexttau, scatau, stscatau,&
sfcmass25, colmass25, mass25, exttau25, scatau25, &
fluxu, fluxv, conc, extcoef, scacoef, &
fluxu, fluxv, conc, extcoef, scacoef, bckcoef,&
exttaufm, scataufm, angstrom, aerindx, NO3nFlag, rc )

! !USES:
Expand Down Expand Up @@ -3299,6 +3299,7 @@ subroutine Aero_Compute_Diags (mie, km, klid, nbegin, nbins, rlow, rup, &
real, optional, dimension(:,:), intent(inout) :: fluxv ! Column mass flux in y direction
real, optional, dimension(:,:,:,:), intent(inout) :: extcoef ! 3d ext. coefficient, 1/m
real, optional, dimension(:,:,:,:), intent(inout) :: scacoef ! 3d scat.coefficient, 1/m
real, optional, dimension(:,:,:,:), intent(inout) :: bckcoef ! 3d backscatter coefficient, m-1 sr-1
real, optional, dimension(:,:,:), intent(inout) :: exttaufm ! fine mode (sub-micron) ext. AOT at 550 nm
real, optional, dimension(:,:,:), intent(inout) :: scataufm ! fine mode (sub-micron) sct. AOT at 550 nm
real, optional, dimension(:,:), intent(inout) :: angstrom ! 470-870 nm Angstrom parameter
Expand All @@ -3319,7 +3320,7 @@ subroutine Aero_Compute_Diags (mie, km, klid, nbegin, nbins, rlow, rup, &
integer :: i, j, k, n, w, ios, status
integer :: i1 =1, i2, j1=1, j2
integer :: ilam470, ilam870
real, allocatable, dimension(:,:,:) :: tau, ssa
real, allocatable, dimension(:,:,:) :: tau, ssa, bck
! real :: fPMfm(nbins) ! fraction of bin with particles diameter < 1.0 um
! real :: fPM25(nbins) ! fraction of bin with particles diameter < 2.5 um
real, dimension(:), allocatable :: fPMfm ! fraction of bin with particles diameter < 1.0 um
Expand Down Expand Up @@ -3474,18 +3475,21 @@ subroutine Aero_Compute_Diags (mie, km, klid, nbegin, nbins, rlow, rup, &

allocate(tau(i1:i2,j1:j2,km),source = 0.)
allocate(ssa(i1:i2,j1:j2,km),source = 0.)
allocate(bck(i1:i2,j1:j2,km),source = 0.)
! Calculate the extinction and/or scattering AOD
if( present(extcoef) .or. &
present(scacoef) ) then
present(scacoef) .or. &
present(bckcoef)) then

if( present(extcoef) ) extcoef = 0.
if( present(scacoef) ) scacoef = 0.
if( present(bckcoef) ) bckcoef = 0.

do n = nbegin, nbins
do w = 1, size(wavelengths_profile)
call mie%Query(wavelengths_profile(w),n, &
aerosol(:,:,:,n)*delp/grav, &
rh, tau=tau, ssa=ssa, __RC__)
rh, tau=tau, ssa=ssa, bbck=bck,__RC__)
! Calculate the total ext. and scat. coefficients
if ( present(extcoef) ) then
extcoef(:,:,:,w) = extcoef(:,:,:,w) + &
Expand All @@ -3495,6 +3499,11 @@ subroutine Aero_Compute_Diags (mie, km, klid, nbegin, nbins, rlow, rup, &
scacoef(:,:,:,w) = scacoef(:,:,:,w) + &
ssa * tau * (grav * rhoa / delp)
endif
!calculate the backscatter coefficient
if ( present(bckcoef) ) then
bckcoef(:,:,:,w) = bckcoef(:,:,:,w) + &
bck * aerosol(:,:,:,n)*rhoa
endif
enddo !wavelengths_profile
enddo !nbins
end if !present(extcoef)...
Expand Down Expand Up @@ -6710,7 +6719,7 @@ subroutine SU_Compute_Diags ( km, klid, rmed, sigma, rhop, grav, pi, nSO4, mie,
so2sfcmass, so2colmass, &
so4sfcmass, so4colmass, &
exttau, stexttau,scatau, stscatau,so4mass, so4conc, extcoef, &
scacoef, angstrom, fluxu, fluxv, sarea, snum, rc )
scacoef, bckcoef, angstrom, fluxu, fluxv, sarea, snum, rc )

! !USES:
implicit NONE
Expand Down Expand Up @@ -6757,6 +6766,7 @@ subroutine SU_Compute_Diags ( km, klid, rmed, sigma, rhop, grav, pi, nSO4, mie,
real, optional, dimension(:,:,:), intent(inout) :: so4conc ! 3D mass concentration, [kg/m3]
real, optional, dimension(:,:,:,:), intent(inout) :: extcoef ! 3D ext. coefficient, [1/m]
real, optional, dimension(:,:,:,:), intent(inout) :: scacoef ! 3D scat.coefficient, [1/m]
real, optional, dimension(:,:,:,:), intent(inout) :: bckcoef ! 3D backscatter coefficient, [m-1 sr-1]
real, optional, dimension(:,:), intent(inout) :: angstrom ! 470-870 nm Angstrom parameter
real, optional, dimension(:,:), intent(inout) :: fluxu ! Column mass flux in x direction
real, optional, dimension(:,:), intent(inout) :: fluxv ! Column mass flux in y direction
Expand All @@ -6776,7 +6786,7 @@ subroutine SU_Compute_Diags ( km, klid, rmed, sigma, rhop, grav, pi, nSO4, mie,

! !Local Variables
integer :: i, j, k, w, i1=1, j1=1, i2, j2, status
real, dimension(:,:,:), allocatable :: tau, ssa
real, dimension(:,:,:), allocatable :: tau, ssa, bck
real, dimension(:,:), allocatable :: tau470, tau870
integer :: ilam470, ilam870
logical :: do_angstrom
Expand Down Expand Up @@ -6909,15 +6919,18 @@ subroutine SU_Compute_Diags ( km, klid, rmed, sigma, rhop, grav, pi, nSO4, mie,
! Calculate the extinction and/or scattering AOD
allocate(tau(i1:i2,j1:j2,km), source = 0.)
allocate(ssa(i1:i2,j1:j2,km), source = 0.)
if( present(extcoef) .or. present(scacoef) ) then
allocate(bck(i1:i2,j1:j2,km), source = 0.)
if( present(extcoef) .or. present(scacoef) .or. &
present(bckcoef)) then

if (present(extcoef)) extcoef = 0.
if (present(scacoef)) scacoef = 0.
if (present(bckcoef)) bckcoef = 0.

do w = 1, size(wavelengths_profile)
call mie%Query(wavelengths_profile(w), 1, & ! Only SO4 exists in the MieTable, so its index is 1
SO4*delp/grav, rh, &
tau=tau, ssa=ssa, __RC__)
tau=tau, ssa=ssa, bbck=bck,__RC__)

! Calculate the total ext. and scat. coefficients
if( present(extcoef) ) then
Expand All @@ -6928,6 +6941,10 @@ subroutine SU_Compute_Diags ( km, klid, rmed, sigma, rhop, grav, pi, nSO4, mie,
scacoef(:,:,:,w) = scacoef(:,:,:,w) + &
ssa * tau * (grav * rhoa / delp)
endif
if( present(bckcoef) ) then
bckcoef(:,:,:,w) = bckcoef(:,:,:,w) + &
bck * SO4 * rhoa
endif
enddo
endif

Expand Down