Changeset 631 for codes/icosagcm/devel/Python/test
- Timestamp:
- 12/12/17 16:04:23 (7 years ago)
- Location:
- codes/icosagcm/devel/Python/test/py
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
codes/icosagcm/devel/Python/test/py/RSW_2D.py
r617 r631 1 from dynamico.meshes import Cartesian_mesh as Mesh 1 2 from dynamico import unstructured as unst 2 3 from dynamico import dyn … … 15 16 16 17 unst.setvar('g',g) 17 mesh = unst.Cartesian_mesh(nx,ny,llm,nqdyn,Lx,Ly,f)18 mesh = Mesh(nx,ny,llm,nqdyn,Lx,Ly,f) 18 19 caldyn = unst.Caldyn_RSW(mesh) 19 20 -
codes/icosagcm/devel/Python/test/py/RSW_MPAS_W02.py
r617 r631 1 import sys2 1 print 'Loading modules ...' 3 sys.stdout.flush()4 5 2 import math as math 6 # select non-interactive backend, cf http://stackoverflow.com/questions/4931376/generating-matplotlib-graphs-without-a-running-x-server7 import matplotlib8 matplotlib.use('Agg')9 3 import matplotlib.pyplot as plt 10 4 import numpy as np 5 print '...Done' 11 6 12 7 print 'Loading DYNAMICO modules ...' 13 sys.stdout.flush()14 8 from dynamico import unstructured as unst 9 from dynamico.meshes import MPAS_Mesh as Mesh 15 10 from dynamico import time_step 16 11 print '...Done' 17 sys.stdout.flush()18 12 19 13 grid, llm, nqdyn = 10242, 1,1 # 2562, 10242, 40962 … … 22 16 23 17 print 'Omega, planetary PV', Omega, 2*Omega/gh0 24 sys.stdout.flush()25 18 26 19 def f(lon,lat): return 2*Omega*np.sin(lat) # Coriolis parameter 27 20 print 'Reading MPAS mesh ...' 28 sys.stdout.flush() 29 mesh = unst.MPAS_Mesh('grids/x1.%d.grid.nc'%grid, llm, nqdyn, radius, f) 21 mesh = Mesh('grids/x1.%d.grid.nc'%grid, llm, nqdyn, radius, f) 30 22 print '...Done' 31 sys.stdout.flush()32 23 lon, lat = mesh.lon_i, mesh.lat_i 33 24 x,y,z = np.cos(lat)*np.cos(lon), np.cos(lat)*np.sin(lon), np.sin(lat) -
codes/icosagcm/devel/Python/test/py/bubble.py
r617 r631 4 4 import matplotlib.animation as manimation 5 5 6 from dynamico.meshes import Cartesian_mesh as Mesh 6 7 import dynamico.dyn as dyn 7 8 import dynamico.time_step as time_step … … 94 95 95 96 unst.setvar('nb_threads', 1) 96 mesh = unst.Cartesian_mesh(nx,ny,llm,nqdyn,Lx,ny*dx,0.)97 mesh = Mesh(nx,ny,llm,nqdyn,Lx,ny*dx,0.) 97 98 xx_ik, xx_il, ll = mesh.xx[:,0,:]/1000, mesh.xxp1[:,0,:]/1000, mesh.ll[:,0,:] 98 99 -
codes/icosagcm/devel/Python/test/py/slice_GW_NH.py
r617 r631 1 from dynamico.meshes import Cartesian_mesh as Mesh 1 2 from dynamico import unstructured as unst 2 3 from dynamico import dyn … … 91 92 Lx, nx, ztop, llm = 2e5, 400, 3e4, 60 92 93 nqdyn, ny, dx = 1, 1, Lx/nx 93 mesh = unst.Cartesian_mesh(nx,ny,llm,nqdyn,nx*dx,ny*dx,0.)94 mesh = Mesh(nx,ny,llm,nqdyn,nx*dx,ny*dx,0.) 94 95 xx,ll = mesh.xx[:,0,:]/1000, mesh.ll[:,0,:] 95 96 -
codes/icosagcm/devel/Python/test/py/slice_GW_hydro.py
r617 r631 1 from dynamico.meshes import Cartesian_mesh as Mesh 1 2 from dynamico import unstructured as unst 2 3 from dynamico import dyn … … 58 59 Lx, nx, llm = 3e5, 300, 20 59 60 nqdyn, ny, dx = 1, 1, Lx/nx 60 mesh = unst.Cartesian_mesh(nx,ny,llm,nqdyn,nx*dx,ny*dx,0.)61 mesh = Mesh(nx,ny,llm,nqdyn,nx*dx,ny*dx,0.) 61 62 xx,ll = mesh.xx[:,0,:]/1000, mesh.ll[:,0,:] 62 63 metric, thermo, BC, m0ik, gas0, Phi0_il, u0_jk = DCMIP.DCMIP31(Lx, nx, llm) -
codes/icosagcm/devel/Python/test/py/test_xios.py
r622 r631 4 4 print '%d/%d starting'%(mpi_rank,mpi_size) 5 5 6 import sys7 6 import numpy as np 8 #import dynamico.wrap as wrap9 7 print 'import dynamico.unstructured' 10 8 import dynamico.unstructured as unst … … 12 10 import dynamico.xios as xios 13 11 print 'Done.' 12 from dynamico.meshes import MPAS_Mesh as Mesh, radian 14 13 15 14 def boundaries(degree,points,lon,lat): … … 29 28 #----------------------------- read MPAS mesh -------------------------------- 30 29 31 radian=unst.radian32 30 grid, llm, nqdyn, nqtot = 10242, 1,1,1 # 2562, 10242, 40962 33 31 Omega, radius, g, gh0 = 2.*np.pi/86400., 6.4e6, 1., 2.94e4 34 32 N, T, courant = 40, 10800., 1.2 # simulation length = N*T 35 33 print 'Omega, planetary PV', Omega, 2*Omega/gh0 36 sys.stdout.flush()37 34 38 35 def f(lon,lat): return 2*Omega*np.sin(lat) # Coriolis parameter 39 36 print 'Reading MPAS mesh ...' 40 sys.stdout.flush() 41 mesh = unst.MPAS_Mesh('grids/x1.%d.grid.nc'%grid, llm, nqdyn, radius, f) 37 mesh = Mesh('grids/x1.%d.grid.nc'%grid, llm, nqdyn, radius, f) 42 38 print '...Done' 43 sys.stdout.flush()44 39 45 40 lon_i, lat_i, lon_v, lat_v = [x*radian for x in mesh.lon_i, mesh.lat_i, mesh.lon_v, mesh.lat_v]
Note: See TracChangeset
for help on using the changeset viewer.