Ignore:
Timestamp:
12/12/17 16:04:23 (7 years ago)
Author:
dubos
Message:

devel/Python : extract pure Python stuff from cython module unstructured.pyx

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  
     1from dynamico.meshes import Cartesian_mesh as Mesh 
    12from dynamico import unstructured as unst 
    23from dynamico import dyn 
     
    1516 
    1617unst.setvar('g',g) 
    17 mesh = unst.Cartesian_mesh(nx,ny,llm,nqdyn,Lx,Ly,f) 
     18mesh = Mesh(nx,ny,llm,nqdyn,Lx,Ly,f) 
    1819caldyn = unst.Caldyn_RSW(mesh) 
    1920 
  • codes/icosagcm/devel/Python/test/py/RSW_MPAS_W02.py

    r617 r631  
    1 import sys 
    21print 'Loading modules ...' 
    3 sys.stdout.flush() 
    4  
    52import math as math 
    6 # select non-interactive backend, cf http://stackoverflow.com/questions/4931376/generating-matplotlib-graphs-without-a-running-x-server 
    7 import matplotlib 
    8 matplotlib.use('Agg')  
    93import matplotlib.pyplot as plt 
    104import numpy as np 
     5print '...Done' 
    116 
    127print 'Loading DYNAMICO modules ...' 
    13 sys.stdout.flush() 
    148from dynamico import unstructured as unst 
     9from dynamico.meshes import MPAS_Mesh as Mesh 
    1510from dynamico import time_step 
    1611print '...Done' 
    17 sys.stdout.flush() 
    1812 
    1913grid, llm, nqdyn = 10242, 1,1 # 2562, 10242, 40962 
     
    2216 
    2317print 'Omega, planetary PV', Omega, 2*Omega/gh0 
    24 sys.stdout.flush() 
    2518 
    2619def f(lon,lat): return 2*Omega*np.sin(lat) # Coriolis parameter 
    2720print 'Reading MPAS mesh ...' 
    28 sys.stdout.flush() 
    29 mesh = unst.MPAS_Mesh('grids/x1.%d.grid.nc'%grid, llm, nqdyn, radius, f) 
     21mesh = Mesh('grids/x1.%d.grid.nc'%grid, llm, nqdyn, radius, f) 
    3022print '...Done' 
    31 sys.stdout.flush() 
    3223lon, lat = mesh.lon_i, mesh.lat_i 
    3324x,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  
    44import matplotlib.animation as manimation 
    55 
     6from dynamico.meshes import Cartesian_mesh as Mesh 
    67import dynamico.dyn as dyn 
    78import dynamico.time_step as time_step 
     
    9495 
    9596unst.setvar('nb_threads', 1) 
    96 mesh = unst.Cartesian_mesh(nx,ny,llm,nqdyn,Lx,ny*dx,0.) 
     97mesh = Mesh(nx,ny,llm,nqdyn,Lx,ny*dx,0.) 
    9798xx_ik, xx_il, ll = mesh.xx[:,0,:]/1000, mesh.xxp1[:,0,:]/1000, mesh.ll[:,0,:] 
    9899 
  • codes/icosagcm/devel/Python/test/py/slice_GW_NH.py

    r617 r631  
     1from dynamico.meshes import Cartesian_mesh as Mesh 
    12from dynamico import unstructured as unst 
    23from dynamico import dyn 
     
    9192Lx, nx, ztop, llm = 2e5, 400, 3e4, 60 
    9293nqdyn, ny, dx = 1, 1, Lx/nx 
    93 mesh = unst.Cartesian_mesh(nx,ny,llm,nqdyn,nx*dx,ny*dx,0.) 
     94mesh = Mesh(nx,ny,llm,nqdyn,nx*dx,ny*dx,0.) 
    9495xx,ll = mesh.xx[:,0,:]/1000, mesh.ll[:,0,:] 
    9596 
  • codes/icosagcm/devel/Python/test/py/slice_GW_hydro.py

    r617 r631  
     1from dynamico.meshes import Cartesian_mesh as Mesh 
    12from dynamico import unstructured as unst 
    23from dynamico import dyn 
     
    5859Lx, nx, llm = 3e5, 300, 20 
    5960nqdyn, ny, dx = 1, 1, Lx/nx 
    60 mesh = unst.Cartesian_mesh(nx,ny,llm,nqdyn,nx*dx,ny*dx,0.) 
     61mesh = Mesh(nx,ny,llm,nqdyn,nx*dx,ny*dx,0.) 
    6162xx,ll = mesh.xx[:,0,:]/1000, mesh.ll[:,0,:] 
    6263metric, thermo, BC, m0ik, gas0, Phi0_il, u0_jk = DCMIP.DCMIP31(Lx, nx, llm) 
  • codes/icosagcm/devel/Python/test/py/test_xios.py

    r622 r631  
    44print '%d/%d starting'%(mpi_rank,mpi_size) 
    55 
    6 import sys 
    76import numpy as np 
    8 #import dynamico.wrap as wrap 
    97print 'import dynamico.unstructured' 
    108import dynamico.unstructured as unst 
     
    1210import dynamico.xios as xios 
    1311print 'Done.' 
     12from dynamico.meshes import MPAS_Mesh as Mesh, radian 
    1413 
    1514def boundaries(degree,points,lon,lat): 
     
    2928#----------------------------- read MPAS mesh -------------------------------- 
    3029 
    31 radian=unst.radian 
    3230grid, llm, nqdyn, nqtot = 10242, 1,1,1 # 2562, 10242, 40962   
    3331Omega, radius, g, gh0 = 2.*np.pi/86400., 6.4e6, 1., 2.94e4 
    3432N, T, courant = 40, 10800., 1.2 # simulation length = N*T 
    3533print 'Omega, planetary PV', Omega, 2*Omega/gh0 
    36 sys.stdout.flush() 
    3734 
    3835def f(lon,lat): return 2*Omega*np.sin(lat) # Coriolis parameter                                                                                                                 
    3936print 'Reading MPAS mesh ...' 
    40 sys.stdout.flush() 
    41 mesh = unst.MPAS_Mesh('grids/x1.%d.grid.nc'%grid, llm, nqdyn, radius, f) 
     37mesh = Mesh('grids/x1.%d.grid.nc'%grid, llm, nqdyn, radius, f) 
    4238print '...Done' 
    43 sys.stdout.flush() 
    4439 
    4540lon_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.