Changeset 895


Ignore:
Timestamp:
May 20, 2015, 11:21:25 AM (9 years ago)
Author:
sommeria
Message:
 
Location:
trunk/src
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/compile.m

    r830 r895  
    4343    SubfctPath=['-I ' SubfctPath];%string indicating the option of including the path SubfctPath
    4444end
    45 
     45hver=ver('MATLAB');
     46FctNameVersion=[FctName '_MCRROOT' regexprep(hver.Version,'\.','')];%suppress the dot in version number
    4647try
    4748    disp(['mcc -m -R -nojvm -R -nodisplay -R -singleCompThread ' SubfctPath ' ' FctName '.m'])
    4849    eval(['mcc -m -R -nojvm -R -nodisplay -R -singleCompThread ' SubfctPath ' ' FctName '.m'])% compile the source file [FctName .m], which produces a binary file FctName and a cmd file [run_' FctName '.sh]
    4950    system(['mv -f ' FctName ' bin/']);%move the binary file FctName to the subdir /bin
    50     system(['sed -e ''''s#/' FctName '#/bin/' FctName '#'''' run_' FctName '.sh > ' FctName '.sh']);%modify the cmd file and copy it to [FctName '.sh']
     51    system(['sed -e ''''s#/' FctName '#/bin/' FctName '#'''' run_' FctName '.sh > ' FctNameVersion '.sh']);%modify the cmd file and copy it to [FctName '.sh']
    5152    system(['rm run_' FctName '.sh']);% remove the initial cmd file [run_' FctName '.sh]
    52     system(['chmod +x ' FctName '.sh']); % set the cmd file to 'executable'
     53    system(['chmod +x ' FctNameVersion '.sh']); % set the cmd file to 'executable'
    5354catch ME
    5455    hh=msgbox_uvmat('ERROR',ME.message);
  • trunk/src/proj_field.m

    r890 r895  
    12751275                    [VarVal,ListVarName,VarAttribute,errormsg]=calc_field_interp([coord_X coord_Y],FieldData,CellInfo{icell}.FieldName,XI,YI);
    12761276                   
    1277                     % set to NaN interpolation points which are too far from any initial data (more than 2 CoordMaesh)
    1278                     F=scatteredInterpolant(coord_X, coord_Y,coord_X,'nearest');
    1279                     G=scatteredInterpolant(coord_X, coord_Y,coord_Y,'nearest');
     1277                    % set to NaN interpolation points which are too far from any initial data (more than 2 CoordMesh)
     1278                    if exist('scatteredInterpolant','file')%recent Matlab versions
     1279                        F=scatteredInterpolant(coord_X, coord_Y,coord_X,'nearest');
     1280                        G=scatteredInterpolant(coord_X, coord_Y,coord_Y,'nearest');
     1281                    else
     1282                        F=TriScatteredInterp([coord_X coord_Y],coord_X,'nearest');
     1283                        G=TriScatteredInterp([coord_X coord_Y],coord_Y,'nearest');
     1284                    end
    12801285                    Distx=F(XI,YI)-XI;% diff of x coordinates with the nearest measurement point
    12811286                    Disty=G(XI,YI)-YI;% diff of y coordinates with the nearest measurement point
     
    13191324                [DataOut,VarAttribute,errormsg]=calc_field_tps(Coord,NbCentres,SubRange,FieldVar,CellInfo{icell}.FieldName,cat(3,XI,YI));
    13201325               
    1321                 % set to NaN interpolation points which are too far from any initial data (more than 2 CoordMaesh)
    1322                 F=scatteredInterpolant(coord_X, coord_Y,coord_X,'nearest');
    1323                 G=scatteredInterpolant(coord_X, coord_Y,coord_Y,'nearest');
    1324                 Distx=F(XI,YI)-XI;% diff of x coordinates with the nearest measurement point
    1325                 Disty=G(XI,YI)-YI;% diff of y coordinates with the nearest measurement point
    1326                 Dist=Distx.*Distx+Disty.*Disty;
    1327                 for ivar=1:numel(VarVal)
    1328                     VarVal{ivar}(Dist>2*ProjData.CoordMesh)=NaN;% put to NaN interpolated positions too far from initial data
    1329                 end
     1326                % set to NaN interpolation points which are too far from any initial data (more than 2 CoordMesh)
     1327                    if exist('scatteredInterpolant','file')%recent Matlab versions
     1328                        F=scatteredInterpolant(coord_X, coord_Y,coord_X,'nearest');
     1329                        G=scatteredInterpolant(coord_X, coord_Y,coord_Y,'nearest');
     1330                    else
     1331                        F=TriScatteredInterp([coord_X coord_Y],coord_X,'nearest');
     1332                        G=TriScatteredInterp([coord_X coord_Y],coord_Y,'nearest');
     1333                    end
     1334                    Distx=F(XI,YI)-XI;% diff of x coordinates with the nearest measurement point
     1335                    Disty=G(XI,YI)-YI;% diff of y coordinates with the nearest measurement point
     1336                    Dist=Distx.*Distx+Disty.*Disty;
     1337                    for ivar=1:numel(VarVal)
     1338                        VarVal{ivar}(Dist>2*ProjData.CoordMesh)=NaN;% put to NaN interpolated positions too far from initial data
     1339                    end 
     1340                   
    13301341               
    13311342                ListVarName=(fieldnames(DataOut))';
  • trunk/src/series.m

    r886 r895  
    14811481    [success,message]=copyfile(fullfile(path_series,'PARAM.xml.default'),xmlfile);
    14821482end
    1483 RunTime='';
     1483% RunTime='';
    14841484if strcmp(ActionExt,'.sh')
    14851485    if exist(xmlfile,'file')
    14861486        s=xml2struct(xmlfile);
    14871487        if strcmp(RunMode,'cluster_oar') && isfield(s,'BatchParam')
    1488             if isfield(s.BatchParam,'RunTime')
    1489                 RunTime=s.BatchParam.RunTime;
    1490             end
     1488%             if isfield(s.BatchParam,'RunTime')
     1489%                 RunTime=s.BatchParam.RunTime;
     1490%             end
    14911491            if isfield(s.BatchParam,'NbCore')
    14921492                NbCore=s.BatchParam.NbCore;
    14931493            end
    14941494        elseif (strcmp(RunMode,'background')||strcmp(RunMode,'local')) && isfield(s,'RunParam')
    1495             if isfield(s.RunParam,'RunTime')
    1496                 RunTime=s.RunParam.RunTime;
    1497             end
     1495%             if isfield(s.RunParam,'RunTime')
     1496%                 RunTime=s.RunParam.RunTime;
     1497%             end
    14981498            if isfield(s.RunParam,'NbCore')
    14991499                NbCore=s.RunParam.NbCore;
     
    15011501        end
    15021502    end
    1503     if isempty(RunTime) && strcmp(RunMode,'cluster_oar')
    1504        errormsg='RunTime name not found in PARAM.xml, compiled version .sh cannot run on cluster';
    1505         return
    1506     end
     1503%     if isempty(RunTime) && strcmp(RunMode,'cluster_oar')
     1504%        errormsg='RunTime name not found in PARAM.xml, compiled version .sh cannot run on cluster';
     1505%         return
     1506%     end
    15071507end
    15081508
     
    15151515    set(handles.series,'Pointer','watch') % set the mouse pointer to 'watch'
    15161516    set(handles.ActionExt,'BackgroundColor',[1 1 0])
    1517     ActionFullName=fullfile(get(handles.ActionPath,'String'),[ActionName '.sh']);
     1517    hver=ver('MATLAB');
     1518    MCRROOT=['MCRROOT' regexprep(hver.Version,'\.','')];%suppress the dot in version number
     1519    RunTime = getenv(MCRROOT);
     1520    ActionNameVersion=[ActionName '_' MCRROOT];
     1521    ActionFullName=fullfile(get(handles.ActionPath,'String'),[ActionNameVersion '.sh']);
    15181522    if ~exist(ActionFullName,'file')
    15191523        answer=msgbox_uvmat('INPUT_Y-N','compiled version has not been created: compile now?');
     
    15311535        end       
    15321536    else
    1533         sh_file_info=dir(fullfile(get(handles.ActionPath,'String'),[ActionName '.sh']));
     1537        sh_file_info=dir(fullfile(get(handles.ActionPath,'String'),[ActionNameVersion '.sh']));
    15341538        m_file_info=dir(fullfile(get(handles.ActionPath,'String'),[ActionName '.m']));
    15351539        if isfield(m_file_info,'datenum') && m_file_info.datenum>sh_file_info.datenum
    15361540            set(handles.ActionExt,'BackgroundColor',[1 1 0])
    15371541            drawnow
    1538             answer=msgbox_uvmat('INPUT_Y-N',[ActionName '.sh needs to be updated: recompile now?']);
     1542            answer=msgbox_uvmat('INPUT_Y-N',[ActionNameVersion '.sh needs to be updated: recompile now?']);
    15391543            if strcmp(answer,'Yes')
    15401544                path_uvmat=fileparts(which('series'));
  • trunk/src/series/civ_series.m

    r894 r895  
    324324%%%%% MAIN LOOP %%%%%%
    325325maskname='';% initiate the mask name
    326 tstart=tic;
     326tic;
    327327for ifield=1:NbField
    328328    if ~isempty(RUNHandle)% update the waitbar in interactive mode with GUI series  (checkrun=1)
Note: See TracChangeset for help on using the changeset viewer.