from dynamico import getargs getargs.add("--nx", type=int, default=64, help="number of points along the x axis") getargs.add("--ny", type=int, default=0, help="number of points along the y axis, defaults to nx") getargs.add("--Lx", type=float, default=0., help="domain size along x, defaults to nx") getargs.add("--Ly", type=float, default=0., help="domain size along y, defaults to ny") args = getargs.parse() for arg in vars(args): print arg, getattr(args, arg) from dynamico import meshes import numpy as np import netCDF4 as cdf import argparse nx, ny, Lx, Ly, llm, nqdyn = args.nx, args.ny,args.Lx, args.Ly, 1, 1 if ny==0 : ny=nx if Lx==0. : Lx=nx if Ly==0. : Ly=ny dx,dy=Lx/nx,Ly/ny mesh = meshes.Cartesian_Mesh(nx,ny,llm,nqdyn,Lx,Ly,0.) print('Successfully initialized Cartesian mesh') mesh.ncwrite('cart_%03d_%03d.nc'%(nx,ny)) print('Successfully written Cartesian mesh to NetCDF File')