Skip to content

Add a daily output test case to QU240 #535

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

Merged

Conversation

xylar
Copy link
Collaborator

@xylar xylar commented Apr 23, 2020

This test case outputs the same fields as E3SM timeSeriesStatsMonthly but is meant to be cheaper to run (since it only requires a day, not a month, of simulation).

The test case will be used to make sure MPAS-Ocean output is CF compliant.

This test case outputs the same fields as E3SM timeSeriesStatsMonthly
but is meant to be cheaper to run (since it only requires a day,
not a month, of simulation).

The test case will be used to make sure MPAS-Ocean output is CF
compliant.
@xylar
Copy link
Collaborator Author

xylar commented Apr 23, 2020

@wenshanw, could you see if you can add my fork, check out this branch, build and do a test run? Here are the steps I would recommend (keeping in mind that I might have forgotten some):

git remote add xylar/MPAS-Model git@github.com:xylar/MPAS-Model.git
git fetch --all -p

Do one of the following two options:

  1. If you want to, I would recommend trying out the git worktree functionality. Do a google search to learn more:
git worktree add ../add_QU240_time_daily_mean
cd ../add_QU240_time_daily_mean
git reset --hard xylar/MPAS-Model/add_QU240_time_daily_mean
  1. If you prefer, you can just create a new branch right where you are (I'm a little rusty on this):
git checkout -b add_QU240_time_daily_mean xylar/MPAS-Model/add_QU240_time_daily_mean

From here, it's the same with either approach:

git submodule update --init --recursive
make clean
make gfortran
cd testing_and_setup/compass
./list_testcases.py | grep QU240

Figure out the numbers for the init and the daily_output_test test case.

./setup_testcase.py -n 75,76 -m runtime_definitions/mpirun.xml -f config.ocean \
    --work_dir </path/to/work/directory>

These instructions quite likely aren't perfect, so please let me know if you run into trouble or corrections are needed.

Please run the init and then the daily_output_test test cases. If everything works okay, as it did for me, you should be able to look at the results with:

ncdump -h analysis_members/mpaso.hist.am.timeSeriesStatsDaily.0001-01-01.nc | more

I wouldn't worry about CF-compliance just yet, I just want to make sure you can get this far. Then, we can merge this new test case to ocean/develop and you can use git merge or git rebase to update your branch in #533 (or start a new branch).

@xylar
Copy link
Collaborator Author

xylar commented Apr 23, 2020

@mark-petersen, if you could run a quick test of daily_output_test, that would also be great! It worked fine for me on my laptop.

@mark-petersen
Copy link
Contributor

@xylar I think it is good to have a test for timeSeriesStats. But is there a reason we can't evaluate CF compliance in a standard output file with other streams? Should we look at both?

@xylar
Copy link
Collaborator Author

xylar commented Apr 23, 2020

@xylar I think it is good to have a test for timeSeriesStats. But is there a reason we can't evaluate CF compliance in a standard output file with other streams? Should we look at both?

Yes, that's the plan. @wenshanw is starting with the QU240/init/test case and just adding variable to the output stream. That's working fine in that the _FillValue attribute is there (though fields have the wrong fill value where they're not valid). But the most significant place where we want CF-compliant output is in timeSeriesStatsMonthlyOutput, and we're pretty sure that adding _FillValue to temperature will not necessarily mean that timeMonthly_avg_activeTracers_temperature has it. What is more, we don't want to be time averaging the fill values in MPAS data arrays because we may end up with overflows or weird results or, at the very least, cases where the time average of the fill value isn't quite the same as the fill value because of round-off. So there's good reason to have a solid test case with timeSeriesStats to play around with early in the process.

@wenshanw
Copy link

wenshanw commented Apr 24, 2020

Thank you, @xylar!
It all worked well until I ./run.py in init/

File "/Users/wenshanw/mpas/cases/002_20200423_daily-avg-test/ocean/global_ocean/QU240/init/base_mesh/jigsaw_to_MPAS/build_mesh.py", line 25, in <module> from mpas_tools.viz.paraview_extractor import extract_vtk
Error: ModuleNotFoundError: No module named 'mpas_tools.viz.paraview_extractor'; 'mpas_tools.viz' is not a package

I conda installed mpas_tools. It didn't help.
This module was not requested by ocean/develop test cases.
Anywhere else I should check?

@xylar
Copy link
Collaborator Author

xylar commented Apr 24, 2020

@wenshanw, I think I know what the issue is. You will need to install the latest compass metapackage. The one you installed (0.1.2) is for a specific set of tools and will prevent you from upgrading those tools to incompatible versions. I would suggest you keep you old environment for now and make a new one:

conda create -y -n compass_0.1.4 -c conda-forge -c e3sm python=3.7 compass=0.1.4

This should give you the latest compass environment and it should work with what you have. You can find out what compass is needed by looking at either of these files:

testing_and_setup/compass/README_ocean.md

on your particular branch. I this case, it will say 0.1.3 is needed but there is no harm in using 0.1.4 instead, since it is backwards compatible and the changes are very minor. Sorry about that! I can understand that this is confusing.

@wenshanw
Copy link

@xylar Yes! It solves the problem! 🙇‍♀️🙇‍♀️🙇‍♀️

It all worked out.
analysis_members/mpaso.hist.am.timeSeriesStatsDaily.0001-01-01.nc looks normal to me.
Thank you very much!

@xylar
Copy link
Collaborator Author

xylar commented Apr 25, 2020

Great, @wenshanw! Glad that worked. I'll wait for @mark-petersen to test this an merge to ocean/develop. Then, we can talk about how to update your branch to either merge or "rebase" onto ocean/develop so you can test with it.

Copy link
Contributor

@mark-petersen mark-petersen left a comment

Choose a reason for hiding this comment

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

I gave it a quick test. Looks great, thanks!

@mark-petersen mark-petersen merged commit aa3b987 into MPAS-Dev:ocean/develop Apr 28, 2020
@xylar xylar deleted the add_QU240_time_daily_mean branch April 29, 2020 08:25
caozd999 pushed a commit to caozd999/MPAS-Model that referenced this pull request Jan 14, 2021
…velop

Add a daily output test case to QU240 MPAS-Dev#535

This test case outputs the same fields as E3SM timeSeriesStatsMonthly
but is meant to be cheaper to run (since it only requires a day, not a
month, of simulation).

The test case will be used to make sure MPAS-Ocean output is CF
compliant.
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.

4 participants