Add mpas analysis model vs model#772
Conversation
This merge adds zppy config options: * `reference_data_path` -- the base path to a previously run zppy "control" (reference) run (if any) * `test_data_path` -- the base path to a previously run zppy "main" (test) run (if any) * `ref_ts_years`, `ref_climo_years`, `ref_enso_years` -- the range of years for time series, climatologies and ENSO indices if different from the "main" run. Thise are needed to be able to find the config file for the control (reference) run zppy finds the MPAS-Analysis config file use for the "control" and optionally the "main" runs, using them in the MPAS-Analsyis config file for the new zppy run.
1f286d3 to
cc926a5
Compare
|
@forsyth2, would you like me to include bumping the minor version here? I assume you might want to hold off and bundle various minor updates together but let me know. |
TestingI created a control run in: closely based on the example config file for that simulation. I disabled all analysis other than MPAS-Analysis Then, I set up a main run in: pointing to the control run as the I then reran the main run in: pointing to my MPAS-Analysis branch with the bug fix. This time, all analysis ran successfully and the comparison output can be seen at: |
|
@forsyth2 and @erinethomas, this is ready for you to have a look at. |
|
The bug in the ENSO model vs. model analysis is unfortunate and zppy users will either have to point to their own environment with the latest MPAS-Analysis from the The issue will, of course, be fixed in the next E3SM-Unified. |
No, I usually make specific PRs for that (e.g., the last version bump PR).
Are we trying to have this feature available for use before the next E3SM Unified environment is ready? We can make a dev environment based on
Great, thank you for working on this! I should be able to do a review today. |
forsyth2
left a comment
There was a problem hiding this comment.
@xylar From visual inspection, this all looks right. Thanks for adding documentation as well.
I see you tested yourself, but I would still like to add integration tests (like e3sm_diags atm_monthly_180x360_aave_mvm task in the v3 test cfg). I can add those as a new commit.
I made some progress on that today; I'm hoping to make more progress tomorrow. |
I have been maintaining a zppy development environment for v3.HR to leverage the latest zppy changes, and advanced users can create their own zppy development environment to use these new features as well. I don’t have a strong preference on whether zppy should have a midterm release; since we are not planning a midterm release for Unified, a zppy release is not strictly necessary. |
@chengzhuzhang Ok great; in that case, it's probably not worth the trouble of doing an intermediate release. Thanks! |
|
@xylar I've been trying to add a test, but I keep running into issues. Updating the test cfg
(It's an auto-generated file, which is why My latest test of this branch ran with: Your test zppy cfg has: So, a few notes:
That file also notes: Taken together, it's clear the model-vs-model Question 1: It appears both Question 2: You're not setting Setting up a model-vs-model test in a repeatable wayPoint 2 above makes sense in real-world use cases, since For the I suppose the equivalent thing to do here would be to set More closely matching your use caseEven just using cd /lcrc/group/e3sm/ac.forsyth2/zppy_weekly_comprehensive_v3_output/test_pr772_mpas_mvm_try5/v3.LR.historical_0051/post/scripts
grep -v "OK" *status
# mpas_analysis_mvm_ts_1985-1989_climo_1985-1989_vs_ref_ts_1850-2014_climo_1985-2014.status:ERROR (1)
# mpas_analysis_mvm_ts_1985-1995_climo_1990-1995_vs_ref_ts_1850-2014_climo_1985-2014.status:WAITING 1125661
emacs mpas_analysis_mvm_ts_1985-1989_climo_1985-1989_vs_ref_ts_1850-2014_climo_1985-2014.o1125660
# The following commands may be helpful:
# cd /lcrc/group/e3sm/ac.forsyth2/zppy_weekly_comprehensive_v3_output/test_pr772_mpas_mvm_try5/v3.LR.historical_0051/post/scripts/../analysis/mpas_analysis/ts_1985-1989_climo_1985-1989/logs
# grep Error *.log
cd /lcrc/group/e3sm/ac.forsyth2/zppy_weekly_comprehensive_v3_output/test_pr772_mpas_mvm_try5/v3.LR.historical_0051/post/scripts/../analysis/mpas_analysis/ts_1985-1989_climo_1985-1989/logs
grep Error *.log
# indexNino34.log:ValueError: could not broadcast input array from shape (5,) into shape (1,)
# timeSeriesOHCAnomaly_computeAnomaly.log: raise ValueError('The data set contains no Time entries between '
# timeSeriesOHCAnomaly_computeAnomaly.log:ValueError: The data set contains no Time entries between dates 1850-01-01 00:00:00 and 1850-12-31 23:59:59.
# timeSeriesSalinityAnomaly_computeAnomaly.log: raise ValueError('The data set contains no Time entries between '
# timeSeriesSalinityAnomaly_computeAnomaly.log:ValueError: The data set contains no Time entries between dates 1850-01-01 00:00:00 and 1850-12-31 23:59:59.
# timeSeriesSSHAnomaly_computeAnomaly.log: raise ValueError('The data set contains no Time entries between '
# timeSeriesSSHAnomaly_computeAnomaly.log:ValueError: The data set contains no Time entries between dates 1850-01-01 00:00:00 and 1850-12-31 23:59:59.
# timeSeriesTemperatureAnomaly_computeAnomaly.log: raise ValueError('The data set contains no Time entries between '
# timeSeriesTemperatureAnomaly_computeAnomaly.log:ValueError: The data set contains no Time entries between dates 1850-01-01 00:00:00 and 1850-12-31 23:59:59.
That explains the It looks like 1850 data is missing. Looking at ls /lcrc/group/e3sm/ac.xylar/zppy/mpas_analysis_model_vs_model/v3.LR.historical_0051/post/analysis/mpas_analysis/
# ts_1850-2014_climo_1985-2014
ls /lcrc/group/e3sm/ac.xylar/zppy/mpas_analysis_model_vs_model/v3.LR.historical_0051/post/analysis/mpas_analysis/cfg/
# mpas_analysis_ts_1850-2014_climo_1985-2014.cfgQuestion 3: I'm not sure why I'm still running into errors, even using an explicit I should note that the Summary notesLet me know if it would be easier to discuss this in a short meeting. I mainly just want to make sure we're not introducing a major new feature without also merging an accompanying test. I'll try to read up more on how to use MPAS-Analysis as well. Thanks! |
|
@forsyth2, your message came in on a Friday and I guess I forgot about it. Sorry about that.
Thanks you for pointing out this issue. It clearly needs to be fixed. I agree with you that it is important that the "control" or "reference" run can be generated first in the same zppy run so it should not have to exist already at zppy launch. I will think about the best solution, likely just moving the check to runtime (presumably already present in MPAS-Analysis in any case).
The idea is that there are 2 common modes of running model-vs-model analysis. In one case, you have already run the analysis on both the "main" or "test" analysis run and the "control" or "reference" run because you wanted the comparison with observations to be available. This is pretty common, and in this case you can save a lot of time in MPAS-Analysis by pointing to both runs -- all the time is spent plotting, and little other computation is required. In another mode, you don't care about the model vs. obs run for the "main" or "test" run, you just want to jump straight to model vs. model. In this situation, you just omit the Does that help? In your test script, you refer to my run: I hope this was a temporary test, as I have no intention of preserving these files (indeed, I have already deleted them because I was close to my quota on scratch space). Instead, this needs to refer to the location where the [[standard]] run will be output. If it isn't easy to know that location in advance, we need to have some kind of a placeholder that signals to zppy that it needs to fill in that location based on another run in its workflow. The same would presumably be needed for the test_data_path. The anomaly errors you are seeing are because you have set: This year is not available in the data, which is an invalid configuration for MPAS-Analysis. The anomaly year must be present in the source data or it is simply not possible to compute anomalies.
I believe it is because of the incorrect anomaly year above. |
|
I tried to make headway on this today but wasn't able to access my home directory after logging in to Chrysalis. hopefully, it will be resolved later today. |
And the same for `test_data_path`.
Same with `test_data_path`. No longer check if the config file exists, as it may be generated at runtime.
This function has been broken into 7 helper functions.
Within that subdirectory, each gets a unique subdirectory.
|
@forsyth2, I believe I have fixed the issues you brought up. Thank you for thinking about them and for testing. I used the following two config files in my testing. I waited for the jobs from the first zppy run to finish before launching the second: # This is an example zppy v3.1.0 configuration file for Chrysalis.
# zppy v3.1.0 is included in E3SM Unified 1.12.
#
# NOTE: This configuration generates approximately 220 tasks/jobs when fully enabled.
# Users should only enable the tasks and time periods they need based on their specific
# analysis requirements to reduce computational load and queue time.
[default]
# Change these two paths to include your username instead
# You can also change these to match your preferred directory structure
output = /lcrc/group/e3sm/ac.xylar/zppy/mpas_analysis_model_vs_model/v3.LR.historical_0051
www = /lcrc/group/e3sm/public_html/diagnostic_output/ac.xylar/zppy/mpas_analysis_model_vs_model/v3.LR.historical_0051
# Other paths
input = /lcrc/group/e3sm2/ac.wlin/E3SMv3/v3.LR.historical_0051
# zppy auto-determines and sources latest e3sm-unified on each supported machine with environment_commands commented out.
#environment_commands = "source /lcrc/soft/climate/e3sm-unified/load_latest_e3sm_unified_chrysalis.sh"
# For testing Unified rc:
#environment_commands = "source /lcrc/soft/climate/e3sm-unified/test_e3sm_unified_1.12.0rc2_chrysalis.sh"
# Other parameters:
campaign = "water_cycle"
case = v3.LR.historical_0051
partition = compute
[mpas_analysis]
active = True
environment_commands = "source /home/ac.xylar/chrysalis/miniforge3/etc/profile.d/conda.sh && conda activate mpas_analysis_dev"
anomalyRefYear = 1985
mesh = "IcoswISC30E3r5"
parallelTaskCount = 32
shortTermArchive = True
walltime = "2:00:00"
[[ reference ]]
ts_years = "1985-1989",
climo_years = "1985-1989",
enso_years = "1985-1989",
[[ test ]]
ts_years = "1985-1995",
climo_years = "1990-1995",
enso_years = "1990-1995",
[[ mvm ]]
reference_data_path = [[ reference ]]
test_data_path = [[ test ]]# This is an example zppy v3.1.0 configuration file for Chrysalis.
# zppy v3.1.0 is included in E3SM Unified 1.12.
#
# NOTE: This configuration generates approximately 220 tasks/jobs when fully enabled.
# Users should only enable the tasks and time periods they need based on their specific
# analysis requirements to reduce computational load and queue time.
[default]
# Change these two paths to include your username instead
# You can also change these to match your preferred directory structure
output = /lcrc/group/e3sm/ac.xylar/zppy/mpas_analysis_model_vs_model/v3.LR.historical_0091_el_nino_fix
www = /lcrc/group/e3sm/public_html/diagnostic_output/ac.xylar/zppy/mpas_analysis_model_vs_model/v3.LR.historical_0091_el_nino_fix
# Other paths
input = /lcrc/group/e3sm2/ac.wlin/E3SMv3/v3.LR.historical_0091
# zppy auto-determines and sources latest e3sm-unified on each supported machine with environment_commands commented out.
#environment_commands = "source /lcrc/soft/climate/e3sm-unified/load_latest_e3sm_unified_chrysalis.sh"
# For testing Unified rc:
#environment_commands = "source /lcrc/soft/climate/e3sm-unified/test_e3sm_unified_1.12.0rc2_chrysalis.sh"
# Other parameters:
campaign = "water_cycle"
case = v3.LR.historical_0091
partition = compute
[mpas_analysis]
active = True
environment_commands = "source /home/ac.xylar/chrysalis/miniforge3/etc/profile.d/conda.sh && conda activate mpas_analysis_dev"
anomalyRefYear = 1985
climo_years = "1985-2014",
enso_years = "1985-2014",
mesh = "IcoswISC30E3r5"
parallelTaskCount = 32
shortTermArchive = True
ts_years = "1985-2014",
walltime = "4:00:00"
reference_case = v3.LR.historical_0051
reference_data_path = "/lcrc/group/e3sm/ac.xylar/zppy/mpas_analysis_model_vs_model/v3.LR.historical_0051"
ref_ts_years = "1985-1995",
ref_climo_years = "1990-1995",
ref_enso_years = "1990-1995",The first performs model-vs-model analysis within a given simulation (relatively uncommon but practical for testing). Results are here: The second performs a more typical model vs model run (no model vs. obs, though, which is also uncommon). Results are here: |
|
As you will see, I added support for references like I also needed to put the output in an I'm open to suggestions on how to revise any of this. |
|
I ran into 3 more MPAS-Analysis bugs that I'm working to fix: |
@xylar No worries, sorry as well for getting back to this late. Do we just want this done by the release candidate deadline or do we need it earlier? I might have some time today/tomorrow to revise the integration test file, but after that I don't expect much opportunity to work on this for a couple weeks.
Yes, thanks, that explains why
Correct, I was just trying to get the test to work in any capacity. I try to avoid having external depdencies like that in the tests.
Ah ok, in retrospect that does make sense since the
Thank you for working on these!! I will work on revising my testing file accordingly.
Thanks! |
I think it would be nice not to lose momentum on this but there's no need to have it finished before the next RC. |
|
The new commit above adds the test case to the |
forsyth2
left a comment
There was a problem hiding this comment.
@xylar I did a high-level visual inspection of the code changes and I was able to generate model-vs-model output, so I think this should be good to merge. Thanks!
|
Okay, great, @forsyth2, feel free to merge when you're ready. I don't have the privileges. Thanks for working on this and for the review! |
|
I'll use a merge commit (rather than squash and merge) here since there were actually a decent number of changes + commits from multiple people. |
Summary
Objectives:
Issue resolution:
mpas-analysis#771Select one: This pull request is...
Please fill out either the "Small Change" or "Big Change" section (the latter includes the numbered subsections), and delete the other.
Small Change