Changeset 687 for codes/icosagcm
- Timestamp:
- 03/08/18 13:05:02 (6 years ago)
- Location:
- codes/icosagcm/devel/Python
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
codes/icosagcm/devel/Python/dynamico/meshes.py
r682 r687 294 294 return ucov 295 295 def plot(self, tri,data, **kwargs): 296 plt.figure(figsize=(1 2,4))296 plt.figure(figsize=(10,4)) 297 297 plt.gca().set_aspect('equal') 298 298 plt.tricontourf(tri, data, 20, **kwargs) -
codes/icosagcm/devel/Python/src/kernels_transport.jin
r685 r687 234 234 rhodz_cum(CELL)=0. 235 235 cur_lev(HIDX(CELL))=1 236 eta(CELL)= 0.236 eta(CELL)=1. 237 237 new_rhodz_cum(HIDX(CELL))=0. 238 238 END_BLOCK … … 252 252 IF(rhodz_cum_target<=rhodz_cum_levp1) EXIT 253 253 END DO 254 IF(level>llm) level=llm 254 255 rhodz_cum_lev = rhodz_cum(AT_LEVEL(CELL,level)) 255 256 ! now rhodz_cum_lev <= rhodz_cum_target <= rhodz_cum_levp1 … … 275 276 BODY('1,llm+1') 276 277 X = eta(CELL) 277 level = FLOOR(X)278 level = MIN(llm,FLOOR(X)) ! eta=llm+1 => level=llm, X=1 278 279 X = X-level 279 280 new_thetarhodz_cum(CELL) = thetarhodz_cum(AT_LEVEL(CELL,level))+X*thetarhodz(AT_LEVEL(CELL,level)) 280 281 END_BLOCK 281 282 BODY('1,llm') 282 thetarhodz(CELL) )= new_thetarhodz_cum(UP(CELL)) - new_thetarhodz_cum(CELL)283 thetarhodz(CELL) = new_thetarhodz_cum(UP(CELL)) - new_thetarhodz_cum(CELL) 283 284 END_BLOCK 284 285 END_BLOCK … … 300 301 BODY('1,llm+1') 301 302 X = .5*(eta(CELL1)+eta(CELL2)) 302 level = FLOOR(X)303 level = MIN(llm,FLOOR(X)) 303 304 X = X-level 304 305 new_urhodz_cum(EDGE) = urhodz_cum(AT_LEVEL(EDGE,level))+X*urhodz(AT_LEVEL(EDGE,level)) -
codes/icosagcm/devel/Python/src/unstructured.pyx
r681 r687 29 29 double *dPhi_fast, double *dPhi_slow, 30 30 double *dW_fast, double *dW_slow) 31 cdef void dynamico_remap(double *rhodz, double *theta_rhodz, double *u) 31 32 cdef void dynamico_init_params() 32 33 cpdef void dynamico_setup_xios() … … 161 162 #time2=time.time() 162 163 #if time2>time1: elapsed=elapsed+time2-time1 164 def remap(self): 165 dynamico_remap(self.p_mass, self.p_theta_rhodz, self.p_u) 163 166 164 167 def caldyn_step_TRSW(mesh,time_scheme,nstep): -
codes/icosagcm/devel/Python/test/py/DCMIP2008c5.py
r680 r687 109 109 #------------------------ main program ------------------------- 110 110 111 grid, llm = 40962, 26 111 #grid, llm = 40962, 26 112 grid, llm = 2562, 26 112 113 T, Nslice, courant = 14400, 24, 3.0 113 #caldyn_thermo, caldyn_eta = unst.thermo_entropy, unst.eta_lag114 caldyn_thermo, caldyn_eta = unst.thermo_entropy, unst.eta_mass114 caldyn_thermo, caldyn_eta = unst.thermo_entropy, unst.eta_lag 115 #caldyn_thermo, caldyn_eta = unst.thermo_entropy, unst.eta_mass 115 116 thermo, mesh, hybrid_coefs, params, flow0, gas0 = DCMIP2008c5(grid,llm) 116 117 llm, dx = mesh.llm, params.dx … … 120 121 else: 121 122 print 'Mass-based coordinate.' 122 unst.ker.dynamico_init_hybrid(*hybrid_coefs) 123 124 unst.ker.dynamico_init_hybrid(*hybrid_coefs) 123 125 124 126 dt = courant*.5*dx/np.sqrt(gas0.c2.max()) … … 129 131 130 132 mesh.plot_e(mesh.le/mesh.de) ; plt.title('le/de') 131 plt.savefig('fig_DCMIP2008c5/le_de.png') ;plt.close()133 plt.savefig('fig_DCMIP2008c5/le_de.png'); plt.close() 132 134 133 135 mesh.plot_i(mesh.Ai) ; plt.title('Ai') … … 146 148 def next_flow(m,S,u): 147 149 caldyn_step.mass[:,:], caldyn_step.theta_rhodz[:,:], caldyn_step.u[:,:] = m,S,u 150 caldyn_step.remap() 148 151 caldyn_step.next() 149 152 return (caldyn_step.mass.copy(), caldyn_step.theta_rhodz.copy(),
Note: See TracChangeset
for help on using the changeset viewer.