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

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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.