source: issm/trunk/src/m/qmu/postqmu.m@ 9571

Last change on this file since 9571 was 9571, checked in by Eric.Larour, 14 years ago

Simplified solutioncore calling structure. Took out control_core
from issm.m and issm.cpp.
New AnalysisConfiguration routine and new call to CorePointerFromSolutionEnum in issm.m and issm.cpp
Qmu could not be folded, had to put it back into issm.m and issm.cpp

Renamed Qmu to Dakota.

File size: 1.8 KB
RevLine 
[963]1function md=postqmu(md)
2%INPUT function md=postqmu(md,qmufile,qmudir)
3%Deal with dakota output results in files.
4
5% check to see if dakota returned errors in the err file
6qmuerrfile=[md.name '.qmu.err'];
7
8if exist(qmuerrfile,'file')
9 fide=fopen(qmuerrfile,'r');
10 fline=fgetl(fide);
11 if ischar(fline)
12 while ischar(fline)
13 disp(sprintf('%s',fline));
14 fline=fgetl(fide);
15 end
16 status=fclose(fide);
17 cd ../
18 error(['Dakota returned error in ''' qmuerrfile ' file. ''' qmudir ''' directory retained.'])
19 end
20 status=fclose(fide);
21else
22 cd ../
23 error(['Dakota did not generate ''' qmuerrfile ' file. ''' qmudir ''' directory retained.'])
24end
25
26%parse inputs and results from dakota
27qmuinfile=[md.name '.qmu.in'];
28qmuoutfile=[md.name '.qmu.out'];
29
[2087]30%[method,dvar,dresp_in]=dakota_in_parse(qmuinfile);
31%dakotaresults.method =method;
32%dakotaresults.dvar =dvar;
33%dakotaresults.dresp_in =dresp_in;
[963]34
35[method,dresp_out,scm,pcm,srcm,prcm]=dakota_out_parse(qmuoutfile);
[2051]36dakotaresults.dresp_out=dresp_out;
37dakotaresults.scm =scm;
38dakotaresults.pcm =pcm;
39dakotaresults.srcm =srcm;
40dakotaresults.prcm =prcm;
[963]41
42if exist('dakota_tabular.dat','file')
43 [method,dresp_dat ]=dakota_out_parse('dakota_tabular.dat');
[2051]44 dakotaresults.dresp_dat=dresp_dat;
[963]45end
46
[2051]47%put dakotaresults in their right location.
[3038]48md.results.dakota=dakotaresults;
[2051]49
[963]50%save input and output files into model
51%md.dakotain =readfile([qmufile '.in']);
[2087]52%md.dakotaout=readfile(qmuoutfile);
[963]53%if exist('dakota_tabular.dat','file')
54% md.dakotadat=readfile('dakota_tabular.dat');
55%end
56
57% move all the individual function evalutations into zip files
[9571]58if ~md.dakota_analysis,
[963]59 system('zip -mq params.in.zip params.in.[1-9]*');
60 system('zip -mq results.out.zip results.out.[1-9]*');
61 system('zip -mq matlab.out.zip matlab*.out.[1-9]*');
62end
Note: See TracBrowser for help on using the repository browser.