Skip to content
Snippets Groups Projects
Commit f783572c authored by Oriol Tintó's avatar Oriol Tintó
Browse files

Trying to convert the analysis to netcdf.

parent 254fc97c
No related branches found
No related tags found
No related merge requests found
Pipeline #19156 canceled
......@@ -53,8 +53,7 @@ interpolate_SST "${DESTINATION_GRID}" "${SST_FORCING}" "${INTERPOLATED_SST}"
# Integrate sst to extpar
integrate_sst_to_extpar "${INTERPOLATED_SST}" "${EXTERNAL_PARAMETERS_FILE}"
#cp ${EXTERNAL_PARAMETERS_FILE} extpar.nc
# Integrate sst to analysis
# integrate_sst_to_analysis "${INTERPOLATED_SST}" "${ANALYSIS_FILE}"
integrate_sst_to_analysis "${INTERPOLATED_SST}" "${ANALYSIS_FILE}"
......@@ -123,10 +123,10 @@ import numpy as np
os.environ['ECCODES_GRIB_NO_INDEX'] = '1'
# Open files
with read("${ANALYSIS_FILE}") as ds, read("${INTERPOLATED_SST}") as sst_ds:
date=ds.time.values
day_of_year = int((date - date.astype('datetime64[Y]')) / np.timedelta64(1, 'D'))
# Replace analysis T_SEA with info from the sst_clim file.
ds["T_SEA"]= sst_ds["T_SEA"].isel(time=day_of_year+1)
# date=ds.time.values
# day_of_year = int((date - date.astype('datetime64[Y]')) / np.timedelta64(1, 'D'))
# Replace analysis T_SEA with info from the sst_clim file.
# ds["T_SEA"]= sst_ds["T_SEA"].isel(time=day_of_year+1)
ds.to_netcdf("analysis.nc")
END
......
......@@ -19,10 +19,10 @@ ATMOSPHERE_NAMELIST_PATH = Path("%simulation.namelist_paths.atmosphere%")
MASTER_NAMELIST_PATH = Path("%simulation.namelist_paths.master%")
# Get first-guess and analysis names:
analysis_filename = (RUNDIR / "igaf*.m*.grb")
analysis_filename = analysis_filename.parent.glob(analysis_filename.name).__next__()
analysis_filename = analysis_filename.name
# analysis_filename = "analysis.nc"
# analysis_filename = (RUNDIR / "igaf*.m*.grb")
# analysis_filename = analysis_filename.parent.glob(analysis_filename.name).__next__()
# analysis_filename = analysis_filename.name
analysis_filename = "analysis.nc"
first_guess_filename = (RUNDIR / "igfff00030000.m*.grb").resolve()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment