Changeset 2399
- Timestamp:
- 10/08/09 11:11:46 (15 years ago)
- 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 37 37 %recover options 38 38 disp(sprintf('\nRecovering options...\n')); 39 options= optionlist2cell(varargin{:});39 options=pairoptions(varargin{:}); 40 40 41 41 %process options -
issm/trunk/src/m/classes/public/modeldefault/modeldefault_process.m
r2328 r2399 13 13 14 14 %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 15 optionstruct.domainoutline=getfieldvalueerr(options,'domainoutline'); 19 16 20 17 %resolution 21 optionstruct.resolution=find_option(options,'resolution'); 22 if isempty(optionstruct.resolution), 23 optionstruct.resolution=10000; 24 end 18 optionstruct.resolution=getfieldvalue(options,'resolution',10000); 25 19 disp(sprintf(' %-18s: %g','resolution',optionstruct.resolution)); 26 20 27 21 %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 22 iceshelves=[ISSM_DIR '/../models/Antarctica/Exp_Par/Iceshelves.exp']; 23 optionstruct.iceshelves=getfieldvalue(options,'iceshelves',iceshelves); 37 24 disp(sprintf(' %-18s: %s','iceshelves',optionstruct.iceshelves)); 38 25 39 26 %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 27 islands=[ISSM_DIR '/../models/Antarctica/Exp_Par/Islands.exp']; 28 optionstruct.islands=getfieldvalue(options,'islands',islands); 49 29 disp(sprintf(' %-18s: %s','islands',optionstruct.islands)); 50 30 51 31 %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 32 thicknesspath=[modeldatapath '/BedMap/gridded/thickness.mat']; 33 optionstruct.thicknesspath=getfieldvalue(options,'thicknesspath',thicknesspath); 61 34 disp(sprintf(' %-18s: %s','thicknesspath',optionstruct.thicknesspath)); 62 35 63 36 %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 37 firnpath=[modeldatapath '/BroekeFirn1km/firn.mat']; 38 optionstruct.firnpath=getfieldvalue(options,'firnpath',firnpath); 73 39 disp(sprintf(' %-18s: %s','firnpath',optionstruct.firnpath)); 74 40 75 41 %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 42 surfacepath=[modeldatapath '/BamberDEMAntarctica1km/surface_smooth30_lowslope.mat']; 43 optionstruct.surfacepath=getfieldvalue(options,'surfacepath',surfacepath); 85 44 disp(sprintf(' %-18s: %s','surfacepath',optionstruct.surfacepath)); 86 45 87 46 %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 47 mosaicpath=[modeldatapath '/RignotAntarcticaVelMosaicRampErsAlos/RignotAntVel.mat']; 48 optionstruct.mosaicpath=getfieldvalue(options,'mosaicpath',mosaicpath); 97 49 disp(sprintf(' %-18s: %s','mosaicpath',optionstruct.mosaicpath)); 98 50 99 51 %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 52 temperaturepath=[modeldatapath '/GiovinettoZwallyTemperatures92/Giovinetto_Temperatures.mat']; 53 optionstruct.temperaturepath=getfieldvalue(options,'temperaturepath',temperaturepath); 109 54 disp(sprintf(' %-18s: %s','temperaturepath',optionstruct.temperaturepath)); 110 55 111 56 %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 57 heatfluxpath=[modeldatapath '/HeatfluxAntarctica/RignotHeatFlux.mat']; 58 optionstruct.heatfluxpath=getfieldvalue(options,'heatfluxpath',heatfluxpath); 121 59 disp(sprintf(' %-18s: %s','heatfluxpath',optionstruct.heatfluxpath)); 122 60 123 61 %numlayers 124 optionstruct.numlayers=find_option(options,'numlayers'); 125 if isempty(optionstruct.numlayers), 126 optionstruct.numlayers=0; 127 end 62 optionstruct.numlayers=getfieldvalue(options,'numlayers',0); 128 63 disp(sprintf(' %-18s: %g','numlayers',optionstruct.numlayers)); 129 64 130 65 %extrusionexponent 131 optionstruct.extrusionexponent=find_option(options,'extrusionexponent'); 132 if isempty(optionstruct.extrusionexponent), 133 optionstruct.extrusionexponent=3; 134 end 66 optionstruct.extrusionexponent=getfieldvalue(options,'extrusionexponent',3); 135 67 disp(sprintf(' %-18s: %g','extrusionexponent',optionstruct.extrusionexponent)); 136 68 137 69 138 70 %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 71 if optionstruct.numlayers>0, 72 elementstype='pattyn'; 73 else 74 elementstype='macayeal'; 146 75 end 76 optionstruct.elementstype=getfieldvalue(options,'elementstype',elementstype); 147 77 disp(sprintf(' %-18s: %s','elementstype',optionstruct.elementstype)); 148 -
issm/trunk/src/m/utils/Nightly/nightlyrun.m
r2333 r2399 27 27 28 28 %recover options 29 options= optionlist2cell(varargin{:});29 options=pairoptions(varargin{:}); 30 30 31 31 %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 32 rank=getfieldvalue(options,'rank',1); 33 numprocs=getfieldvalue(options,'numprocs',1); 34 if (numprocs<rank), numprocs=1; end 35 procedure=getfieldvalue(options,'procedure','check'); 38 36 39 37 %Go to Test directory -
issm/trunk/src/m/utils/Nightly/runme.m
r2257 r2399 26 26 27 27 %recover options 28 options= optionlist2cell(varargin{:});28 options=pairoptions(varargin{:}); 29 29 30 30 %check arguments … … 60 60 61 61 %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 67 65 end 68 66 69 67 %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 75 71 end 76 72 77 73 %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 83 77 end 84 78 85 79 %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 91 83 end 92 84 93 85 %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 99 89 end 100 90 101 91 %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 107 95 end 108 96 109 97 %CHECK procedure 110 procedure=find_option(options,'procedure'); 111 if isempty(procedure), 112 procedure='check'; 113 end 98 procedure=getfieldvalue(options,'procedure','check'); 114 99 if ~ismember(procedure,{'check','update'}) 115 100 disp('runme warning: procedure not supported, defaulting to test ''check''') … … 138 123 md.name=testname; 139 124 %check and modify number of cpus if necessary 140 numcpus= find_option(options,'numprocs');125 numcpus=getfieldvalue(options,'numprocs',[]); 141 126 if ~isempty(numcpus) & numcpus>1, 142 127 if md.np>numcpus,
Note:
See TracChangeset
for help on using the changeset viewer.