Changeset 25588


Ignore:
Timestamp:
09/21/20 10:21:06 (4 years ago)
Author:
Eric.Larour
Message:

CHG: diverse

Location:
issm/branches/trunk-larour-SLPS2020/src/m/contrib/larour
Files:
1 added
2 edited

Legend:

Unmodified
Added
Removed
  • issm/branches/trunk-larour-SLPS2020/src/m/contrib/larour/glacier_inventory.m

    r24880 r25588  
    149149                        errornotfound=getfieldvalue(options,'errornotfound',1);
    150150                        plotr=getfieldvalue(options,'plot',0);
     151                        plotr=1;
    151152
    152153                        %The way we run this is through the O2 zones defined in boxes. We go through
     
    203204                                        switch i,
    204205                                                case 4, radius=40;
     206                                                case 8, radius=60;
    205207                                                case 12, radius=25;
     208                                                case 19, radius=60;
     209                                                case 32, radius=60;
    206210                                                case 33, radius=5;
    207211                                                case 41, radius=75;
    208212                                                case 42, radius=45;
     213                                                case 61, radius=66;
    209214                                                case 68, radius=10;
    210215                                                case 82, radius=30;
  • issm/branches/trunk-larour-SLPS2020/src/m/contrib/larour/oceanmip.m

    r25326 r25588  
    4646                                        pos=find(diff(time)<0);
    4747                                        if isempty(pos),
    48                                                 pos=(length(time)-12*100+1):length(time);
     48                                                %pos=(length(time)-12*100+1):length(time);
     49                                                pos=1:length(time);
    4950                                        else
    5051                                                pos=[(pos+1):length(time)];
     
    7576                                                zostogam(year)=mean(zostoga(i-11:i));
    7677                                        end
     78                                        %control against 2006:
     79                                        zostogam=zostogam-zostogam(1);
    7780                                        self.zostoga{end+1}=zostogam; clear zostoga;
    7881
     
    109112                                disp(['interpolating model ' self.model{i} ' onto model mesh']);
    110113
     114                                %If we have 182 cells in long, trim by 1 on each side:
     115                                if size(self.pbo{i},1)==182,
     116                                        self.pbo{i}=self.pbo{i}(2:181,:,:);
     117                                        self.zos{i}=self.zos{i}(2:181,:,:);
     118                                        self.long{i}=self.long{i}(2:181,:,:);
     119                                        self.lat{i}=self.lat{i}(2:181,:,:);
     120                                end
     121
     122
    111123                                %triangulation:
    112                                 long=double(self.long{i});  long=long(:);
     124                                long=double(self.long{i});  long=long(:);
     125                                pos=find(long<0); long(pos)=long(pos)+360;
    113126                                lat=double(self.lat{i}); lat=lat(:);
    114127                                [newl,uniqpos]=unique([lat,long],'rows','stable');
     
    122135                                ind=find(areas<1e-8); index(ind,:)=[];
    123136
     137                                %fix if we have orphans
     138                                [index long lat dummy newpos]=FixMesh(index,long,lat,1:length(long));
     139
    124140                                time=self.time{i};
    125141                                %retrieve fields:
     
    133149
    134150                                parfor j=1:length(time),
     151                                %for j=1:length(time),
    135152                                        if mod(j,10)==0,
    136153                                                s=sprintf('   progress: %.2g ',j/length(time)*100);
     
    138155                                        end
    139156
    140                                         pbo=omip_pbo(:,:,j); pbo=pbo(:); pbo=pbo(uniqpos);
     157                                        pbo=omip_pbo(:,:,j); pbo=pbo(:); pbo=pbo(uniqpos); 
    141158                                        zos=omip_zos(:,:,j); zos=zos(:); zos=zos(uniqpos);
    142159
    143                                         mesh_pbo(:,j)=InterpFromMeshToMesh2d(index,long,lat,pbo,meshlong,meshlat);
    144                                         mesh_zos(:,j)=InterpFromMeshToMesh2d(index,long,lat,zos,meshlong,meshlat);
     160                                        pboj= InterpFromMeshToMesh2d(index,long,lat,pbo(newpos),meshlong,meshlat);
     161                                        pos=find(abs(pboj)>1e4); pboj(pos)=0;
     162                                        mesh_pbo(:,j)=pboj;
     163
     164                                        zosj=InterpFromMeshToMesh2d(index,long,lat,zos(newpos),meshlong,meshlat);
     165                                        pos=find(abs(zosj)>1e5); zosj(pos)=0;
     166                                        mesh_zos(:,j)=zosj;
    145167                                end
    146168                                self.mesh_pbo{end+1}=mesh_pbo;
     
    200222                                                pbo=self.mesh_pbo{i}; pbo=pbo/1000; %in meters
    201223                                        end
    202                                         time=self.time{i};
    203                                         array=[pbo;time];
     224                                        array=pbo;
    204225                                        break;
    205226                                end
Note: See TracChangeset for help on using the changeset viewer.