Changeset 696 for codes/icosagcm
- Timestamp:
- 05/10/18 01:01:55 (6 years ago)
- Location:
- codes/icosagcm/devel/Python
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
codes/icosagcm/devel/Python/dynamico/xios.py
r694 r696 29 29 30 30 class XIOS_Context: 31 def __init__(self, pmesh, mesh,nqtot ):31 def __init__(self, pmesh, mesh,nqtot, step): 32 32 self.mesh=mesh 33 33 ker.dynamico_setup_xios() … … 46 46 # calendar 47 47 calendar=cxios.Handle('calendar_wrapper') 48 dtime = cxios.Duration(second= 3600.)48 dtime = cxios.Duration(second=step) 49 49 calendar.set_attr(timestep=dtime) 50 50 calendar.update_timestep() … … 60 60 data = data[own_loc] 61 61 if data.ndim==2: 62 data = data[:,own_loc] 62 data = data[own_loc,:] 63 data = data.transpose() # XIOS expects contiguous horizontal slices 63 64 data = np.ascontiguousarray(data) 64 65 cxios.send_field(name, data) -
codes/icosagcm/devel/Python/test/py/test_xios.py
r694 r696 28 28 #--------------------------------- write some data ---------------------------------------- 29 29 30 context=xios.XIOS_Context(pmesh,mesh,nqtot )30 context=xios.XIOS_Context(pmesh,mesh,nqtot, 3600) 31 31 32 32 lat_i = radian*mesh.lat_i 33 lat_ik, junk = np.meshgrid(lat_i, np.arange(llm), indexing=' xy')33 lat_ik, junk = np.meshgrid(lat_i, np.arange(llm), indexing='ij') 34 34 35 35 no_error=True … … 37 37 for i in range(100): 38 38 context.update_calendar(i) 39 print 'send_field', i 39 print 'send_field', i, lat_ik.shape 40 40 context.send_field_primal('ps', lat_i) 41 41 context.send_field_primal('theta', lat_ik)
Note: See TracChangeset
for help on using the changeset viewer.