Ignore:
Timestamp:
09/20/20 16:36:58 (4 years ago)
Author:
Eric.Larour
Message:

CHG: diverse

File:
1 edited

Legend:

Unmodified
Added
Removed
  • issm/branches/trunk-larour-SLPS2020/src/m/plot/processmesh.m

    r25163 r25587  
    2424if strcmp(domaintype(md.mesh),'3Dsurface'),
    2525        [x y z elements is2d isplanet] = processmesh(md.mesh,options);
    26         if strcmpi(getfieldvalue(options,'coord','xy'),'latlon'),
    27                 x=md.mesh.long;
    28                 y=md.mesh.lat;
     26        if strcmpi(getfieldvalue(options,'coord','xy'),'latlon') | strcmpi(getfieldvalue(options,'coord','xy'),'latlong'),
     27                x0=md.mesh.long;
     28                y0=md.mesh.lat;
     29                %add row at lat=90 and lat=-90
     30                add=[(-180:.1:-1e-5)';(1e-5:.1:180)'];
     31                nadd=length(add);
     32                xextra=[add;add];
     33                yextra=[90*ones(nadd,1); -90*ones(nadd,1)];
     34                x=[x0;xextra];
     35                y=[y0;yextra];
     36
     37                if strcmpi(getfieldvalue(options,'coordcent','atlantic'),'pacific'),
     38                        pos=find(x>0);  x(pos)=-360+x(pos);
     39                end
    2940                elements=delaunay(x,y);
    30                 z=md.mesh.lat; z(:)=0;
     41                z=x; z(:)=0;
    3142        end
    3243        return;
     
    4253else
    4354        elements=md.mesh.elements;
    44         if ~strcmpi(getfieldvalue(options,'coord','xy'),'latlon') ,
     55        if ~strcmpi(getfieldvalue(options,'coord','xy'),'latlon') &  ~strcmpi(getfieldvalue(options,'coord','xy'),'latlong') ,
    4556                x=md.mesh.x;
    4657                if isprop(md.mesh,'x2d'), x2d=md.mesh.x2d; end
     
    5061                x=md.mesh.long;
    5162                y=md.mesh.lat;
     63                if strcmpi(getfieldvalue(options,'coordcent','atlantic'),'pacific'),
     64                        pos=find(x>0);  x(pos)-360+x(pos);
     65                end
    5266        end
    5367end
Note: See TracChangeset for help on using the changeset viewer.