Changeset 18068 for issm/trunk-jpl/src/c/classes/Elements/Tria.cpp
- Timestamp:
- 05/28/14 16:26:33 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/c/classes/Elements/Tria.cpp
r18062 r18068 2990 2990 2991 2991 int i,migration_style; 2992 bool oldfloating;2993 bool floatingelement = false;2994 2992 bool groundedelement = false; 2995 IssmDouble bed_hydro,yts ,gl_melting_rate;2993 IssmDouble bed_hydro,yts; 2996 2994 IssmDouble rho_water,rho_ice,density; 2997 2995 IssmDouble melting[NUMVERTICES],phi[NUMVERTICES];; … … 3000 2998 /*Recover info at the vertices: */ 3001 2999 parameters->FindParam(&migration_style,GroundinglineMigrationEnum); 3002 parameters->FindParam(&gl_melting_rate,GroundinglineMeltingRateEnum);3003 3000 parameters->FindParam(&yts,ConstantsYtsEnum); 3004 3001 GetInputListOnVertices(&h[0],ThicknessEnum); … … 3010 3007 rho_ice = matpar->GetRhoIce(); 3011 3008 density = rho_ice/rho_water; 3012 oldfloating = this->IsFloating(); //figure out if element is floating before we start to change everything3013 3009 3014 3010 if(migration_style == ContactEnum){ … … 3023 3019 } 3024 3020 } 3025 3026 /*Add basal melting rate if element just ungrounded*/3027 for(i=0;i<NUMVERTICES;i++){3028 if(phi[i]<0.){3029 floatingelement=true;3030 break;3031 }3032 }3033 if(!oldfloating && floatingelement==true){3034 for(i=0;i<NUMVERTICES;i++) melting[i]=gl_melting_rate/yts;3035 this->inputs->AddInput(new TriaInput(BasalforcingsMeltingRateEnum,&melting[0],P1Enum));3036 }3037 3021 3038 3022 /*Update inputs*/ … … 3085 3069 this->inputs->AddInput(new TriaInput(MaskGroundediceLevelsetEnum,&phi[0],P1Enum)); 3086 3070 3087 /*SubelementMigrationEnum: if one grounded, all grounded*/3088 if(migration_style==SubelementMigrationEnum || migration_style==SubelementMigration2Enum){3089 for(i=0;i<NUMVERTICES;i++){3090 if(phi[i]>0.){3091 groundedelement=true;3092 break;3093 }3094 }3095 floatingelement=!groundedelement;3096 }3097 else{3098 /*Otherwise: if one floating, all floating*/3099 for(i=0;i<NUMVERTICES;i++){3100 if(phi[i]<=0.){3101 floatingelement=true;3102 break;3103 }3104 }3105 }3106 3107 /*Add basal melting rate if element just ungrounded*/3108 if(!oldfloating && floatingelement==true){3109 for(i=0;i<NUMVERTICES;i++)melting[i]=gl_melting_rate/yts;3110 this->inputs->AddInput(new TriaInput(BasalforcingsMeltingRateEnum,&melting[0],P1Enum));3111 }3112 3113 3071 /*Update inputs*/ 3114 3072 this->inputs->AddInput(new TriaInput(SurfaceEnum,&s[0],P1Enum));
Note:
See TracChangeset
for help on using the changeset viewer.