| [20498] | 1 | Index: ../trunk-jpl/src/m/consistency/checkfield.py
|
|---|
| 2 | ===================================================================
|
|---|
| 3 | --- ../trunk-jpl/src/m/consistency/checkfield.py (revision 19284)
|
|---|
| 4 | +++ ../trunk-jpl/src/m/consistency/checkfield.py (revision 19285)
|
|---|
| 5 | @@ -166,5 +166,18 @@
|
|---|
| 6 | md = md.checkmessage(options.getfieldvalue('message',\
|
|---|
| 7 | "field '%s' should have md.mesh.numberofvertices or md.mesh.numberofvertices+1 lines" % fieldname))
|
|---|
| 8 |
|
|---|
| 9 | + #Check single value forcings (size and times)
|
|---|
| 10 | + if options.getfieldvalue('singletimeseries',0):
|
|---|
| 11 | + if numpy.size(field,0)==2:
|
|---|
| 12 | + if not all(field[-1,:]==numpy.sort(field[-1,:])):
|
|---|
| 13 | + md = md.checkmessage(options.getfieldvalue('message',\
|
|---|
| 14 | + "field '%s' columns should be sorted chronologically" % fieldname))
|
|---|
| 15 | + if any(field[-1,0:-1]==field[-1,1:]):
|
|---|
| 16 | + md = md.checkmessage(options.getfieldvalue('message',\
|
|---|
| 17 | + "field '%s' columns must not contain duplicate timesteps" % fieldname))
|
|---|
| 18 | + else:
|
|---|
| 19 | + md = md.checkmessage(options.getfieldvalue('message',\
|
|---|
| 20 | + "field '%s' should have 2 lines" % fieldname))
|
|---|
| 21 | +
|
|---|
| 22 | return md
|
|---|
| 23 |
|
|---|
| 24 | Index: ../trunk-jpl/src/m/consistency/checkfield.m
|
|---|
| 25 | ===================================================================
|
|---|
| 26 | --- ../trunk-jpl/src/m/consistency/checkfield.m (revision 19284)
|
|---|
| 27 | +++ ../trunk-jpl/src/m/consistency/checkfield.m (revision 19285)
|
|---|
| 28 | @@ -203,7 +203,7 @@
|
|---|
| 29 | md = checkmessage(md,getfieldvalue(options,'message',...
|
|---|
| 30 | ['field ''' fieldname ''' should have only one column as there are md.mesh.numberofvertices lines']));
|
|---|
| 31 | end
|
|---|
| 32 | - elseif size(field,1)==md.mesh.numberofvertices+1 || size(field,1)==2
|
|---|
| 33 | + elseif size(field,1)==md.mesh.numberofvertices+1
|
|---|
| 34 | if any(field(end,:)~=sort(field(end,:))),
|
|---|
| 35 | md = checkmessage(md,getfieldvalue(options,'message',...
|
|---|
| 36 | ['field ''' fieldname ''' columns should be sorted chronologically']));
|
|---|
| 37 | @@ -217,3 +217,20 @@
|
|---|
| 38 | ['field ''' fieldname ''' should have md.mesh.numberofvertices or md.mesh.numberofvertices+1 lines']));
|
|---|
| 39 | end
|
|---|
| 40 | end
|
|---|
| 41 | +
|
|---|
| 42 | +%Check single value forcings (size and times)
|
|---|
| 43 | +if getfieldvalue(options,'singletimeseries',0),
|
|---|
| 44 | + if size(field,1)==2
|
|---|
| 45 | + if any(field(end,:)~=sort(field(end,:))),
|
|---|
| 46 | + md = checkmessage(md,getfieldvalue(options,'message',...
|
|---|
| 47 | + ['field ''' fieldname ''' columns should be sorted chronologically']));
|
|---|
| 48 | + end
|
|---|
| 49 | + if any(field(end,1:end-1)==field(end,2:end)),
|
|---|
| 50 | + md = checkmessage(md,getfieldvalue(options,'message',...
|
|---|
| 51 | + ['field ''' fieldname ''' columns must not contain duplicate timesteps']));
|
|---|
| 52 | + end
|
|---|
| 53 | + else
|
|---|
| 54 | + md = checkmessage(md,getfieldvalue(options,'message',...
|
|---|
| 55 | + ['field ''' fieldname ''' should have 2 lines']));
|
|---|
| 56 | + end
|
|---|
| 57 | +end
|
|---|
| 58 | Index: ../trunk-jpl/src/m/classes/SMBd18opdd.py
|
|---|
| 59 | ===================================================================
|
|---|
| 60 | --- ../trunk-jpl/src/m/classes/SMBd18opdd.py (revision 19284)
|
|---|
| 61 | +++ ../trunk-jpl/src/m/classes/SMBd18opdd.py (revision 19285)
|
|---|
| 62 | @@ -88,7 +88,7 @@
|
|---|
| 63 | if self.isd18opd:
|
|---|
| 64 | md = checkfield(md,'fieldname','surfaceforcings.temperatures_presentday','size',[md.mesh.numberofvertices+1,12],'NaN',1,'timeseries',1)
|
|---|
| 65 | md = checkfield(md,'fieldname','surfaceforcings.precipitations_presentday','size',[md.mesh.numberofvertices+1,12],'NaN',1,'timeseries',1)
|
|---|
| 66 | - md = checkfield(md,'fieldname','surfaceforcings.delta18o','NaN',1,'size',[2,numpy.nan],'timeseries',1)
|
|---|
| 67 | + md = checkfield(md,'fieldname','surfaceforcings.delta18o','NaN',1,'size',[2,numpy.nan],'singletimeseries',1)
|
|---|
| 68 | md = checkfield(md,'fieldname','surfaceforcings.dpermil','>=',0,'numel',[1])
|
|---|
| 69 |
|
|---|
| 70 | return md
|
|---|
| 71 | Index: ../trunk-jpl/src/m/classes/SMBd18opdd.m
|
|---|
| 72 | ===================================================================
|
|---|
| 73 | --- ../trunk-jpl/src/m/classes/SMBd18opdd.m (revision 19284)
|
|---|
| 74 | +++ ../trunk-jpl/src/m/classes/SMBd18opdd.m (revision 19285)
|
|---|
| 75 | @@ -65,7 +65,7 @@
|
|---|
| 76 | if(self.isd18opd==1)
|
|---|
| 77 | md = checkfield(md,'fieldname','surfaceforcings.temperatures_presentday','size',[md.mesh.numberofvertices+1 12],'NaN',1,'timeseries',1);
|
|---|
| 78 | md = checkfield(md,'fieldname','surfaceforcings.precipitations_presentday','size',[md.mesh.numberofvertices+1 12],'NaN',1,'timeseries',1);
|
|---|
| 79 | - md = checkfield(md,'fieldname','surfaceforcings.delta18o','NaN',1,'size',[2,NaN],'timeseries',1);
|
|---|
| 80 | + md = checkfield(md,'fieldname','surfaceforcings.delta18o','NaN',1,'size',[2,NaN],'singletimeseries',1);
|
|---|
| 81 | md = checkfield(md,'fieldname','surfaceforcings.dpermil','>=',0,'numel',1);
|
|---|
| 82 | end
|
|---|
| 83 | end
|
|---|
| 84 | Index: ../trunk-jpl/src/m/classes/SMBpdd.py
|
|---|
| 85 | ===================================================================
|
|---|
| 86 | --- ../trunk-jpl/src/m/classes/SMBpdd.py (revision 19284)
|
|---|
| 87 | +++ ../trunk-jpl/src/m/classes/SMBpdd.py (revision 19285)
|
|---|
| 88 | @@ -117,22 +117,22 @@
|
|---|
| 89 | md = checkfield(md,'fieldname','surfaceforcings.monthlytemperatures','NaN',1,'timeseries',1)
|
|---|
| 90 | md = checkfield(md,'fieldname','surfaceforcings.precipitation','NaN',1,'timeseries',1)
|
|---|
| 91 | elif self.isdelta18o:
|
|---|
| 92 | - md = checkfield(md,'fieldname','surfaceforcings.delta18o','NaN',1,'size',[2,numpy.nan],'timeseries',1)
|
|---|
| 93 | - md = checkfield(md,'fieldname','surfaceforcings.delta18o_surface','NaN',1,'size',[2,numpy.nan],'timeseries',1)
|
|---|
| 94 | + md = checkfield(md,'fieldname','surfaceforcings.delta18o','NaN',1,'size',[2,numpy.nan],'singletimeseries',1)
|
|---|
| 95 | + md = checkfield(md,'fieldname','surfaceforcings.delta18o_surface','NaN',1,'size',[2,numpy.nan],'singletimeseries',1)
|
|---|
| 96 | md = checkfield(md,'fieldname','surfaceforcings.temperatures_presentday','size',[md.mesh.numberofvertices+1,12],'NaN',1,'timeseries',1)
|
|---|
| 97 | md = checkfield(md,'fieldname','surfaceforcings.temperatures_lgm','size',[md.mesh.numberofvertices+1,12],'NaN',1,'timeseries',1)
|
|---|
| 98 | md = checkfield(md,'fieldname','surfaceforcings.precipitations_presentday','size',[md.mesh.numberofvertices+1,12],'NaN',1,'timeseries',1)
|
|---|
| 99 | md = checkfield(md,'fieldname','surfaceforcings.precipitations_lgm','size',[md.mesh.numberofvertices+1,12],'NaN',1,'timeseries',1)
|
|---|
| 100 | - md = checkfield(md,'fieldname','surfaceforcings.Tdiff','NaN',1,'size',[2,numpy.nan],'timeseries',1)
|
|---|
| 101 | - md = checkfield(md,'fieldname','surfaceforcings.sealev','NaN',1,'size',[2,numpy.nan],'timeseries',1)
|
|---|
| 102 | + md = checkfield(md,'fieldname','surfaceforcings.Tdiff','NaN',1,'size',[2,numpy.nan],'singletimeseries',1)
|
|---|
| 103 | + md = checkfield(md,'fieldname','surfaceforcings.sealev','NaN',1,'size',[2,numpy.nan],'singletimeseries',1)
|
|---|
| 104 | elif self.ismungsm:
|
|---|
| 105 | md = checkfield(md,'fieldname','surfaceforcings.temperatures_presentday','size',[md.mesh.numberofvertices+1,12],'NaN',1,'timeseries',1)
|
|---|
| 106 | md = checkfield(md,'fieldname','surfaceforcings.temperatures_lgm','size',[md.mesh.numberofvertices+1,12],'NaN',1,'timeseries',1)
|
|---|
| 107 | md = checkfield(md,'fieldname','surfaceforcings.precipitations_presentday','size',[md.mesh.numberofvertices+1,12],'NaN',1,'timeseries',1)
|
|---|
| 108 | md = checkfield(md,'fieldname','surfaceforcings.precipitations_lgm','size',[md.mesh.numberofvertices+1,12],'NaN',1,'timeseries',1)
|
|---|
| 109 | - md = checkfield(md,'fieldname','surfaceforcings.Pfac','NaN',1,'size',[2,numpy.nan],'timeseries',1)
|
|---|
| 110 | - md = checkfield(md,'fieldname','surfaceforcings.Tdiff','NaN',1,'size',[2,numpy.nan],'timeseries',1)
|
|---|
| 111 | - md = checkfield(md,'fieldname','surfaceforcings.sealev','NaN',1,'size',[2,numpy.nan],'timeseries',1)
|
|---|
| 112 | + md = checkfield(md,'fieldname','surfaceforcings.Pfac','NaN',1,'size',[2,numpy.nan],'singletimeseries',1)
|
|---|
| 113 | + md = checkfield(md,'fieldname','surfaceforcings.Tdiff','NaN',1,'size',[2,numpy.nan],'singletimeseries',1)
|
|---|
| 114 | + md = checkfield(md,'fieldname','surfaceforcings.sealev','NaN',1,'size',[2,numpy.nan],'singletimeseries',1)
|
|---|
| 115 |
|
|---|
| 116 | return md
|
|---|
| 117 | # }}}
|
|---|
| 118 | Index: ../trunk-jpl/src/m/classes/SMBpdd.m
|
|---|
| 119 | ===================================================================
|
|---|
| 120 | --- ../trunk-jpl/src/m/classes/SMBpdd.m (revision 19284)
|
|---|
| 121 | +++ ../trunk-jpl/src/m/classes/SMBpdd.m (revision 19285)
|
|---|
| 122 | @@ -77,22 +77,22 @@
|
|---|
| 123 | md = checkfield(md,'fieldname','surfaceforcings.monthlytemperatures','timeseries',1,'NaN',1);
|
|---|
| 124 | md = checkfield(md,'fieldname','surfaceforcings.precipitation','timeseries',1,'NaN',1);
|
|---|
| 125 | elseif(self.isdelta18o==1)
|
|---|
| 126 | - md = checkfield(md,'fieldname','surfaceforcings.delta18o','NaN',1,'size',[2,NaN],'timeseries',1);
|
|---|
| 127 | - md = checkfield(md,'fieldname','surfaceforcings.delta18o_surface','NaN',1,'size',[2,NaN],'timeseries',1);
|
|---|
| 128 | + md = checkfield(md,'fieldname','surfaceforcings.delta18o','NaN',1,'size',[2,NaN],'singletimeseries',1);
|
|---|
| 129 | + md = checkfield(md,'fieldname','surfaceforcings.delta18o_surface','NaN',1,'size',[2,NaN],'singletimeseries',1);
|
|---|
| 130 | md = checkfield(md,'fieldname','surfaceforcings.temperatures_presentday','size',[md.mesh.numberofvertices+1 12],'NaN',1,'timeseries',1);
|
|---|
| 131 | md = checkfield(md,'fieldname','surfaceforcings.temperatures_lgm','size',[md.mesh.numberofvertices+1 12],'NaN',1,'timeseries',1);
|
|---|
| 132 | md = checkfield(md,'fieldname','surfaceforcings.precipitations_presentday','size',[md.mesh.numberofvertices+1 12],'NaN',1,'timeseries',1);
|
|---|
| 133 | md = checkfield(md,'fieldname','surfaceforcings.precipitations_lgm','size',[md.mesh.numberofvertices+1 12],'NaN',1,'timeseries',1);
|
|---|
| 134 | - md = checkfield(md,'fieldname','surfaceforcings.Tdiff','NaN',1,'size',[2,NaN],'timeseries',1);
|
|---|
| 135 | - md = checkfield(md,'fieldname','surfaceforcings.sealev','NaN',1,'size',[2,NaN],'timeseries',1);
|
|---|
| 136 | + md = checkfield(md,'fieldname','surfaceforcings.Tdiff','NaN',1,'size',[2,NaN],'singletimeseries',1);
|
|---|
| 137 | + md = checkfield(md,'fieldname','surfaceforcings.sealev','NaN',1,'size',[2,NaN],'singletimeseries',1);
|
|---|
| 138 | elseif(self.ismungsm==1)
|
|---|
| 139 | md = checkfield(md,'fieldname','surfaceforcings.temperatures_presentday','size',[md.mesh.numberofvertices+1 12],'NaN',1,'timeseries',1);
|
|---|
| 140 | md = checkfield(md,'fieldname','surfaceforcings.temperatures_lgm','size',[md.mesh.numberofvertices+1 12],'NaN',1,'timeseries',1);
|
|---|
| 141 | md = checkfield(md,'fieldname','surfaceforcings.precipitations_presentday','size',[md.mesh.numberofvertices+1 12],'NaN',1,'timeseries',1);
|
|---|
| 142 | md = checkfield(md,'fieldname','surfaceforcings.precipitations_lgm','size',[md.mesh.numberofvertices+1 12],'NaN',1,'timeseries',1);
|
|---|
| 143 | - md = checkfield(md,'fieldname','surfaceforcings.Pfac','NaN',1,'size',[2,NaN],'timeseries',1);
|
|---|
| 144 | - md = checkfield(md,'fieldname','surfaceforcings.Tdiff','NaN',1,'size',[2,NaN],'timeseries',1);
|
|---|
| 145 | - md = checkfield(md,'fieldname','surfaceforcings.sealev','NaN',1,'size',[2,NaN],'timeseries',1);
|
|---|
| 146 | + md = checkfield(md,'fieldname','surfaceforcings.Pfac','NaN',1,'size',[2,NaN],'singletimeseries',1);
|
|---|
| 147 | + md = checkfield(md,'fieldname','surfaceforcings.Tdiff','NaN',1,'size',[2,NaN],'singletimeseries',1);
|
|---|
| 148 | + md = checkfield(md,'fieldname','surfaceforcings.sealev','NaN',1,'size',[2,NaN],'singletimeseries',1);
|
|---|
| 149 | end
|
|---|
| 150 | end
|
|---|
| 151 | end % }}}
|
|---|