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

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

Now we expand the variables before going into dakota_in_data, which simplifies a lot
of the preqmu and marshalling.
Simplified also the QmuSetupDesign: no need for all these individual drivers.

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