diff --git a/DAC/calculate_inverse_barometer.py b/DAC/calculate_inverse_barometer.py index 775218f..b8d67bd 100644 --- a/DAC/calculate_inverse_barometer.py +++ b/DAC/calculate_inverse_barometer.py @@ -92,8 +92,8 @@ def ncdf_pressure(fileID, VARNAME, TIMENAME, MEAN, OCEAN, AREA): # invalid value fill_value = fileID.variables[VARNAME]._FillValue # allocate for pressure fields - SLP = np.ma.zeros((24,ny,nx), fill_value=fill_value) - TPX = np.ma.zeros((24,ny,nx), fill_value=fill_value) + SLP = np.ma.zeros((24,ny,nx), dtype=np.float32, fill_value=fill_value) + TPX = np.ma.zeros((24,ny,nx), dtype=np.float32, fill_value=fill_value) # calculate total area of reanalysis ocean # ocean pressure points will be based on reanalysis mask ii,jj = np.nonzero(OCEAN) @@ -253,7 +253,6 @@ def calculate_inverse_barometer(base_dir, MODEL, YEAR=None, RANGE=None, regex_years = r'\d{4}' if (YEAR is None) else r'|'.join(map(str,YEAR)) rx = re.compile(regex_pattern.format(regex_years), re.VERBOSE) input_files = [fi for fi in ddir.iterdir() if rx.match(fi.name)] - print(ddir) # for each reanalysis file for INPUT_FILE in sorted(input_files): # extract parameters from filename diff --git a/grounding_zones/utilities.py b/grounding_zones/utilities.py index de8fca2..4680d2c 100644 --- a/grounding_zones/utilities.py +++ b/grounding_zones/utilities.py @@ -20,6 +20,7 @@ """ from __future__ import annotations +import sys import ssl import pathlib import inspect