Skip to content

Commit

Permalink
Merge pull request #1014 from cbegeman/conserv-output-freq-fixes
Browse files Browse the repository at this point in the history
Bug fixes for time series conservation task
  • Loading branch information
xylar authored Jul 18, 2024
2 parents 89fe749 + 15cfd88 commit 22b15ef
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 5 deletions.
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

0 comments on commit 22b15ef

Please sign in to comment.