Skip to content

Commit 69dc9ef

Browse files
authored
Merge pull request #373 from GEOS-ESM/feature/catemgn/nitrate_GMI_coupling
Feature/catemgn/nitrate gmi coupling
2 parents 930788a + 8735cd2 commit 69dc9ef

File tree

6 files changed

+134
-34
lines changed

6 files changed

+134
-34
lines changed

CHANGELOG.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1818
- Changed effective radius in MieQuery.H to remove in place units scaling; made
1919
corresponding change in Chem_SettlingSimple
2020
- Updated optics lookup tables to accommodate area and effective radius calculation
21-
- Check userRC in ESMF_GridCompRun in GOCART2G gridcomp
21+
I- Check userRC in ESMF_GridCompRun in GOCART2G gridcomp
2222
- The pressure lid change associated with the introduction of run0 to set 0 above the lid
2323
- Fwet value in dust modified from 0.8 to 1.0
2424
- Dust and Sea salt Emission scale factors updated for L181
@@ -47,6 +47,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
4747
- Removed erroneous/extraneous friendly attributes to internal state for DU and NI
4848
when in data_driven mode
4949
- typo in filepath for BR optics file
50+
- Units error for dust and sea salt radius in NIheterogenousChem in Process Library corrected.
51+
- stochiometric coefficent correction for heterogenous production diagnostic NI_phet
52+
in NIheterogenousChem in Process Library.
53+
- corrected references for RH factor for hno3 uptake on dust in NIheterogenousChem in Process Library.
54+
- units error for external data hno3 corrected in NI instance file and in Process Library.
55+
- corrected units error for hno3 column diagnostic in Process Library.
56+
57+
5058
- Bug fix for "WetRemovalUFS"
5159

5260
### Added
@@ -56,6 +64,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
5664
coupling of GMI OH, NO3, H2O2 to sulfur chemistry mechanism
5765
- Added a callback to allow a chemistry module to call for optical properties needed
5866
for photolysis calculation; currently used for GMI with CloudJ
67+
- Added 3d diagnostics for nitrate production.
68+
- Added logic in NI2G_GridCompMod.F90 through NI2G_instance_NI.rc to allow two-way
69+
coupling of GMI HNO3 to nitrate chemistry mechanism.
5970
- Implementation of the "WetRemovalUFS" option for sulfate
6071

6172
## [v2.4.3] - 2025-07-21

ESMF/GOCART2G_GridComp/NI2G_GridComp/NI2G_GridCompMod.F90

Lines changed: 50 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ module NI2G_GridCompMod
6161
real, allocatable :: fnumDU(:), fnumSS(:) ! DU and SS particles per kg mass
6262
type(ThreadWorkspace), allocatable :: workspaces(:)
6363
type(ESMF_Alarm) :: alarm
64+
logical :: using_GMI !CM: logic for hno3 GMI coupling
6465
end type NI2G_GridComp
6566

6667
type wrap_
@@ -138,6 +139,9 @@ subroutine SetServices ( GC, RC )
138139
! process generic config items
139140
call self%GA_Environment%load_from_config( cfg, universal_cfg, __RC__)
140141

142+
! process NI specific items
143+
call ESMF_ConfigGetAttribute(cfg, self%using_GMI, label='using_GMI:', __RC__)
144+
141145
! Is NI data driven?
142146
! ------------------
143147
call determine_data_driven (COMP_NAME, data_driven, __RC__)
@@ -232,6 +236,16 @@ subroutine SetServices ( GC, RC )
232236
restart=MAPL_RestartOptional, __RC__)
233237
end if ! (data_driven)
234238

239+
if(self%using_GMI) then
240+
241+
call MAPL_AddImportSpec(GC, &
242+
SHORT_NAME = 'GMI_HNO3', &
243+
LONG_NAME = 'nitric_acid', &
244+
UNITS = 'mol/mol', &
245+
DIMS = MAPL_DimsHorzVert, &
246+
VLOCATION = MAPL_VLocationCenter, &
247+
RESTART = MAPL_RestartSkip, __RC__)
248+
endif
235249

236250
! Import, Export, Internal states for computational instance
237251
! ----------------------------------------------------------
@@ -827,45 +841,64 @@ subroutine Run2 (GC, import, export, clock, RC)
827841
allocate(dqa, mold=lwi, __STAT__)
828842
allocate(drydepositionfrequency, mold=lwi, __STAT__)
829843

830-
alarm_is_ringing = ESMF_AlarmIsRinging(self%alarm, _RC)
844+
845+
if(self%using_GMI) then
846+
xhno3 = GMI_HNO3
847+
call MAPL_MaxMin ( 'GMI:HNO3 ', xhno3)
848+
849+
else
850+
alarm_is_ringing = ESMF_AlarmIsRinging(self%alarm, _RC)
831851
#ifdef DEBUG
832-
if (alarm_is_ringing) then
852+
if (alarm_is_ringing) then
833853
if (MAPL_Am_I_Root()) then
834854
print *,'DEBUG:: NI replenish alarm is ringing'
835855
end if
836-
end if
856+
end if
837857
#endif
838858

839-
! Save local copy of HNO3 for first pass through run method regardless
840-
thread = MAPL_get_current_thread()
841-
workspace => self%workspaces(thread)
859+
!Save local copy of HNO3 for first pass through run method regardless
860+
thread = MAPL_get_current_thread()
861+
workspace => self%workspaces(thread)
842862

843-
!if (workspace%first) then
844-
!xhno3 = MAPL_UNDEF
845-
!workspace%first = .false.
846-
!end if
863+
!if (workspace%first) then
864+
!xhno3 = MAPL_UNDEF
865+
!workspace%first = .false.
866+
!end if
867+
868+
! Recycle HNO3 every 3 hours
869+
if (alarm_is_ringing) then
870+
xhno3 = NITRATE_HNO3
871+
end if
872+
endif
847873

848-
! Recycle HNO3 every 3 hours
849-
if (alarm_is_ringing) then
850-
xhno3 = NITRATE_HNO3
851-
end if
852874

853875
if (associated(NIPNO3AQ)) NIPNO3AQ(:,:) = 0.
854876
if (associated(NIPNH4AQ)) NIPNH4AQ(:,:) = 0.
855877
if (associated(NIPNH3AQ)) NIPNH3AQ(:,:) = 0.
878+
if (associated(NIPHNO3AQ)) NIPHNO3AQ(:,:) = 0.
879+
! 3D diag
880+
if (associated(NIPNO3AQV)) NIPNO3AQV(:,:,:) = 0.
881+
if (associated(NIPNH4AQV)) NIPNH4AQV(:,:,:) = 0.
882+
if (associated(NIPNH3AQV)) NIPNH3AQV(:,:,:) = 0.
883+
if (associated(NIPHNO3AQV)) NIPHNO3AQV(:,:,:) = 0.
856884

857885
call NIthermo (self%km, self%klid, self%cdt, MAPL_GRAV, delp, airdens, &
858886
t, rh2, fMassHNO3, MAPL_AIRMW, SO4, NH3, NO3an1, NH4a, &
859-
xhno3, NIPNO3AQ, NIPNH4AQ, NIPNH3AQ, __RC__)
887+
xhno3, NIPNO3AQ, NIPNH4AQ, NIPNH3AQ, NIPHNO3AQ, &
888+
NIPNO3AQV, NIPNH4AQV, NIPNH3AQV, NIPHNO3AQV, __RC__)
860889

861890

862-
call NIheterogenousChem (NIHT, xhno3, MAPL_UNDEF, MAPL_AVOGAD, MAPL_AIRMW, &
891+
call NIheterogenousChem (NIHT, NIHTV, xhno3, MAPL_UNDEF, MAPL_AVOGAD, MAPL_AIRMW, &
863892
MAPL_PI, MAPL_RUNIV/1000., airdens, t, rh2, delp, DU, &
864893
SS, self%rmedDU*1.e-6, self%rmedSS*1.e-6, &
865894
self%fnumDU, self%fnumSS, self%km, self%klid, &
866895
self%cdt, MAPL_GRAV, fMassHNO3, fMassNO3, NO3an1, NO3an2, &
867896
NO3an3, HNO3CONC, HNO3SMASS, HNO3CMASS, __RC__)
868-
! Save local copy of HNO3 for first pass through run method regardless
897+
898+
! CM: update GMI_HNO3 after nitrate processes for 2way coupling.
899+
if(self%using_GMI) then
900+
GMI_HNO3 = xhno3
901+
endif
869902

870903

871904
! NI Settling

ESMF/GOCART2G_GridComp/NI2G_GridComp/NI2G_GridComp_ExtData.yaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,4 +96,8 @@ Exports:
9696
regrid: CONSERVE
9797
sample: NI2G_sample_0
9898
variable: NO3AN3
99-
99+
GMI_HNO3:
100+
collection: /dev/null
101+
regrid: CONSERVE
102+
sample: NI2G_sample_2
103+
variable: GMI_HNO3

ESMF/GOCART2G_GridComp/NI2G_GridComp/NI2G_StateSpecs.rc

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@ category: IMPORT
3535
EMI_NH3_OC | kg m-2 s-1 | xy | N | | SKIP | ocean emissions
3636
EMI_NH3_RE | kg m-2 s-1 | xy | N | | SKIP | resedential emissions
3737
EMI_NH3_TR | kg m-2 s-1 | xy | N | | SKIP | transport emissions
38-
NITRATE_HNO3 | kg m-2 s-1 | xyz | C | | SKIP | nitrate hno3 emissions
38+
NITRATE_HNO3 | mol mol-1 | xyz | C | | SKIP | nitrate hno3 offline field
39+
GMI_HNO3 | mol mol-1 | xyz | C | | SKIP | nitrate GMI HNO3 source
3940
DU | kg kg-1 | xyz | C | 5 | OPT | Dust Mixing Ratio all bins
4041
SS | kg kg-1 | xyz | C | 5 | OPT | Sea Salt Mixing Ratio all bins
4142
SO4 | kg kg-1 | xyz | C | | OPT | Sulfate Mixing Ratio
@@ -64,10 +65,16 @@ category: EXPORT
6465
NISCACOEFRH20 | m-1 | xyz | C | size(self%wavelengths_profile) | Nitrate Scattering Coefficient - fixed RH=20%
6566
NISCACOEFRH80 | m-1 | xyz | C | size(self%wavelengths_profile) | Nitrate Scattering Coefficient - fixed RH=80%
6667
NIBCKCOEF | m-1 sr-1 | xyz | C | size(self%wavelengths_profile) | Nitrate Backscatter Coefficient
68+
NIPNO3AQV | kg m-2 s-1 | xyz | C | | 3D Nitrate Production from Aqueous Chemistry
69+
NIPNH4AQV | kg m-2 s-1 | xyz | C | | 3D Ammonium production from Aqueous Chemistry
70+
NIPNH3AQV | kg m-2 s-1 | xyz | C | | 3D Ammonia Change from Aqueous Chemistry
71+
NIPHNO3AQV | kg m-2 s-1 | xyz | C | | 3D Nitric acid Change from Aqueous Chemistry
72+
NIHTV | kg m-2 s-1 | xyz | C | 3 | 3D Nitrate Production from Het Chem (Bin %d)
6773
# ............. | ............ | ..... | ..... | ........... | ..................................
6874
NIPNO3AQ | kg m-2 s-1 | xy | N | | Nitrate Production from Aqueous Chemistry
6975
NIPNH4AQ | kg m-2 s-1 | xy | N | | Ammonium Production from Aqueous Chemistry
7076
NIPNH3AQ | kg m-2 s-1 | xy | N | | Ammonia Change from Aqueous Chemistry
77+
NIPHNO3AQ | kg m-2 s-1 | xy | N | | Nitric Acid Change from Aqueous Chemistry
7178
NIHT | kg m-2 s-1 | xy | N | 3 | Nitrate Production from Het Chem (Bin %d)
7279
NISD | kg m-2 s-1 | xy | N | 3 | Nitrate Sedimentation (Bin %d)
7380
NIDP | kg m-2 s-1 | xy | N | 3 | Nitrate Dry Deposition (Bin %d)
@@ -114,7 +121,7 @@ category: INTERNAL
114121
NO3an1 |kg kg-1 | xyz | C | MAPL_RestartOptional | T | DYNAMICS:TURBULENCE:MOIST | Nitrate size bin 001
115122
NO3an2 |kg kg-1 | xyz | C | MAPL_RestartOptional | T | DYNAMICS:TURBULENCE:MOIST | Nitrate size bin 002
116123
NO3an3 |kg kg-1 | xyz | C | MAPL_RestartOptional | T | DYNAMICS:TURBULENCE:MOIST | Nitrate size bin 003
117-
XHNO3 |kg m-2 s-1| xyz | C | | F | | buffer for NITRATE_HNO3
124+
XHNO3 |mol mol-1 | xyz | C | | F | | buffer for NITRATE_HNO3
118125

119126
#********************************************************
120127
#

ESMF/GOCART2G_GridComp/NI2G_GridComp/NI2G_instance_NI.rc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,10 @@ sigma: 2.0 2.0 2.0 2.0 2.0
3333

3434
pressure_lid_in_hPa: 0.01
3535

36+
# HNO3 from GMI
37+
using_GMI: .false.
38+
39+
3640
# SettlingSolver options
3741
# Options: 'gocart' or 'ufs'
3842
settling_scheme: 'gocart'

Process_Library/GOCART2G_Process.F90

Lines changed: 54 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5986,7 +5986,7 @@ end subroutine carbonChemLoss
59865986
! !IROUTINE: NIheterogenousChemOpt
59875987
!
59885988
! !INTERFACE:
5989-
subroutine NIheterogenousChem (NI_phet, xhno3, UNDEF, AVOGAD, AIRMW, PI, RUNIV, rhoa, tmpu, relhum, delp, &
5989+
subroutine NIheterogenousChem (NI_phet, NI_phetv, xhno3, UNDEF, AVOGAD, AIRMW, PI, RUNIV, rhoa, tmpu, relhum, delp, &
59905990
DU, SS, rmedDU, rmedSS, fnumDU, fnumSS, &
59915991
km, klid, cdt, grav, fMassHNO3, fMassNO3, nNO3an1, nNO3an2, &
59925992
nNO3an3, HNO3_conc, HNO3_sfcmass, HNO3_colmass, rc)
@@ -6009,8 +6009,8 @@ subroutine NIheterogenousChem (NI_phet, xhno3, UNDEF, AVOGAD, AIRMW, PI, RUNIV,
60096009
real, dimension(:,:,:), intent(in) :: delp ! pressure thickness [Pa]
60106010
real, pointer, dimension(:,:,:,:), intent(in) :: DU ! dust aerosol [kg/kg]
60116011
real, pointer, dimension(:,:,:,:), intent(in) :: SS ! sea salt aerosol [kg/kg]
6012-
real, dimension(:) ,intent(in) :: rmedDU ! dust aerosol radius [um]
6013-
real, dimension(:) ,intent(in) :: rmedSS ! sea salt aerosol radius [um]
6012+
real, dimension(:) ,intent(in) :: rmedDU ! dust aerosol radius [m]
6013+
real, dimension(:) ,intent(in) :: rmedSS ! sea salt aerosol radius [m]
60146014
real, dimension(:) ,intent(in) :: fnumDU ! number of dust particles per kg mass
60156015
real, dimension(:) ,intent(in) :: fnumSS ! number of sea salt particles per kg mass
60166016
integer, intent(in) :: km ! number of model levels
@@ -6022,10 +6022,11 @@ subroutine NIheterogenousChem (NI_phet, xhno3, UNDEF, AVOGAD, AIRMW, PI, RUNIV,
60226022

60236023
! !INOUTPUT PARAMETERS:
60246024
real, pointer, dimension(:,:,:), intent(inout) :: NI_phet ! Nitrate Production from Het Chem [kg/(m^2 sec)]
6025-
real, dimension(:,:,:), intent(inout) :: xhno3 ! buffer for NITRATE_HNO3 [kg/(m^2 sec)]
6025+
real, pointer, dimension(:,:,:,:), intent(inout) :: NI_phetv ! 3D Nitrate Production from Het Chem [kg/(m^2 sec)]
6026+
real, dimension(:,:,:), intent(inout) :: xhno3 ! buffer for NITRATE_HNO3 [mol mol-1]
60266027
real, pointer, dimension(:,:,:), intent(inout) :: HNO3_conc ! Nitric Acid Mass Concentration [kg/m^3]
60276028
real, pointer, dimension(:,:), intent(inout) :: HNO3_sfcmass ! Nitric Acid Surface Mass Concentration [kg/m^3]
6028-
real, pointer, dimension(:,:), intent(inout) :: HNO3_colmass ! Nitric Acid Column Mass Density [kg/m^3]
6029+
real, pointer, dimension(:,:), intent(inout) :: HNO3_colmass ! Nitric Acid Column Mass Density [kg/m^2]
60296030
real, pointer, dimension(:,:,:), intent(inout) :: nNO3an1 ! Nitrate bin 1 [kg/kg]
60306031
real, pointer, dimension(:,:,:), intent(inout) :: nNO3an2 ! Nitrate bin 2 [kg/kg]
60316032
real, pointer, dimension(:,:,:), intent(inout) :: nNO3an3 ! Nitrate bin 3 [kg/kg]
@@ -6144,11 +6145,18 @@ subroutine NIheterogenousChem (NI_phet, xhno3, UNDEF, AVOGAD, AIRMW, PI, RUNIV,
61446145
nNO3an3 = nNO3an3 + kan3 * deltahno3 * fMassNO3 / fMassHNO3
61456146

61466147
if(associated(NI_phet)) then
6147-
NI_phet(:,:,1) = (1.0 / (grav*cdt)) * sum(kan1*deltahno3*delp, dim=3)
6148-
NI_phet(:,:,2) = (1.0 / (grav*cdt)) * sum(kan2*deltahno3*delp, dim=3)
6149-
NI_phet(:,:,3) = (1.0 / (grav*cdt)) * sum(kan3*deltahno3*delp, dim=3)
6148+
NI_phet(:,:,1) = (1.0 / (grav*cdt)) * sum(kan1*deltahno3*(fMassNO3/fMassHNO3)*delp, dim=3)
6149+
NI_phet(:,:,2) = (1.0 / (grav*cdt)) * sum(kan2*deltahno3*(fMassNO3/fMassHNO3)*delp, dim=3)
6150+
NI_phet(:,:,3) = (1.0 / (grav*cdt)) * sum(kan3*deltahno3*(fMassNO3/fMassHNO3)*delp, dim=3)
61506151
end if
61516152

6153+
if(associated(NI_phetv)) then
6154+
NI_phetv(:,:,:,1) = (1.0 / (grav*cdt)) * kan1*deltahno3*(fMassNO3/fMassHNO3)*delp
6155+
NI_phetv(:,:,:,2) = (1.0 / (grav*cdt)) * kan2*deltahno3*(fMassNO3/fMassHNO3)*delp
6156+
NI_phetv(:,:,:,3) = (1.0 / (grav*cdt)) * kan3*deltahno3*(fMassNO3/fMassHNO3)*delp
6157+
end if
6158+
6159+
61526160
! Output diagnostic HNO3
61536161
! ----------------------
61546162
! Calculate the HNO3 mass concentration
@@ -6164,7 +6172,7 @@ subroutine NIheterogenousChem (NI_phet, xhno3, UNDEF, AVOGAD, AIRMW, PI, RUNIV,
61646172
HNO3_colmass(i1:i2,j1:j2) = 0.
61656173
do k = klid, km
61666174
HNO3_colmass(i1:i2,j1:j2) &
6167-
= HNO3_colmass(i1:i2,j1:j2) + xhno3(i1:i2,j1:j2,k)*delp(i1:i2,j1:j2,k)/grav
6175+
= HNO3_colmass(i1:i2,j1:j2) + xhno3(i1:i2,j1:j2,k) * fMassHNO3 / AIRMW * delp(i1:i2,j1:j2,k)/grav
61686176
end do
61696177
endif
61706178

@@ -6411,7 +6419,12 @@ function sktrs_hno3 ( tk, rh, sad, ad, radA, pi, rgas, fMassHNO3 )
64116419
p_dfkg = sqrt(3.472e-2 + 1.0/fmassHNO3)
64126420
p_avgvel = sqrt(8.0 * rgas_dp * 1000.0 / (pi_dp * fmassHNO3))
64136421

6414-
! RH factor - Figure 1 in Duncan et al. (2010)
6422+
! RH factor: rh dependent gamma for dust - references:
6423+
! Table 1 in Liu et al. J. Phys. Chem. A 2008
6424+
! doi:10.1021/jp076169h
6425+
! Figure 1 in Fairlie et al. ACP 2010
6426+
! doi:10.5194/acp-10-3999-2010
6427+
64156428
f_rh = 0.03
64166429

64176430
if (rh >= 0.1 .and. rh < 0.3) then
@@ -6428,7 +6441,6 @@ function sktrs_hno3 ( tk, rh, sad, ad, radA, pi, rgas, fMassHNO3 )
64286441
f_rh = 2.0
64296442
end if
64306443

6431-
! Following uptake coefficients of Liu et al.(2007)
64326444
gamma = gamma_hno3 * f_rh
64336445

64346446
sqrt_tk = sqrt(tk)
@@ -9546,7 +9558,8 @@ end subroutine get_HenrysLawCts
95469558

95479559
subroutine NIthermo (km, klid, cdt, grav, delp, rhoa, tmpu, rh, fMassHNO3, fMassAir, &
95489560
SO4, NH3, NO3an1, NH4a, xhno3, &
9549-
NI_pno3aq, NI_pnh4aq, NI_pnh3aq, rc)
9561+
NI_pno3aq, NI_pnh4aq, NI_pnh3aq, NI_phno3aq, &
9562+
NI_pno3aqv,NI_pnh4aqv, NI_pnh3aqv, NI_phno3aqv, rc)
95509563

95519564

95529565
! !USES:
@@ -9569,10 +9582,15 @@ subroutine NIthermo (km, klid, cdt, grav, delp, rhoa, tmpu, rh, fMassHNO3, fMass
95699582
real, dimension(:,:,:), intent(inout) :: NH3 ! Ammonia (NH3, gas phase) [kg kg-1]
95709583
real, dimension(:,:,:), intent(inout) :: NO3an1 ! Nitrate size bin 001 [kg kg-1]
95719584
real, dimension(:,:,:), intent(inout) :: NH4a ! Ammonium ion (NH4+, aerosol phase) [kg kg-1]
9572-
real, dimension(:,:,:), intent(inout) :: xhno3 ! buffer for NITRATE_HNO3 [kg m-2 sec-1]
9585+
real, dimension(:,:,:), intent(inout) :: xhno3 ! buffer for NITRATE_HNO3 [mol mol-1]
95739586
real, pointer, dimension(:,:), intent(inout) :: NI_pno3aq ! Nitrate Production from Aqueous Chemistry [kg m-2 s-1]
95749587
real, pointer, dimension(:,:), intent(inout) :: NI_pnh4aq ! Ammonium Production from Aqueous Chemistry [kg m-2 s-1]
95759588
real, pointer, dimension(:,:), intent(inout) :: NI_pnh3aq ! Ammonia Change from Aqueous Chemistry [kg m-2 s-1]
9589+
real, pointer, dimension(:,:), intent(inout) :: NI_phno3aq ! Nitric Acid Change from Aqueous Chemistry [kg m-2 s-1]
9590+
real, pointer, dimension(:,:,:), intent(inout) :: NI_pno3aqv ! 3D Nitrate Production from Aqueous Chemistry [kg m-2 s-1]
9591+
real, pointer, dimension(:,:,:), intent(inout) :: NI_pnh4aqv ! 3D Ammonium Production from Aqueous Chemistry [kg m-2 s-1]
9592+
real, pointer, dimension(:,:,:), intent(inout) :: NI_pnh3aqv ! 3D Ammonia Change from Aqueous Chemistry [kg m-2 s-1]
9593+
real, pointer, dimension(:,:,:), intent(inout) :: NI_phno3aqv ! 3D Nitric Acid Change from Aqueous Chemistry [kg m-2 s-1]
95769594

95779595
! !OUTPUT PARAMETERS:
95789596
integer, optional, intent(out) :: rc ! Error return code:
@@ -9638,6 +9656,29 @@ subroutine NIthermo (km, klid, cdt, grav, delp, rhoa, tmpu, rh, fMassHNO3, fMass
96389656
NI_pnh3aq(i,j) = NI_pnh3aq(i,j) &
96399657
+ (GNH3 / fmmr_to_conc - NH3(i,j,k)) &
96409658
* delp(i,j,k)/grav/cdt
9659+
if(associated(NI_phno3aq)) &
9660+
NI_phno3aq(i,j) = NI_phno3aq(i,j) &
9661+
+ (GNO3 / fmmr_to_conc - (xhno3(i,j,k)*fMassHNO3/fMassAir)) &
9662+
* delp(i,j,k)/grav/cdt
9663+
9664+
if(associated(NI_pno3aqv)) &
9665+
NI_pno3aqv(i,j,k) = NI_pno3aqv(i,j,k) &
9666+
+ (ANO3 / fmmr_to_conc - NO3an1(i,j,k)) &
9667+
* delp(i,j,k)/grav/cdt
9668+
if(associated(NI_pnh4aqv)) &
9669+
NI_pnh4aqv(i,j,k) = NI_pnh4aqv(i,j,k) &
9670+
+ (ANH4 / fmmr_to_conc - NH4a(i,j,k)) &
9671+
* delp(i,j,k)/grav/cdt
9672+
if(associated(NI_pnh3aqv)) &
9673+
NI_pnh3aqv(i,j,k) = NI_pnh3aqv(i,j,k) &
9674+
+ (GNH3 / fmmr_to_conc - NH3(i,j,k)) &
9675+
* delp(i,j,k)/grav/cdt
9676+
if(associated(NI_phno3aqv)) &
9677+
NI_phno3aqv(i,j,k) = NI_phno3aqv(i,j,k) &
9678+
+ (GNO3 / fmmr_to_conc - (xhno3(i,j,k)*fMassHNO3/fMassAir)) &
9679+
* delp(i,j,k)/grav/cdt
9680+
9681+
96419682

96429683
! Unit conversion back on return from thermodynamic module
96439684
NH3(i,j,k) = GNH3 / fmmr_to_conc

0 commit comments

Comments
 (0)