Changeset 25313


Ignore:
Timestamp:
07/30/20 04:09:29 (5 years ago)
Author:
bdef
Message:

BUG: fix for the scaling in WriteData

Location:
issm/trunk-jpl/src/m
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/src/m/classes/SMBgemb.py

    r25312 r25313  
    376376        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'isclimatology', 'format', 'Boolean')
    377377        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'isconstrainsurfaceT', 'format', 'Boolean')
    378 
    379378        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'Ta', 'format', 'DoubleMat', 'mattype', 2, 'timeserieslength', md.mesh.numberofelements + 1, 'yts', yts)
    380379        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'V', 'format', 'DoubleMat', 'mattype', 2, 'timeserieslength', md.mesh.numberofelements + 1, 'yts', yts)
     
    434433        time = self.Ta[-1]  #assume all forcings are on the same time step
    435434        dtime = np.diff(time, n=1, axis=0)
    436         dt = min(dtime) / yts
     435        dt = min(dtime)
    437436
    438437        WriteData(fid, prefix, 'data', dt, 'name', 'md.smb.dt', 'format', 'Double', 'scale', yts)
  • issm/trunk-jpl/src/m/solve/WriteData.py

    r25311 r25313  
    1717    #process options
    1818    options = pairoptions.pairoptions(*args)
    19 
    2019    #Get data properties
    2120    if options.exist('object'):
     
    4948    #       (see https://ross.ics.uci.edu/jenkins/view/All/job/Debian_Linux-Python/1036).
    5049    #
    51     # data = deepcopy(data)
     50    data = deepcopy(data)
    5251
    5352    #Scale data if necessary
     
    6362                    data[i] = scale * data[i]
    6463            if np.ndim(data[i]) > 1 and data[i].shape[0] == timeserieslength:
    65                 #no scaling given, use yts instead
     64                #no scaling given, just get the time right
    6665                yts = options.getfieldvalue('yts')
    6766                #We scale only the last line that holds time
     
    7776        if np.ndim(data) > 1 and data.shape[0] == timeserieslength:
    7877            yts = options.getfieldvalue('yts')
     78            #We scale only the last line that holds time
     79            # scaler = np.ones((np.shape(data)))
     80            # scaler[-1, :] = yts
     81            # data = scaler * data
    7982            data[-1, :] = yts * data[-1, :]
    8083
Note: See TracChangeset for help on using the changeset viewer.