Skip to content

Conversation

@QianyeSu
Copy link
Contributor

PR Description

Background

In the current plotting code, the direction of the streamfunction does not align with the definition in the reference [Oort and Yienger, 1996]. Specifically:

  • Negative values correspond to clockwise rotation, while positive values correspond to counterclockwise rotation.
  • According to the reference, positive values should correspond to clockwise rotation, and negative values should correspond to counterclockwise rotation.

Changes

  1. Adjusted the streamfunction calculation to match the reference definition:
    • Updated formula: $\psi\left(\phi,\ p\right)=\frac{2\pi R \cos\phi}{g}\int_{0}^{Ps}\bar{v\left(\phi,\ p\right)}dp$
    • Added a negative sign in the code: (sf * -const) / 1e10
  2. Updated the plotting code to ensure the correct streamfunction direction:
    • Positive values correspond to clockwise rotation.
    • Negative values correspond to counterclockwise rotation.

Impact

  • The corrected streamfunction direction aligns with the reference, facilitating comparison with other research results.
  • Improves the scientific accuracy of the code.

Testing

  • Local tests have been conducted, and the plotting results meet expectations.
  • The streamfunction direction matches the reference [Oort and Yienger, 1996].

References

Oort A H, Yienger J J. American Meteorological Society, 1996. Observed Interannual Variability in the Hadley Circulation and Its Connection to ENSO[J]. Journal of Climate, 1996, 9(11): 2751–2767.


Code Changes

# Before (Hadley)
m4 = ax4.contourf(lat, level, (sf), levels=21, cmap='RdBu_r')

# After(Hadley)
m4 = ax4.contourf(lat, level, (sf * -const) / 1e10, levels=21, cmap='RdBu_r')

Code Changes

# Before (Walker)
m4 = ax4.contourf(lon, level, (sf), levels=21, cmap='RdBu_r')

# After(Walker)
m4 = ax4.contourf(lat, level, (sf * const) / 1e10, levels=21, cmap='RdBu_r')

@miniufo
Copy link
Owner

miniufo commented Mar 18, 2025

Thank you very much. Rescaling here is important for atmospheric applications, which is missing previously.

You have changed the size of the figure, which may render the docs here a bit larger. But that's not a big problem. I will first include your contribution and then make some changes to fit the docs.

@miniufo miniufo merged commit c2fb271 into miniufo:master Mar 19, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants