Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug fixes for time series conservation task #1014

Merged
merged 3 commits into from
Jul 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions mpas_analysis/default.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,10 @@ fitColor1 = tab:blue
# land_ice_mass_flux_components : Mass fluxes from land ice
plotTypes = ['absolute_energy_error', 'absolute_salt_error', 'total_mass_change']

# Number of points over which to compute moving average(e.g., for monthly
# output, movingAveragePoints=12 corresponds to a 12-month moving average
# window)
movingAveragePoints = 365

[index]
## options related to producing nino index.
Expand Down
8 changes: 5 additions & 3 deletions mpas_analysis/ocean/conservation.py
Original file line number Diff line number Diff line change
Expand Up @@ -468,9 +468,11 @@ def _make_plot(self, plot_type):
lineStyles.append(lineStylesBase[index])

lineWidths = [3 for i in fields]
if config.has_option('timeSeries', 'movingAveragePoints'):
movingAveragePoints = config.getint('timeSeries',
'movingAveragePoints')
if config.has_option('timeSeriesConservation', 'movingAveragePoints'):
# We assume here that movingAveragePoints is given in months
# and conservation output has daily frequency
movingAveragePoints = \
config.getint('timeSeriesConservation', 'movingAveragePoints')
else:
movingAveragePoints = None

Expand Down
3 changes: 2 additions & 1 deletion mpas_analysis/shared/io/mpas_reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,8 @@ def _parse_dataset_time(ds, inTimeVariableName, calendar,
timeStrings = [''.join(xtime.astype('U')).strip()
for xtime in timeVar.values]
for i, timeString in enumerate(timeStrings):
if timeString[8:] == '15_00:00:00' and i +1 < len(timeStrings):
if timeString == '0000-01-15_00:00:00' and \
i + 1 < len(timeStrings):
timeStrings[i] = f'{timeStrings[i + 1][:7]}-01_00:00:00'
days = string_to_days_since_date(dateString=timeStrings,
referenceDate=referenceDate,
Expand Down
2 changes: 1 addition & 1 deletion suite/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def main():
simulation = '20200305.A_WCYCL1850.ne4_oQU480.anvil'
mesh = 'QU480'
else:
simulation = '20230406.GMPAS-IAF-ISMF.T62_oQU240wLI.chrysalis'
simulation = '20240718.GMPAS-IAF-PISMF.T62_oQU240wLI.chrysalis'
mesh = 'oQU240wLI'
if machine in ['anvil', 'chrysalis']:
input_base = '/lcrc/group/e3sm/public_html/diagnostics/mpas_analysis/example_simulations'
Expand Down