-
Notifications
You must be signed in to change notification settings - Fork 37
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
Adds WOA 23 SSS restoring file script #872
base: main
Are you sure you want to change the base?
Conversation
@xylar I've made progress on the salinity restoring we discussed. I was hoping to get a quick look from you to see if i'm on a good track. I've made a script to create the surface salinity climatology file as close as possible to the PHC2 version (variable names and such). I haven't hooked up to files for e3sm yet. I will do so tomorrow and test. |
the new lat, lon WOA23 SSS file has been place in the |
@xylar I think this is ready for your look. I haven't done the documentation yet, if you'd rather wait for that let me know. I'll get to that soon |
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.
@vanroekel, this looks great and just needs a little clean up and documentation. Feel free to commit my suggestions from GitHub but please also make some arbitrary changes to whitespace locally, then make sure you source the compass load script and then commit the files. This should trigger pre-commit which will do some linting that seems to be missing.
compass/ocean/tests/global_ocean/files_for_e3sm/remap_sea_surface_salinity_restoring.py
Outdated
Show resolved
Hide resolved
compass/ocean/tests/utility/create_salinity_restoring/salinity_restoring.py
Outdated
Show resolved
Hide resolved
compass/ocean/tests/utility/create_salinity_restoring/salinity_restoring.py
Outdated
Show resolved
Hide resolved
compass/ocean/tests/utility/create_salinity_restoring/salinity_restoring.py
Outdated
Show resolved
Hide resolved
compass/ocean/tests/utility/create_salinity_restoring/extrap_salin.py
Outdated
Show resolved
Hide resolved
compass/ocean/tests/utility/create_salinity_restoring/__init__.py
Outdated
Show resolved
Hide resolved
compass/ocean/tests/utility/create_salinity_restoring/__init__.py
Outdated
Show resolved
Hide resolved
compass/ocean/tests/utility/create_salinity_restoring/__init__.py
Outdated
Show resolved
Hide resolved
41bbe66
to
e90c58a
Compare
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.
Looks great! Testing this now.
filename='woa23_decav_0.25_sss_monthly_extrap.20241031.nc', | ||
target='woa23_decav_0.25_sss_monthly_extrap.20241031.nc', |
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.
The actual file in the initial condition database needs to be renamed woa
--> woa23
.
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.
I can't do it because I don't have write permission. In general, if you can chmod all your files in mpas_standalone
so they are group writable, that would be helpful.
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.
Interesting! I can rename it without having write permission.
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.
Sorry for the stupid question, but here you mean just make sure group has full rwx permissions after I put the file in the initial_condition_database and not figuring how to do this through the python script?
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.
No, these files should not be executable. Just group readable and writable. (Folks add execute permission to files a lot that shouldn't have it and this is not a great idea.) To change permissions recursively, do something like:
chmod -R g+rwX .
The capital X
indicates execute permission only gets added to directories, not files.
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.
not figuring how to do this through the python script?
Correct, not in the python script.
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.
I caught my 'x' and did not add it when I changed permissions. It should just be 'rw' for groups.
self.woa_filename = f'woa23_decav_0.25_sss_monthly_extrap.\ | ||
{datestring}.nc' |
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 isn't okay to put a continuation line in the middle of a string. Here's how to do that properly:
self.woa_filename = f'woa23_decav_0.25_sss_monthly_extrap.\ | |
{datestring}.nc' | |
self.woa_filename = f'woa23_decav_0.25_sss_monthly_extrap.' \ | |
f'{datestring}.nc' |
@@ -44,9 +44,9 @@ def run(self): | |||
config = self.config | |||
ntasks = self.ntasks | |||
|
|||
in_filename = 'PHC2_salx.2004_08_03.filled_double_precision.nc' | |||
in_filename = 'WOA23_monthly_sfc_salin.20241030.nc' |
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.
in_filename = 'WOA23_monthly_sfc_salin.20241030.nc' | |
in_filename = 'woa23_decav_0.25_sss_monthly_extrap.20241031.nc' |
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.
@vanroekel, if you make my suggested changes, I'll test again.
@xylar Thanks for the testing. I've taken on your changes and run the full test top to bottom on a different machine and it worked. This should be ready for your retesting. I also changed permissions on the files I added to the initial_conditions_database. |
Perfect, I'll re-test as well, just to be safe. Sounds like we're likely good to go. |
Presumably, this is partly because we extrapolate in lat/lon space, not in real distance. |
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.
@vanroekel, this looks great, thanks for your patience and hard work.
I'll merge as soon as I get your reaction to my north pole plot.
I'm not sure about the artifacts on the N. Pole. Looks like a fair bit of variability over the pole. I'd ask what @alicebarthel and @milenaveneziani think. Does this same kind of artifact show up in the initial condition too? |
Kat no longer has the RARE climatologies, so those would have to be recalculated. But of course they wouldn't work for the SO. |
Thanks @milenaveneziani this is intriguing. For the arctic it looks like since we have weak AMOC we'd probably want to use PHC3. It still would be nice if we could get a sense of if PHC3 is closer to truth. Any thoughts on how to do that? The story seems switched for the S. Ocean. There are more of those wave like structures in the SSS field and the WOA23 looks smoother. I'm not sure what the best path is. I'll need to think on this. Let me know what you think after looking at these. |
yes, I agree, and that's likely because of all the new data in the SH that went into making recent versions of WOA. I just don't understand why WOA is so weird in the Arctic.. |
you're right - the structures seem very odd in WOA23. Could some of the difference be vertical resolution? I recall WOA23 has higher near surface resolution, but don't know what PHC3 is. What are your feelings on thinking about blending WOA and PHC? Seems scary to me, but I don't know how to pick up what we want in each hemisphere. The other alternative is two sss restoring files that are used for different cases, but I'm not a huge fan of that either. I'm also curious what @xylar an @irenavankova think too. |
Just to reiterate @vanroekel's earlier point that not even the authors of PHC recommend it now. |
Those patterns in the Arctic in WOA are worrisome to me. I don't think we want to use WOA-SSS restoring for G-cases that have a north polar ocean focus. About the vertical resolution, Luke: WOA has a 5m resolution in the upper 100m, PHC has 10m res. Are you thinking that the artifacts are related to vertical interpolation? |
Looking at the Weddell and Ross patterns, they look much better to me in WOA. I am not sure what happens in Weddell in October though that the salinity increases suddenly over a large area. While the pattern in Weddell looks reasonable for April and July, the peak salinities in front of western FRIS front are too low. They need to reach 34.9 as that is very consistently observed at the sea floor for three decades now. What I see from the WOA plot is 34.5 instead. When I was looking at the PHC earlier in the Southern Ocean I saw some places with a one cycle in a season and other places with two cycles in a season. I wasn't sure whether that was physical or not. |
@vanroekel, (and everyone), I don't feel comfortable with PHC but I do share @milenaveneziani's concern that WOA23 looks weird enough in the middle of the Arctic that it could cause weird behavior there. My guess is that data is just sparse there and no product is well constrained. Even so, some may be more plausible than others. I continue to feel that salinity restoring is a crude instrument, but particularly anywhere you have salinification (areas of sea ice production and evaporation). Whereas fresher water stays at the surface, saltier water sinks so there's less of a signature in the SSS. So my feeling is partly that, if you are restoring hard enough that the details of the SSS restoring field matter especially where you have sea ice cover, even having the correct SSS field doesn't relate to having the right salt fluxes. |
@irenavankova, about this:
Note that those salinities I plotted are SSS, not Sbot. I can also plot the bottom level (I actually thought about it, but I just didn't want to inundate this PR with plots). Maybe I'll just make a one month plot for the SH only. |
Here is Mike's response, mingled with my own comments:
Luke, Alice: this makes me think that PHC could work well for the new initial condition process that we discussed (1-year G-case, which of course would start in 1958), but perhaps not for the long, standard G-cases.
I am less worried about this, and more worried about PHC in the SO.
For some reason, I had forgotten about EN4. I'll see if I can find climatologies easily; I know I have downloaded it a while back, but I can look into it again. My conclusion in all this is similar to yours, Luke: there is likely no perfect product for the whole globe. One option is to allow (within compass) for a couple of choices, say WOA and EN4, and then the user decides what to do when they are building their cases from scratch. |
Yes, I am aware SSS was plotted. But I thought that for 34.9 to be observed on the sea floor, it must have been at least that high at the surface at some point prior to that. |
Regarding EN4, I have used it in ISMIP6. If it has been updated since then to include newer (especially seal-based) Antarctic observations, it might be worth considering. @vanroekel tried their 1900 climatology as an initial condition and it didn't help whatever the issue was at that time (Compass still supports that). We can give it a go... |
@irenavankova : here is WOA bottom salinity (1500 m) for April (never mind the title, and also note the different colorbar levels than before): |
So it's basically missing the continental shelf? |
I guess we can try EN4 and see if that's reasonable. What should we use for the climatology? 1993-2023? Getting that processed will be trickier since the data I'm aware of is by year. I can't seem to find the climatology Mike mentions. |
Before changing this PR though, Milena can you make some plots of EN4? This is where I've found data - https://www.metoffice.gov.uk/hadobs/en4/download-en4-2-2.html I'd prefer to find a product that is acceptable than try have multiple G-case configs. |
From what I can tell, EN4's gridded products use a climatology from 1970-2000 wherever data is missing. That worries me for creating a climatology that's ostensibly supposed to be more recent. In general, I worry about creating our own climatology. |
I agree @xylar tinkering around with making our own climo is worrying. Is it worth exploring other editions of WOA? CESM uses WOA18. As I've thought about this, I'd really prefer to use a single product and not blend or have a bunch of different options. Maybe the available data precludes this though |
I am in the process of switching from WOA18 to 23 in MPAS-Analysis. The differences seem to be negligible. |
Thanks, that's helpful to hear Mike's comments about PHC. I agree with @vanroekel and @xylar's concern about making our own dataset. My main concern in bringing it up was to have a sense for the agreed-upon best estimates, or the uncertainty range associated with monthly values in the Arctic. If we are simply concerned about the polar features (and satisfied with the magnitude), would a small degree of smoothing for the SSS restoring fields be an option? SSS restoring is already a model-per-model decision, and it sounds like PHC was smoothed. That would avoid impacting the broader E3SM/B-case methodology. |
@alicebarthel I was thinking about smoothing as well. That seems like a potentially good option. Agreed on initialization being a valid discussion, but that should be a different issue and not a part of this PR. |
Sorry @vanroekel for continuing to hijack this PR. We should move this discussion somewhere else. Someone feel free to make a space for this and we can move it there.
My concern is with the strategy they use to fill in the gaps. They use a 1970-2000 climatology. That means if you do a 1990-2024 climatology, rather than having holes where there was no data, you will have 1970-2000 data. In my view, it would be better to have the holes and interpolate/extrapolate to fill them in rather than fill them in with data that is 20 years older than you think you have. |
How should we finish this PR? Should we add some smoothing? @milenaveneziani do you want to plot SSS from EN4? |
I thought people didn't want to compute climatologies with EN4? |
my initial feeling is to just try some smoothing. I think where/when we have a more robust IC discussion, we may end up revisiting SSS restoring to be consistent with the IC chosen. |
Yes, smoothing of the WOA field sounds good: hopefully it helps. |
Let's plan on trying smoothing in this PR and in the IC discussion if we switch from WOA we definitely want to reconsider SSS |
This adds WOA23 surface salinity restoring for E3SM G-cases.
Checklist
api.rst
) has any new or modified class, method and/or functions listed