- Timestamp:
- Jun 28, 2012, 12:16:58 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/civ.m
r486 r487 1308 1308 switch Param.Program 1309 1309 case {'civ_matlab'} 1310 filename_bat=regexprep(Param.OutputFile,'(\w+)([/\\])(\w+$)','$1$20_BAT$2$3.m'); 1310 filename_bat=regexprep(Param.OutputFile,'(.+)([/\\])(.+$)','$1$20_BAT$2$3.m'); 1311 filename_bat=regexprep(filename_bat,'-','__'); 1311 1312 case {'CivX','CivAll','civ_matlab.sh'} 1312 1313 switch computer 1313 1314 case {'PCWIN','PCWIN64'} 1314 filename_bat=regexprep(Param.OutputFile,'( \w+)([/\\])(\w+$)','$1$20_BAT$2$3.bat');1315 filename_bat=regexprep(Param.OutputFile,'(.+)([/\\])(.+$)','$1$20_BAT$2$3.bat'); 1315 1316 case {'GLNX86','GLNXA64','MACI64'} 1316 filename_bat=regexprep(Param.OutputFile,'( \w+)([/\\])(\w+$)','$1$20_BAT$2$3.sh');1317 filename_bat=regexprep(Param.OutputFile,'(.+)([/\\])(.+$)','$1$20_BAT$2$3.sh'); 1317 1318 end 1318 1319 end … … 1329 1330 % special case for civ_matlab on cluster 1330 1331 if strcmp(Param.Program,'civ_matlab') && strcmp(Param.RunMode,'cluster') 1331 filename_bat2=regexprep(Param.OutputFile,'( \w+)([/\\])(\w+$)','$1$20_BAT$2$3.sh');1332 filename_bat2=regexprep(Param.OutputFile,'(.+)([/\\])(.+$)','$1$20_BAT$2$3.sh'); 1332 1333 [fid,message]=fopen(filename_bat2,'w'); 1333 1334 if isequal(fid,-1) … … 3981 3982 case 'CivX' 3982 3983 if Param.CheckCiv1 3983 filename=regexprep(Param.OutputFile,'( \w+)([/\\])(\w+$)','$1$20_CMX$2$3.civ1.cmx');3984 filename=regexprep(Param.OutputFile,'(.+)([/\\])(.+$)','$1$20_CMX$2$3.civ1.cmx'); 3984 3985 if isequal(Param.Civ1.Dt,0) 3985 3986 Param.Civ1.Dt=1 ;%case of 'displacement' mode … … 4048 4049 4049 4050 if Param.CheckCiv2 4050 filename=regexprep(Param.OutputFile,'( \w+)([/\\])(\w+$)','$1$20_CMX$2$3.civ2.cmx');4051 filename=regexprep(Param.OutputFile,'(.+)([/\\])(.+$)','$1$20_CMX$2$3.civ2.cmx'); 4051 4052 4052 4053 if isequal(Param.Civ2.Dt,'0') … … 4121 4122 end 4122 4123 case {'civ_matlab','civ_matlab.sh'} 4123 filename=regexprep(Param.OutputFile,'( \w+)([/\\])(\w+$)','$1$20_XML$2$3.xml');4124 filename=regexprep(Param.OutputFile,'(.+)([/\\])(.+$)','$1$20_XML$2$3.xml'); 4124 4125 save(struct2xml(Param),filename); 4125 4126 end … … 4134 4135 case 'CivX' 4135 4136 if isunix % check: necessaire aussi en RUN? 4136 cmd=[cmd '#!/bin/bash \n 4137 '#$ -cwd \n 4138 'hostname && date \n 4137 cmd=[cmd '#!/bin/bash \n'... 4138 '#$ -cwd \n'... 4139 'hostname && date \n'... 4139 4140 'umask 002 \n'];%allow writting access to created files for user group 4140 4141 end 4141 4142 case 'CivAll' 4142 4143 if isunix % check: necessaire aussi en RUN? 4143 cmd=[cmd '#!/bin/bash \n 4144 '#$ -cwd \n 4145 'hostname && date \n 4144 cmd=[cmd '#!/bin/bash \n'... 4145 '#$ -cwd \n'... 4146 'hostname && date \n'... 4146 4147 'umask 002 \n'];%allow writting access to created files for user group 4147 4148 end … … 4154 4155 case 'CivX' 4155 4156 if(isunix) %unix (or Mac) system 4156 cmd=[cmd 'cp -f ' regexprep(filename,'( \w+)/(\w+$)','$1/0_CMX/$2.civ1.cmx ') regexprep(filename,'(\w+)/(\w+$)','$1/$2.cmx \n')...% the cmx file gives the name to the nc file4157 Param.xml.Civ1Bin ' -f ' regexprep(filename,'( \w+)/(\w+$)','$1/$2.cmx >') regexprep(filename,'(\w+)/(\w+$)','$1/0_LOG/$2.civ1.log \n')... % redirect standard output to the log file, the result file is named [filename '.nc'] by CIVx4158 'rm ' regexprep(filename,'( \w+)/(\w+$)','$1/$2.cmx \n')];4157 cmd=[cmd 'cp -f ' regexprep(filename,'(.+)/(.+$)','$1/0_CMX/$2.civ1.cmx ') regexprep(filename,'(.+)/(.+$)','$1/$2.cmx \n')...% the cmx file gives the name to the nc file 4158 Param.xml.Civ1Bin ' -f ' regexprep(filename,'(.+)/(.+$)','$1/$2.cmx >') regexprep(filename,'(.+)/(.+$)','$1/0_LOG/$2.civ1.log \n')... % redirect standard output to the log file, the result file is named [filename '.nc'] by CIVx 4159 'rm ' regexprep(filename,'(.+)/(.+$)','$1/$2.cmx \n')]; 4159 4160 else %Windows system 4160 4161 filename=regexprep(filename,'\\','\\\\'); 4161 cmd=['copy /Y ' regexprep(filename,'( \w+)\\\\(\w+$)','"$1\\\\0_CMX\\\\$2.civ1.cmx" ') regexprep(filename,'(\w+)\\\\(\w+$)','"$1\\\\$2.civ1.cmx" \n')...4162 '"' regexprep(Param.xml.Civ1Bin,'\\','\\\\') '" -f ' regexprep(filename,'( \w+)\\\\(\w+$)','"$1\\\\$2.cmx" > ')...4163 regexprep(filename,'( \w+)\\\\(\w+$)','"$1\\\\0_LOG\\\\$2.civ1.log" \n')... % redirect standard output to the log file4164 'del ' regexprep(filename,'( \w+)\\\\(\w+$)','"$1\\\\$2.cmx" \n')];4162 cmd=['copy /Y ' regexprep(filename,'(.+)\\\\(.+$)','"$1\\\\0_CMX\\\\$2.civ1.cmx" ') regexprep(filename,'(.+)\\\\(.+$)','"$1\\\\$2.civ1.cmx" \n')... 4163 '"' regexprep(Param.xml.Civ1Bin,'\\','\\\\') '" -f ' regexprep(filename,'(.+)\\\\(.+$)','"$1\\\\$2.cmx" > ')... 4164 regexprep(filename,'(.+)\\\\(.+$)','"$1\\\\0_LOG\\\\$2.civ1.log" \n')... % redirect standard output to the log file 4165 'del ' regexprep(filename,'(.+)\\\\(.+$)','"$1\\\\$2.cmx" \n')]; 4165 4166 end 4166 4167 case 'CivAll' … … 4261 4262 case 'CivX' 4262 4263 if(isunix) 4263 cmd=[cmd 'cp -f ' regexprep(filename,'( \w+)/(\w+$)','$1/0_CMX/$2.civ2.cmx ') regexprep(filename,'(\w+)/(\w+$)','$1/$2.cmx \n')...4264 Param.xml.Civ2Bin ' -f ' regexprep(filename,'( \w+)/(\w+$)','$1/$2.cmx >') regexprep(filename,'(\w+)/(\w+$)','$1/0_LOG/$2.civ2.log \n')...% redirect standard output to the log file, the result file is named [filename '.nc'] by CIVx4265 'rm ' regexprep(filename,'( \w+)/(\w+$)','$1/$2.cmx \n')];%rename .cmx as .checkciv2.cmx, the result file is named [filename '.nc'] by CIVx4264 cmd=[cmd 'cp -f ' regexprep(filename,'(.+)/(.+$)','$1/0_CMX/$2.civ2.cmx ') regexprep(filename,'(.+)/(.+$)','$1/$2.cmx \n')... 4265 Param.xml.Civ2Bin ' -f ' regexprep(filename,'(.+)/(.+$)','$1/$2.cmx >') regexprep(filename,'(.+)/(.+$)','$1/0_LOG/$2.civ2.log \n')...% redirect standard output to the log file, the result file is named [filename '.nc'] by CIVx 4266 'rm ' regexprep(filename,'(.+)/(.+$)','$1/$2.cmx \n')];%rename .cmx as .checkciv2.cmx, the result file is named [filename '.nc'] by CIVx 4266 4267 else 4267 4268 filename=regexprep(filename,'\\','\\\\'); 4268 cmd=[cmd 'copy /Y ' regexprep(filename,'( \w+)\\\\(\w+$)','"$1\\\\0_CMX\\\\$2.civ2.cmx" ') regexprep(filename,'(\w+)\\\\(\w+$)','"$1\\\\$2.cmx" \n')...4269 '"' regexprep(Param.xml.Civ2Bin,'\\','\\\\') '" -f "' regexprep(filename,'( \w+)\\\\(\w+$)','"$1\\\\$2.cmx" > ')...4270 regexprep(filename,'( \w+)\\\\(\w+$)','"$1\\\\0_LOG\\\\$2.civ2.log" \n')... % redirect standard output to the log file4271 'del ' regexprep(filename,'( \w+)\\\\(\w+$)','"$1\\\\$2.cmx" \n')];4269 cmd=[cmd 'copy /Y ' regexprep(filename,'(.+)\\\\(.+$)','"$1\\\\0_CMX\\\\$2.civ2.cmx" ') regexprep(filename,'(.+)\\\\(.+$)','"$1\\\\$2.cmx" \n')... 4270 '"' regexprep(Param.xml.Civ2Bin,'\\','\\\\') '" -f "' regexprep(filename,'(.+)\\\\(.+$)','"$1\\\\$2.cmx" > ')... 4271 regexprep(filename,'(.+)\\\\(.+$)','"$1\\\\0_LOG\\\\$2.civ2.log" \n')... % redirect standard output to the log file 4272 'del ' regexprep(filename,'(.+)\\\\(.+$)','"$1\\\\$2.cmx" \n')]; 4272 4273 end 4273 4274 case 'CivAll' … … 4376 4377 case {'GLNX86','GLNXA64','MACI64'} 4377 4378 end 4378 cmd=['civ_matlab(''' regexprep(filename,'( \w+)([/\\])(\w+$)','$1$20_XML$2$3.xml') ''','''...4379 cmd=['civ_matlab(''' regexprep(filename,'(.+)([/\\])(.+$)','$1$20_XML$2$3.xml') ''','''... 4379 4380 filename '.nc'');']; 4380 4381 case 'civ_matlab.sh' … … 4388 4389 'hostname && date \n '... 4389 4390 '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 group4391 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 4391 4392 end 4392 4393 end … … 4414 4415 ' -fi2 ' fi2_value ' -fi3 ' num2str(Param.(fixname).CheckF3) ... 4415 4416 ' -threshC ' num2str(Param.(fixname).MinCorr) MaxVel_string MaskName_string... 4416 ' >' regexprep(filename,'( \w+)/(\w+$)','$1/0_LOG/$2.') lower(fixname) '.log 2>&1'];4417 ' >' regexprep(filename,'(.+)/(.+$)','$1/0_LOG/$2.') lower(fixname) '.log 2>&1']; 4417 4418 else 4418 4419 cmd=['"' Param.xml.FixBin '" -f "' filename '.nc" -fi1 ' num2str(Param.(fixname).CheckFmin2)... … … 4438 4439 ' -n ' num2str(Param.(patchname).Ny) ' -ro ' num2str(Param.(patchname).FieldSmooth)... 4439 4440 ' -nopt ' num2str(Param.(patchname).SubdomainSize) ... 4440 ' > ' regexprep(filename,'( \w+)/(\w+$)','$1/0_LOG/$2.') lower(patchname) '.log 2>&1']; % redirect standard output to the log file4441 ' > ' regexprep(filename,'(.+)/(.+$)','$1/0_LOG/$2.') lower(patchname) '.log 2>&1']; % redirect standard output to the log file 4441 4442 else 4442 4443 cmd=['"' Param.xml.PatchBin...
Note: See TracChangeset
for help on using the changeset viewer.