Changeset 24851
- Timestamp:
- 05/13/20 09:55:24 (5 years ago)
- Location:
- issm/trunk-jpl/src/m/contrib/larour
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/m/contrib/larour/glacier_inventory.m
r24850 r24851 32 32 self.shapefileroot=getfieldvalue(options,'shapefileroot'); 33 33 self.region_names=getfieldvalue(options,'region_names'); 34 regions_zone_shapefile=getfieldvalue(options,'regions_zone_shapefile',''); 35 36 %region region zones first if available: 37 if ~strcmpi(regions_zone_shapefile,''), 38 region_zones=shpread(regions_zone_shapefile); 39 end 34 40 35 41 %read the shape files and create the regions: … … 40 46 disp(['reading region: ' self.regions(i).name]); 41 47 self.regions(i).id=i; 48 self.regions(i).zone=[region_zones(i).x,region_zones(i).y]; 42 49 contours=shpread([self.shapefileroot '/' self.regions(i).name '.shp']); 43 50 -
issm/trunk-jpl/src/m/contrib/larour/glaciermip.m
r24848 r24851 84 84 sc=getfieldvalue(options,'scenario',1:length(self.scenario)); 85 85 zerostonan=getfieldvalue(options,'zerostonan',0); 86 unit=getfieldvalue(options,'unit','Gt'); 87 sumregion=getfieldvalue(options,'sumregion',0); 86 88 87 89 if self.version==1, … … 90 92 91 93 %serialize: 92 masses=[]; 93 for i=rg, 94 for j=cm, 95 for k=gm, 96 for l=sc, 97 masses=[masses; squeeze(self.mass(i,:,j,k,l))]; 94 if sumregion, 95 for i=rg, 96 masses_regioni=[]; 97 for j=cm, 98 for k=gm, 99 for l=sc, 100 masses_regioni=[masses_regioni; squeeze(self.mass(i,:,j,k,l))]; 101 end 102 end 103 end 104 if i==1, 105 masses=masses_regioni; 106 else 107 masses=masses+masses_regioni; 108 end 109 end 110 else 111 masses=[]; 112 for i=rg, 113 for j=cm, 114 for k=gm, 115 for l=sc, 116 masses=[masses; squeeze(self.mass(i,:,j,k,l))]; 117 end 98 118 end 99 119 end … … 103 123 masses(find(masses==0))=NaN; 104 124 end 125 if strcmpi(unit,'mmSLE'), 126 masses=masses/sletogt(); 127 end 128 105 129 106 130 end % }}} … … 108 132 109 133 options=pairoptions(varargin{:}); 134 135 unit=getfieldvalue(options,'unit','Gt/yr'); 110 136 111 137 %get mass first: … … 121 147 end 122 148 149 if strcmpi(unit,'mmSLE/yr'), 150 massrates=massrates/sletogt(); 151 end 123 152 124 153 end % }}} … … 149 178 end 150 179 end % }}} 151 end 180 end 152 181 end
Note:
See TracChangeset
for help on using the changeset viewer.