Changeset 681 for codes/icosagcm/devel/Python/test
- Timestamp:
- 02/14/18 00:06:52 (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
codes/icosagcm/devel/Python/test/py/RSW2_MPAS_W02.py
r680 r681 1 print 'Starting' 2 3 from mpi4py import MPI 4 comm = MPI.COMM_WORLD 5 mpi_rank, mpi_size = comm.Get_rank(), comm.Get_size() 6 print '%d/%d starting'%(mpi_rank,mpi_size) 7 prefix='fig_RSW2_MPAS_W02/%02d'%mpi_rank 8 1 9 print 'Loading DYNAMICO modules ...' 2 10 from dynamico import unstructured as unst 3 from dynamico.meshes import MPAS_Format, Unstructured_ Mesh as Mesh11 from dynamico.meshes import MPAS_Format, Unstructured_PMesh as PMesh, Local_Mesh as Mesh 4 12 from dynamico import time_step 5 13 print '...Done' … … 11 19 print '...Done' 12 20 13 grid, llm, nqdyn = 10242, 1,1 # 2562, 10242, 4096221 grid, llm, nqdyn = 2562, 1,1 # 2562, 10242, 40962 14 22 Omega, radius, g, gh0 = 2.*np.pi/86400., 6.4e6, 1., 2.94e4 15 N, T, courant = 40, 10 800., 1.2 # simulation length = N*T23 N, T, courant = 40, 10400., 1.2 # simulation length = N*T 16 24 17 25 print 'Omega, planetary PV', Omega, 2*Omega/gh0 … … 20 28 print 'Reading MPAS mesh ...' 21 29 meshfile = MPAS_Format('grids/x1.%d.grid.nc'%grid) 22 mesh = Mesh(meshfile, llm, nqdyn, radius, f) 30 pmesh = PMesh(comm,meshfile) 31 mesh = Mesh(pmesh, llm, nqdyn, radius, f) 23 32 print '...Done' 24 33 lon, lat = mesh.lon_i, mesh.lat_i … … 30 39 dx = mesh.de.min() 31 40 dt = courant*dx/c0 41 print dx, dt 32 42 nt = int(math.ceil(T/dt)) 33 43 dt = T/nt … … 61 71 flow=gh,u 62 72 73 unst.ker.dynamico_update_halo(mesh.com_edges.index, 1, u.shape[0], u) 74 63 75 for i in range(20): 64 76 if True: … … 67 79 print i, gh.shape, gh.min(), gh.max(), u.min(), u.max() 68 80 mesh.plot_i(gh-Phi0) ; plt.title('err(gh)'); 69 plt.savefig(' fig_RSW2_MPAS_W02/err_gh_%02d.png'%i)81 plt.savefig('%s_err_gh_%02d.png'%(prefix,i)) 70 82 plt.close() 71 83 else: … … 100 112 ax8.scatter(u_nowref,u_now-u_nowref) ; ax8.set_title('u_now'); 101 113 f.subplots_adjust(hspace=1.) 102 plt.savefig(' fig_RSW2_MPAS_W02/scatter_%02d.png'%i)114 plt.savefig('%s_scatter_%02d.png'%(prefix,i)) 103 115 plt.close() 104 116
Note: See TracChangeset
for help on using the changeset viewer.