Changeset 18865


Ignore:
Timestamp:
11/26/14 11:26:17 (10 years ago)
Author:
bdef
Message:

CHG: fixing time dependant result output

File:
1 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/src/m/contrib/netCDF/export_netCDF.py

    r18864 r18865  
    8686                                vartab=var
    8787                                for time in range(freq-1,last,freq):
    88                                         timevar=md.results.__dict__[supfield].__getitem__(time).__dict__[field]
    89                                         #print 'Treating '+str(group)+'.'+str(supfield)+'.'+str(field)+' for time '+str(time)
    90                                         vartab=numpy.column_stack((vartab,timevar))
    91                                 print numpy.shape(ncvar)
    92                                 ncvar[:,:]=vartab
     88                                        if time!=0:
     89                                                timevar=md.results.__dict__[supfield].__getitem__(time).__dict__[field]
     90#                                               print 'Treating '+str(group)+'.'+str(supfield)+'.'+str(field)+' for time '+str(time)
     91                                                vartab=numpy.column_stack((vartab,timevar))
     92                                try:
     93                                        ncvar[:,:]=vartab[:,:]
     94                                except ValueError:
     95                                        ncvar[:]=vartab.T[:]
    9396                        else:
    9497                                try:
     
    169172                                        subfields=dict.keys(md.results.__dict__[supfield].__getitem__(0).__dict__)
    170173                                        for field in subfields:
    171 #                                               print 'Treating '+str(group)+'.'+str(supfield)+'.'+str(field)+' for time '+str(0)
    172174                                                if str(field)!='errlog' and str(field)!='outlog' and str(field)!='SolutionType':
    173175                                                        Var=md.results.__dict__[supfield].__getitem__(0).__dict__[field]
    174176                                                        CreateVar(Var,True,last_step,step_freq)
    175 #                                                       print 'Treating '+str(group)+'.'+str(supfield)+'.'+str(field)+' for time '+str(0)
    176177                                       
    177178                                elif type(md.results.__dict__[supfield])==results:#only one timestep
     
    179180                                        for field in subfields:
    180181                                                if str(field)!='errlog' and str(field)!='outlog' and str(field)!='SolutionType':
     182#                                                       print 'Treating '+str(group)+'.'+str(supfield)+'.'+str(field)
    181183                                                        Var=md.results.__dict__[supfield].__dict__[field]
    182184                                                        CreateVar(Var,False)
    183 #                                                       print 'Treating '+str(group)+'.'+str(supfield)+'.'+str(field)
    184185                                else:
    185186                                        print 'Result format not suported'
Note: See TracChangeset for help on using the changeset viewer.