Changeset 505


Ignore:
Timestamp:
Jul 26, 2012, 11:04:43 PM (12 years ago)
Author:
sommeria
Message:

bugs correctied in civ. test for compilation need introduced in check_files

Location:
trunk/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/check_files.m

    r498 r505  
    184184checkmsg=checkmsg';
    185185
     186%% check dates of compilation
     187currentdir=pwd;
     188cd(pathuvmat)
     189list_compile=dir('*.sh');
     190for ilist=1:numel(list_compile)
     191    mfile=regexprep(list_compile(ilist).name,'.sh$','.m');
     192    datfile=dir(mfile);
     193    if isfield(datfile,'datenum') && datfile.datenum>list_compile(ilist).datenum
     194        checkmsg=[checkmsg;{[list_compile(ilist).name ' needs to be updated by compile_functions']}];
     195    end
     196end
     197
  • trunk/src/civ.m

    r501 r505  
    6363sparam=[];
    6464if ~exist(xmlfile,'file')
    65     [success,message]=copyfile(fullfile(path_civ,'PARAM.xml.default'),xmlfile)
     65    [success,message]=copyfile(fullfile(path_civ,'PARAM.xml.default'),xmlfile);
    6666end
    6767if exist(xmlfile,'file')
     
    106106else
    107107    set(handles.RunMode,'String',{'local';'background';'cluster'})
    108 %     set(handles.BATCH,'Enable','off')% put the BATCH button in grey (unactivated)
    109 %     set(handles.BATCH,'BackgroundColor',[0.831 0.816 0.784])% put the BATCH button in grey (unactivated)
    110108end
    111109% if isfield(sparam.RunParam,'CivBin')
     
    323321set(handles.RUN, 'Enable','On')
    324322set(handles.RUN,'BackgroundColor',[1 0 0])%set RUN button to red color
    325 % set(handles.BATCH,'Enable','On')
    326 % set(handles.BATCH,'BackgroundColor',[1 0 0])%set BATCH button to red color
    327323if isfield(handles,'status')
    328324    set(handles.status,'Value',0);       %suppress the 'status' display
     
    618614%% set the civ options depending on the input file content when a nc file has been opened
    619615ListOptions={'CheckCiv1', 'CheckFix1' 'CheckPatch1', 'CheckCiv2', 'CheckFix2', 'CheckPatch2'};
    620 if ind_opening==0
     616checkbox=zeros(size(ListOptions));%default
     617if ind_opening==0%case of image opening, start with Civ1
    621618    for index=1:numel(ListOptions)
    622619        checkbox(index)=get(handles.(ListOptions{index}),'Value');
    623620    end
    624     for index=1:max(1,max(find(checkbox)))
     621    index_max=find(checkbox, 1, 'last' );
     622    if isempty(index_max),index_max=1;end       
     623    for index=1:index_max
    625624        set(handles.(ListOptions{index}),'Value',1)% select all operations starting from CIV1
    626625    end
     
    848847    status_Callback(hObject, eventdata, handles)
    849848end
    850 %
    851 % %------------------------------------------------------------------------
    852 % % --- Executes on button press in BATCH: remote processing
    853 % function BATCH_Callback(hObject, eventdata, handles)
    854 % % -----------------------------------------------------------------------
    855 % set(handles.BATCH, 'Enable','Off')
    856 % set(handles.BATCH,'BackgroundColor',[0.831 0.816 0.784])
    857 % batch=1;
    858 % errormsg=launch_jobs(hObject, eventdata, handles, batch);
    859 % set(handles.BATCH, 'Enable','On')
    860 % set(handles.BATCH,'BackgroundColor',[1 0 0])
    861 %
    862 % % display errors or start status callback to visualise results
    863 % if ~isempty(errormsg)
    864 %     display(errormsg)
    865 %     msgbox_uvmat('ERROR',errormsg)
    866 % elseif isfield(handles,'status')
    867 %     set(handles.status,'Value',1);%suppress status display
    868 %     status_Callback(hObject, eventdata, handles)
    869 % end
    870849
    871850%-------------------------------------------------------------------
     
    11861165    if ~exist(fullfile(path_civ,'civ_matlab.sh'),'file')
    11871166        errormsg=[{'no file civ_matlab.sh found'}; {'run compile_functions.m to create it by compiling civ_matlab.m'}];
    1188     end
    1189     return
     1167            return
     1168    end
    11901169end
    11911170
     
    13611340        switch Param.Program
    13621341            case {'civ_matlab'}
    1363                 filename_bat=regexprep(Param.OutputFile,'(.+)([/\\])(.+$)','$1$20_BAT$2$3.m');
    1364                 filename_bat=regexprep(filename_bat,'-','__');
     1342                filename_bat=regexprep(Param.OutputFile,'(.+)([/\\])(.+$)','$1$20_BAT$2$3.m');           
     1343                [BatRoot,BatFile]=fileparts(filename_bat);
     1344                 BatFile=regexprep(BatFile,'-','__');%transform name to suppress'-' (not valid for .m files)
     1345                 filename_bat=[fullfile(BatRoot,BatFile) '.m'];
    13651346            case {'CivX','CivAll','civ_matlab.sh'}
    13661347                switch computer
     
    44134394       
    44144395    case 'civ_matlab.sh'
     4396        CivmBin=fullfile(fileparts(which('civ')),'civ_matlab.sh'); %path to the source directory of uvmat
    44154397        switch computer
    44164398            case {'PCWIN','PCWIN64'}
     
    44224404                    'hostname && date \n '...
    44234405                    'umask 002 \n'...
    4424                     Param.xml.CivmBin ' ' Param.xml.RunTime ' ' regexprep(filename,'(.+)([/\\])(.+$)','$1$20_XML$2$3.xml') ' ' Param.OutputFile '.nc'];%allow writting access to created files for user group
     4406                    CivmBin ' ' Param.xml.RunTime ' ' regexprep(filename,'(.+)([/\\])(.+$)','$1$20_XML$2$3.xml') ' ' Param.OutputFile '.nc'];%allow writting access to created files for user group
    44254407        end
    44264408end   
Note: See TracChangeset for help on using the changeset viewer.