Changeset 9674


Ignore:
Timestamp:
09/07/11 16:22:22 (14 years ago)
Author:
Mathieu Morlighem
Message:

Fixed loadmodel

File:
1 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk/src/m/classes/model/model.m

    r9661 r9674  
    308308                         if isfield(structmd,'numberofgrids'), md.numberofnodes=structmd.numberofgrids; end
    309309                         if isfield(structmd,'numberofgrids2d'), md.numberofnodes2d=structmd.numberofgrids2d; end
    310                          if isfield(structmd,'gridonhutter'), md.nodeonhutter=structmd.gridonhutter; end
    311                          if isfield(structmd,'gridonmacayeal'), md.nodeonmacayeal=structmd.gridonmacayeal; end
    312                          if isfield(structmd,'gridonpattyn'), md.nodeonpattyn=structmd.gridonpattyn; end
    313                          if isfield(structmd,'gridonstokes'), md.nodeonstokes=structmd.gridonstokes; end
    314310                         if isfield(structmd,'uppergrids'), md.uppernodes=structmd.uppergrids; end
    315311                         if isfield(structmd,'lowergrids'), md.lowernodes=structmd.lowergrids; end
     
    317313                         if isfield(structmd,'gridonsurface'), md.nodeonsurface=structmd.gridonsurface; end
    318314                         if isfield(structmd,'extractedgrids'), md.extractednodes=structmd.extractedgrids; end
    319                          if isfield(structmd,'gridoniceshelf'), md.nodeoniceshelf=structmd.gridoniceshelf; end
    320                          if isfield(structmd,'gridonicesheet'), md.nodeonicesheet=structmd.gridonicesheet; end
    321                          if isfield(structmd,'gridonwater'), md.nodeonwater=structmd.gridonwater; end
    322                          if isfield(structmd,'gridonnuna'), md.nodeonnuna=structmd.gridonnuna; end
     315                         if isfield(structmd,'gridoniceshelf'), md.mask.vertexonfloatingice=structmd.gridoniceshelf; end
     316                         if isfield(structmd,'gridonicesheet'), md.mask.vertexongroundedice=structmd.gridonicesheet; end
     317                         if isfield(structmd,'gridonwater'), md.mask.vertexonwater=structmd.gridonwater; end
    323318                         if isfield(structmd,'gridonboundary'), md.nodeonboundary=structmd.gridonboundary; end
    324319                         if isfield(structmd,'petscoptions'), md.solver=structmd.petscoptions; end
     
    332327                         if isfield(structmd,'drag_p'), md.friction.p=structmd.drag_p; end
    333328                         if isfield(structmd,'drag_q'), md.friction.q=structmd.drag_q; end
    334                          if isfield(structmd,'numrifts'), md.rifts.numrifts=structmd.numrifts; end
     329                         if isfield(structmd,'numrifts'),
     330                                 md.rifts=rifts; %Rifts already existed as a struct in a previous version
     331                                 md.rifts.numrifts=structmd.numrifts;
     332                         end
    335333                         if isfield(structmd,'rifts'), md.rifts.riftstruct=structmd.rifts; end
    336334                         if isfield(structmd,'riftproperties'), md.rifts.riftproperties=structmd.riftproperties; end
     
    362360                         if isfield(structmd,'penalties'), md.prognostic.vertex_pairing=structmd.penalties; end
    363361                         if isfield(structmd,'penalty_offset'), md.prognostic.penalty_factor=structmd.penalty_offset; end
    364                          if isfield(structmd,'rheology_B'), md.materials.rheology_B=structmd.B; end
    365                          if isfield(structmd,'rheology_n'), md.materials.rheology_n=structmd.n; end
    366                          if isfield(structmd,'elementoniceshelf'), md.mask.elementonfloatingice=structmd.elementoniceshelf; end
     362                         if isfield(structmd,'rheology_B'), md.materials.rheology_B=structmd.rheology_B; end
     363                         if isfield(structmd,'rheology_n'), md.materials.rheology_n=structmd.rheology_n; end
     364                         if isfield(structmd,'elementoniceshelf'),
     365                                 md.mask=mask(); %maks already existed in a previous version
     366                                 md.mask.elementonfloatingice=structmd.elementoniceshelf;
     367                         end
    367368                         if isfield(structmd,'elementonicesheet'), md.mask.elementongroundedice=structmd.elementonicesheet; end
    368369                         if isfield(structmd,'elementonwater'), md.mask.elementonwater=structmd.elementonwater; end
     
    418419                                 pos=find(structmd.elements_type==61); md.elements_type(pos,end)=7;
    419420                         end
    420                          if isnumeric(structmd.rheology_law),
     421                         if isfield(structmd,'rheology_law') & isnumeric(structmd.rheology_law),
    421422                                 if (structmd.rheology_law==272), md.materials.rheology_law='None';      end
    422423                                 if (structmd.rheology_law==368), md.materials.rheology_law='Paterson';  end
    423424                                 if (structmd.rheology_law==369), md.materials.rheology_law='Arrhenius'; end
    424425                         end
    425                          if isnumeric(structmd.groundingline_migration),
     426                         if isfield(structmd,'groundingline_migration') & isnumeric(structmd.groundingline_migration),
    426427                                 if (structmd.groundingline_migration==272), md.groundingline.migration='None';      end
    427428                                 if (structmd.groundingline_migration==273), md.groundingline.migration='AgressiveMigration';  end
     
    434435                         end
    435436                         if ismember(structmd.cm_responses(end,end),[165:170 383 388 389]),
    436                                  pos=find(structmd.cm_responses==166), md.control_type(pos)=101;
    437                                  pos=find(structmd.cm_responses==167), md.control_type(pos)=102;
    438                                  pos=find(structmd.cm_responses==168), md.control_type(pos)=103;
    439                                  pos=find(structmd.cm_responses==169), md.control_type(pos)=104;
    440                                  pos=find(structmd.cm_responses==170), md.control_type(pos)=105;
    441                                  pos=find(structmd.cm_responses==165), md.control_type(pos)=201;
    442                                  pos=find(structmd.cm_responses==389), md.control_type(pos)=501;
    443                                  pos=find(structmd.cm_responses==388), md.control_type(pos)=502;
    444                                  pos=find(structmd.cm_responses==382), md.control_type(pos)=503;
     437                                 pos=find(structmd.cm_responses==166); md.control_type(pos)=101;
     438                                 pos=find(structmd.cm_responses==167); md.control_type(pos)=102;
     439                                 pos=find(structmd.cm_responses==168); md.control_type(pos)=103;
     440                                 pos=find(structmd.cm_responses==169); md.control_type(pos)=104;
     441                                 pos=find(structmd.cm_responses==170); md.control_type(pos)=105;
     442                                 pos=find(structmd.cm_responses==165); md.control_type(pos)=201;
     443                                 pos=find(structmd.cm_responses==389); md.control_type(pos)=501;
     444                                 pos=find(structmd.cm_responses==388); md.control_type(pos)=502;
     445                                 pos=find(structmd.cm_responses==382); md.control_type(pos)=503;
    445446                         end
    446447
Note: See TracChangeset for help on using the changeset viewer.