Changeset 2399


Ignore:
Timestamp:
10/08/09 11:11:46 (15 years ago)
Author:
Mathieu Morlighem
Message:

now use pairoptions in nightly runs

Location:
issm/trunk/src/m
Files:
1 deleted
4 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk/src/m/classes/public/modeldefault/modeldefault.m

    r2216 r2399  
    3737%recover options
    3838disp(sprintf('\nRecovering options...\n'));
    39 options=optionlist2cell(varargin{:});
     39options=pairoptions(varargin{:});
    4040
    4141%process options
  • issm/trunk/src/m/classes/public/modeldefault/modeldefault_process.m

    r2328 r2399  
    1313
    1414%domainoutline
    15 optionstruct.domainoutline=find_option(options,'domainoutline');
    16 if isempty(optionstruct.domainoutline),
    17         error('modeldefault_process error pessage: at least the option ''domainoutline'' must be specified')
    18 end
     15optionstruct.domainoutline=getfieldvalueerr(options,'domainoutline');
    1916
    2017%resolution
    21 optionstruct.resolution=find_option(options,'resolution');
    22 if isempty(optionstruct.resolution),
    23         optionstruct.resolution=10000;
    24 end
     18optionstruct.resolution=getfieldvalue(options,'resolution',10000);
    2519disp(sprintf('   %-18s: %g','resolution',optionstruct.resolution));
    2620
    2721%iceshelves
    28 optionstruct.iceshelves=find_option(options,'iceshelves');
    29 if isempty(optionstruct.iceshelves),
    30         iceshelves=[ISSM_DIR '/../models/Antarctica/Exp_Par/Iceshelves.exp'];
    31         if exist(iceshelves),
    32                 optionstruct.iceshelves=iceshelves;
    33         else
    34                 optionstruct.iceshelves='';
    35         end
    36 end
     22iceshelves=[ISSM_DIR '/../models/Antarctica/Exp_Par/Iceshelves.exp'];
     23optionstruct.iceshelves=getfieldvalue(options,'iceshelves',iceshelves);
    3724disp(sprintf('   %-18s: %s','iceshelves',optionstruct.iceshelves));
    3825
    3926%islands
    40 optionstruct.islands=find_option(options,'islands');
    41 if isempty(optionstruct.islands),
    42         islands=[ISSM_DIR '/../models/Antarctica/Exp_Par/Islands.exp'];
    43         if exist(islands),
    44                 optionstruct.islands=islands;
    45         else
    46                 optionstruct.islands='';
    47         end
    48 end
     27islands=[ISSM_DIR '/../models/Antarctica/Exp_Par/Islands.exp'];
     28optionstruct.islands=getfieldvalue(options,'islands',islands);
    4929disp(sprintf('   %-18s: %s','islands',optionstruct.islands));
    5030
    5131%thicknesspath
    52 optionstruct.thicknesspath=find_option(options,'thicknesspath');
    53 if isempty(optionstruct.thicknesspath),
    54         thicknesspath=[modeldatapath '/BedMap/gridded/thickness.mat'];
    55         if exist(thicknesspath),
    56                 optionstruct.thicknesspath=thicknesspath;
    57         else
    58                 optionstruct.thicknesspath='';
    59         end
    60 end
     32thicknesspath=[modeldatapath '/BedMap/gridded/thickness.mat'];
     33optionstruct.thicknesspath=getfieldvalue(options,'thicknesspath',thicknesspath);
    6134disp(sprintf('   %-18s: %s','thicknesspath',optionstruct.thicknesspath));
    6235
    6336%firnpath
    64 optionstruct.firnpath=find_option(options,'firnpath');
    65 if isempty(optionstruct.firnpath),
    66         firnpath=[modeldatapath '/BroekeFirn1km/firn.mat'];
    67         if exist(firnpath),
    68                 optionstruct.firnpath=firnpath;
    69         else
    70                 optionstruct.firnpath='';
    71         end
    72 end
     37firnpath=[modeldatapath '/BroekeFirn1km/firn.mat'];
     38optionstruct.firnpath=getfieldvalue(options,'firnpath',firnpath);
    7339disp(sprintf('   %-18s: %s','firnpath',optionstruct.firnpath));
    7440
    7541%surfacepath
    76 optionstruct.surfacepath=find_option(options,'surfacepath');
    77 if isempty(optionstruct.surfacepath),
    78         surfacepath=[modeldatapath '/BamberDEMAntarctica1km/surface_smooth30_lowslope.mat'];
    79         if exist(surfacepath),
    80                 optionstruct.surfacepath=surfacepath;
    81         else
    82                 optionstruct.surfacepath='';
    83         end
    84 end
     42surfacepath=[modeldatapath '/BamberDEMAntarctica1km/surface_smooth30_lowslope.mat'];
     43optionstruct.surfacepath=getfieldvalue(options,'surfacepath',surfacepath);
    8544disp(sprintf('   %-18s: %s','surfacepath',optionstruct.surfacepath));
    8645
    8746%mosaicpath
    88 optionstruct.mosaicpath=find_option(options,'mosaicpath');
    89 if isempty(optionstruct.mosaicpath),
    90         mosaicpath=[modeldatapath '/RignotAntarcticaVelMosaicRampErsAlos/RignotAntVel.mat'];
    91         if exist(mosaicpath),
    92                 optionstruct.mosaicpath=mosaicpath;
    93         else
    94                 optionstruct.mosaicpath='';
    95         end
    96 end
     47mosaicpath=[modeldatapath '/RignotAntarcticaVelMosaicRampErsAlos/RignotAntVel.mat'];
     48optionstruct.mosaicpath=getfieldvalue(options,'mosaicpath',mosaicpath);
    9749disp(sprintf('   %-18s: %s','mosaicpath',optionstruct.mosaicpath));
    9850
    9951%temperaturepath
    100 optionstruct.temperaturepath=find_option(options,'temperaturepath');
    101 if isempty(optionstruct.temperaturepath),
    102         temperaturepath=[modeldatapath '/GiovinettoZwallyTemperatures92/Giovinetto_Temperatures.mat'];
    103         if exist(temperaturepath),
    104                 optionstruct.temperaturepath=temperaturepath;
    105         else
    106                 optionstruct.temperaturepath='';
    107         end
    108 end
     52temperaturepath=[modeldatapath '/GiovinettoZwallyTemperatures92/Giovinetto_Temperatures.mat'];
     53optionstruct.temperaturepath=getfieldvalue(options,'temperaturepath',temperaturepath);
    10954disp(sprintf('   %-18s: %s','temperaturepath',optionstruct.temperaturepath));
    11055
    11156%heatfluxpath
    112 optionstruct.heatfluxpath=find_option(options,'heatfluxpath');
    113 if isempty(optionstruct.heatfluxpath),
    114         heatfluxpath=[modeldatapath '/HeatfluxAntarctica/RignotHeatFlux.mat'];
    115         if exist(heatfluxpath),
    116                 optionstruct.heatfluxpath=heatfluxpath;
    117         else
    118                 optionstruct.heatfluxpath='';
    119         end
    120 end
     57heatfluxpath=[modeldatapath '/HeatfluxAntarctica/RignotHeatFlux.mat'];
     58optionstruct.heatfluxpath=getfieldvalue(options,'heatfluxpath',heatfluxpath);
    12159disp(sprintf('   %-18s: %s','heatfluxpath',optionstruct.heatfluxpath));
    12260
    12361%numlayers
    124 optionstruct.numlayers=find_option(options,'numlayers');
    125 if isempty(optionstruct.numlayers),
    126         optionstruct.numlayers=0;
    127 end
     62optionstruct.numlayers=getfieldvalue(options,'numlayers',0);
    12863disp(sprintf('   %-18s: %g','numlayers',optionstruct.numlayers));
    12964
    13065%extrusionexponent
    131 optionstruct.extrusionexponent=find_option(options,'extrusionexponent');
    132 if isempty(optionstruct.extrusionexponent),
    133         optionstruct.extrusionexponent=3;
    134 end
     66optionstruct.extrusionexponent=getfieldvalue(options,'extrusionexponent',3);
    13567disp(sprintf('   %-18s: %g','extrusionexponent',optionstruct.extrusionexponent));
    13668
    13769
    13870%elementstype
    139 optionstruct.elementstype=find_option(options,'elementstype');
    140 if isempty(optionstruct.elementstype),
    141         if optionstruct.numlayers>0,
    142                 optionstruct.elementstype='pattyn';
    143         else
    144                 optionstruct.elementstype='macayeal';
    145         end
     71if optionstruct.numlayers>0,
     72        elementstype='pattyn';
     73else
     74        elementstype='macayeal';
    14675end
     76optionstruct.elementstype=getfieldvalue(options,'elementstype',elementstype);
    14777disp(sprintf('   %-18s: %s','elementstype',optionstruct.elementstype));
    148 
  • issm/trunk/src/m/utils/Nightly/nightlyrun.m

    r2333 r2399  
    2727
    2828%recover options
    29 options=optionlist2cell(varargin{:});
     29options=pairoptions(varargin{:});
    3030
    3131%check some options
    32 rank=find_option(options,'rank');
    33 if isempty(rank), rank=1; end
    34 numprocs=find_option(options,'numprocs');
    35 if (isempty(numprocs) | numprocs<rank), numprocs=1; end
    36 procedure=find_option(options,'procedure');
    37 if isempty(procedure), procedure='check'; end
     32rank=getfieldvalue(options,'rank',1);
     33numprocs=getfieldvalue(options,'numprocs',1);
     34if (numprocs<rank), numprocs=1; end
     35procedure=getfieldvalue(options,'procedure','check');
    3836
    3937%Go to Test directory
  • issm/trunk/src/m/utils/Nightly/runme.m

    r2257 r2399  
    2626
    2727%recover options
    28 options=optionlist2cell(varargin{:});
     28options=pairoptions(varargin{:});
    2929
    3030%check arguments
     
    6060
    6161        %CHECK analysis_type
    62         analysis_type_arg=find_option(options,'analysis_type');
    63         if ~isempty(analysis_type_arg),
    64                 if ~ismember(analysis_type,analysis_type_arg)
    65                         continue
    66                 end
     62        analysis_type_arg=getfieldvalue(options,'analysis_type',{analysis_type});
     63        if ~ismember(analysis_type,analysis_type_arg)
     64                continue
    6765        end
    6866
    6967        %CHECK sub_analysis_type
    70         sub_analysis_type_arg=find_option(options,'sub_analysis_type');
    71         if ~isempty(sub_analysis_type_arg),
    72                 if ~ismember(sub_analysis_type,sub_analysis_type_arg)
    73                         continue
    74                 end
     68        sub_analysis_type_arg=getfieldvalue(options,'sub_analysis_type',{sub_analysis_type});
     69        if ~ismember(sub_analysis_type,sub_analysis_type_arg)
     70                continue
    7571        end
    7672
    7773        %CHECK qmu
    78         qmu_arg=find_option(options,'qmu');
    79         if ~isempty(qmu_arg),
    80                 if qmu~=qmu_arg,
    81                         continue
    82                 end
     74        qmu_arg=getfieldvalue(options,'qmu',qmu);
     75        if qmu~=qmu_arg,
     76                continue
    8377        end
    8478
    8579        %CHECK control
    86         control_arg=find_option(options,'control');
    87         if ~isempty(control_arg),
    88                 if control~=control_arg,
    89                         continue
    90                 end
     80        control_arg=getfieldvalue(options,'control',control);
     81        if control~=control_arg,
     82                continue
    9183        end
    9284
    9385        %CHECK control_fit
    94         control_fit_arg=find_option(options,'control_fit');
    95         if ~isempty(control_fit_arg),
    96                 if ~ismember(control_fit,control_fit_arg)
    97                         continue
    98                 end
     86        control_fit_arg=getfieldvalue(options,'control_fit',{control_fit});
     87        if ~ismember(control_fit,control_fit_arg)
     88                continue
    9989        end
    10090
    10191        %CHECK parallel
    102         parallel_arg=find_option(options,'parallel');
    103         if ~isempty(parallel_arg),
    104                 if parallel~=parallel_arg,
    105                         continue
    106                 end
     92        parallel_arg=getfieldvalue(options,'parallel',parallel);
     93        if parallel~=parallel_arg,
     94                continue
    10795        end
    10896
    10997        %CHECK procedure
    110         procedure=find_option(options,'procedure');
    111         if isempty(procedure),
    112                 procedure='check';
    113         end
     98        procedure=getfieldvalue(options,'procedure','check');
    11499        if ~ismember(procedure,{'check','update'})
    115100                disp('runme warning: procedure not supported, defaulting to test ''check''')
     
    138123                md.name=testname;
    139124                %check and modify number of cpus if necessary
    140                 numcpus=find_option(options,'numprocs');
     125                numcpus=getfieldvalue(options,'numprocs',[]);
    141126                if ~isempty(numcpus) & numcpus>1,
    142127                        if md.np>numcpus,
Note: See TracChangeset for help on using the changeset viewer.