Changeset 17791


Ignore:
Timestamp:
04/21/14 15:34:54 (11 years ago)
Author:
Mathieu Morlighem
Message:

CHG: updating preqmu

File:
1 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/src/m/qmu/preqmu.m

    r15771 r17791  
    1313%       iparams: same thing for params
    1414%       overwrite: overwrite qmudir before analysis
    15 %       keep: keep qmudir after analysis
    16 %       outfiles: (John?)
    17 %       rstfile: backup file name
    18 %       rundakota: (John?)
    19 %       runmpi: (John?)
    2015
    2116disp('preprocessing dakota inputs');
     17qmudir    = getfieldvalue(options,'qmudir',['qmu' num2str(feature('GetPid'))]);  % qmudir = ['qmu_' datestr(now,'yyyymmdd_HHMMSS')];
     18qmufile   = getfieldvalue(options,'qmufile','qmu');% qmufile cannot be changed unless ????script.sh is also changed
     19overwrite = getfieldvalue(options,'overwrite','n');
     20ivar      = getfieldvalue(options,'ivar',1);
     21iresp     = getfieldvalue(options,'iresp',1);
     22imethod   = getfieldvalue(options,'imethod',1);
     23iparams   = getfieldvalue(options,'iparams',1);
    2224
    2325%first create temporary directory in which we will work
    24 if strncmpi(options.overwrite,'y',1)
    25         system(['rm -rf ' options.qmudir '/*']);
     26if strncmpi(overwrite,'y',1)
     27        system(['rm -rf ' qmudir '/*']);
    2628else
    2729        %does the directory exist? if so, then error out
     
    3436
    3537%when running in library mode, the in file needs to be called md.miscellaneous.name.qmu.in
    36 options.qmufile=[md.miscellaneous.name ];
     38qmufile=[md.miscellaneous.name ];
    3739
    3840%retrieve variables and resposnes for this particular analysis.
    39 variables=md.qmu.variables(options.ivar);
    40 responses=md.qmu.responses(options.iresp);
     41variables=md.qmu.variables(ivar);
     42responses=md.qmu.responses(iresp);
    4143
    4244%expand variables and responses
     
    7375
    7476%create in file for dakota
    75 dakota_in_data(md.qmu.method(options.imethod),variables,responses,md.qmu.params(options.iparams),options.qmufile);
     77dakota_in_data(md.qmu.method(imethod),variables,responses,md.qmu.params(iparams),qmufile);
    7678system(['rm -rf ' md.miscellaneous.name '.m']);
    7779
    7880%build a list of variables and responses descriptors. the list is not expanded. {{{
    7981variabledescriptors={};
    80 variable_fieldnames=fieldnames(md.qmu.variables(options.ivar));
     82variable_fieldnames=fieldnames(md.qmu.variables(ivar));
    8183for i=1:length(variable_fieldnames),
    8284        field_name=variable_fieldnames{i};
    83         fieldvariables=md.qmu.variables(options.ivar).(field_name);
     85        fieldvariables=md.qmu.variables(ivar).(field_name);
    8486        for j=1:numel(fieldvariables)
    8587                variabledescriptors{end+1}=fieldvariables(j).descriptor;
     
    8890
    8991responsedescriptors={};
    90 response_fieldnames=fieldnames(md.qmu.responses(options.iresp));
     92response_fieldnames=fieldnames(md.qmu.responses(iresp));
    9193for i=1:length(response_fieldnames),
    9294        field_name=response_fieldnames{i};
    93         fieldresponses=md.qmu.responses(options.iresp).(field_name);
     95        fieldresponses=md.qmu.responses(iresp).(field_name);
    9496        for j=1:numel(fieldresponses)
    9597                responsedescriptors{end+1}=fieldresponses(j).descriptor;
Note: See TracChangeset for help on using the changeset viewer.