Skip to content

Commit

Permalink
fixed a couple bugs introduced by PR #41
Browse files Browse the repository at this point in the history
  • Loading branch information
ledm committed Aug 16, 2022
1 parent ae1abd4 commit 99e1e38
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 59 deletions.
2 changes: 1 addition & 1 deletion bgcval2/analysis_compare.py
Original file line number Diff line number Diff line change
Expand Up @@ -3996,7 +3996,7 @@ def load_yml_and_run(compare_yml, config_user):
for jobID in jobs:
analysis_timeseries(
jobID=jobID,
analysisSuite=suites[jobID],
suites=suites[jobID],
config_user=config_user
)

Expand Down
100 changes: 42 additions & 58 deletions bgcval2/analysis_timeseries.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,15 +160,15 @@ def analysis_timeseries(
The strictFileCheck switch checks that the data/model netcdf files exist.
It fails if the switch is on and the files no not exist.
analysisSuite chooses a set of fields to look at.
suites chooses a set of fields to look at.
regions selects a list of regions, default is 'all', which is the list supplied by Andy Yool.
:param jobID: the jobID
:param clean: deletes old images if true
:param annual: Flag for monthly or annual model data.
:param strictFileCheck: CStrickt check for model and data files. Asserts if no files are found.
:param analysisSuite: Which data to analyse, ie level1, physics only, debug, etc
:param suites: Which data to analyse, ie level1, physics only, debug, etc
:param regions:
"""
Expand Down Expand Up @@ -1165,14 +1165,7 @@ def caldiafrac(nc, keys):
'units': 'mmol O2/m^3'
}

if analysisSuite.lower() == 'spinup':
av[name]['layers'] = layerList
else:
av[name]['layers'] = [
'Surface',
'500m',
'1000m',
] #layerList
av[name]['layers'] = layerList
av[name]['regions'] = regionList
av[name]['metrics'] = metricList

Expand Down Expand Up @@ -1669,26 +1662,26 @@ def convertmeqm3TOumolkg(nc, keys):
av[name]['datadetails'] = {'name': '', 'units': ''}
av[name]['dataFile'] = ''
av[name]['datasource'] = ''
if analysisSuite.lower() == 'fast':
av[name]['Dimensions'] = 2
av[name]['modeldetails'] = {
'name': name,
'vars': [
'OCN_PH',
],
'convert': ukp.NoChange,
'units': 'pH',
}
else:
av[name]['Dimensions'] = 3
av[name]['modeldetails'] = {
'name': name,
'vars': [
'PH3',
],
'convert': ukp.NoChange,
'units': 'pH',
}
# if analysisSuite.lower() == 'fast':
# av[name]['Dimensions'] = 2
# av[name]['modeldetails'] = {
# 'name': name,
# 'vars': [
# 'OCN_PH',
# ],
# 'convert': ukp.NoChange,
# 'units': 'pH',
# }
# else:
av[name]['Dimensions'] = 3
av[name]['modeldetails'] = {
'name': name,
'vars': [
'PH3',
],
'convert': ukp.NoChange,
'units': 'pH',
}
#av[name]['datadetails'] = {'name': name, 'vars':['Alk',], 'convert': convertmeqm3TOumolkg,'units':'meq/m^3',}

av[name]['layers'] = [
Expand Down Expand Up @@ -3009,20 +3002,15 @@ def meanLandMask(nc, keys):
'units': 'degrees C'
}

tregions = [
'Global', 'ignoreInlandSeas', 'Equator10', 'AtlanticSOcean',
'SouthernOcean', 'ArcticOcean', 'Remainder',
'NorthernSubpolarAtlantic', 'NorthernSubpolarPacific', 'WeddelSea',
'Cornwall'
]
tregions.extend(PierceRegions)
#tregions = ['Global',]
if analysisSuite.lower() == 'spinup':
av[name]['layers'] = layerList
av[name]['regions'] = regionList
else:
av[name]['layers'] = layerList
av[name]['regions'] = tregions
#tregions = [
# 'Global', 'ignoreInlandSeas', 'Equator10', 'AtlanticSOcean',
# 'SouthernOcean', 'ArcticOcean', 'Remainder',
# 'NorthernSubpolarAtlantic', 'NorthernSubpolarPacific', 'WeddelSea',
# 'Cornwall'
#]
#tregions.extend(PierceRegions)
av[name]['layers'] = layerList
av[name]['regions'] = regionList
av[name]['metrics'] = metricList

#try:
Expand Down Expand Up @@ -3070,18 +3058,14 @@ def meanLandMask(nc, keys):
'units': 'PSU'
}

salregions = [
'Global', 'ignoreInlandSeas', 'Equator10', 'AtlanticSOcean',
'SouthernOcean', 'ArcticOcean', 'Remainder',
'NorthernSubpolarAtlantic', 'NorthernSubpolarPacific', 'WeddelSea'
]
salregions.extend(PierceRegions)
if analysisSuite.lower() in ['spinup', 'salinity']:
av[name]['layers'] = layerList
av[name]['regions'] = regionList
else:
av[name]['layers'] = layerList
av[name]['regions'] = salregions
#salregions = [
# 'Global', 'ignoreInlandSeas', 'Equator10', 'AtlanticSOcean',
# 'SouthernOcean', 'ArcticOcean', 'Remainder',
# 'NorthernSubpolarAtlantic', 'NorthernSubpolarPacific', 'WeddelSea'
#]
#salregions.extend(PierceRegions)
av[name]['layers'] = layerList
av[name]['regions'] = regionList
av[name]['metrics'] = metricList

av[name]['datasource'] = 'WOA'
Expand Down Expand Up @@ -4565,7 +4549,7 @@ def singleTimeSeriesProfile(jobID, key):
if key in FullDepths:
analysis_timeseries(
jobID=jobID,
analysisSuite=[
suites=[
key,
],
)
Expand All @@ -4577,7 +4561,7 @@ def singleTimeSeries(
):
# try:
analysis_timeseries(jobID=jobID,
analysisSuite=[
suites=[
key,
],
strictFileCheck=False) #clean=1)
Expand Down

0 comments on commit 99e1e38

Please sign in to comment.