Skip to content

Conversation

@pwolfram
Copy link
Contributor

This merge migrates postprocess-computed meridional overturning circulation calculations.

Previously numpy commands were not valid to specify config file
settings.  Now, numpy commands can be used as the values
in config key-value pairs.  This is beneficial because long
arrays are now easily specified, e.g., np.arange(0,1,100).
Takes existing moc.py workflow and integrates it into
MPAS-Analysis.
@pwolfram
Copy link
Contributor Author

This follows directly from @mark-petersen's moc.py script. Note, the config file used to test following the tutorial is at https://gist.github.com/dad27a6991e17866e6ef4f3e21263230. This presumes that #92 to allow numpy usage in config files has already been fulfilled.

@pwolfram
Copy link
Contributor Author

Note, per @xylar's earlier request the hard-coded file names will likely need to be fixed during the review unless @mark-petersen would prefer this script be handled differently.

@xylar
Copy link
Collaborator

xylar commented Jan 31, 2017

@pwolfram, this seems like a nice start. But currently it seems too much like a direct translation of @mark-petersen's script and doesn't take enough advantage of the analysis infrastructure.

I'm only part way through looking over the code so I'll try to give some more comments over the next few days as I have time.

@pwolfram
Copy link
Contributor Author

@xylar, I attempted to make this as faithful to the moc.py script as possible to respect @mark-petersen's code but am happy to make edits to meld this more into the MPAS-Analysis framework.

@xylar
Copy link
Collaborator

xylar commented Jan 31, 2017

@pwolfram, I think when we bring scripts into MPAS-Analysis, it's more important to be "faithful" to the design concept of this repo than that of the original script. I appreciate what you did as kind of a teaching tool but an important part of translating scripts to this repo is showing how files can be found without having to use paths in the config file, how times can be selected without the need for time indices, etc.

@pwolfram
Copy link
Contributor Author

@xylar, agreed. I need to update this when I get a chance.

@milenaveneziani
Copy link
Collaborator

milenaveneziani commented Feb 1, 2017

@pwolfram: thanks for doing this. I agree with @xylar that we should integrate this fully within MPAS-Analysis.
In my mind, this was the plan I envisioned for adding MOC (and this is reflected in the MPAS-Analysis roadmap on Confluence):

  1. Add script for postprocessed MOC, but for the global calculation only. Also add the timeseries part to this script (max MOC at 26.5N, where we can eventually compare with the RAPID observational array, when it makes sense to do so);
  2. Solve issue of extracting a southern boundary out of our MOCbasin regions (Add an extractor for the southern boundary of MOCs MPAS-Tools#147)
  3. Generate mask files for MOCbasins and MOCsouthernBoundary for our main MPAS meshes
  4. Add regional MOC computation to postprocessed MOC script
  5. Test MOC analysis member in ACME, both global and regional calculation
  6. Add script to plot MOC from the AM. Add option to verify whether MOC AM was turned on: if not, use postprocessed MOC script instead. Exit with a warning that no MOC can be calculated if no fields necessary to compute postprocessed MOC was saved.

So, for this PR, we would just need to address 1).

How does this sound?

Copy link
Collaborator

@xylar xylar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops, same issue here that my comments didn't get posted. Sorry about that.

[moc_postprocess]
filename = ../mpaso.hist.am.timeSeriesStats.yr100-119.avg.nc
filenamemesh = ../mpaso.rst.0002-01-01_00000.nc
filenamemask = ../EC60to30v3_SingleRegionAtlanticWTransportTransects_masks.nc
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The first two of these filenames need to be read in from the streams file like normal. In place of the third file name, I would strongly prefer that an automated process be devised for generating the mask file. Presumably this would be achieved by running scripts from the GeometricFeatures repository, and maybe also adding some geometry to that repo. I'm definitely opposed to adding any new steps where the user has to generate a resolution-specific file before calling analysis. This is precisely the kind of thing that is already a big hindrance, especially in seaice_modelvsobs.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would comment out the Atlantic mask file for now, because we want to be plotting only the global MOC for this PR (see my initial comment and point 1)).

filenamemask = ../EC60to30v3_SingleRegionAtlanticWTransportTransects_masks.nc
timeIndex = 0
horVelName = time_avg_normalVelocity
vertVelName = time_avg_vertVelocityTop
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't these two be handled through the variableMap instead of being config options?

filename = ../mpaso.hist.am.timeSeriesStats.yr100-119.avg.nc
filenamemesh = ../mpaso.rst.0002-01-01_00000.nc
filenamemask = ../EC60to30v3_SingleRegionAtlanticWTransportTransects_masks.nc
timeIndex = 0
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be a time rather than a time index?

[seaice_modelvsobs]
generate = 1

[moc_postprocess]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We probably do not need a specific section for mocPostprocess (it could just be 'MOC'), but I am OK with leaving this section name for now until we'll have the moc AM stuff in.

compare_with_obs = True
# Number of points over which to compute moving average (e.g., for monthly
# output, N_movavg=12 corresponds to a 12-month moving average window)
N_movavg = 12
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would remove the moc_timeseries section, and add everything that is in there under moc_postprocess. This is because we will want to add the MOC time series to the current script that does the MOC vertical section.

@xylar
Copy link
Collaborator

xylar commented Feb 2, 2017

@pwolfram, you will have to decide if you want this merge before #86 (which still needs some work but is getting closer). Obviously there will be a non-negligible amount of merging work needed to handle make make this module compatible with the new config layout.

@milenaveneziani
Copy link
Collaborator

Also, @pwolfram, I think it is appropriate to add the timeseries plot to this script before merging, if you are OK with the idea.
I could look into it more and suggest some related changes, if it helps.

@milenaveneziani milenaveneziani changed the title Add moc postprocess Add global moc postprocess Feb 2, 2017
@pwolfram
Copy link
Contributor Author

pwolfram commented Feb 2, 2017

@xylar and @milenaveneziani, I think it is best to wait on this until #86 and add the timeseries plot too. I don't think there is a rush on this PR.

@milenaveneziani
Copy link
Collaborator

This PR has been superseded by #139 (where the comments added here have been addressed).

@pwolfram pwolfram deleted the add_moc_postprocess branch March 24, 2017 17:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants