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