Changeset 938


Ignore:
Timestamp:
Apr 1, 2016, 7:22:25 PM (5 years ago)
Author:
sommeria
Message:

group writing access set for result files

Location:
trunk/src
Files:
1 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/calc_field_tps.m

    r924 r938  
    122122    end
    123123    for ilist=1:length(FieldName)
    124         %Operator{ilist}='';%default empty operator (vec, norm,...)
    125         %r=regexp(FieldName{ilist},'(?<Operator>(^vec|^norm|^curl|^div|^strain))\((?<UName>.+),(?<VName>.+)\)$','names');% TODO, replace U, V
    126124        switch FieldName{ilist}
    127125            case 'vec(U,V)'
    128 %                 ListVar=[ListVar {'U', 'V'}];
    129 %                 VarAttribute{var_count+1}.Role='vector_x';
    130 %                 VarAttribute{var_count+2}.Role='vector_y';
    131126                DataOut.U(ind_sel)=DataOut.U(ind_sel)+EM *FieldVar(1:nbvec_sub+3,isub,1);
    132127                DataOut.V(ind_sel)=DataOut.V(ind_sel)+EM *FieldVar(1:nbvec_sub+3,isub,2);
    133128            case 'U'
    134 %                 ListVar=[ListVar {'U'}];
    135 %                 VarAttribute{var_count+1}.Role='scalar';
    136129                DataOut.U(ind_sel)=DataOut.U(ind_sel)+EM *FieldVar(1:nbvec_sub+3,isub,1);
    137130            case 'V'
    138 %                 ListVar=[ListVar {'V'}];
    139 %                 VarAttribute{var_count+1}.Role='scalar';
    140131                DataOut.V(ind_sel)=DataOut.V(ind_sel)+EM *FieldVar(1:nbvec_sub+3,isub,2);
    141132            case 'norm(U,V)'
    142 %                 ListVar=[ListVar {'norm'}];
    143 %                 VarAttribute{var_count+1}.Role='scalar';
    144133                U=DataOut.U(ind_sel)+EM *FieldVar(1:nbvec_sub+3,isub,1);
    145134                V=DataOut.V(ind_sel)+EM *FieldVar(1:nbvec_sub+3,isub,2);
    146135                DataOut.norm(ind_sel)=sqrt(U.*U+V.*V);
    147136            case 'curl(U,V)'
    148 %                 ListVar=[ListVar {'curl'}];
    149 %                 VarAttribute{var_count+1}.Role='scalar';
    150137                DataOut.curl(ind_sel)=DataOut.curl(ind_sel)-EMDY *FieldVar(1:nbvec_sub+3,isub,1)+EMDX *FieldVar(1:nbvec_sub+3,isub,2);
    151138            case 'div(U,V)'
    152 %                 ListVar=[ListVar {'div'}];
    153 %                 VarAttribute{var_count+1}.Role='scalar';
    154139                DataOut.div(ind_sel)=DataOut.div(ind_sel)+EMDX*FieldVar(1:nbvec_sub+3,isub,1)+EMDY *FieldVar(1:nbvec_sub+3,isub,2);
     140%             case 'curl_polar(U,V)'
     141%                 DataOut.curl(ind_sel)=DataOut.curl(ind_sel)+(-EMDY *FieldVar(1:nbvec_sub+3,isub,1)+EMDX *(Coord_interp(ind_sel,1).*FieldVar(1:nbvec_sub+3,isub,2)))./Coord_interp(ind_sel,1);
    155142            case 'strain(U,V)'
    156 %                 ListVar=[ListVar {'strain'}];
    157 %                 VarAttribute{var_count+1}.Role='scalar';
    158143                DataOut.strain(ind_sel)=DataOut.strain(ind_sel)+EMDY*FieldVar(1:nbvec_sub+3,isub,1)+EMDX *FieldVar(1:nbvec_sub+3,isub,2);
    159144        end
    160145    end
    161146end
    162 %DataOut.FF=nbval==0; %put errorflag to 1 for points outside the interpolation rang
    163147nbval(nbval==0)=NaN;% to avoid division by zero for averaging
    164148ListFieldOut=fieldnames(DataOut);
  • trunk/src/series/civ_series.m

    r932 r938  
    890890        if isempty(errormsg)
    891891            disp([ncfile_out ' written'])
    892             [success,msg] = fileattrib(ncfile_out ,'+w','g');% allow writing access for the group of users, recursively in the folder
     892            %[success,msg] = fileattrib(ncfile_out ,'+w','g');% done in struct2nc
    893893        else
    894894            disp(errormsg)
  • trunk/src/series/merge_proj.m

    r937 r938  
    252252    %%%%%%%%%%%%%%%% loop on field indices %%%%%%%%%%%%%%%%
    253253tstart=tic; %used to record the computing time
     254CheckOverwrite=1;%default
     255if isfield(Param,'CheckOverwrite')
     256    CheckOverwrite=Param.CheckOverwrite;
     257end
    254258for index=1:NbField
    255259        update_waitbar(WaitbarHandle,index/NbField)
     
    258262        return
    259263    end
     264   
     265     %% generating the name of the merged field
     266    i1=i1_series{1}(index);
     267    if ~isempty(i2_series{end})
     268        i2=i2_series{end}(index);
     269    else
     270        i2=i1;
     271    end
     272    j1=1;
     273    j2=1;
     274    if ~isempty(j1_series{1})
     275        j1=j1_series{1}(index);
     276        if ~isempty(j2_series{end})
     277            j2=j2_series{end}(index);
     278        else
     279            j2=j1;
     280        end
     281    end
     282    OutputFile=fullfile_uvmat(RootPath{1},OutputDir,RootFileOut,FileExtOut,NomTypeOut,i1,i2,j1,j2);
     283    if ~CheckOverwrite && exist(OutputFile,'file')
     284            disp(['existing output file ' OutputFile ' already exists, skip to next field'])
     285            continue% skip iteration if the mode overwrite is desactivated and the result file already exists
     286    end
     287       
    260288    %%%%%%%%%%%%%%%% loop on views (input lines) %%%%%%%%%%%%%%%%
    261289    Data=cell(1,NbView);%initiate the set Data
     
    268296            return
    269297        end
     298       
    270299        ListVar=Data{iview}.ListVarName;
    271300        for ilist=1:numel(ListVar)
     
    325354    end
    326355
    327     %% generating the name of the merged field
    328     i1=i1_series{1}(index);
    329     if ~isempty(i2_series{end})
    330         i2=i2_series{end}(index);
    331     else
    332         i2=i1;
    333     end
    334     j1=1;
    335     j2=1;
    336     if ~isempty(j1_series{1})
    337         j1=j1_series{1}(index);
    338         if ~isempty(j2_series{end})
    339             j2=j2_series{end}(index);
    340         else
    341             j2=j1;
    342         end
    343     end
    344     OutputFile=fullfile_uvmat(RootPath{1},OutputDir,RootFileOut,FileExtOut,NomTypeOut,i1,i2,j1,j2);
    345 
     356 
    346357    %% recording the merged field
    347358    if strcmp(FileExtOut,'.png')    %output as image
  • trunk/src/struct2nc.m

    r930 r938  
    170170if strcmp(action,'one_input')
    171171netcdf.close(nc)
     172[success,errormsg] = fileattrib(flname ,'+w');% allow writing access for the group of users
    172173end
    173174
Note: See TracChangeset for help on using the changeset viewer.