Skip to content

Conversation

@xylar
Copy link
Collaborator

@xylar xylar commented Feb 3, 2020

This currently only affects coastal test cases.

closes #439

This currently only affects coastal test cases.
@xylar
Copy link
Collaborator Author

xylar commented Feb 3, 2020

@sbrus89, could you use this as a starting point to address #439? I think it's most of the way there but I'm not familiar with the test cases affected so could use your help testing/debugging.

@xylar
Copy link
Collaborator Author

xylar commented Feb 3, 2020

@sbrus89, I'll set up a test environment compass_cartopy for you to test with as soon as I can. Stay tuned...

@sbrus89
Copy link

sbrus89 commented Feb 3, 2020

@xylar, sounds great. Thanks for setting this up!

@xylar
Copy link
Collaborator Author

xylar commented Feb 3, 2020

Okay, an environment should be in place. To activate it, do:

source /usr/projects/climate/SHARED_CLIMATE/anaconda_envs/base/etc/profile.d/conda.sh
conda activate compass_cartopy

@sbrus89
Copy link

sbrus89 commented Feb 3, 2020

@xylar, I'm running into an error. When cartopy tries downloading the coastline data, I get a 403: Forbidden. I'd say this probably some kind of proxy issue, but I do have all of my proxy settings in place (https://hpc.lanl.gov/proxy_setup)

@xylar
Copy link
Collaborator Author

xylar commented Feb 3, 2020

Shoot, that's a tricky one. We've dealt with this in MPAS-Analysis:
https://github.com/MPAS-Dev/MPAS-Analysis#download-natural-earth-data-for-cartopy

I'll move the data over from my laptop.

@sbrus89
Copy link

sbrus89 commented Feb 3, 2020

Oh good. I'm glad this has already been sorted out for MPAS-Analysis. Thanks for moving the data. I'll try again once it is place.

@xylar
Copy link
Collaborator Author

xylar commented Feb 3, 2020

@sbrus89, I put the files at /usr/projects/climate/SHARED_CLIMATE/anaconda_envs/cartopy. I'm not aware of a way to configure the environment to look there, so maybe you can link your local path ~/.local/share/cartopy to that folder or if the folder is already there, link the shapefiles subfolder to be within that local folder.

@sbrus89 sbrus89 closed this Feb 4, 2020
@sbrus89 sbrus89 reopened this Feb 4, 2020
@xylar
Copy link
Collaborator Author

xylar commented Feb 4, 2020

SciTools/cartopy#1325 (comment) gives a suggestion on how to get the directory we need from an environment variable. That variable could be set when COMPASS is activated but we would need to add the relevant check. I'll do this.

This should let us set $CARTOPY_DIR in a compass activation
script on LANL IC
@xylar
Copy link
Collaborator Author

xylar commented Feb 4, 2020

@sbrus89, I just added activation/deactivation scripts to the compass_cartopy environment that should set CARTOPY_DIR when the environment is active (and unset it when you deactivate).

Could you delete your ~/.local/share/cartopy and see if things still work for you?

@xylar
Copy link
Collaborator Author

xylar commented Feb 4, 2020

Make sure you deactivate and reactivate compass_cartopy and also that you get the commit I just pushed to this branch.

@xylar
Copy link
Collaborator Author

xylar commented Feb 12, 2020

A couple of updates for this PR. First, the new definition of COMPASS here:
MPAS-Dev/MPAS-Tools#285
will include cartopy and not basemap so we can test this PR with that environment before the COMPASS metapackage becomes official.

Second, regarding the offline data for cartopy, this issue is being addressed by adding a cartopy_offlinedata package to conda-forge:
conda-forge/staged-recipes#10831

@xylar
Copy link
Collaborator Author

xylar commented Feb 19, 2020

@sbrus89, I just created a new conda environment for compass 0.1.0 that includes both cartopy and cartopy_offlinedata (a conda package with all of the data cartopy would download).

Could you do the following for me as a test before we merge this PR?

mv ~/.local/share/cartopy ~/.local/share/old_cartopy

Then, make sure you can run one of your test cases that now uses cartopy by activating the new environment:

source /usr/projects/climate/SHARED_CLIMATE/anaconda_envs/base/etc/profile.d/conda.sh
conda activate compass_0.1.0

I'd like to switch to this new version of COMPASS by early next week. Could you let me know if you'll be able to test by then? I'm only at LANL until Wednesday.

@sbrus89
Copy link

sbrus89 commented Feb 20, 2020

@xylar, this sounds great. I will try to test over the next day or so. Thanks again for taking this on!

@sbrus89
Copy link

sbrus89 commented Feb 21, 2020

@xylar, I tested this on the NAEC60to30cr8 case and it works great. I didn't have any issues with using the offline data.

@xylar xylar removed the in progress label Feb 21, 2020
@xylar
Copy link
Collaborator Author

xylar commented Feb 21, 2020

@pwolfram or @mark-petersen, this is ready to merge at your (earliest) convenience.

@sbrus89
Copy link

sbrus89 commented Feb 21, 2020

I still need to test the interpolate_time_varying_forcing.py script

@xylar
Copy link
Collaborator Author

xylar commented Feb 21, 2020

Ah, sorry, then let us know when you're happy.

@sbrus89
Copy link

sbrus89 commented Feb 21, 2020

Sorry about jumping the gun there.

@sbrus89
Copy link

sbrus89 commented Feb 25, 2020

@xylar, Alright, things are looking more reasonable now. I increased the number of plotting levels and had to use different scales for the two plots. Something is definitely buggy because it should work without having to do that.

vel_0000

I'll try pushing the changes to your branch and will do a PR if I can't.

@sbrus89
Copy link

sbrus89 commented Feb 25, 2020

@xylar, I opened a PR to your fork.

Just so you know, I also tested this with the compass_0.1.0 environment and it works as well.

@xylar
Copy link
Collaborator Author

xylar commented Feb 25, 2020

Okay, not perfect but I agree we can live with it for now. Sorry this is such a pain.

Fix cartopy issues with tricontourf
Copy link

@sbrus89 sbrus89 left a comment

Choose a reason for hiding this comment

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

I'm happy with things at this point. Thanks again @xylar for your help in getting this switched over.

@xylar
Copy link
Collaborator Author

xylar commented Feb 26, 2020

@mark-petersen or @pwolfram, which of you would like to merge this PR into ocean/coastal?

@pwolfram
Copy link
Contributor

@xylar and @mark-petersen, I can take care of this later, especially since I'm cranking on coastal right now. Thanks!

@mark-petersen mark-petersen self-requested a review March 11, 2020 03:44
@mark-petersen mark-petersen removed their assignment Mar 11, 2020
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.

This looks good. Thanks for your work on it, @xylar and @sbrus89.

@pwolfram I'll let you merge when you are ready, since you are using this branch.

@pwolfram pwolfram merged commit 58502f1 into MPAS-Dev:ocean/coastal Mar 23, 2020
@xylar xylar deleted the ocean/compass/basemap_to_cartopy branch March 23, 2020 14:57
@xylar
Copy link
Collaborator Author

xylar commented Mar 23, 2020

Thanks for merging this, @pwolfram! We need to get it into ocean/develop at some point so we also don't have trouble with basemap there.

@mark-petersen
Copy link
Contributor

@xylar is cartopy useful for our work on V2 meshes this week? If so, I think this is an example that justifies a parallel identical PR into ocean/develop, as I won't merge ocean/coastal into ocean/develop for 2-4 more weeks.

@xylar
Copy link
Collaborator Author

xylar commented Mar 23, 2020

Yes, we need this in ocean/develop because otherwise we're going to have the same broken imports unless we explicitly add basemap back into the testing compass conda envrionment. So let's include it in the test branch.

@xylar xylar mentioned this pull request Apr 2, 2020
@xylar xylar restored the ocean/compass/basemap_to_cartopy branch April 2, 2020 13:58
@xylar xylar deleted the ocean/compass/basemap_to_cartopy branch April 2, 2020 14:07
mark-petersen added a commit to mark-petersen/MPAS-Model that referenced this pull request Apr 2, 2020
…elop

Fix cartopy issues with tricontourf

This brings the functionality from MPAS-Dev#441 into ocean/develop without
having to merge the full ocean/coastal branch.
caozd999 pushed a commit to caozd999/MPAS-Model that referenced this pull request Jan 14, 2021
…elop

Fix cartopy issues with tricontourf

This brings the functionality from MPAS-Dev#441 into ocean/develop without
having to merge the full ocean/coastal branch.
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.

5 participants