GithubHelp home page GithubHelp logo

Comments (5)

MaceKuailv avatar MaceKuailv commented on August 26, 2024

BTW, it does not make a difference if one includes hFacS and hFacW

ds['utrans'] = (ds['UVELSTAR']*ds['drF']*ds['dyG']*ds['hFacW']).fillna(0)
ds['vtrans'] = (ds['VVELSTAR']*ds['drF']*ds['dxG']*ds['hFacS']).fillna(0)

from gcmfaces.

MaceKuailv avatar MaceKuailv commented on August 26, 2024

I tried to use xgcm for the same calculation,

strm = xr.open_dataset('OCEAN_BOLUS_STREAMFUNCTION_day_mean_1992-01-01_ECCO_V4r4_native_llc0090.nc')

strmx = strm.GM_PsiX.fillna(0)
strmy = strm.GM_PsiY.fillna(0)

u = xgcmgrd.diff(strmx,"k", boundary = 'fill', fill_value = 0.0)/ds.drF
v = xgcmgrd.diff(strmy,"k", boundary = 'fill', fill_value = 0.0)/ds.drF

vstrmx = strmx*ds.dyG
vstrmy = strmy*ds.dxG

xy_diff = xgcmgrd.diff_2d_vector(
    {"i": vstrmx, "j": vstrmy}, boundary="fill", fill_value=0.0
)
x_diff = xy_diff["i"]
y_diff = xy_diff["j"]
hDiv = (x_diff + y_diff) 

w = hDiv/ds.rA

When I plug this into the divergence calculation above, the divergence is very small. The horizontal components are the same but the vertical velocity at the second level are different.

diffu = (u - ds.UVELSTAR).fillna(0)
diffv = (v - ds.VVELSTAR).fillna(0)
diffw = (w - ds.WVELSTAR).fillna(0)
plt.imshow(diffw[0,1,10].T)
plt.colorbar()

which yields:
image

from gcmfaces.

gaelforget avatar gaelforget commented on August 26, 2024

@ifenty @owang1 can you help with this? It relates to python toolboxes and ECCOv4r4 which you know better than me

from gcmfaces.

MaceKuailv avatar MaceKuailv commented on August 26, 2024

Thank you! Let me know if there is anything that I could help.

from gcmfaces.

owang01 avatar owang01 commented on August 26, 2024

Thanks @gaelforget

@MaceKuailv Thank you for the detailed description and the Python code regarding the issue. I will look into it and get back to you.

from gcmfaces.

Related Issues (11)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.