Comments (6)
Hi Dr. Huang
This is Amin Fazl kazemi from I.R.Iran. I've just downloaded your description of SOR solving method to find UREF. It is published February 2020 and refers to HN2018 paper, Equation S3. By the way I find no equation marked as "S3" in HN2018 , Atmospheric blocking as a traffic jam in the jet stream. Could you please Help.
By the way I tried to solve Equation 12 of Nakamura&Solomon (2010) to find delta_u , the zonal adjustment to zonal mean zonal wind to yield largrangian mean , UREF
By the way the result is apparently not conserved by time. I donot know what wrong I have done.
Thanks
from hn2016_falwa.
@AminFazlKazemi Equation S3 is in the supplementary materials of the Science paper:
In realistic atmosphere, Uref
is not conserved due to non-conservative processes (dissipation, diabatic heating etc). Do I answer your question?
By the way, please open a new issue when you raise questions. Thank you.
from hn2016_falwa.
from hn2016_falwa.
@AminFazlKazemi On top of the variable of the equations being different, NS10 and NH18 are using different boundary conditions. NS10 uses the two poles as boundary, while NH18 is using the equator and the north pole as boundaries. We switched to hemispheric boundary conditions because I encountered the issue that anomalies in the southern hemisphere is causing problematic gradient of Qref in northern hemisphere. This hemispheric boundary conditions suffers from sensitivity on equator field values though, and we switched to using absolute vorticity at
When we tried both boundary conditions, there are substantial difference in Uref at topics and subtropics, but at midlatitude, their patterns were similar. What's the difference you observed between the two cases? Did I answer your question?
from hn2016_falwa.
Hi Dr. Huang
I used this code to solve UREF based on Nakamura_Solomon 2010:
` @numba.guvectorize(['(float64[:],int64,float64,float64[:,:],float64[:,:],float64[:],float64[:],float64[:],float64[:,:],int64,int64,float64,float64[:,:])']
, '(z),(),(),(m,z),(m,z),(m),(z),(z),(m,z),(),(),()->(m,z)',target='cpu', nopython=True)
def density_weighted_elliptic_solver(A,max_iter,acceptable_precision,first_guess,epsilon,dmu2,dz2,ru0,forcing,ny,nz,alfa,result):
dz=dz2**.5
dmu=dmu2**.5
precision=1000.
iter_=0
old=first_guess.copy()
for iter_ in range(1,max_iter+1):
for i in range(1,ny-1):
for j in range(int(A[0]),nz-1):
#print(j,i)
if j==0:
coeff=1./(ru0[j]*epsilon[i,j]/(ru0[j]*dz2[j]))
t=forcing[i,j]-( ((ru0[j+1]*epsilon[i,j+1]*(first_guess[i,j+2]-first_guess[i,j+1])-ru0[j]*epsilon[i,j]*first_guess[i,j+1])/(dz2[j]))/ru0[j])
first_guess[i,j] = (1.-alfa)*first_guess[i,j]+ alfa*coeff*t
else:
epsilon_p=.5*(epsilon[i,j]+epsilon[i,j+1])
epsilon_m=.5*(epsilon[i,j]+epsilon[i,j-1])
ru0_p=.5*(ru0[j]+ru0[j+1])
ru0_m=.5*(ru0[j]+ru0[j-1])
zarib=1./(-(ru0_p*epsilon_p+ru0_m*epsilon_m)/(ru0[j]*dz2[j])-2./((.25*(dmu[i+1]+dmu[i-1]+2.*dmu[i]))*dmu[i]))
t=forcing[i,j]-((first_guess[i+1,j]/(.5*(dmu[i]+dmu[i+1]))+first_guess[i-1,j]/(.5*(dmu[i]+dmu[i-1])))/dmu[i] + (ru0_p*epsilon_p*first_guess[i,j+1]+ru0_m*epsilon_m*first_guess[i,j-1])/(dz2[j])/ru0[j])
first_guess[i,j] = (1.-alfa)*first_guess[i,j]+ alfa*coeff*t
#diff=numpy.abs(calc(first_guess,epsilon,ru0,zs,mus)-forcing)
precision=abs(first_guess[0,0]-old[0,0])
#print("p_",precision)
for i in range(1,ny-1):
for j in range(int(A[0]),nz-1):
n=abs(first_guess[i,j]-old[i,j])
if n>precision:
precision=n
if precision<=acceptable_precision:
print(iter_,precision)
break
else:
print(iter_,precision)
old=first_guess.copy()
for i in range(1,ny-1):
for j in range(int(A[0]),nz-1):
result[i,j]=first_guess[i,j]
`
I used mu=sin(latitude) directly to differentiate. The program converges but the result is very low amplitude. In fact the resulted UREF is much the same as UBAR and there is something wrong with it.
forcing is the right-hand side of nakamura-Solomon equation 12.
vector A is used to switch between no-slip and surface wave activity boundary condition .
I also coded OPTIMIZED SOR method for NH18-S3 the same way. the result is quite favorable and apparently conserved to a great extent. It is very similar to HN2016_FALWA package and is completely symmetrical around equator.
I would be thankful if you provide me with descriptions about your new boundary condition using absolute vorticity at 5 degrees North instead of ubar+FAWA at equator so that I can apply and test it in my code.
from hn2016_falwa.
Hi @AminFazlKazemi ,
in NHN22 we use direct solver instead of SOR since we have MKL installed. The numerical procedures are outlined in supplementary materials:
https://agupubs.onlinelibrary.wiley.com/action/downloadSupplement?doi=10.1029%2F2021GL097699&file=2021GL097699-sup-0001-Supporting+Information+SI-S01.pdf
Equation (16) is the boundary condition I mentioned.
The part of code using direct solver is already available in this package:
The lines doing matrix inversion:
hn2016_falwa/hn2016_falwa/oopinterface.py
Lines 884 to 885 in e287b2a
But this version only works for data with 1 deg x 1 deg lat-lon grid. I am going to generalize this to accommodate arbitrary grids in the upcoming release.
I suggest you use intel MKL version of numpy/scipy to do the matrix inversion. It is very fast and more accurate.
from hn2016_falwa.
Related Issues (20)
- Add unit tests that cover xarray interface HOT 1
- Solve Memory Issues of QGField HOT 1
- Release 0.7.0 HOT 1
- Make northern_hemisphere_results_only an instance variable of QGField
- Fail to install HOT 3
- netCDF4 installation requirement has to be updated HOT 6
- Trying to run a notebook in examples/nh2018_science. Unable to import modules: __init__.py refers to modules not present in hn_2016_falwa HOT 7
- ValueError: The reference state does not converge for Northern Hemisphere. HOT 17
- Translate all f2py modules into python/cython scripts HOT 2
- Deploy the package on Anaconda channel HOT 4
- Verify that all example notebooks and scripts are working HOT 2
- Cope with the differences between treatment of fields in QGField in NH18 and NHN22 HOT 1
- Provide default variable encoding parameters for xarray's to_netcdf
- To-do items for Release 1.0 HOT 4
- Issues with deployment onto conda channel HOT 2
- Issues deploying package to PyPI channel HOT 1
- Diagnostics (+ interpretations) to incorporate into MDTF
- Research into Scikit-build solution for F2PY
- Incorporate listed diagnostic to MDTF and submit pull request
- Bug in GitHub action
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hn2016_falwa.