-
Notifications
You must be signed in to change notification settings - Fork 0
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
Added several Mission atlantic developments and a shelve fixer tool #121
Open
ledm
wants to merge
19
commits into
main
Choose a base branch
from
mission_atlantic_dev
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
d689b03
So much MA work.
ledm 43e52db
Update bgcval2_make_report.py
ledm 31a7bb0
Updated to woa 18.
ledm ea9d2fc
add ma files.
ledm d63c66d
Removed hard link to SENEMO in files.
ledm 7b25785
Added new mission atlantic code.
ledm 7f645d5
Update .gitignore
ledm dd88b1a
Added new paths to remove linking of MA runs.
ledm c7cd5b0
Merge remote-tracking branch 'origin/main' into mission_atlantic_dev
ledm a1d0407
fixed error when file is missing
ledm 290ee4d
added metric to path
ledm 6b06595
Merge remote-tracking branch 'origin/main' into mission_atlantic_dev
ledm 8ec9ecb
Added MA fixes and new revert shelves tool.
ledm b3af6e4
added new files and command revert
ledm 918c6c8
added documentation
ledm bf27519
Merge remote-tracking branch 'origin/main' into mission_atlantic_dev
ledm e9d9deb
removed .idea files.
ledm c78c1ea
removed old runs
ledm d8a8884
Apply suggestions from code review
ledm File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -244,7 +244,6 @@ def TwentySixNorth(nc,keys,**kwargs): | |||||||||||||||||||
|
||||||||||||||||||||
assert 0 | ||||||||||||||||||||
|
||||||||||||||||||||
|
||||||||||||||||||||
zv = np.ma.array(nc.variables[keys[0]][..., latslice26Nnm, :]) # m/s | ||||||||||||||||||||
atlmoc = np.array(np.zeros_like(zv[0, :, :, 0])) | ||||||||||||||||||||
print('TwentySixNorth:', e3v_AMOC26N.shape, atlmoc.shape, zv.shape) | ||||||||||||||||||||
|
@@ -290,11 +289,28 @@ def twentysixnorth025(nc,keys,**kwargs): | |||||||||||||||||||
depths = np.ma.masked_where(thkcello.mask + np.abs(depths)<500., depths) # masked above 500m depth. | ||||||||||||||||||||
|
||||||||||||||||||||
e1v = e1v_AMOC26N[:,None, :, :] | ||||||||||||||||||||
flux = vo * depths * e1v_AMOC26N[:,None, :, :]/1.E06 | ||||||||||||||||||||
|
||||||||||||||||||||
moc=np.ma.zeros_like(flux) | ||||||||||||||||||||
np.ma.cumsum(flux[:,::-1], axis=1, out=moc ) # sum floor to surface | ||||||||||||||||||||
return moc.max() | ||||||||||||||||||||
# flux = vo * thkcello * e1v_AMOC26N[:,None, :, :]/1.E06 | ||||||||||||||||||||
# moc=np.ma.zeros_like(flux) | ||||||||||||||||||||
# np.ma.cumsum(flux[:,::-1], axis=1, out=moc ) # sum floor to surface | ||||||||||||||||||||
# return moc.max() | ||||||||||||||||||||
atlmoc = np.array(np.zeros_like(vo.squeeze())) | ||||||||||||||||||||
#print(atlmoc.shape, thkcello.shape, depths.shape, vo.shape, e1v_AMOC26N.shape, e3v_AMOC26N.shape) | ||||||||||||||||||||
# (75, 264) (1, 75, 1, 264) (1, 75, 1, 264) (1, 75, 1, 264) (1, 1, 264) (75, 264) | ||||||||||||||||||||
|
||||||||||||||||||||
#assert 0 | ||||||||||||||||||||
|
||||||||||||||||||||
Comment on lines
+292
to
+301
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||||||||
for (t, z, la, lo), vox in np.ndenumerate(vo): | ||||||||||||||||||||
if not vox: | ||||||||||||||||||||
continue | ||||||||||||||||||||
if not depths[t, z, la, lo] or np.ma.is_masked(depths[t, z, la, lo]): | ||||||||||||||||||||
continue | ||||||||||||||||||||
atlmoc[z, la] = atlmoc[z, la] - e1v[t, 0, la, lo] * thkcello[t, z, la, lo] * vo[t, z, la, lo] / 1.E06 | ||||||||||||||||||||
|
||||||||||||||||||||
for z in range(thkcello.shape[1] -2, 1, -1): # add from the bottom up | ||||||||||||||||||||
atlmoc[z, :] = atlmoc[z+1, :] + atlmoc[z, :] | ||||||||||||||||||||
print('AMOC:', atlmoc.max()) | ||||||||||||||||||||
return atlmoc.max() | ||||||||||||||||||||
|
||||||||||||||||||||
|
||||||||||||||||||||
|
||||||||||||||||||||
def AMOC26N(nc, keys, **kwargs): | ||||||||||||||||||||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,6 +27,7 @@ | |
|
||
""" | ||
#Standard Python modules: | ||
import os | ||
from sys import argv, exit | ||
from os.path import exists | ||
from calendar import month_name | ||
|
@@ -162,6 +163,9 @@ def testsuite_p2p( | |
# Match observations and model. | ||
# Does not produce and plots. | ||
#annual = True | ||
if not os.path.exists(av[name].get('dataFiles', '')): | ||
print('Data file missing:', name, av[name].get('dataFiles', '')) | ||
assert 0 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. come on, get rid of all this old crappe - raise an exception or continue |
||
b = matchDataAndModel(av[name]['dataFiles'], | ||
av[name]['modelFiles'], | ||
dataType=name, | ||
|
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
np.ma.masked what? That's just a generic Numpy function
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's a masked value, so that the arrays all line up corectly, even if there's no data here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that's a
<class 'numpy.ma.core.MaskedConstant'>
which is a stuffy class (that, in effect is just a--
with a value of , all you need is the value that gets masked (1e20 or -999 or whatever). Note that the fillvalue of np.ma.masked is not always what one needs be, it's 999999 so that might screw up things https://numpy.org/doc/stable/reference/maskedarray.baseclass.html