Skip to content

Commit

Permalink
Support doing optimal interpolation for ice thickness in pysurfex
Browse files Browse the repository at this point in the history
  • Loading branch information
joewkr committed Jan 11, 2024
1 parent 34448aa commit 2a1b240
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 0 deletions.
7 changes: 7 additions & 0 deletions pysurfex/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,13 @@ def run_first_guess_for_oi(**kwargs):
fileformat = kwargs["sd_format"]
if "sd_converter" in kwargs and kwargs["sd_converter"] is not None:
converter = kwargs["sd_converter"]
elif var == "sea_ice_thickness":
if "icetk_file" in kwargs and kwargs["icetk_file"] is not None:
inputfile = kwargs["icetk_file"]
if "icetk_format" in kwargs and kwargs["icetk_format"] is not None:
fileformat = kwargs["icetk_format"]
if "icetk_converter" in kwargs and kwargs["icetk_converter"] is not None:
converter = kwargs["icetk_converter"]
elif var == "cloud_base":
if "cb_file" in kwargs and kwargs["cb_file"] is not None:
inputfile = kwargs["cb_file"]
Expand Down
21 changes: 21 additions & 0 deletions pysurfex/cmd_parsing.py
Original file line number Diff line number Diff line change
Expand Up @@ -618,6 +618,26 @@ def parse_args_first_guess_for_oi(argv):
choices=["none", "sweclim", "swe2sd", "sdp"],
)

parser.add_argument(
"-icetk_file", type=str, default=None, help="Ice thickness file", nargs="?"
)
parser.add_argument(
"-icetk_format",
type=str,
default=None,
help="Ice thickness file format",
nargs="?",
choices=["fa"],
)
parser.add_argument(
"--icetk_converter",
type=str,
default="none",
help="",
nargs="?",
choices=["none"],
)

parser.add_argument(
"-cb_file", type=str, default=None, help="Cloud base file", nargs="?"
)
Expand Down Expand Up @@ -721,6 +741,7 @@ def parse_args_first_guess_for_oi(argv):
"air_temperature_2m",
"relative_humidity_2m",
"surface_snow_thickness",
"sea_ice_thickness",
"cloud_base",
"surface_soil_moisture",
],
Expand Down
4 changes: 4 additions & 0 deletions pysurfex/netcdf.py
Original file line number Diff line number Diff line change
Expand Up @@ -643,6 +643,7 @@ def create_netcdf_first_guess_template(
"relative_humidity_2m": "relative_humidity",
"altitude": "altitude",
"surface_snow_thickness": "surface_snow_thickness",
"sea_ice_thickness": "sea_ice_thickness",
"surface_soil_moisture": "surface_soil_moisture",
"cloud_base": "cloud_base",
"land_area_fraction": "land_area_fraction",
Expand All @@ -652,6 +653,7 @@ def create_netcdf_first_guess_template(
"relative_humidity_2m": "Screen level relative humidity (RH2M)",
"altitude": "Altitude",
"surface_snow_thickness": "Surface snow thickness",
"sea_ice_thickness": "Sea ice thickness",
"surface_soil_moisture": "Surface soil moisture",
"cloud_base": "Cloud base",
"land_area_fraction": "Land Area Fraction",
Expand All @@ -661,6 +663,7 @@ def create_netcdf_first_guess_template(
"relative_humidity_2m": "1",
"altitude": "m",
"surface_snow_thickness": "m",
"sea_ice_thickness": "m",
"surface_soil_moisture": "m3/m3",
"cloud_base": "m",
"land_area_fraction": "1",
Expand All @@ -670,6 +673,7 @@ def create_netcdf_first_guess_template(
"relative_humidity_2m": "9.96921e+36",
"altitude": "9.96921e+36",
"surface_snow_thickness": "9.96921e+36",
"sea_ice_thickness": "9.96921e+36",
"surface_soil_moisture": "9.96921e+36",
"cloud_base": "9.96921e+36",
"land_area_fraction": "9.96921e+36",
Expand Down

0 comments on commit 2a1b240

Please sign in to comment.