Changeset 696 for codes/icosagcm


Ignore:
Timestamp:
05/10/18 01:01:55 (6 years ago)
Author:
dubos
Message:

devel/unstructured : bugfix XIOS output

Location:
codes/icosagcm/devel/Python
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • codes/icosagcm/devel/Python/dynamico/xios.py

    r694 r696  
    2929 
    3030class XIOS_Context: 
    31     def __init__(self, pmesh, mesh,nqtot): 
     31    def __init__(self, pmesh, mesh,nqtot, step): 
    3232        self.mesh=mesh 
    3333        ker.dynamico_setup_xios() 
     
    4646        # calendar 
    4747        calendar=cxios.Handle('calendar_wrapper') 
    48         dtime = cxios.Duration(second=3600.) 
     48        dtime = cxios.Duration(second=step) 
    4949        calendar.set_attr(timestep=dtime) 
    5050        calendar.update_timestep() 
     
    6060            data = data[own_loc] 
    6161        if data.ndim==2: 
    62             data = data[:,own_loc] 
     62            data = data[own_loc,:] 
     63            data = data.transpose() # XIOS expects contiguous horizontal slices 
    6364        data = np.ascontiguousarray(data) 
    6465        cxios.send_field(name, data) 
  • codes/icosagcm/devel/Python/test/py/test_xios.py

    r694 r696  
    2828#--------------------------------- write some data ---------------------------------------- 
    2929 
    30 context=xios.XIOS_Context(pmesh,mesh,nqtot) 
     30context=xios.XIOS_Context(pmesh,mesh,nqtot, 3600) 
    3131 
    3232lat_i = radian*mesh.lat_i 
    33 lat_ik, junk  = np.meshgrid(lat_i, np.arange(llm), indexing='xy') 
     33lat_ik, junk  = np.meshgrid(lat_i, np.arange(llm), indexing='ij') 
    3434 
    3535no_error=True 
     
    3737    for i in range(100): 
    3838        context.update_calendar(i) 
    39         print 'send_field', i 
     39        print 'send_field', i, lat_ik.shape 
    4040        context.send_field_primal('ps', lat_i) 
    4141        context.send_field_primal('theta', lat_ik) 
Note: See TracChangeset for help on using the changeset viewer.