geoschem / geos-chem

GEOS-Chem "Science Codebase" repository. Contains GEOS-Chem science routines, run directory generation scripts, and interface code. This repository is used as a submodule within the GCClassic and GCHP wrappers, as well as in other modeling contexts (external ESMs).
http://geos-chem.org
Other
167 stars 163 forks source link

[BUG/ISSUE] WetLossConv diagnostic value differs from BudgetConvectionFull #1361

Open cdholmes opened 2 years ago

cdholmes commented 2 years ago

What institution are you from?

Florida State U.

Description of the problem

The WetLossConv and BudgetConvectionFull diagnostics give different values, but they should be the same (within small numerical error). In contrast, the WetLossLS and BudgetWetDepFull diagnostics agree with high precision.

Description of troubleshooting performed

I simulated 30 minutes and then printed the global total removal of HNO3 using both diagnostics. With WetLossConv, I get 0.29158556 kg/s removed. With BudgetConvectionFull, I get 0.28948277 kg/s. These are 1% different. The equivalent diagnostics for large-scale wet scavenging agree within 1e-7.

Here's a code snippet for calculating the global sums.

import xarray as xr
wf = 'GEOSChem.WetLossConv.20190701_0000z.nc4'
bf = 'GEOSChem.Budget.20190701_0000z.nc4'
w = xr.open_dataset(wf)
b = xr.open_dataset(bf)
print(w['WetLossConv_HNO3'].sum())
print(b['BudgetConvectionFull_HNO3'].sum())

Possibly related issue

The HISTORY diagnostics are saved in qualitatively different ways for large-scale vs. convective wet scavenging. Perhaps this is related to the problem.

In wetscav_mod (large-scale precip), the diagnostic values are summed across time steps. Here's an example: https://github.com/geoschem/geos-chem/blob/7e51a0674aba638c8322fef493ac9251095e8cf4/GeosCore/wetscav_mod.F90#L4176-L4178

In convection_mod (convective precip), the diagnostic values are /not/ cumulative across time steps. Here's an example. https://github.com/geoschem/geos-chem/blob/7e51a0674aba638c8322fef493ac9251095e8cf4/GeosCore/convection_mod.F90#L310

Why is one diagnostic cumulative and the other is not?

GEOS-Chem version

13.3.4

Description of modifications

No code modifications. For testing expediency, I ran simulations with transport and chemistry off.

Log files

Log files not relevant

Software versions

lizziel commented 2 years ago

The large-scale wetloss diagnostic (State_Diag%WetLossLS) is summed over wetloss processes (rainout, washout, reevaporation) but not over timesteps. It is set to zero whenever Do_WetDep is called (see here), and the value is then cumulatively added to in Do_WashOut_Only, Do_RainOut_Only, Do_Complete_Reevap, and Do_WashOut_At_Sfc, all of which are called in Do_WetDep within the call to WetDep. This explains why it is consistent with the wet deposition budget diagnostic which is computed using values at the start and end of Do_WetDep.

Regarding the WetLossConv diagnostic, I will dig into the code to figure out why it does not match up with the budget diagnostic. If it is a bug we can put a fix into the model. Stay tuned.

lizziel commented 2 years ago

Hi @cdholmes, I want to give you a heads up there may be a delay in getting to this issue. I am labeling it "never stale" so that it does not get lost. If you end up looking more closely at the problem let us know here.