Giter Club home page Giter Club logo

grid_generation's People

Contributors

adcroft avatar nikizadehgfdl avatar

Stargazers

 avatar

Watchers

 avatar  avatar

grid_generation's Issues

Need command line options for parameters

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.

Higher resolution grids

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?

find the origin of arbitrary factors in number of j points in MIDAS

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

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.