[790] | 1 | from dynamico import getargs |
---|
[869] | 2 | getargs.add("--nx", type=int, default=64, |
---|
| 3 | help="number of points along the x axis") |
---|
| 4 | getargs.add("--ny", type=int, default=0, |
---|
| 5 | help="number of points along the y axis, defaults to nx") |
---|
| 6 | getargs.add("--Lx", type=float, default=0., |
---|
| 7 | help="domain size along x, defaults to nx") |
---|
| 8 | getargs.add("--Ly", type=float, default=0., |
---|
| 9 | help="domain size along y, defaults to ny") |
---|
[751] | 10 | |
---|
[790] | 11 | args = getargs.parse() |
---|
[825] | 12 | for arg in vars(args): print arg, getattr(args, arg) |
---|
[790] | 13 | |
---|
| 14 | from dynamico import meshes |
---|
| 15 | import numpy as np |
---|
| 16 | import netCDF4 as cdf |
---|
| 17 | import argparse |
---|
| 18 | |
---|
[773] | 19 | nx, ny, Lx, Ly, llm, nqdyn = args.nx, args.ny,args.Lx, args.Ly, 1, 1 |
---|
[869] | 20 | if ny==0 : ny=nx |
---|
| 21 | if Lx==0. : Lx=nx |
---|
| 22 | if Ly==0. : Ly=ny |
---|
[773] | 23 | |
---|
[751] | 24 | dx,dy=Lx/nx,Ly/ny |
---|
[807] | 25 | mesh = meshes.Cartesian_Mesh(nx,ny,llm,nqdyn,Lx,Ly,0.) |
---|
[751] | 26 | print('Successfully initialized Cartesian mesh') |
---|
[758] | 27 | mesh.ncwrite('cart_%03d_%03d.nc'%(nx,ny)) |
---|
[751] | 28 | print('Successfully written Cartesian mesh to NetCDF File') |
---|