NOAA-GFDL / xwmt

Python package for water mass transformation analysis that leverages xarray functionality
https://xwmt.readthedocs.io/
MIT License
7 stars 5 forks source link

vsf vs wfo #44

Open Taydra-Low opened 1 month ago

Taydra-Low commented 1 month ago

Some models (CESM2) only have virtual salt flux (vsf) and not wfo. Is the wfo converted into a vsf? Or is there functionality to work with a vsf with xwmt?

hdrake commented 1 month ago

That's a great question @Taydra-Low. Because the VSF is already formulated as a tracer flux that affects tracer content, it should be treated just like any other tracer tendency (as opposed to wfo, which is a mass flux exchange that only indirectly affects salt concentrations by diluting salt content).

This is easy to accommodate in my branch https://github.com/hdrake/xwmt but would require source code changes in the main or @jetesdal's branches.

hdrake commented 1 month ago

It might be as easy as adding vsf to the salt flux dictionary https://github.com/NOAA-GFDL/xwmt/blob/07b2e6fc95fd5bb715b461656509a8497c21b87a/xwmt/swmt.py#L35

jetesdal commented 1 month ago

Hi @Taydra-Low! Thanks for bringing this up. To answer your question, the main branch version does not consider virtual salt flux. The current main branch is somewhat legacy code from submission to CMEC, and it is not actively developed. I agree with @hdrake to add the virtual salt flux in his branch. It is also our long-term goal to merge the development in Henri’s branch with the current main branch.

Taydra-Low commented 1 month ago

Hi!

Thanks for the speedy response. Yeah after looking through the code more deeply, it looks as though the mass flux (wfo) is converted to a salt flux (vsf) when computing the density flux. So, for preprocessing I will just have to convert the vsf to a wfo which then gets converted back into a vsf in the computation. I believe the conversion is vsf/-so. I have yet to look at Henri's branch, but I am curious now.

Cheers, Taydra


From: Jan-Erik Tesdal @.> Sent: Tuesday, August 6, 2024 2:45 PM To: NOAA-GFDL/xwmt @.> Cc: TAYDRA LOW @.>; Mention @.> Subject: Re: [NOAA-GFDL/xwmt] vsf vs wfo (Issue #44)

Hi @Taydra-Lowhttps://urldefense.com/v3/__https://github.com/Taydra-Low__;!!Mak6IKo!Nrm2oJUwZHNWt3b21V7jCDGdL--sAkwhFmdAM_z7qKTxHUaZuaQ98X7Ae3Vvo2W04FlTPsap-gC9mxJLjv2Sul7w$! Thanks for bringing this up. To answer your question, the main branch version does not consider virtual salt flux. The current main branch is somewhat legacy code from submission to CMEChttps://urldefense.com/v3/__https://cmec.llnl.gov/__;!!Mak6IKo!Nrm2oJUwZHNWt3b21V7jCDGdL--sAkwhFmdAM_z7qKTxHUaZuaQ98X7Ae3Vvo2W04FlTPsap-gC9mxJLjlv-hxmt$, and it is not actively developed. I agree with @hdrakehttps://urldefense.com/v3/__https://github.com/hdrake__;!!Mak6IKo!Nrm2oJUwZHNWt3b21V7jCDGdL--sAkwhFmdAM_z7qKTxHUaZuaQ98X7Ae3Vvo2W04FlTPsap-gC9mxJLjls4pEjj$ to add the virtual salt flux in his branch. It is also our long-term goal to merge the development in Henri’s branch with the current main branch.

— Reply to this email directly, view it on GitHubhttps://urldefense.com/v3/__https://github.com/NOAA-GFDL/xwmt/issues/44*issuecomment-2272022215__;Iw!!Mak6IKo!Nrm2oJUwZHNWt3b21V7jCDGdL--sAkwhFmdAM_z7qKTxHUaZuaQ98X7Ae3Vvo2W04FlTPsap-gC9mxJLjvCeSZe0$, or unsubscribehttps://urldefense.com/v3/__https://github.com/notifications/unsubscribe-auth/AYFI7DZQTNPCGVWIJ7H5263ZQERV7AVCNFSM6AAAAABMC3FUN2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDENZSGAZDEMRRGU__;!!Mak6IKo!Nrm2oJUwZHNWt3b21V7jCDGdL--sAkwhFmdAM_z7qKTxHUaZuaQ98X7Ae3Vvo2W04FlTPsap-gC9mxJLjm9xVKey$. You are receiving this because you were mentioned.Message ID: @.***>

hdrake commented 1 month ago

Yeah after looking through the code more deeply, it looks as though the mass flux (wfo) is converted to a salt flux (vsf) when computing the density flux. So, for preprocessing I will just have to convert the vsf to a wfo which then gets converted back into a vsf in the computation.

Yes, you could either address this in preprocessing as your suggest or you could change the xwmt source code to allow vsf to be treated directly (just like surface heat fluxes already are).

I believe the conversion is vsf/-so. I have yet to look at Henri's branch, but I am curious now.

Happy to help you port your code over to my branch, if you want. Just open a separate Issue if you run into any problems.