source:
issm/oecreview/Archive/17984-18295/ISSM-18202-18203.diff@
18296
Last change on this file since 18296 was 18296, checked in by , 11 years ago | |
---|---|
File size: 13.6 KB |
-
../trunk-jpl/examples/ISMIP/CheatyRunme.m
2 2 %step 7 is specific to ISMIPA 3 3 %step 8 is specific to ISMIPF 4 4 5 steps=[1 2 3 4 5 6 8];5 steps=[1:7]; 6 6 7 7 % parameter file to be used, choose between CheatyIsmipA.par or CheatyIsmipF.par 8 8 ParamFile='CheatyIsmipF.par' 9 9 10 name_prefix='ISMIP';11 10 %Run Steps 12 org=organizer('repository','./Models','prefix',name_prefix,'steps',steps);13 11 14 12 % {{{ Mesh Generation #1 15 if perform(org,'Mesh_Generation')13 if any(steps==1) 16 14 17 15 %initialize md as a new model #help model 18 16 %-> … … 30 28 plotmodel(md,'data','mesh') 31 29 % save the given model 32 30 %-> 33 save model(org,md);31 save ./Models/ISMIP.Mesh_generation md; 34 32 end 35 33 % }}} 36 34 37 35 % {{{ Masks #2 38 if perform(org,'SetMask'),36 if any(steps==2) 39 37 40 38 % load the preceding step #help loadmodel 41 39 % path is given by the organizer with the name of the given step 42 40 %-> 43 md =loadmodel(org,'Mesh_Generation');41 md = loadmodel('./Models/ISMIP.Mesh_generation'); 44 42 % set the mask #help setmask 45 43 % all MISMIP nodes are grounded 46 44 %-> … … 50 48 plotmodel(md,'data',md.mask.groundedice_levelset); 51 49 % save the given model 52 50 %-> 53 save model(org,md);51 save ./Models/ISMIP.SetMask md; 54 52 end 55 53 % }}} 56 54 57 55 % {{{ Parameterization #3 58 if perform(org,'Parameterization')56 if any(steps==3) 59 57 60 58 % load the preceding step #help loadmodel 61 59 % path is given by the organizer with the name of the given step 62 60 %-> 63 md =loadmodel(org,'SetMask');61 md = loadmodel('./Models/ISMIP.SetMask'); 64 62 % parametrize the model # help parameterize 65 63 % you will need to fil-up the parameter file defined by the 66 64 % ParamFile variable 67 65 %-> 68 66 md=parameterize(md,ParamFile); 69 67 % save the given model 70 68 %-> 71 save model(org,md);69 save ./Models/ISMIP.Parameterization md; 72 70 end 73 71 % }}} 74 72 75 73 % {{{ Extrusion #4 76 if perform(org,'Extrusion')74 if any(steps==4) 77 75 78 76 % load the preceding step #help loadmodel 79 77 % path is given by the organizer with the name of the given step 80 78 %-> 81 md =loadmodel(org,'Parameterization');79 md = loadmodel('./Models/ISMIP.Parameterization'); 82 80 % vertically extrude the preceding mesh #help extrude 83 81 % only 5 layers exponent 1 84 82 %-> … … 88 86 plotmodel(md,'data',md.geometry.base) 89 87 % save the given model 90 88 %-> 91 save model(org,md);89 save ./Models/ISMIP.Extrusion md; 92 90 end 93 91 % }}} 94 92 95 93 % {{{ Set the flow computing method #5 94 if any(steps==5) 96 95 97 if perform(org,'SetFlow')98 99 96 % load the preceding step #help loadmodel 100 97 % path is given by the organizer with the name of the given step 101 98 %-> 102 md =loadmodel(org,'Extrusion');99 md = loadmodel('./Models/ISMIP.Extrusion'); 103 100 % set the approximation for the flow computation #help setflowequation 104 101 % We will be using the Higher Order Model (HO) 105 102 %-> 106 103 md=setflowequation(md,'HO','all'); 107 104 % save the given model 108 105 %-> 109 save model(org,md);106 save ./Models/ISMIP.SetFlow md; 110 107 end 111 108 % }}} 112 109 113 110 % {{{ Set Boundary Conditions #6 114 if perform(org,'BoundaryCondition')111 if any(steps==6) 115 112 116 113 % load the preceding step #help loadmodel 117 114 % path is given by the organizer with the name of the given step 118 115 %-> 119 md =loadmodel(org,'SetFlow');116 md = loadmodel('./Models/ISMIP.SetFlow'); 120 117 % dirichlet boundary condition are known as SPCs 121 118 % ice frozen to the base, no velocity #md.stressbalance 122 119 % SPCs are initialized at NaN one value per vertex … … 129 126 % extract the nodenumbers at the base #md.mesh.vertexonbase 130 127 %-> 131 128 basalnodes=find(md.mesh.vertexonbase); 132 129 % set the sliding to zero on the bed 133 130 %-> 134 131 md.stressbalance.spcvx(basalnodes)=0.0; 135 132 %-> … … 161 158 end 162 159 % save the given model 163 160 %-> 164 save model(org,md);161 save ./Models/ISMIP.BoundaryCondition md; 165 162 end 166 163 % }}} 167 164 168 165 % {{{ Solving #7 169 if perform(org,'SolvingISMIPA')166 if any(steps==7) 170 167 % load the preceding step #help loadmodel 171 168 % path is given by the organizer with the name of the given step 172 169 %-> 173 md =loadmodel(org,'BoundaryCondition');170 md = loadmodel('./Models/ISMIP.BoundaryCondition'); 174 171 % Set cluster #md.cluster 175 172 % generic parameters #help generic 176 173 % set only the name and number of process … … 185 182 md=solve(md,StressbalanceSolutionEnum()); 186 183 % save the given model 187 184 %-> 188 save model(org,md);185 save ./Models/ISMIP.StressBalance md; 189 186 % plot the surface velocities #plotdoc 190 187 %-> 191 188 plotmodel(md,'data',md.results.StressbalanceSolution.Vel) … … 193 190 % }}} 194 191 195 192 % {{{ Solving #8 196 if perform(org,'SolvingISMIPF')193 if any(steps==8) 197 194 % load the preceding step #help loadmodel 198 195 % path is given by the organizer with the name of the given step 199 196 %-> 200 md =loadmodel(org,'BoundaryCondition');197 md = loadmodel('./Models/ISMIP.BoundaryCondition'); 201 198 % Set cluster #md.cluster 202 199 % generic parameters #help generic 203 200 % set only the name and number of process … … 224 221 md=solve(md,TransientSolutionEnum); 225 222 % save the given model 226 223 %-> 227 save model(org,md);224 save ./Models/ISMIP.Transient md; 228 225 % plot the surface velocities #plotdoc 229 226 %-> 230 227 plotmodel(md,'data',md.results.TransientSolution(20).Vel) -
../trunk-jpl/examples/ISMIP/CheatyIsmipA.par
49 49 %Set the default boundary conditions for an ice-sheet 50 50 % #help SetIceSheetBC 51 51 %-> 52 md=SetIceSheetBC(md); 53 No newline at end of file 52 md=SetIceSheetBC(md); -
../trunk-jpl/examples/ISMIP/runme.m
7 7 % parameter file to be used, choose between IsmipA.par or IsmipF.par 8 8 ParamFile='IsmipA.par' 9 9 10 name_prefix='ISMIP';11 10 %Run Steps 12 org=organizer('repository','./Models','prefix',name_prefix,'steps',steps);13 11 14 12 % {{{ Mesh Generation #1 15 if perform(org,'Mesh_Generation')13 if any(steps==1) 16 14 17 15 %initialize md as a new model #help model 18 16 %-> … … 31 29 % }}} 32 30 33 31 % {{{ Masks #2 34 if perform(org,'SetMask'),32 if any(steps==2) 35 33 36 34 % load the preceding step #help loadmodel 37 35 % path is given by the organizer with the name of the given step … … 51 49 % }}} 52 50 53 51 % {{{ Parameterization #3 54 if perform(org,'Parameterization')52 if any(steps==3) 55 53 56 54 % load the preceding step #help loadmodel 57 55 % path is given by the organizer with the name of the given step … … 69 67 % }}} 70 68 71 69 % {{{ Extrusion #4 72 if perform(org,'Extrusion')70 if any(steps==4) 73 71 74 72 % load the preceding step #help loadmodel 75 73 % path is given by the organizer with the name of the given step … … 90 88 91 89 % {{{ Set the flow computing method #5 92 90 93 if perform(org,'SetFlow')91 if any(steps==5) 94 92 95 93 % load the preceding step #help loadmodel 96 94 % path is given by the organizer with the name of the given step … … 107 105 % }}} 108 106 109 107 % {{{ Set Boundary Conditions #6 110 if perform(org,'BoundaryCondition')108 if any(steps==6) 111 109 112 110 % load the preceding step #help loadmodel 113 111 % path is given by the organizer with the name of the given step … … 161 159 % }}} 162 160 163 161 % {{{ Solving #7 164 if perform(org,'SolvingISMIPA')162 if any(steps==7) 165 163 % load the preceding step #help loadmodel 166 164 % path is given by the organizer with the name of the given step 167 165 %-> … … 187 185 % }}} 188 186 189 187 % {{{ Solving #8 190 if perform(org,'SolvingISMIPF')188 if any(steps==8) 191 189 % load the preceding step #help loadmodel 192 190 % path is given by the organizer with the name of the given step 193 191 %-> -
../trunk-jpl/examples/ISMIP/CheatyIsmipF.par
63 63 %-> 64 64 md.initialization.vz=zeros(md.mesh.numberofvertices,1); 65 65 %-> 66 md.initialization.pressure=zeros(md.mesh.numberofvertices,1); 67 No newline at end of file 66 md.initialization.pressure=zeros(md.mesh.numberofvertices,1); -
../trunk-jpl/examples/UncertaintyQuantification/runme.m
1 1 %PIG Uncertainty Quantification Application 2 steps=[3]; eval(['addpath ' pwd]);2 steps=[3]; 3 3 4 4 if any(steps==1) 5 5 disp(' Step 1: plot flux gates'); 6 6 7 md = loadmodel('../ Data/PIG.Control_drag_default');7 md = loadmodel('../Pig/Models/PIG.Control_drag'); 8 8 9 9 texts=cell(1,13); 10 10 textpositions=cell(1,13); 11 11 12 12 for i=1:13, 13 contour=expread(['./ Exp_Par/MassFluxes/MassFlux' num2str(i) '.exp']);13 contour=expread(['./MassFluxes/MassFlux' num2str(i) '.exp']); 14 14 textpositions{i}=[contour.x(end) contour.y(end)]; 15 15 end 16 16 17 17 plotmodel(md,'data',md.results.StressbalanceSolution.Vel,'log',10,'expdisp',... 18 {' Exp_Par/MassFluxes/MassFlux1.exp','Exp_Par/MassFluxes/MassFlux2.exp',...19 ' Exp_Par/MassFluxes/MassFlux3.exp','Exp_Par/MassFluxes/MassFlux4.exp',...20 ' Exp_Par/MassFluxes/MassFlux5.exp','Exp_Par/MassFluxes/MassFlux6.exp',...21 ' Exp_Par/MassFluxes/MassFlux7.exp','Exp_Par/MassFluxes/MassFlux8.exp',...22 ' Exp_Par/MassFluxes/MassFlux9.exp','Exp_Par/MassFluxes/MassFlux10.exp',...23 ' Exp_Par/MassFluxes/MassFlux11.exp','Exp_Par/MassFluxes/MassFlux12.exp',...24 ' Exp_Par/MassFluxes/MassFlux13.exp'},...18 {'MassFluxes/MassFlux1.exp','MassFluxes/MassFlux2.exp',... 19 'MassFluxes/MassFlux3.exp','MassFluxes/MassFlux4.exp',... 20 'MassFluxes/MassFlux5.exp','MassFluxes/MassFlux6.exp',... 21 'MassFluxes/MassFlux7.exp','MassFluxes/MassFlux8.exp',... 22 'MassFluxes/MassFlux9.exp','MassFluxes/MassFlux10.exp',... 23 'MassFluxes/MassFlux11.exp','MassFluxes/MassFlux12.exp',... 24 'MassFluxes/MassFlux13.exp'},... 25 25 'expstyle',{'k-','k-','k-','k-','k-','k-','k-',... 26 26 'k-','k-','k-','k-','k-','k-'},'linewidth',2,... 27 27 'text',{'1','2','3','4','5','6','7',... … … 32 32 if any(steps==2) 33 33 disp(' Step 2: compute cross overs from CRESIS'); 34 34 35 md = loadmodel('../ Data/PIG.Control_drag_default');35 md = loadmodel('../Pig/Models/PIG.Control_drag'); 36 36 37 37 %load cross overs: CRESIS McCord Antarctica, 2009 (courtesy of John Paden) 38 38 load('../Data/CrossOvers2009.mat'); … … 44 44 pos=find(isnan(DeltaHH)); DeltaHH(pos)=0; 45 45 46 46 %filter out unrealistic error ranges 47 flags=ContourToNodes(md.mesh.x,md.mesh.y,'E xp_Par/ErrorContour.exp',1);47 flags=ContourToNodes(md.mesh.x,md.mesh.y,'ErrorContour.exp',1); 48 48 pos=find(~flags); DeltaHH(pos)=0; 49 49 50 50 %avoid large unrealistic values … … 63 63 disp(' Step 3: sampling analysis'); 64 64 65 65 %load model and cross over errors 66 md = loadmodel('../ Data/PIG.Control_drag_default');66 md = loadmodel('../Pig/Models/PIG.Control_drag'); 67 67 load -mat Models/PIG.CrossOvers 68 68 69 69 %partition the mesh … … 122 122 'MassFlux11.exp',... 123 123 'MassFlux12.exp',... 124 124 'MassFlux13.exp'}; 125 md.qmu.mass_flux_profile_directory='../ Exp_Par/MassFluxes/';125 md.qmu.mass_flux_profile_directory='../MassFluxes/'; 126 126 127 127 %% sampling analysis 128 128 md.qmu.method =dakota_method('nond_samp'); … … 151 151 disp(' Step 4: sensitivity analysis'); 152 152 153 153 %load model 154 md = loadmodel('../ Data/PIG.Control_drag_default');154 md = loadmodel('../Pig/Models/PIG.Control_drag'); 155 155 156 156 %partition the mesh 157 157 md.qmu.numberofpartitions=10; … … 196 196 'MassFlux11.exp',... 197 197 'MassFlux12.exp',... 198 198 'MassFlux13.exp'}; 199 md.qmu.mass_flux_profile_directory='../ Exp_Par/MassFluxes/';199 md.qmu.mass_flux_profile_directory='../MassFluxes/'; 200 200 201 201 %method: local reliability 202 202 md.qmu.method =dakota_method('nond_l'); … … 267 267 sh=md.results.dakota.dresp_out(index).sens(21:30); sh=sh(md.qmu.partition+1)/1e12*60*60*24*365; 268 268 269 269 plotmodel(md,'data',sh,'data',sa,'data',sb,'expdisp#all',... 270 [' Exp_Par/MassFluxes/MassFlux' num2str(index) '.exp'],...270 ['MassFluxes/MassFlux' num2str(index) '.exp'],... 271 271 'expstyle#all','b-','linewidth#all',2,... 272 272 'nlines',3,'ncols',1, 'axis#all','image',... 273 273 'colorbar#all','on','colorbarfontsize#all',10,... … … 280 280 ifh=importancefactors(md,'scaled_Thickness',['indexed_MassFlux_' num2str(index)]); 281 281 282 282 plotmodel(md,'data',ifh,'data',ifa,'data',ifb,'expdisp#all',... 283 [' Exp_Par/MassFluxes/MassFlux' num2str(index) '.exp'],...283 ['MassFluxes/MassFlux' num2str(index) '.exp'],... 284 284 'expstyle#all','b-','linewidth#all',2,'log#all',10,... 285 285 'nlines',3,'ncols',1, 'axis#all','image','caxis#all',[1e-10 1],... 286 286 'colorbar#all','on','colorbarfontsize#all',10,... -
../trunk-jpl/examples/Inversion/runme.m
1 step= 1;1 step=3; 2 2 if step==1 3 3 %Generate observation 4 4 md = model; … … 46 46 md.inversion.iscontrol = 1; 47 47 md.inversion.control_parameters = {'FrictionCoefficient'}; 48 48 md.inversion.maxsteps = maxsteps; 49 49 md.inversion.dxmin=10^-6; 50 50 md.inversion.cost_functions = [103 501]; 51 51 md.inversion.cost_functions_coefficients = ones(md.mesh.numberofvertices,2); 52 52 md.inversion.cost_functions_coefficients(:,2)=0; 53 53 md.inversion.min_parameters = 10^-5*ones(md.mesh.numberofvertices,1); 54 54 md.inversion.max_parameters = 100*ones(md.mesh.numberofvertices,1); 55 55
Note:
See TracBrowser
for help on using the repository browser.