nikizadehgfdl / grid_generation Goto Github PK
View Code? Open in Web Editor NEWA collection of tools and documents for creating compute grids for earth system models
A collection of tools and documents for creating compute grids for earth system models
I just realized all the grid parameters are hard-coded. These all should be adjustable on the command line.
We also need a mechanism to turn on/off patches. e.g. include or not include the spherical band.
I was about to roll forward to the new grid but it has a different shape so is obviously very different.
I am looking to create a higher than 1/8 degree ocean grid.
As a first step I just tried to change the r
parameter:
Changing it to 10 seemed to work (havent checked the output carefully yet), but when I change it to 12 this error pops up.
./ocean_grid_generator.py -f julius_test/ocean_hgrid_res0.08.nc -r 12 --no_changing_meta
Requesting Mercator grid with phi range: phi_s,phi_n= -66.85954724706843 64.0589597296948
y*= [-2182 2019] nj= 4202
Equator is not going to be a u-point!
Fixing this by shifting the bounds!
y*= [-2183 2018] nj= 4202
Supergrid has an odd number of area cells!
Fixing this by shifting the y_star[1]
y*= [-2183 2017] nj= 4201
Generating Mercator grid with phi range: phi_s,phi_n= [-66.89227423 64.02248205]
Equator is at j= 2183
number of js= 4201
Generating bipolar grid bounded at latitude 64.0407387829004
number of js= 1423
Generating regular lat-lon grid between latitudes -78.0 -66.9086322432972
generated regular lat-lon grid between latitudes -78.0 -66.9086322432972
number of js= 679
Generating displaced pole grid bounded at latitude -78.01635894949366
rdp= 0.2 , doughnut= 0.12
The number of j's is not even. Fixing this by cutting one row at south.
number of js= 365
Stitching the grids together...
Writing netcdf file with ny,nx= 6664 8640
Traceback (most recent call last):
File "./ocean_grid_generator.py", line 776, in <module>
main(sys.argv[1:])
File "./ocean_grid_generator.py", line 767, in main
write_nc(x3,y3,dx3,dy3,area3,angle3,axis_units='degrees',fnam=gridfilename,description=desc,history=hist,source=source,no_changing_meta=no_changing_meta)
File "./ocean_grid_generator.py", line 341, in write_nc
anglev[:]=angle_dx
File "netCDF4/_netCDF4.pyx", line 4648, in netCDF4._netCDF4.Variable.__setitem__
File "netCDF4/_netCDF4.pyx", line 4913, in netCDF4._netCDF4.Variable._put
File "netCDF4/_netCDF4.pyx", line 1754, in netCDF4._netCDF4._ensure_nc_success
RuntimeError: NetCDF: Operation not allowed in define mode
I am not yet very familiar with this code. Would this be a common problem?
The only thing i noticed is that the 1/12 grid has an even number of y cells (Writing netcdf file with ny,nx= 6664 8640
, while the 1/10
(Writing netcdf file with ny,nx= 5555 7200
) and the example 1/8 from the Makefile
(Writing netcdf file with ny,nx= 4441 5760
) seem to produce an odd number of y cells. Could this be a problem?
The MIDAS generating code has these arbitrary looking factors in Nj. I have tried to replace these by scaling the variable "refine" :
refine=2*degree_resolution_inverse # instead of 2 in MIDAS
Ni =refine* lenlon
Nj_ncap=refine* 60 #MIDAS has refine*( 240 for 1/4 degree, 119 for 1/2 degree
Nj_SO =refine* 28 #MIDAS has refine*( 110 for 1/4 degree, 54 for 1/2 degree
Nj_scap=refine* 20 #MIDAS has refine*( 80 for 1/4 degree, ??? for 1/2 degree
#Nj_Merc=UNUSED #MIDAS has refine*( 700 for 1/4 degree, 364 for 1/2 degree
Where do these factors come from? They should be derivable from the extents of the grids, right?
Also
#Mercator grid
#MIDAS has nominal starting latitude for Mercator grid = -65 for 1/4 degree, -70 for 1/2 degree
#MIDAS has nominal latitude range of Mercator grid = 125 for 1/4 degree, 135 for 1/2 degree
How do these relate to the new code?
phi_s_Merc, phi_n_Merc = -66.85954724706843, 64.0589597296948
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.