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