Changeset 631 for codes/icosagcm/devel/Python/test/py/RSW_MPAS_W02.py
- Timestamp:
- 12/12/17 16:04:23 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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)
Note: See TracChangeset
for help on using the changeset viewer.