Skip to content

Commit

Permalink
Bugfix/hemco grid precision (#267)
Browse files Browse the repository at this point in the history
* increase precision of hemco grid vars in the hemco standalone simulation to accomodate 12km resolution

* expand base vars
  • Loading branch information
laestrada authored Aug 21, 2024
1 parent 6428393 commit 5183b12
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/components/prior_component/get_hemco_grid_vars.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ def get_hemco_grid_vars(sv):
XEDGE = calc_edges(sv.lon)

if option == "YMID":
print(" ".join([f"{num:.2f}" for num in YMID]))
print(" ".join([f"{num:.5f}" for num in YMID]))
elif option == "YEDGE":
print(" ".join([f"{num:.3f}" for num in YEDGE]))
print(" ".join([f"{num:.5f}" for num in YEDGE]))
elif option == "XMIN":
XMIN = XEDGE[0]
print(XMIN)
Expand Down
3 changes: 2 additions & 1 deletion src/inversion_scripts/operators/TROPOMI_operator.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import os
import numpy as np
import xarray as xr
import pandas as pd
Expand Down Expand Up @@ -102,7 +103,7 @@ def apply_average_tropomi_operator(
jacobian_K = np.zeros([n_gridcells, n_elements], dtype=np.float32)
jacobian_K.fill(np.nan)

pertf = (
pertf = os.path.expandvars(
f'{config["OutputPath"]}/{config["RunName"]}/'
f'archive_perturbation_sfs/pert_sf_{period_i}.npz'
)
Expand Down
5 changes: 3 additions & 2 deletions src/inversion_scripts/operators/operator_utilities.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import os
import yaml
import numpy as np
import xarray as xr
import pandas as pd
import yaml
from src.inversion_scripts.utils import (
check_is_OH_element,
check_is_BC_element
Expand Down Expand Up @@ -171,7 +172,7 @@ def concat_tracers(run_id, gc_date, config, sv_elems, n_elements, baserun=False)
"""
prefix = config['OutputPath'] + '/' + config['RunName'] + '/jacobian_runs'
j_dir = f"{prefix}/{config['RunName']}_{run_id}/OutputDir"
j_dir = os.path.expandvars(f"{prefix}/{config['RunName']}_{run_id}/OutputDir")
file_stub = gc_date.strftime('GEOSChem.SpeciesConc.%Y%m%d_0000z.nc4')
dsmf = xr.open_dataset(
'/'.join([j_dir,file_stub]),
Expand Down

0 comments on commit 5183b12

Please sign in to comment.