Skip to content

Commit

Permalink
save lat/lon grid variables from sfc_dt_atmos (#204)
Browse files Browse the repository at this point in the history
* save lat/lon grid variables from sfc_dt_atmos
  • Loading branch information
Anna Kwa authored Mar 30, 2020
1 parent f929f75 commit 906eb69
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions workflows/one_step_jobs/runfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,16 +91,27 @@
"DLWRFsfc",
"ULWRFtoa",
"ULWRFsfc",
"lat",
"lon",
"latb",
"lonb",
"area",
)


def rename_sfc_dt_atmos(sfc: xr.Dataset) -> xr.Dataset:
DIMS = {"grid_xt": "x", "grid_yt": "y", "time": "forecast_time"}
DIMS = {
"grid_xt": "x",
"grid_yt": "y",
"grid_x": "x_interface",
"grid_y": "y_interface",
"time": "forecast_time",
}
return (
sfc[list(SFC_VARIABLES)]
.rename(DIMS)
.transpose("forecast_time", "tile", "y", "x")
.drop(["forecast_time", "y", "x"])
.transpose("forecast_time", "tile", "y", "x", "y_interface", "x_interface")
.drop(["forecast_time", "y", "x", "y_interface", "x_interface"])
)


Expand Down Expand Up @@ -247,7 +258,7 @@ def post_process(
)

monitors = {
key: fv3gfs.ZarrMonitor(path, partitioner, mode="w", mpi_comm=MPI.COMM_WORLD,)
key: fv3gfs.ZarrMonitor(path, partitioner, mode="w", mpi_comm=MPI.COMM_WORLD)
for key, path in paths.items()
}

Expand Down

0 comments on commit 906eb69

Please sign in to comment.