Changeset 486 for trunk/src/civ.m


Ignore:
Timestamp:
Jun 28, 2012, 11:26:31 AM (12 years ago)
Author:
sommeria
Message:

cmd modified for Windows \ + record time

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/civ.m

    r485 r486  
    800800set(handles.RUN, 'Enable','Off')
    801801set(handles.RUN,'BackgroundColor',[0.831 0.816 0.784])
    802 %batch=get(handles.RunMode,'Value');
    803 % batch=0;
     802set(handles.RUN,'UserData',now)% record the time of launch
    804803errormsg=launch_jobs(hObject, eventdata, handles);
    805804set(handles.RUN, 'Enable','On')
     
    895894    drawnow
    896895end
    897 StatusData.time_ref=now;% store the current time
     896StatusData.time_ref=get(handles.RUN,'UserData');% get the time of launch
    898897StatusData.option_civ=option_civ;
    899898set(hrefresh,'UserData',StatusData)
     
    13191318        end
    13201319       
    1321         % print the command in the file
     1320        % print the command in the bat file
    13221321        [fid,message]=fopen(filename_bat,'w');
    13231322        if isequal(fid,-1)
    13241323            errormsg=['creation of .bat file: ' message];
    13251324            return
    1326         end
    1327         if ~isunix
    1328             cmd=regexprep(cmd,'\\','\\\\');
    13291325        end
    13301326        fprintf(fid,cmd);
     
    43754371        cmd=[cmd sparam.CivBin ' -f ' Param.OutputFile '.xml '  CivAllCmd ' >' Param.OutputFile '.log' '\n'];
    43764372    case 'civ_matlab'
     4373                    switch computer
     4374                        case {'PCWIN','PCWIN64'}                     
     4375                            filename=regexprep(filename,'\\','\\\\');% add '\' so that '\' are left as characters
     4376                        case {'GLNX86','GLNXA64','MACI64'}
     4377                    end
    43774378        cmd=['civ_matlab(''' regexprep(filename,'(\w+)([/\\])(\w+$)','$1$20_XML$2$3.xml') ''','''...
    43784379            filename '.nc'');'];
    43794380    case 'civ_matlab.sh'
    4380         cmd=['#!/bin/bash \n '...
    4381             '#$ -cwd \n '...
    4382             'hostname && date \n '...
    4383             'umask 002 \n'...
    4384             Param.xml.CivmBin ' ' Param.xml.RunTime ' ' regexprep(filename,'(\w+)([/\\])(\w+$)','$1$20_XML$2$3.xml') ' ' Param.OutputFile '.nc'];%allow writting access to created files for user group
     4381        switch computer
     4382            case {'PCWIN','PCWIN64'}
     4383                filename=regexprep(filename,'\\','\\\\');% add '\' so that '\' are left as characters
     4384                % TODO launch command in DOS
     4385            case {'GLNX86','GLNXA64','MACI64'}
     4386                cmd=['#!/bin/bash \n '...
     4387                    '#$ -cwd \n '...
     4388                    'hostname && date \n '...
     4389                    'umask 002 \n'...
     4390                    Param.xml.CivmBin ' ' Param.xml.RunTime ' ' regexprep(filename,'(\w+)([/\\])(\w+$)','$1$20_XML$2$3.xml') ' ' Param.OutputFile '.nc'];%allow writting access to created files for user group
     4391        end
    43854392end   
    43864393   
Note: See TracChangeset for help on using the changeset viewer.