Skip to content

Commit

Permalink
Update HISTORY and fix missing zmin args in meso CO calculation
Browse files Browse the repository at this point in the history
  • Loading branch information
joshua-laughner committed May 31, 2023
1 parent f540d19 commit 7a30fa0
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 3 deletions.
21 changes: 21 additions & 0 deletions HISTORY.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,27 @@

## v1.1.8

Another minor update to address issues arising from running with GEOS IT.

1. Download URLs for GEOS IT updated to latest product.
2. Solves an issue running the satellite interface (`oco`, `gosat`, or `geocarb` subcommands)
with 3 GEOS IT input. The interpolators created for the GEOS IT files are large enough that
three cannot be passed between threads in Python 3.6 due to a limit on the number of bytes
that the Python 3.6 multiprocessing module can pickle. This is fixed by Python 3.10 at the
latest, but getting Python 3.10 and required numerical dependencies to reproduce the Python
3.6 results to numerical precision was not possible. Therefore, as a workaround, if the
satellite interface detects that it is running on Python 3.9 or earlier, it will pickle the
interpolators as separate files and load them back in from the threads when `--nprocs` is not
0.

There are two other aspects to this release:

1. This is the first release that can be run on Python 3.10 and has the changes needed to run
the satellite interface with GEOS IT files. v1.1.7 didn't have those GEOS IT changes and
v1.1.5d was not compatible with Python 3.6.
2. The unit testing code now ignores the GINPUT_VERSION value in the `.vmr` file headers; this
saves us from needing to update the test input files with each version if there should not
be changes in the output.

## v1.1.7

Expand Down
9 changes: 6 additions & 3 deletions ginput/priors/tccon_priors.py
Original file line number Diff line number Diff line change
Expand Up @@ -2705,8 +2705,10 @@ def calculate_meso_co(alt_profile, eqlat_profile, pres_profile, temp_profile, pr
co_alts = ds['altitude'][:]

# In the LUT, nair is assumed to be the same for every profile (because pressure is) so we don't need to interpolate
# anything before we calculate the effective vertical path we'll use to integrate the CO profiles
vpath = mod_utils.effective_vertical_path(co_alts.data, nair=co_nair.data)
# anything before we calculate the effective vertical path we'll use to integrate the CO profiles.
# Since we only care about the mesosphere, we'll just use zmin = 0 for all calculations (it won't affect anything
# except the level about the surface).
vpath = mod_utils.effective_vertical_path(co_alts.data, zmin=0.0, nair=co_nair.data)
plev = co_nd.plev
prof_doy = mod_utils.day_of_year(prof_date)
# Unlike the extra strat CO, we don't need the CO on the same levels as any existing profile, we want it on its
Expand All @@ -2722,7 +2724,8 @@ def calculate_meso_co(alt_profile, eqlat_profile, pres_profile, temp_profile, pr
meso_co_col = np.sum(vpath[xx_meso] * 1e5 * cmam_co_prof[xx_meso])

# Now we need the effective vertical path for the top level of the actual CO profile.
top_prior_vpath = mod_utils.effective_vertical_path(z=alt_profile, p=pres_profile, t=temp_profile)[-1]
# Again, the actual value of zmin does not matter here so we just use 0.
top_prior_vpath = mod_utils.effective_vertical_path(z=alt_profile, p=pres_profile, t=temp_profile, zmin=0.0)[-1]

# So we can calculate the number density and then the mixing ratio (convert to ppb) that would result from putting
# the CO column above the top level into the top level with the effective path length that we calculated and an
Expand Down

0 comments on commit 7a30fa0

Please sign in to comment.