Changeset 24710


Ignore:
Timestamp:
04/15/20 17:32:53 (5 years ago)
Author:
schlegel
Message:

CHG: add GEMB check for transient forcing row to be equal between variables

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

Legend:

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

    r24240 r24710  
    446446                        WriteData(fid, prefix, 'object', self, 'fieldname', 'steps_per_step', 'format', 'Integer');
    447447                        %figure out dt from forcings:
     448                        if (any(md.smb.P(end,:) - md.smb.Ta(end,:) ~= 0) | ...
     449                                        any(md.smb.V(end,:) - md.smb.Ta(end,:) ~= 0) | ...
     450                                        any(md.smb.dswrf(end,:) - md.smb.Ta(end,:) ~= 0) | ...
     451                                        any(md.smb.dlwrf(end,:) - md.smb.Ta(end,:) ~= 0) | ...
     452                                        any(md.smb.eAir(end,:) - md.smb.Ta(end,:) ~= 0) | ...
     453                                        any(md.smb.pAir(end,:) - md.smb.Ta(end,:) ~= 0))
     454                                error('All GEMB forcings (Ta, P, V, dswrf, dlwrf, eAir, pAir) must have the same time steps in the final row!');
     455                        end
    448456                        time=self.Ta(end,:); %assume all forcings are on the same time step
    449457                        dtime=diff(time,1);
  • issm/trunk-jpl/src/m/classes/SMBgemb.py

    r24240 r24710  
    407407        WriteData(fid, prefix, 'object', self, 'fieldname', 'steps_per_step', 'format', 'Integer')
    408408        #figure out dt from forcings:
     409        if (np.any(self.P[-1] - self.Ta[-1] != 0) | np.any(self.V[-1] - self.Ta[-1] != 0) | np.any(self.dswrf[-1] - self.Ta[-1] !=0) | np.any(self.dlwrf[-1] - self.Ta[-1] != 0) | np.any(self.eAir[-1] - self.Ta[-1] != 0) | np.any(self.pAir[-1] - self.Ta[-1] != 0)):
     410            raise IOError('All GEMB forcings (Ta, P, V, dswrf, dlwrf, eAir, pAir) must have the same time steps in the final row!')
     411
    409412        time = self.Ta[-1]  #assume all forcings are on the same time step
    410413        dtime = np.diff(time, n=1, axis=0)
Note: See TracChangeset for help on using the changeset viewer.