source:
issm/oecreview/Archive/25834-26739/ISSM-26109-26110.diff@
26740
Last change on this file since 26740 was 26740, checked in by , 3 years ago | |
---|---|
File size: 60.9 KB |
-
../trunk-jpl/src/c/toolkits/issm/IssmAbsVec.h
51 51 virtual void PointwiseDivide(IssmAbsVec* x,IssmAbsVec* y)=0; 52 52 virtual void PointwiseMult(IssmAbsVec* x,IssmAbsVec* y)=0; 53 53 virtual void Pow(doubletype scale_factor)=0; 54 virtual void Sum(doubletype* pvalue)=0; 54 55 }; 55 56 56 57 #endif //#ifndef _ISSM_ABS_VEC_H_ -
../trunk-jpl/src/c/toolkits/issm/IssmMpiVec.h
593 593 594 594 } 595 595 /*}}}*/ 596 void Sum(doubletype* pvalue){/*{{{*/ 597 _error_("not support yet!"); 598 } 599 /*}}}*/ 596 600 void BucketsBuildScatterBuffers(int** pnumvalues_forcpu,int** prow_indices_forcpu,doubletype** pvalues_forcpu,int** pmodes_forcpu,DataSet** bucketsforcpu,int num_procs){/*{{{*/ 597 601 598 602 /*intermediary: */ -
../trunk-jpl/src/c/toolkits/issm/IssmVec.h
219 219 vector->Pow(scale_factor); 220 220 } 221 221 /*}}}*/ 222 void Sum(doubletype* pvalue){/*{{{*/ 223 vector->Sum(pvalue); 224 } 225 /*}}}*/ 222 226 }; 223 227 224 228 #endif //#ifndef _ISSMVEC_H_ -
../trunk-jpl/src/c/toolkits/objects/Vector.h
405 405 else this->ivector->Pow(scale_factor); 406 406 } 407 407 /*}}}*/ 408 }; 408 void Sum(doubletype* pvalue){ /*{{{*/ 409 _assert_(this);/*{{{*/ 410 411 if(type==PetscVecType){ 412 #ifdef _HAVE_PETSC_ 413 this->pvector->Sum(pvalue); 414 #endif 415 } 416 else this->ivector->Sum(pvalue); 417 } 418 /*}}}*/ 419 }; /*}}}*/ 409 420 #endif //#ifndef _VECTOR_H_ -
../trunk-jpl/src/c/toolkits/petsc/objects/PetscVec.h
57 57 IssmDouble Max(void); 58 58 void Scale(IssmDouble scale_factor); 59 59 void Pow(IssmDouble scale_factor); 60 void Sum(IssmDouble* pvalue); 60 61 void PointwiseDivide(PetscVec* x,PetscVec* y); 61 62 void PointwiseMult(PetscVec* x,PetscVec* y); 62 63 IssmDouble Dot(PetscVec* vector); -
../trunk-jpl/src/c/Makefile.am
96 96 ./classes/Vertex.cpp \ 97 97 ./classes/Hook.cpp \ 98 98 ./classes/Radar.cpp \ 99 ./classes/BarystaticContributions.cpp \ 99 100 ./classes/ExternalResults/Results.cpp \ 100 101 ./classes/Elements/Element.cpp \ 101 102 ./classes/Elements/Elements.cpp \ -
../trunk-jpl/src/c/analyses/SealevelchangeAnalysis.cpp
182 182 parameters->AddObject(new DoubleMatParam(CumBslcOceanPartitionEnum,bslcocean_partition,npartocean,1)); 183 183 xDelete<IssmDouble>(partitionocean); 184 184 } 185 185 /*New optimized code:*/ 186 BarystaticContributions* barystaticcontributions=new BarystaticContributions(iomodel); 187 parameters->AddObject(new GenericParam<BarystaticContributions*>(barystaticcontributions,BarystaticContributionsEnum)); 186 188 187 189 /*Deal with external multi-model ensembles: {{{*/ 188 190 if(isexternal){ -
../trunk-jpl/src/c/classes/BarystaticContributions.cpp
1 /*!\file BarystaticContributions.c 2 * \brief: implementation of the BarystaticContributions object 3 */ 4 5 /*Include files: {{{*/ 6 #ifdef HAVE_CONFIG_H 7 #include <config.h> 8 #else 9 #error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!" 10 #endif 11 12 #include "./BarystaticContributions.h" 13 #include "../toolkits/toolkits.h" 14 #include "./classes.h" 15 /*}}}*/ 16 17 /*Constructors and destructors:*/ 18 BarystaticContributions::BarystaticContributions(IoModel* iomodel ){ /*{{{*/ 19 20 int nel; 21 22 iomodel->FetchData(&nice,"md.solidearth.npartice"); 23 if(nice){ 24 iomodel->FetchData(&pice,&nel,NULL,"md.solidearth.partitionice"); 25 ice=new Vector<IssmDouble>(nice); 26 cumice=new Vector<IssmDouble>(nice); cumice->Set(0); cumice->Assemble(); 27 } 28 29 iomodel->FetchData(&nhydro,"md.solidearth.nparthydro"); 30 if(nhydro){ 31 iomodel->FetchData(&phydro,&nel,NULL,"md.solidearth.partitionhydro"); 32 hydro=new Vector<IssmDouble>(nhydro); 33 cumhydro=new Vector<IssmDouble>(nhydro); cumhydro->Set(0); cumhydro->Assemble(); 34 } 35 iomodel->FetchData(&nocean,"md.solidearth.npartocean"); 36 if(nocean){ 37 iomodel->FetchData(&pocean,&nel,NULL,"md.solidearth.partitionocean"); 38 ocean=new Vector<IssmDouble>(nocean); 39 cumocean=new Vector<IssmDouble>(nocean); cumocean->Set(0); cumocean->Assemble(); 40 } 41 42 } /*}}}*/ 43 BarystaticContributions::~BarystaticContributions(){ /*{{{*/ 44 delete ice; delete cumice; 45 delete hydro; delete cumhydro; 46 delete ocean; delete cumocean; 47 if(nice)xDelete<IssmDouble>(pice); 48 if(nhydro)xDelete<IssmDouble>(phydro); 49 if(nocean)xDelete<IssmDouble>(pocean); 50 }; /*}}}*/ 51 52 /*Support routines:*/ 53 IssmDouble BarystaticContributions::Total(){ /*{{{*/ 54 55 IssmDouble sumice,sumhydro,sumocean; 56 57 ice->Assemble(); 58 hydro->Assemble(); 59 ocean->Assemble(); 60 61 ice->Sum(&sumice); 62 hydro->Sum(&sumhydro); 63 ocean->Sum(&sumocean); 64 65 return sumice+sumhydro+sumocean; 66 67 } /*}}}*/ 68 IssmDouble BarystaticContributions::CumTotal(){ /*{{{*/ 69 70 IssmDouble sumice,sumhydro,sumocean; 71 72 cumice->Assemble(); 73 cumhydro->Assemble(); 74 cumocean->Assemble(); 75 76 cumice->Sum(&sumice); 77 cumhydro->Sum(&sumhydro); 78 cumocean->Sum(&sumocean); 79 80 81 return sumice+sumhydro+sumocean; 82 83 } /*}}}*/ 84 void BarystaticContributions::Cumulate(Parameters* parameters){ /*{{{*/ 85 86 cumice->AXPY(ice,1); 87 cumocean->AXPY(ocean,1); 88 cumhydro->AXPY(hydro,1); 89 90 91 } /*}}}*/ 92 void BarystaticContributions::Save(Results* results, Parameters* parameters, IssmDouble oceanarea){ /*{{{*/ 93 94 int step; 95 IssmDouble time; 96 IssmDouble rho_water; 97 98 IssmDouble* cumice_serial=NULL; 99 IssmDouble* cumhydro_serial=NULL; 100 IssmDouble* cumocean_serial=NULL; 101 102 IssmDouble sumice,sumhydro,sumocean; 103 104 parameters->FindParam(&step,StepEnum); 105 parameters->FindParam(&time,TimeEnum); 106 parameters->FindParam(&rho_water,TimeEnum); 107 108 ice->Sum(&sumice); hydro->Sum(&sumhydro); ocean->Sum(&sumocean); 109 results->AddResult(new GenericExternalResult<IssmDouble>(results->Size()+1,BslcEnum,-this->Total()/oceanarea/rho_water,step,time)); 110 results->AddResult(new GenericExternalResult<IssmDouble>(results->Size()+1,BslcIceEnum,-sumice/oceanarea/rho_water,step,time)); 111 results->AddResult(new GenericExternalResult<IssmDouble>(results->Size()+1,BslcHydroEnum,-sumice/oceanarea/rho_water,step,time)); 112 results->AddResult(new GenericExternalResult<IssmDouble>(results->Size()+1,BslcOceanEnum,-sumocean/oceanarea/rho_water,step,time)); 113 114 cumice->Sum(&sumice); cumhydro->Sum(&sumhydro); cumocean->Sum(&sumocean); 115 results->AddResult(new GenericExternalResult<IssmDouble>(results->Size()+1,CumBslcEnum,this->CumTotal()/oceanarea/rho_water,step,time)); 116 results->AddResult(new GenericExternalResult<IssmDouble>(results->Size()+1,CumBslcIceEnum,sumice/oceanarea/rho_water,step,time)); 117 results->AddResult(new GenericExternalResult<IssmDouble>(results->Size()+1,CumBslcHydroEnum,sumhydro/oceanarea/rho_water,step,time)); 118 results->AddResult(new GenericExternalResult<IssmDouble>(results->Size()+1,CumBslcOceanEnum,sumocean/oceanarea/rho_water,step,time)); 119 120 cumice_serial=this->cumice->ToMPISerial0(); for (int i=0;i<nice;i++)cumice_serial[i]=cumice_serial[i]/oceanarea/rho_water; 121 cumhydro_serial=this->cumhydro->ToMPISerial0(); for (int i=0;i<nhydro;i++)cumhydro_serial[i]=cumhydro_serial[i]/oceanarea/rho_water; 122 cumocean_serial=this->cumocean->ToMPISerial0(); for (int i=0;i<nocean;i++)cumocean_serial[i]=cumocean_serial[i]/oceanarea/rho_water; 123 124 results->AddResult(new GenericExternalResult<IssmDouble*>(results->Size()+1,CumBslcIcePartitionEnum,cumice_serial,nice,1,step,time)); 125 results->AddResult(new GenericExternalResult<IssmDouble*>(results->Size()+1,CumBslcHydroPartitionEnum,cumhydro_serial,nhydro,1,step,time)); 126 results->AddResult(new GenericExternalResult<IssmDouble*>(results->Size()+1,CumBslcOceanPartitionEnum,cumocean_serial,nocean,1,step,time)); 127 128 if(IssmComm::GetRank()==0){ 129 xDelete<IssmDouble>(cumice_serial); 130 xDelete<IssmDouble>(cumhydro_serial); 131 xDelete<IssmDouble>(cumocean_serial); 132 } 133 return; 134 135 } /*}}}*/ 136 void BarystaticContributions::Set(int eid, IssmDouble icevalue, IssmDouble hydrovalue, IssmDouble oceanvalue){ /*{{{*/ 137 138 int id; 139 140 id=reCast<int>(pice[eid]); 141 ice->SetValue(id,icevalue,ADD_VAL); 142 143 id=reCast<int>(phydro[eid]); 144 hydro->SetValue(id,hydrovalue,ADD_VAL); 145 146 id=reCast<int>(pocean[eid]); 147 ocean->SetValue(id,oceanvalue,ADD_VAL); 148 149 } /*}}}*/ -
../trunk-jpl/src/c/classes/BarystaticContributions.h
1 /*!\file BarystaticContributions.h 2 * \brief: header file for barystatic contribution object 3 */ 4 5 #ifndef _BARYSTATICCONTRIBUTIONS_H_ 6 #define _BARYSTATICCONTRIBUTIONS_H_ 7 8 /*Headers:*/ 9 class IoModel; 10 class Parameters; 11 class Results; 12 template <class doubletype> class Vector; 13 #include "../shared/shared.h" 14 15 class BarystaticContributions { 16 17 public: 18 19 Vector<IssmDouble>* ice; //contributions to every ice partition 20 Vector<IssmDouble>* cumice; //cumulated contributions to every ice partition 21 int nice; //number of ice partitions 22 IssmDouble* pice; //ice partition 23 24 Vector<IssmDouble>* hydro; //contributions to every hydro partition 25 Vector<IssmDouble>* cumhydro; //cumulated contributions to every hydro partition 26 int nhydro; //number of hydro partitions 27 IssmDouble* phydro; //hydro partition 28 29 Vector<IssmDouble>* ocean; //contributions to every ocean partition 30 Vector<IssmDouble>* cumocean; //cumulated contributions to every ocean partition 31 int nocean; //number of ocean partitions 32 IssmDouble* pocean; //ocean partition 33 34 /*BarystaticContributions constructors, destructors :*/ 35 BarystaticContributions(IoModel* iomodel ); 36 ~BarystaticContributions(); 37 38 /*routines:*/ 39 IssmDouble Total(); 40 IssmDouble CumTotal(); 41 void Cumulate(Parameters* parameters); 42 void Save(Results* results, Parameters* parameters, IssmDouble oceanarea); 43 void Set(int eid, IssmDouble icevalue, IssmDouble hydrovalue, IssmDouble oceanvalue); 44 45 }; 46 #endif /* _BARYSTATICCONTRIBUTIONS_H_ */ -
../trunk-jpl/src/c/classes/Elements/Element.h
37 37 template <class doubletype> class Vector; 38 38 class ElementMatrix; 39 39 class ElementVector; 40 class BarystaticContributions; 40 41 /*}}}*/ 41 42 42 43 class Element: public Object{ … … 388 389 virtual void SealevelchangeSal(IssmDouble* Sgo, IssmDouble* Sg_old,SealevelMasks* mask)=0; 389 390 virtual void DeformationFromSurfaceLoads(IssmDouble* Up, IssmDouble* North, IssmDouble* East, IssmDouble* Sg,SealevelMasks* masks)=0; 390 391 virtual void GiaDeflection(Vector<IssmDouble>* wg,Vector<IssmDouble>* dwgdt,Matlitho* litho, IssmDouble* x,IssmDouble* y)=0; 392 393 virtual void SealevelchangeGeometryOptim(IssmDouble* lat,IssmDouble* longi,IssmDouble* radius, IssmDouble* xx, IssmDouble* yy, IssmDouble* zz, IssmDouble* xxe, IssmDouble* yye, IssmDouble* zze)=0; 394 virtual void SealevelchangeBarystaticLoads(Vector<IssmDouble>* loads, BarystaticContributions* barycontrib, SealevelMasks* masks)=0; 395 virtual void SealevelchangeInitialConvolution(Vector<IssmDouble>* sealevelloads,Vector<IssmDouble>* oceanareas,IssmDouble* loads, SealevelMasks* masks)=0; 396 virtual void SealevelchangeOceanConvolution(Vector<IssmDouble>* newsealevelloads, IssmDouble* sealevelloads, IssmDouble* loads, SealevelMasks* masks)=0; 397 virtual void OceanAverageOptim(IssmDouble* poceanaverage, IssmDouble* poceanarea, IssmDouble* Sg, SealevelMasks* masks)=0; 391 398 #endif 392 399 393 400 }; -
../trunk-jpl/src/c/classes/Elements/Penta.h
226 226 void SealevelchangeSal(IssmDouble* Sgo, IssmDouble* Sg_old, SealevelMasks* masks){_error_("not implemented yet!");}; 227 227 void DeformationFromSurfaceLoads(IssmDouble* Up, IssmDouble* North, IssmDouble* East, IssmDouble* Sg, SealevelMasks* masks){_error_("not implemented yet!");}; 228 228 void GiaDeflection(Vector<IssmDouble>* wg,Vector<IssmDouble>* dwgdt,Matlitho* litho, IssmDouble* x,IssmDouble* y){_error_("not implemented yet");}; 229 230 void SealevelchangeGeometryOptim(IssmDouble* lat,IssmDouble* longi,IssmDouble* radius, IssmDouble* xx, IssmDouble* yy, IssmDouble* zz, IssmDouble* xxe, IssmDouble* yye, IssmDouble* zze){_error_("not implemented yet");}; 231 void SealevelchangeBarystaticLoads(Vector<IssmDouble>* loads, BarystaticContributions* barycontrib, SealevelMasks* masks){_error_("not implemented yet");}; 232 void SealevelchangeInitialConvolution(Vector<IssmDouble>* sealevelloads,Vector<IssmDouble>* oceanareas,IssmDouble* loads, SealevelMasks* masks){_error_("not implemented yet");}; 233 void SealevelchangeOceanConvolution(Vector<IssmDouble>* newsealevelloads, IssmDouble* sealevelloads, IssmDouble* loads, SealevelMasks* masks){_error_("not implemented yet");}; 234 void OceanAverageOptim(IssmDouble* poceanaverage, IssmDouble* poceanarea, IssmDouble* Sg, SealevelMasks* masks){_error_("not implemented yet");}; 229 235 #endif 230 236 231 237 /*}}}*/ -
../trunk-jpl/src/c/classes/Elements/Seg.h
181 181 void DeformationFromSurfaceLoads(IssmDouble* Up, IssmDouble* North, IssmDouble* East, IssmDouble* Sg, SealevelMasks* masks){_error_("not implemented yet!");}; 182 182 IssmDouble OceanAverage(IssmDouble* Sg, SealevelMasks* masks){_error_("not implemented yet!");}; 183 183 void GiaDeflection(Vector<IssmDouble>* wg,Vector<IssmDouble>* dwgdt,Matlitho* litho, IssmDouble* x,IssmDouble* y){_error_("not implemented yet");}; 184 185 void SealevelchangeGeometryOptim(IssmDouble* lat,IssmDouble* longi,IssmDouble* radius, IssmDouble* xx, IssmDouble* yy, IssmDouble* zz, IssmDouble* xxe, IssmDouble* yye, IssmDouble* zze){_error_("not implemented yet");}; 186 void SealevelchangeBarystaticLoads(Vector<IssmDouble>* loads, BarystaticContributions* barycontrib, SealevelMasks* masks){_error_("not implemented yet");}; 187 void SealevelchangeInitialConvolution(Vector<IssmDouble>* sealevelloads,Vector<IssmDouble>* oceanareas,IssmDouble* loads, SealevelMasks* masks){_error_("not implemented yet");}; 188 void SealevelchangeOceanConvolution(Vector<IssmDouble>* newsealevelloads, IssmDouble* sealevelloads, IssmDouble* loads, SealevelMasks* masks){_error_("not implemented yet");}; 189 void OceanAverageOptim(IssmDouble* poceanaverage, IssmDouble* poceanarea, IssmDouble* Sg, SealevelMasks* masks){_error_("not implemented yet");}; 190 184 191 #endif 185 192 186 193 #ifdef _HAVE_DAKOTA_ -
../trunk-jpl/src/c/classes/Elements/Tetra.h
188 188 void DeformationFromSurfaceLoads(IssmDouble* Up ,IssmDouble* North, IssmDouble* East, IssmDouble* Sg, SealevelMasks* masks){_error_("not implemented yet!");}; 189 189 IssmDouble OceanAverage(IssmDouble* Sg, SealevelMasks* masks){_error_("not implemented yet!");}; 190 190 void GiaDeflection(Vector<IssmDouble>* wg,Vector<IssmDouble>* dwgdt, Matlitho* litho, IssmDouble* x,IssmDouble* y){_error_("not implemented yet");}; 191 void SealevelchangeGeometryOptim(IssmDouble* lat,IssmDouble* longi,IssmDouble* radius, IssmDouble* xx, IssmDouble* yy, IssmDouble* zz, IssmDouble* xxe, IssmDouble* yye, IssmDouble* zze){_error_("not implemented yet");}; 192 void SealevelchangeBarystaticLoads(Vector<IssmDouble>* loads, BarystaticContributions* barycontrib, SealevelMasks* masks){_error_("not implemented yet");}; 193 void SealevelchangeInitialConvolution(Vector<IssmDouble>* sealevelloads,Vector<IssmDouble>* oceanareas,IssmDouble* loads, SealevelMasks* masks){_error_("not implemented yet");}; 194 void SealevelchangeOceanConvolution(Vector<IssmDouble>* newsealevelloads, IssmDouble* sealevelloads, IssmDouble* loads, SealevelMasks* masks){_error_("not implemented yet");}; 195 void OceanAverageOptim(IssmDouble* poceanaverage, IssmDouble* poceanarea, IssmDouble* Sg, SealevelMasks* masks){_error_("not implemented yet");}; 196 191 197 #endif 192 198 193 199 #ifdef _HAVE_DAKOTA_ -
../trunk-jpl/src/c/classes/Elements/Tria.cpp
5431 5431 /*}}}*/ 5432 5432 #endif 5433 5433 #ifdef _HAVE_SEALEVELCHANGE_ 5434 //old code 5434 5435 IssmDouble Tria::OceanAverage(IssmDouble* Sg, SealevelMasks* masks){ /*{{{*/ 5435 5436 5436 5437 if(masks->isoceanin[this->lid]){ … … 5450 5451 5451 5452 } 5452 5453 /*}}}*/ 5453 void Tria::SealevelchangeMomentOfInertia(IssmDouble* dI_list,IssmDouble* Sg_old, SealevelMasks* masks){/*{{{*/5454 void Tria::SealevelchangeMomentOfInertia(IssmDouble* dI_list,IssmDouble* Sg_old, SealevelMasks* masks){/*{{{*/ 5454 5455 /*early return if we are not on an ice cap OR ocean:*/ 5455 5456 if(!masks->isiceonly[this->lid] && !masks->isoceanin[this->lid]){ 5456 5457 dI_list[0] = 0.0; // this is important!!! … … 5544 5545 5545 5546 return; 5546 5547 }/*}}}*/ 5547 void Tria::SetSealevelMasks(SealevelMasks* masks){ /*{{{*/5548 void Tria::SetSealevelMasks(SealevelMasks* masks){ /*{{{*/ 5548 5549 5549 5550 masks->isiceonly[this->lid]=this->IsIceOnlyInElement(); 5550 5551 masks->isoceanin[this->lid]=this->IsOceanInElement(); … … 5557 5558 /*are we not fully grounded: */ 5558 5559 if ((gr_input->GetInputMin())<0) masks->notfullygrounded[this->lid]=true; 5559 5560 else masks->notfullygrounded[this->lid]=false; 5560 5561 5561 } 5562 5562 /*}}}*/ 5563 void Tria::SealevelchangeGeometry(IssmDouble* latitude,IssmDouble* longitude,IssmDouble* radius, IssmDouble* xx, IssmDouble* yy, IssmDouble* zz, IssmDouble* xxe, IssmDouble* yye, IssmDouble* zze){ /*{{{*/5563 void Tria::SealevelchangeGeometry(IssmDouble* latitude,IssmDouble* longitude,IssmDouble* radius, IssmDouble* xx, IssmDouble* yy, IssmDouble* zz, IssmDouble* xxe, IssmDouble* yye, IssmDouble* zze){ /*{{{*/ 5564 5564 5565 5565 /*diverse:*/ 5566 5566 int gsize; … … 5950 5950 return bslchydro; 5951 5951 } 5952 5952 /*}}}*/ 5953 void Tria::SealevelchangeBarystaticBottomPressure(IssmDouble* Sgi,SealevelMasks* masks){ /*{{{*/5953 void Tria::SealevelchangeBarystaticBottomPressure(IssmDouble* Sgi,SealevelMasks* masks){ /*{{{*/ 5954 5954 5955 5955 /*diverse:*/ 5956 5956 int gsize; … … 6000 6000 return; 6001 6001 } 6002 6002 /*}}}*/ 6003 void Tria::SealevelchangeSal(IssmDouble* Sgo,IssmDouble* Sg_old, SealevelMasks* masks){ /*{{{*/6003 void Tria::SealevelchangeSal(IssmDouble* Sgo,IssmDouble* Sg_old, SealevelMasks* masks){ /*{{{*/ 6004 6004 6005 6005 /*diverse:*/ 6006 6006 int gsize,dummy; … … 6042 6042 return; 6043 6043 } 6044 6044 /*}}}*/ 6045 void Tria::DeformationFromSurfaceLoads(IssmDouble* Up, IssmDouble* North ,IssmDouble* East,IssmDouble* Sg, SealevelMasks* masks){ /*{{{*/6045 void Tria::DeformationFromSurfaceLoads(IssmDouble* Up, IssmDouble* North ,IssmDouble* East,IssmDouble* Sg, SealevelMasks* masks){ /*{{{*/ 6046 6046 6047 6047 /*diverse:*/ 6048 6048 int gsize; … … 6131 6131 return; 6132 6132 } 6133 6133 /*}}}*/ 6134 void Tria::GiaDeflection(Vector<IssmDouble>* wg,Vector<IssmDouble>* dwgdt, Matlitho* litho, IssmDouble* x, IssmDouble* y){/*{{{*/6134 void Tria::GiaDeflection(Vector<IssmDouble>* wg,Vector<IssmDouble>* dwgdt, Matlitho* litho, IssmDouble* x, IssmDouble* y){/*{{{*/ 6135 6135 6136 6136 IssmDouble xyz_list[NUMVERTICES][3]; 6137 6137 … … 6237 6237 } 6238 6238 /*}}}*/ 6239 6239 6240 //new logic6241 void Tria::SealevelchangeGeometryOptim(IssmDouble* latitude,IssmDouble* longitude,IssmDouble* radius, IssmDouble* xx, IssmDouble* yy, IssmDouble* zz, IssmDouble* xxe, IssmDouble* yye, IssmDouble* zze){ /*{{{*/6240 //new code 6241 void Tria::SealevelchangeGeometryOptim(IssmDouble* latitude,IssmDouble* longitude,IssmDouble* radius, IssmDouble* xx, IssmDouble* yy, IssmDouble* zz, IssmDouble* xxe, IssmDouble* yye, IssmDouble* zze){ /*{{{*/ 6242 6242 6243 6243 /*diverse:*/ 6244 6244 int nel; … … 6427 6427 return; 6428 6428 } 6429 6429 /*}}}*/ 6430 void Tria::SealevelchangeBarystaticLoads(IssmDouble* barystatic_contribution,IssmDouble* localloads, SealevelMasks* masks, Matrix<IssmDouble>* barystatic_contribution_onpartition, IssmDouble* partition, IssmDouble oceanarea){ /*{{{*/6430 void Tria::SealevelchangeBarystaticLoads(Vector<IssmDouble>* loads, BarystaticContributions* barycontrib, SealevelMasks* masks){ /*{{{*/ 6431 6431 6432 6432 /*diverse:*/ 6433 6433 IssmDouble area; … … 6435 6435 IssmDouble phi_water=1.0; //WARNING: do not touch this, default is entire elemnt contributes barystatic 6436 6436 IssmDouble I,W,BP; //change in ice thickness, water column or bottom pressure (Farrel and Clarke, Equ. 4) 6437 6437 bool notfullygrounded=false; 6438 bool scaleoceanarea= false;6439 6438 bool computerigid= false; 6440 6439 int glfraction=1; 6441 6440 int npartice,nparthydro,npartocean; … … 6468 6467 #ifdef _ISSM_DEBUG_ 6469 6468 constant=0; this->AddInput(SealevelBarystaticMaskEnum,&constant,P0Enum); 6470 6469 #endif 6471 /*barystatic_contribution[0]+=0;6472 barystatic_contribution[1]+=0;6473 barystatic_contribution[2]+=0;*/6474 6470 return; 6475 6471 } 6476 6472 } … … 6482 6478 #ifdef _ISSM_DEBUG_ 6483 6479 this->AddInput(SealevelBarystaticMaskEnum,&constant,P0Enum); 6484 6480 #endif 6485 /*barystatic_contribution[0]+=0;6486 barystatic_contribution[1]+=0;6487 barystatic_contribution[2]+=0;*/6488 6481 return; 6489 6482 } 6490 6483 } … … 6493 6486 * hydrology:*/ 6494 6487 if(!isice && !ishydro){ 6495 6488 if(!masks->isoceanin[this->lid]){ 6496 /*barystatic_contribution[0]+=0;6497 barystatic_contribution[1]+=0;6498 barystatic_contribution[2]+=0;*/6499 6489 return; 6500 6490 } 6501 6491 … … 6508 6498 rho_ice=FindParam(MaterialsRhoIceEnum); 6509 6499 rho_water=FindParam(MaterialsRhoSeawaterEnum); 6510 6500 this->parameters->FindParam(&computerigid,SolidearthSettingsRigidEnum); 6511 this->parameters->FindParam(&scaleoceanarea,SolidearthSettingsOceanAreaScalingEnum);6512 6501 this->parameters->FindParam(&glfraction,SolidearthSettingsGlfractionEnum); 6513 6502 this->parameters->FindParam(&npartice,SolidearthNpartIceEnum); 6514 6503 this->parameters->FindParam(&nparthydro,SolidearthNpartHydroEnum); … … 6517 6506 this->Element::GetInputValue(&area,AreaEnum); 6518 6507 6519 6508 /*Deal with ice loads if we are on grounded ice:*/ 6520 if(masks->isiceonly[this->lid] && !masks->isfullyfloating[this->lid]){ /*{{{*/6509 if(masks->isiceonly[this->lid] && !masks->isfullyfloating[this->lid]){ 6521 6510 6522 /*Compute fraction of the element that is grounded: */6511 /*Compute fraction of the element that is grounded: {{{*/ 6523 6512 if(notfullygrounded){ 6524 6513 IssmDouble xyz_list[NUMVERTICES][3]; 6525 6514 ::GetVerticesCoordinates(&xyz_list[0][0],vertices,NUMVERTICES); … … 6531 6520 #endif 6532 6521 } 6533 6522 else phi_ice=1.0; 6523 /*}}}*/ 6534 6524 6535 6525 /*Inform mask: */ 6536 6526 constant+=100; //1 for ice. … … 6568 6558 } 6569 6559 /*}}}*/ 6570 6560 6571 /*Compute barystatic contribution:*/ 6572 _assert_(oceanarea>0.); 6573 if(scaleoceanarea) oceanarea=3.619e+14; // use true ocean area, m^2 6574 bslcice = rho_ice*area*I/(oceanarea*rho_water); 6561 /*Compute barystatic contribution in kg:*/ 6562 bslcice = rho_ice*area*I; 6575 6563 _assert_(!xIsNan<IssmDouble>(bslcice)); 6576 6564 6577 6565 /*Transfer thickness change into kg/m^2:*/ 6578 6566 I=I*rho_ice*phi_ice; 6579 } /*}}}*/6567 } 6580 6568 6581 6569 /*Deal with water loads if we are on ground:*/ 6582 6570 if(!masks->isfullyfloating[this->lid]){ … … 6586 6574 if (!deltathickness_input)_error_("DeltaTwsEnum input needed to compute sea level change!"); 6587 6575 deltathickness_input->GetInputAverage(&W); 6588 6576 6589 /*Compute barystatic component:*/ 6590 _assert_(oceanarea>0.); 6591 if(scaleoceanarea) oceanarea=3.619e+14; // use true ocean area, m^2 6592 bslchydro = rho_freshwater*area*phi_water*W/(oceanarea*rho_water); 6577 /*Compute barystatic component in kg:*/ 6578 bslchydro = rho_freshwater*area*phi_water*W; 6593 6579 _assert_(!xIsNan<IssmDouble>(bslchydro)); 6594 6580 6595 6581 /*convert from m to kg/m^2:*/ … … 6604 6590 if (!bottompressure_change_input)_error_("DeltaBottomPressureEnum pressure input needed to compute sea level change fingerprint!"); 6605 6591 bottompressure_change_input->GetInputAverage(&BP); 6606 6592 6607 /*Compute barystatic component :*/6608 bslcbp = rho_water*area*BP /(oceanarea*rho_water);6593 /*Compute barystatic component in kg:*/ 6594 bslcbp = rho_water*area*BP; 6609 6595 6610 6596 /*convert from m to kg/m^2:*/ 6611 6597 BP=BP*rho_water; … … 6612 6598 } 6613 6599 6614 6600 /*Plug all loads into total load vector:*/ 6615 lo calloads[this->lid]+=I+W+BP;6601 loads->SetValue(this->sid,I+W+BP,INS_VAL); 6616 6602 6617 /*Plug bslcice into barystatic contribution vector:*/ 6618 if(barystatic_contribution_onpartition){ 6619 int idi=reCast<int>(partition[this->Sid()])+1; 6620 int idj=0; 6621 idj=0;barystatic_contribution_onpartition->SetValues(1,&idi,1,&idj,&bslcice,ADD_VAL); 6622 idj=1;barystatic_contribution_onpartition->SetValues(1,&idi,1,&idj,&bslchydro,ADD_VAL); 6623 idj=2;barystatic_contribution_onpartition->SetValues(1,&idi,1,&idj,&bslcbp,ADD_VAL); 6624 } 6603 /*Keep track of barystatic contributions:*/ 6604 barycontrib->Set(this->Sid(),bslcice,bslchydro,bslcbp); 6625 6605 6626 barystatic_contribution[0]+=bslcice;6627 barystatic_contribution[1]+=bslchydro;6628 barystatic_contribution[2]+=bslcbp;6629 6630 6606 } 6631 6607 /*}}}*/ 6632 IssmDouble Tria::SealevelchangeConvolution(IssmDouble* loads){ /*{{{*/6608 void Tria::SealevelchangeInitialConvolution(Vector<IssmDouble>* sealevelloads,Vector<IssmDouble>* oceanareas,IssmDouble* loads, SealevelMasks* masks){ /*{{{*/ 6633 6609 6634 6610 /*sal green function:*/ 6635 6611 IssmDouble* G=NULL; 6636 IssmDouble Sealevel[NUMVERTICES]={0,0,0}; 6612 IssmDouble SealevelGRD[NUMVERTICES]={0,0,0}; 6613 IssmDouble oceanaverage,oceanarea=0; 6637 6614 6638 6615 bool sal = false; 6639 6616 int size; … … 6646 6623 6647 6624 for(int i=0;i<NUMVERTICES;i++) { 6648 6625 for (int e=0;e<nel;e++){ 6649 Sealevel [i]+=G[i*nel+e]*loads[e];6626 SealevelGRD[i]+=G[i*nel+e]*loads[e]; 6650 6627 } 6651 6628 } 6629 } 6652 6630 6653 this->AddInput(SealevelRSLEnum,Sealevel,P1Enum); 6631 /*compute ocean average over element:*/ 6632 OceanAverageOptim(&oceanaverage,&oceanarea,SealevelGRD,masks); 6633 6634 /*add ocean average in the global sealevelloads vector:*/ 6635 sealevelloads->SetValue(this->sid,oceanaverage,INS_VAL); 6636 oceanareas->SetValue(this->sid,oceanarea,INS_VAL); 6637 6638 return; 6639 } /*}}}*/ 6640 void Tria::SealevelchangeOceanConvolution(Vector<IssmDouble>* newsealevelloads, IssmDouble* sealevelloads, IssmDouble* loads, SealevelMasks* masks){ /*{{{*/ 6641 6642 bool converged=false; 6643 IssmDouble SealevelGRD[3]={0,0,0}; 6644 IssmDouble oceanaverage,oceanarea=0; 6645 int nel; 6646 bool sal = false; 6647 IssmDouble* G=NULL; 6648 int size; 6649 6650 this->parameters->FindParam(&nel,MeshNumberofelementsEnum); 6651 this->parameters->FindParam(&sal,SolidearthSettingsRigidEnum); 6652 6653 if(sal){ 6654 this->inputs->GetArrayPtr(SealevelchangeGEnum,this->lid,&G,&size); 6655 6656 for(int i=0;i<NUMVERTICES;i++) { 6657 for (int e=0;e<nel;e++){ 6658 SealevelGRD[i]+=G[i*nel+e]*(sealevelloads[e]+loads[e]); 6659 } 6660 } 6654 6661 } 6662 OceanAverageOptim(&oceanaverage,&oceanarea,SealevelGRD,masks); 6663 newsealevelloads->SetValue(this->sid,oceanaverage,INS_VAL); 6655 6664 6656 6665 } /*}}}*/ 6666 void Tria::OceanAverageOptim(IssmDouble* poceanaverage, IssmDouble* poceanarea, IssmDouble* Sg, SealevelMasks* masks){ /*{{{*/ 6657 6667 6668 IssmDouble phi=1.0; 6669 bool iscoastline=false; 6670 IssmDouble area; 6671 IssmDouble Sg_avg=0; //output 6672 6673 /*Do we have an ocean?:*/ 6674 if(!masks->isoceanin[this->lid]){ 6675 *poceanarea=0; 6676 *poceanaverage=0; 6677 } 6678 6679 /*Do we have a coastline?:*/ 6680 if(!masks->isfullyfloating[this->lid])iscoastline=true; 6681 6682 if(iscoastline){ 6683 IssmDouble xyz_list[NUMVERTICES][3]; 6684 ::GetVerticesCoordinates(&xyz_list[0][0],vertices,NUMVERTICES); 6685 phi=1.0-this->GetGroundedPortion(&xyz_list[0][0]); 6686 } 6687 6688 /*Get area of element:*/ 6689 this->Element::GetInputValue(&area,AreaEnum); 6690 6691 /*Average over ocean if there is no coastline, area of the ocean 6692 *is the areaa of the element:*/ 6693 if(!iscoastline){ 6694 6695 /*Average Sg over vertices:*/ 6696 for(int i=0;i<NUMVERTICES;i++) Sg_avg+=Sg[i]/NUMVERTICES; 6697 6698 *poceanaverage=Sg_avg; 6699 *poceanarea=area; 6700 return; 6701 } 6702 6703 /*Average over the ocean only if there is a coastline. Area of the 6704 * ocean will be the fraction times the area of the element:*/ 6705 area=phi*area; 6706 6707 IssmDouble total_weight=0; 6708 bool mainlyfloating = true; 6709 int point1; 6710 IssmDouble fraction1,fraction2; 6711 6712 /*Recover portion of element that is grounded*/ 6713 this->GetGroundedPart(&point1,&fraction1,&fraction2,&mainlyfloating); 6714 //!mainlyfloating so that the integration is done on the ocean (and not the grounded) part 6715 Gauss* gauss = this->NewGauss(point1,fraction1,fraction2,!mainlyfloating,2); 6716 6717 /* Start looping on the number of gaussian points and average over these gaussian points: */ 6718 total_weight=0; 6719 Sg_avg=0; 6720 while(gauss->next()){ 6721 IssmDouble Sg_gauss=0; 6722 TriaRef::GetInputValue(&Sg_gauss, Sg, gauss,P1Enum); 6723 Sg_avg+=Sg_gauss*gauss->weight; 6724 total_weight+=gauss->weight; 6725 } 6726 Sg_avg=Sg_avg/total_weight; 6727 delete gauss; 6728 6729 *poceanaverage=Sg_avg; 6730 *poceanarea=area; 6731 return; 6732 6733 } 6734 /*}}}*/ 6658 6735 #endif 6659 6736 6660 6737 #ifdef _HAVE_DAKOTA_ -
../trunk-jpl/src/c/classes/Elements/Tria.h
161 161 void EsaGeodetic3D(Vector<IssmDouble>* pUp,Vector<IssmDouble>* pNorth,Vector<IssmDouble>* pEast,IssmDouble* latitude,IssmDouble* longitude,IssmDouble* radius,IssmDouble* xx,IssmDouble* yy,IssmDouble* zz); 162 162 #endif 163 163 #ifdef _HAVE_SEALEVELCHANGE_ 164 void SealevelchangeMomentOfInertia(IssmDouble* dI_list,IssmDouble* Sg_old,SealevelMasks* masks); 165 void SealevelchangeGeometry(IssmDouble* lat, IssmDouble* longi,IssmDouble* radius, IssmDouble* xx, IssmDouble* yy, IssmDouble* zz, IssmDouble* xxe, IssmDouble* yye, IssmDouble* zze); 166 IssmDouble SealevelchangeBarystaticIce(IssmDouble* Sgi, SealevelMasks* masks, Vector<IssmDouble>* barystatic_contribution, IssmDouble* partition, IssmDouble oceanarea); 167 IssmDouble SealevelchangeBarystaticHydro(IssmDouble* Sgi, SealevelMasks* masks, Vector<IssmDouble>* barystatic_contribution, IssmDouble* partition,IssmDouble oceanarea); 168 void SealevelchangeBarystaticBottomPressure(IssmDouble* Sgi,SealevelMasks* masks); 169 void SealevelchangeSal(IssmDouble* Sgo,IssmDouble* Sg_old,SealevelMasks* masks); 170 void DeformationFromSurfaceLoads(IssmDouble* Up, IssmDouble* North, IssmDouble* East, IssmDouble* Sg,SealevelMasks* masks); 171 void GiaDeflection(Vector<IssmDouble>* wg,Vector<IssmDouble>* dwgdt,Matlitho* litho, IssmDouble* x,IssmDouble* y); 164 172 IssmDouble OceanAverage(IssmDouble* Sg, SealevelMasks* masks); 165 void SealevelchangeMomentOfInertia(IssmDouble* dI_list,IssmDouble* Sg_old,SealevelMasks* masks); 166 void SetSealevelMasks(SealevelMasks* masks); 167 void SealevelchangeGeometry(IssmDouble* latitude,IssmDouble* longitude,IssmDouble* radius, IssmDouble* xx, IssmDouble* yy, IssmDouble* zz, IssmDouble* xxe, IssmDouble* yye, IssmDouble* zze); 168 void SealevelchangeGeometryOptim(IssmDouble* latitude,IssmDouble* longitude,IssmDouble* radius, IssmDouble* xx, IssmDouble* yy, IssmDouble* zz, IssmDouble* xxe, IssmDouble* yye, IssmDouble* zze); 169 170 IssmDouble SealevelchangeBarystaticIce(IssmDouble* Sgi, SealevelMasks* masks, Vector<IssmDouble>* barystatic_contribution, IssmDouble* partition, IssmDouble oceanarea); 171 IssmDouble SealevelchangeBarystaticHydro(IssmDouble* Sgi, SealevelMasks* masks, Vector<IssmDouble>* barystatic_contribution, IssmDouble* partition,IssmDouble oceanarea); 172 void SealevelchangeBarystaticBottomPressure(IssmDouble* Sgi,SealevelMasks* masks); 173 void SealevelchangeSal(IssmDouble* Sgo,IssmDouble* Sg_old,SealevelMasks* masks); 174 void DeformationFromSurfaceLoads(IssmDouble* Up, IssmDouble* North, IssmDouble* East, IssmDouble* Sg,SealevelMasks* masks); 175 void GiaDeflection(Vector<IssmDouble>* wg,Vector<IssmDouble>* dwgdt,Matlitho* litho, IssmDouble* x,IssmDouble* y); 176 void SealevelchangeBarystaticLoads(IssmDouble* barystatic_contribution,IssmDouble* localloads, SealevelMasks* masks, Matrix<IssmDouble>* barystatic_contribution_onpartition, IssmDouble* partition, IssmDouble oceanarea); 177 IssmDouble SealevelchangeConvolution(IssmDouble* loads); 173 void SetSealevelMasks(SealevelMasks* masks); 174 175 void SealevelchangeGeometryOptim(IssmDouble* lat,IssmDouble* longi,IssmDouble* radius, IssmDouble* xx, IssmDouble* yy, IssmDouble* zz, IssmDouble* xxe, IssmDouble* yye, IssmDouble* zze); 176 void SealevelchangeBarystaticLoads(Vector<IssmDouble>* loads, BarystaticContributions* barycontrib, SealevelMasks* masks); 177 void SealevelchangeInitialConvolution(Vector<IssmDouble>* sealevelloads,Vector<IssmDouble>* oceanareas,IssmDouble* loads, SealevelMasks* masks); 178 void SealevelchangeOceanConvolution(Vector<IssmDouble>* newsealevelloads, IssmDouble* sealevelloads, IssmDouble* loads, SealevelMasks* masks); 179 void OceanAverageOptim(IssmDouble* poceanaverage, IssmDouble* poceanarea, IssmDouble* Sg, SealevelMasks* masks); 178 180 #endif 179 181 /*}}}*/ 180 182 /*Tria specific routines:{{{*/ -
../trunk-jpl/src/c/classes/FemModel.cpp
4748 4748 /*}}}*/ 4749 4749 #endif 4750 4750 #ifdef _HAVE_SEALEVELCHANGE_ 4751 void FemModel::SealevelchangeBarystatic(Vector<IssmDouble>* pRSLgi, IssmDouble* poceanarea, IssmDouble* pbslc,IssmDouble* pbslcice, IssmDouble* pbslchydro, IssmDouble** pbslcice_partition,IssmDouble** pbslchydro_partition,SealevelMasks* masks) { /*{{{*/4752 4753 /*serialized vectors:*/4754 IssmDouble bslcice = 0.;4755 IssmDouble bslcice_cpu = 0.;4756 IssmDouble bslchydro = 0.;4757 IssmDouble bslchydro_cpu = 0.;4758 IssmDouble area = 0.;4759 IssmDouble oceanarea = 0.;4760 IssmDouble oceanarea_cpu = 0.;4761 int bp_compute_fingerprints= 0;4762 bool isoceantransport=false;4763 4764 Vector<IssmDouble>* bslcice_partition=NULL;4765 IssmDouble* bslcice_partition_serial=NULL;4766 IssmDouble* partitionice=NULL;4767 int npartice,nel;4768 4769 Vector<IssmDouble>* bslchydro_partition=NULL;4770 IssmDouble* bslchydro_partition_serial=NULL;4771 IssmDouble* partitionhydro=NULL;4772 bool istws=0;4773 int nparthydro;4774 4775 int npartocean;4776 Vector<IssmDouble>* bslcocean_partition=NULL;4777 IssmDouble* bslcocean_partition_serial=NULL;4778 IssmDouble* partitionocean=NULL;4779 4780 /*Initialize temporary vector that will be used to sum barystatic components4781 * on all local elements, prior to assembly:*/4782 int gsize = this->nodes->NumberOfDofs(GsetEnum);4783 IssmDouble* RSLgi=xNewZeroInit<IssmDouble>(gsize);4784 int* indices=xNew<int>(gsize);4785 for(int i=0;i<gsize;i++) indices[i]=i;4786 4787 /*First, figure out the area of the ocean, which is needed to compute the barystatic component: */4788 int i = -1;4789 for(Object* & object : this->elements->objects){4790 i +=1;4791 Element* element = xDynamicCast<Element*>(object);4792 element->GetInputValue(&area,AreaEnum);4793 if (masks->isoceanin[i]) oceanarea_cpu += area;4794 }4795 ISSM_MPI_Reduce (&oceanarea_cpu,&oceanarea,1,ISSM_MPI_DOUBLE,ISSM_MPI_SUM,0,IssmComm::GetComm() );4796 ISSM_MPI_Bcast(&oceanarea,1,ISSM_MPI_DOUBLE,0,IssmComm::GetComm());4797 _assert_(oceanarea>0.);4798 4799 /*Initialize partition vectors to retrieve barystatic contributions: */4800 this->parameters->FindParam(&npartice,SolidearthNpartIceEnum);4801 if(npartice){4802 this->parameters->FindParam(&partitionice,&nel,NULL,SolidearthPartitionIceEnum);4803 bslcice_partition= new Vector<IssmDouble>(npartice);4804 }4805 4806 this->parameters->FindParam(&nparthydro,SolidearthNpartHydroEnum);4807 if(nparthydro){4808 this->parameters->FindParam(&partitionhydro,&nel,NULL,SolidearthPartitionHydroEnum);4809 bslchydro_partition= new Vector<IssmDouble>(nparthydro);4810 }4811 4812 this->parameters->FindParam(&npartocean,SolidearthNpartOceanEnum);4813 if(npartocean){4814 this->parameters->FindParam(&partitionocean,&nel,NULL,SolidearthPartitionOceanEnum);4815 bslchydro_partition= new Vector<IssmDouble>(npartocean);4816 }4817 /*For later:4818 npartbarystatic=npartice;4819 if(nparthydro>npartbarystatic)npartbarystatic=nparthydro;4820 if(npartocean>npartbarystatic)npartbarystatic=npartocean;4821 bslc_partition=new Matrix(IssmDouble>(npartbarystatic,3);4822 4823 bslc_cpu[0]=0; bslc_cpu[1]=0; bslc_cpu[2]=0;4824 for(Object* & object : this->elements->objects){4825 Element* element = xDynamicCast<Element*>(object);4826 element->SealevelchangeBarystaticLoads(&bslc_cpu[0], localloads,masks, bslcice_partition,partitionice,oceanarea);4827 }4828 MPI Bcast localloads -> loads4829 4830 for(Object* & object : this->elements->objects){4831 Element* element = xDynamicCast<Element*>(object);4832 element->SealevelchangeConvolution(loads);4833 }4834 */4835 4836 4837 4838 4839 4840 /*Call the barystatic sea level change core for ice : */4841 bslcice_cpu=0;4842 for(Object* & object : this->elements->objects){4843 Element* element = xDynamicCast<Element*>(object);4844 bslcice_cpu+=element->SealevelchangeBarystaticIce(RSLgi,masks, bslcice_partition,partitionice,oceanarea);4845 }4846 4847 /*Call the barystatic sea level change core for hydro: */4848 bslchydro_cpu=0; //make sure to initialize this, so we have a total barystatic contribution computed at 0.4849 this->parameters->FindParam(&istws,TransientIshydrologyEnum);4850 if(istws){4851 for(int i=0;i<elements->Size();i++){4852 Element* element=xDynamicCast<Element*>(elements->GetObjectByOffset(i));4853 bslchydro_cpu+=element->SealevelchangeBarystaticHydro(RSLgi,masks, bslchydro_partition,partitionhydro,oceanarea);4854 }4855 }4856 4857 /*Call the barystatic sea level change core for bottom pressures: */4858 this->parameters->FindParam(&bp_compute_fingerprints,SolidearthSettingsComputeBpGrdEnum);4859 this->parameters->FindParam(&isoceantransport,TransientIsoceantransportEnum);4860 if(bp_compute_fingerprints && isoceantransport){4861 for(int i=0;i<elements->Size();i++){4862 Element* element=xDynamicCast<Element*>(elements->GetObjectByOffset(i));4863 element->SealevelchangeBarystaticBottomPressure(RSLgi,masks);4864 }4865 }4866 4867 /*Plug values once and assemble: */4868 pRSLgi->SetValues(gsize,indices,RSLgi,ADD_VAL);4869 pRSLgi->Assemble();4870 4871 /*Sum all barystatic components from all cpus:*/4872 ISSM_MPI_Reduce (&bslcice_cpu,&bslcice,1,ISSM_MPI_DOUBLE,ISSM_MPI_SUM,0,IssmComm::GetComm() );4873 ISSM_MPI_Bcast(&bslcice,1,ISSM_MPI_DOUBLE,0,IssmComm::GetComm());4874 _assert_(!xIsNan<IssmDouble>(bslcice));4875 4876 ISSM_MPI_Reduce (&bslchydro_cpu,&bslchydro,1,ISSM_MPI_DOUBLE,ISSM_MPI_SUM,0,IssmComm::GetComm() );4877 ISSM_MPI_Bcast(&bslchydro,1,ISSM_MPI_DOUBLE,0,IssmComm::GetComm());4878 _assert_(!xIsNan<IssmDouble>(bslchydro));4879 4880 /*Take care of partition vectors:*/4881 if(bslcice_partition){4882 bslcice_partition->Assemble();4883 bslcice_partition_serial=bslcice_partition->ToMPISerial();4884 }4885 if(bslchydro_partition){4886 bslchydro_partition->Assemble();4887 bslchydro_partition_serial=bslchydro_partition->ToMPISerial();4888 }4889 4890 4891 /*Free ressources:*/4892 xDelete<int>(indices);4893 xDelete<IssmDouble>(RSLgi);4894 if(bslchydro_partition)delete bslchydro_partition;4895 if(bslcice_partition)delete bslcice_partition;4896 if(partitionhydro)xDelete<IssmDouble>(partitionhydro);4897 if(partitionice)xDelete<IssmDouble>(partitionice);4898 4899 /*Assign output pointers:*/4900 *poceanarea = oceanarea;4901 *pbslcice = bslcice;4902 *pbslchydro = bslchydro;4903 *pbslc=bslchydro+bslcice;4904 *pbslcice_partition=bslcice_partition_serial;4905 *pbslchydro_partition=bslchydro_partition_serial;4906 4907 }4908 /*}}}*/4909 4751 void FemModel::SealevelchangeSal(Vector<IssmDouble>* pRSLgo, Vector<IssmDouble>* pRSLg_old, SealevelMasks* masks, bool verboseconvolution){/*{{{*/ 4910 4752 4911 4753 /*serialized vectors:*/ -
../trunk-jpl/src/c/classes/classes.h
18 18 #include "./Massfluxatgate.h" 19 19 #include "./Misfit.h" 20 20 #include "./SealevelMasks.h" 21 #include "./BarystaticContributions.h" 21 22 #include "./Nodalvalue.h" 22 23 #include "./Numberedcostfunction.h" 23 24 #include "./Cfsurfacesquare.h" -
../trunk-jpl/src/c/cores/cores.h
80 80 void WriteLockFile(char* filename); 81 81 void ResetBoundaryConditions(FemModel* femmodel, int analysis_type); 82 82 void PrintBanner(void); 83 void TransferForcing(FemModel* femmodel,int forcingenum);84 void TransferSealevel(FemModel* femmodel,int forcingenum);85 83 void EarthMassTransport(FemModel* femmodel); 86 void slcconvergence(bool* pconverged, Vector<IssmDouble>* RSLg,Vector<IssmDouble>* RSLg_old,IssmDouble eps_rel,IssmDouble eps_abs);87 84 88 85 //solution configuration 89 86 void CorePointerFromSolutionEnum(void (**psolutioncore)(FemModel*),Parameters* parameters,int solutiontype); -
../trunk-jpl/src/c/cores/sealevelchange_core.cpp
11 11 #include "../shared/shared.h" 12 12 #include "../modules/modules.h" 13 13 #include "../solutionsequences/solutionsequences.h" 14 /*support routines local definitions:{{{*/ 15 void TransferForcing(FemModel* femmodel,int forcingenum); 16 void TransferSealevel(FemModel* femmodel,int forcingenum); 17 void slcconvergence(bool* pconverged, Vector<IssmDouble>* RSLg,Vector<IssmDouble>* RSLg_old,IssmDouble eps_rel,IssmDouble eps_abs); 18 IssmDouble SealevelloadsOceanAverage(Vector<IssmDouble>* sealevelloads,Vector<IssmDouble>* oceanareas, IssmDouble oceanarea); 19 /*}}}*/ 14 20 15 21 /*main cores:*/ 16 22 void sealevelchange_core(FemModel* femmodel){ /*{{{*/ … … 383 389 } 384 390 }; /*}}}*/ 385 391 392 void grd_core_optim(FemModel* femmodel,SealevelMasks* masks) { /*{{{*/ 393 394 /*variables:{{{*/ 395 int nel; 396 BarystaticContributions* barycontrib=NULL; 397 GenericParam<BarystaticContributions*>* barycontribparam=NULL; 398 IssmDouble barystatic; 399 400 Vector<IssmDouble>* loads=NULL; 401 IssmDouble* allloads=NULL; 402 Vector<IssmDouble>* sealevelloads=NULL; 403 Vector<IssmDouble>* oldsealevelloads=NULL; 404 IssmDouble sealevelloadsaverage; 405 IssmDouble* allsealevelloads=NULL; 406 Vector<IssmDouble>* oceanareas=NULL; 407 IssmDouble oceanarea; 408 bool scaleoceanarea=false; 409 IssmDouble rho_water; 410 411 IssmDouble eps_rel; 412 IssmDouble eps_abs; 413 int step; 414 IssmDouble time; 415 416 IssmDouble cumbslc; 417 IssmDouble cumbslcice; 418 IssmDouble cumbslchydro; 419 /*}}}*/ 420 421 /*retrieve parameters: */ 422 femmodel->parameters->FindParam(&scaleoceanarea,SolidearthSettingsOceanAreaScalingEnum); 423 barycontribparam = xDynamicCast<GenericParam<BarystaticContributions*>*>(femmodel->parameters->FindParamObject(BarystaticContributionsEnum)); 424 barycontrib=barycontribparam->GetParameterValue(); 425 femmodel->parameters->FindParam(&rho_water,MaterialsRhoSeawaterEnum); 426 femmodel->parameters->FindParam(&eps_rel,SolidearthSettingsReltolEnum); 427 femmodel->parameters->FindParam(&eps_abs,SolidearthSettingsAbstolEnum); 428 429 /*initialize matrices and vectors:*/ 430 femmodel->parameters->FindParam(&nel,MeshNumberofelementsEnum); 431 loads=new Vector<IssmDouble>(nel); 432 sealevelloads=new Vector<IssmDouble>(nel); 433 oceanareas=new Vector<IssmDouble>(nel); 434 435 /*buildup loads: */ 436 for(Object* & object : femmodel->elements->objects){ 437 Element* element = xDynamicCast<Element*>(object); 438 element->SealevelchangeBarystaticLoads(loads, barycontrib,masks); 439 } 440 441 //Communicate loads from local to global: 442 loads->Assemble(); allloads=loads->ToMPISerial(); 443 444 /*convolve loads:*/ 445 for(Object* & object : femmodel->elements->objects){ 446 Element* element = xDynamicCast<Element*>(object); 447 element->SealevelchangeInitialConvolution(sealevelloads,oceanareas,allloads,masks); 448 } 449 450 //Get ocean area: 451 oceanareas->Assemble(); oceanareas->Sum(&oceanarea); _assert_(oceanarea>0.); 452 if(scaleoceanarea) oceanarea=3.619e+14; // use true ocean area, m^2 453 454 //Get sea level loads ocean average: 455 sealevelloadsaverage=SealevelloadsOceanAverage(sealevelloads,oceanareas,oceanarea); 456 457 //substract ocean average and barystatic contributionfrom sea level loads: 458 barystatic=barycontrib->Total()/oceanarea/rho_water; 459 sealevelloads->Shift(-sealevelloadsaverage+barystatic); 460 allsealevelloads=sealevelloads->ToMPISerial(); 461 462 bool converged=false; 463 for(;;){ 464 465 oldsealevelloads=sealevelloads->Duplicate(); 466 467 /*convolve load and sealevel loads on oceans:*/ 468 for(Object* & object : femmodel->elements->objects){ 469 Element* element = xDynamicCast<Element*>(object); 470 element->SealevelchangeOceanConvolution(sealevelloads, allsealevelloads, allloads,masks); 471 } 472 sealevelloads->Assemble(); 473 474 //substract ocean average and barystatic contribution 475 sealevelloadsaverage=SealevelloadsOceanAverage(sealevelloads,oceanareas,oceanarea); 476 sealevelloads->Shift(-sealevelloadsaverage+barystatic); 477 478 //broadcast loads 479 allsealevelloads=sealevelloads->ToMPISerial(); 480 481 //convergence? 482 slcconvergence(&converged,sealevelloads,oldsealevelloads,eps_rel,eps_abs); 483 if (converged)break; 484 } 485 486 /*cumulate barystatic contributions and save to results: */ 487 barycontrib->Cumulate(femmodel->parameters); 488 barycontrib->Save(femmodel->results,femmodel->parameters,oceanarea); 489 490 } 491 /*}}}*/ 492 386 493 //Geometry: 387 494 SealevelMasks* sealevel_masks(FemModel* femmodel) { /*{{{*/ 388 495 … … 1061 1168 *pconverged=converged; 1062 1169 1063 1170 } /*}}}*/ 1171 IssmDouble SealevelloadsOceanAverage(Vector<IssmDouble>* sealevelloads,Vector<IssmDouble>* oceanareas, IssmDouble oceanarea){ /*{{{*/ 1172 IssmDouble sealevelloadsaverage; 1173 Vector<IssmDouble>* sealevelloadsvolume=sealevelloads->Duplicate(); 1174 sealevelloadsvolume->PointwiseMult(sealevelloads,oceanareas); 1175 sealevelloadsvolume->Sum(&sealevelloadsaverage); 1176 delete sealevelloadsvolume; 1177 return sealevelloadsaverage/oceanarea; 1178 } /*}}}*/ -
../trunk-jpl/src/c/shared/Enum/Enum.vim
746 746 syn keyword cConstant BslcEnum 747 747 syn keyword cConstant BslcIceEnum 748 748 syn keyword cConstant BslcHydroEnum 749 syn keyword cConstant BslcOceanEnum 749 750 syn keyword cConstant BslcRateEnum 750 751 syn keyword cConstant GmtslcEnum 751 752 syn keyword cConstant SealevelRSLBarystaticEnum … … 1070 1071 syn keyword cConstant BalancevelocitySolutionEnum 1071 1072 syn keyword cConstant BasalforcingsIsmip6Enum 1072 1073 syn keyword cConstant BasalforcingsPicoEnum 1074 syn keyword cConstant BarystaticContributionsEnum 1073 1075 syn keyword cConstant BeckmannGoosseFloatingMeltRateEnum 1074 1076 syn keyword cConstant BedSlopeSolutionEnum 1075 1077 syn keyword cConstant BoolExternalResultEnum … … 1432 1434 syn keyword cType AmrBamg 1433 1435 syn keyword cType AmrNeopz 1434 1436 syn keyword cType ArrayInput 1437 syn keyword cType BarystaticContributions 1435 1438 syn keyword cType BoolInput 1436 1439 syn keyword cType BoolParam 1437 1440 syn keyword cType Cfdragcoeffabsgrad -
../trunk-jpl/src/c/shared/Enum/EnumDefinitions.h
742 742 BslcEnum, 743 743 BslcIceEnum, 744 744 BslcHydroEnum, 745 BslcOceanEnum, 745 746 BslcRateEnum, 746 747 GmtslcEnum, 747 748 SealevelRSLBarystaticEnum, … … 1069 1070 BalancevelocitySolutionEnum, 1070 1071 BasalforcingsIsmip6Enum, 1071 1072 BasalforcingsPicoEnum, 1073 BarystaticContributionsEnum, 1072 1074 BeckmannGoosseFloatingMeltRateEnum, 1073 1075 BedSlopeSolutionEnum, 1074 1076 BoolExternalResultEnum, -
../trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp
748 748 case BslcEnum : return "Bslc"; 749 749 case BslcIceEnum : return "BslcIce"; 750 750 case BslcHydroEnum : return "BslcHydro"; 751 case BslcOceanEnum : return "BslcOcean"; 751 752 case BslcRateEnum : return "BslcRate"; 752 753 case GmtslcEnum : return "Gmtslc"; 753 754 case SealevelRSLBarystaticEnum : return "SealevelRSLBarystatic"; … … 1072 1073 case BalancevelocitySolutionEnum : return "BalancevelocitySolution"; 1073 1074 case BasalforcingsIsmip6Enum : return "BasalforcingsIsmip6"; 1074 1075 case BasalforcingsPicoEnum : return "BasalforcingsPico"; 1076 case BarystaticContributionsEnum : return "BarystaticContributions"; 1075 1077 case BeckmannGoosseFloatingMeltRateEnum : return "BeckmannGoosseFloatingMeltRate"; 1076 1078 case BedSlopeSolutionEnum : return "BedSlopeSolution"; 1077 1079 case BoolExternalResultEnum : return "BoolExternalResult"; -
../trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp
766 766 else if (strcmp(name,"Bslc")==0) return BslcEnum; 767 767 else if (strcmp(name,"BslcIce")==0) return BslcIceEnum; 768 768 else if (strcmp(name,"BslcHydro")==0) return BslcHydroEnum; 769 else if (strcmp(name,"BslcOcean")==0) return BslcOceanEnum; 769 770 else if (strcmp(name,"BslcRate")==0) return BslcRateEnum; 770 771 else if (strcmp(name,"Gmtslc")==0) return GmtslcEnum; 771 772 else if (strcmp(name,"SealevelRSLBarystatic")==0) return SealevelRSLBarystaticEnum; … … 873 874 else if (strcmp(name,"SmbSmbCorr")==0) return SmbSmbCorrEnum; 874 875 else if (strcmp(name,"SmbSmbref")==0) return SmbSmbrefEnum; 875 876 else if (strcmp(name,"SmbSzaValue")==0) return SmbSzaValueEnum; 876 else if (strcmp(name,"SmbT")==0) return SmbTEnum;877 877 else stage=8; 878 878 } 879 879 if(stage==8){ 880 if (strcmp(name,"SmbTa")==0) return SmbTaEnum; 880 if (strcmp(name,"SmbT")==0) return SmbTEnum; 881 else if (strcmp(name,"SmbTa")==0) return SmbTaEnum; 881 882 else if (strcmp(name,"SmbTeValue")==0) return SmbTeValueEnum; 882 883 else if (strcmp(name,"SmbTemperaturesAnomaly")==0) return SmbTemperaturesAnomalyEnum; 883 884 else if (strcmp(name,"SmbTemperaturesLgm")==0) return SmbTemperaturesLgmEnum; … … 996 997 else if (strcmp(name,"Outputdefinition31")==0) return Outputdefinition31Enum; 997 998 else if (strcmp(name,"Outputdefinition32")==0) return Outputdefinition32Enum; 998 999 else if (strcmp(name,"Outputdefinition33")==0) return Outputdefinition33Enum; 999 else if (strcmp(name,"Outputdefinition34")==0) return Outputdefinition34Enum;1000 1000 else stage=9; 1001 1001 } 1002 1002 if(stage==9){ 1003 if (strcmp(name,"Outputdefinition35")==0) return Outputdefinition35Enum; 1003 if (strcmp(name,"Outputdefinition34")==0) return Outputdefinition34Enum; 1004 else if (strcmp(name,"Outputdefinition35")==0) return Outputdefinition35Enum; 1004 1005 else if (strcmp(name,"Outputdefinition36")==0) return Outputdefinition36Enum; 1005 1006 else if (strcmp(name,"Outputdefinition37")==0) return Outputdefinition37Enum; 1006 1007 else if (strcmp(name,"Outputdefinition38")==0) return Outputdefinition38Enum; … … 1096 1097 else if (strcmp(name,"BalancevelocitySolution")==0) return BalancevelocitySolutionEnum; 1097 1098 else if (strcmp(name,"BasalforcingsIsmip6")==0) return BasalforcingsIsmip6Enum; 1098 1099 else if (strcmp(name,"BasalforcingsPico")==0) return BasalforcingsPicoEnum; 1100 else if (strcmp(name,"BarystaticContributions")==0) return BarystaticContributionsEnum; 1099 1101 else if (strcmp(name,"BeckmannGoosseFloatingMeltRate")==0) return BeckmannGoosseFloatingMeltRateEnum; 1100 1102 else if (strcmp(name,"BedSlopeSolution")==0) return BedSlopeSolutionEnum; 1101 1103 else if (strcmp(name,"BoolExternalResult")==0) return BoolExternalResultEnum; … … 1118 1120 else if (strcmp(name,"ChannelDischarge")==0) return ChannelDischargeEnum; 1119 1121 else if (strcmp(name,"Closed")==0) return ClosedEnum; 1120 1122 else if (strcmp(name,"Colinear")==0) return ColinearEnum; 1121 else if (strcmp(name,"Constraints")==0) return ConstraintsEnum;1122 else if (strcmp(name,"Contact")==0) return ContactEnum;1123 1123 else stage=10; 1124 1124 } 1125 1125 if(stage==10){ 1126 if (strcmp(name,"Contour")==0) return ContourEnum; 1126 if (strcmp(name,"Constraints")==0) return ConstraintsEnum; 1127 else if (strcmp(name,"Contact")==0) return ContactEnum; 1128 else if (strcmp(name,"Contour")==0) return ContourEnum; 1127 1129 else if (strcmp(name,"Contours")==0) return ContoursEnum; 1128 1130 else if (strcmp(name,"ControlInput")==0) return ControlInputEnum; 1129 1131 else if (strcmp(name,"ControlInputGrad")==0) return ControlInputGradEnum; … … 1241 1243 else if (strcmp(name,"L2ProjectionBaseAnalysis")==0) return L2ProjectionBaseAnalysisEnum; 1242 1244 else if (strcmp(name,"L2ProjectionEPLAnalysis")==0) return L2ProjectionEPLAnalysisEnum; 1243 1245 else if (strcmp(name,"LACrouzeixRaviart")==0) return LACrouzeixRaviartEnum; 1244 else if (strcmp(name,"LATaylorHood")==0) return LATaylorHoodEnum;1245 else if (strcmp(name,"LambdaS")==0) return LambdaSEnum;1246 1246 else stage=11; 1247 1247 } 1248 1248 if(stage==11){ 1249 if (strcmp(name,"LevelsetAnalysis")==0) return LevelsetAnalysisEnum; 1249 if (strcmp(name,"LATaylorHood")==0) return LATaylorHoodEnum; 1250 else if (strcmp(name,"LambdaS")==0) return LambdaSEnum; 1251 else if (strcmp(name,"LevelsetAnalysis")==0) return LevelsetAnalysisEnum; 1250 1252 else if (strcmp(name,"LevelsetfunctionPicard")==0) return LevelsetfunctionPicardEnum; 1251 1253 else if (strcmp(name,"LinearFloatingMeltRate")==0) return LinearFloatingMeltRateEnum; 1252 1254 else if (strcmp(name,"LliboutryDuval")==0) return LliboutryDuvalEnum; … … 1364 1366 else if (strcmp(name,"SMBpdd")==0) return SMBpddEnum; 1365 1367 else if (strcmp(name,"SMBpddSicopolis")==0) return SMBpddSicopolisEnum; 1366 1368 else if (strcmp(name,"SMBsemic")==0) return SMBsemicEnum; 1367 else if (strcmp(name,"SSAApproximation")==0) return SSAApproximationEnum;1368 else if (strcmp(name,"SSAFSApproximation")==0) return SSAFSApproximationEnum;1369 1369 else stage=12; 1370 1370 } 1371 1371 if(stage==12){ 1372 if (strcmp(name,"SSAHOApproximation")==0) return SSAHOApproximationEnum; 1372 if (strcmp(name,"SSAApproximation")==0) return SSAApproximationEnum; 1373 else if (strcmp(name,"SSAFSApproximation")==0) return SSAFSApproximationEnum; 1374 else if (strcmp(name,"SSAHOApproximation")==0) return SSAHOApproximationEnum; 1373 1375 else if (strcmp(name,"Scaled")==0) return ScaledEnum; 1374 1376 else if (strcmp(name,"SealevelAbsolute")==0) return SealevelAbsoluteEnum; 1375 1377 else if (strcmp(name,"SealevelEmotion")==0) return SealevelEmotionEnum; -
../trunk-jpl/src/c/toolkits/issm/IssmSeqVec.h
323 323 324 324 } 325 325 /*}}}*/ 326 void Sum(doubletype* pvalue){/*{{{*/ 327 328 doubletype value=0; 329 int i; 330 for(i=0;i<this->M;i++)value+=this->vector[i]; 331 *pvalue=value; 332 } 333 /*}}}*/ 326 334 327 335 }; 328 336 #endif //#ifndef _ISSM_SEQ_VEC_H_ -
../trunk-jpl/src/c/toolkits/objects/Matrix.h
281 281 return output; 282 282 } 283 283 /*}}}*/ 284 doubletype* ToMPISerial(void){/*{{{*/ 285 286 doubletype* output=NULL; 287 288 if(type==PetscMatType){ 289 #ifdef _HAVE_PETSC_ 290 output=this->pmatrix->ToMPISerial(); 291 #endif 292 } 293 else{ 294 _error_("not implemented yet!"); 295 } 296 297 return output; 298 } 299 /*}}}*/ 284 300 void SetValues(int m,int* idxm,int n,int* idxn,IssmDouble* values,InsMode mode){/*{{{*/ 285 301 286 302 if(type==PetscMatType){ … … 306 322 307 323 } 308 324 /*}}}*/ 309 /*310 * sets all values to 0 but keeps the structure of a sparse matrix311 */312 325 void SetZero(void) {/*{{{*/ 326 // sets all values to 0 but keeps the structure of a sparse matrix 313 327 if(type==PetscMatType){ 314 328 #ifdef _HAVE_PETSC_ 315 329 this->pmatrix->SetZero(); -
../trunk-jpl/src/c/toolkits/petsc/objects/PetscVec.cpp
248 248 249 249 } 250 250 /*}}}*/ 251 void PetscVec::Sum(IssmDouble* pvalue){/*{{{*/ 252 253 _assert_(this->vector); 254 VecSum(this->vector,pvalue); 255 256 } 257 /*}}}*/ 251 258 IssmDouble PetscVec::Dot(PetscVec* input){/*{{{*/ 252 259 253 260 IssmDouble dot; -
../trunk-jpl/src/c/toolkits/petsc/patches/petscpatches.h
31 31 void PetscOptionsDetermineSolverType(int* psolver_type); 32 32 void MatMultPatch(Mat A,Vec X, Vec AX,ISSM_MPI_Comm comm); 33 33 void MatToSerial(double** poutmatrix,Mat matrix,ISSM_MPI_Comm comm); 34 void MatToMPISerial(double** poutmatrix,Mat matrix,ISSM_MPI_Comm comm); 34 35 Vec SerialToVec(double* vector,int vector_size); 35 36 InsertMode ISSMToPetscInsertMode(InsMode mode); 36 37 NormType ISSMToPetscNormMode(NormMode mode); -
../trunk-jpl/test/NightlyRun/test2004.m
133 133 134 134 disp(' reading bedrock'); 135 135 md.geometry.bed=-ones(md.mesh.numberofvertices,1); 136 md.geometry.base=md.geometry.bed; 137 md.geometry.thickness=1000*ones(md.mesh.numberofvertices,1); 138 md.geometry.surface=md.geometry.bed+md.geometry.thickness; 139 136 140 end % }}} 137 141 %Slc: {{{ 138 142 if bas.iscontinentany('antarctica'), … … 166 170 md.masstransport.spcthickness=mean(delHAIS(md.mesh.elements),2)/100; 167 171 end 168 172 169 md. solidearth.initialsealevel=zeros(md.mesh.numberofvertices,1);173 md.initialization.sealevel=zeros(md.mesh.numberofvertices,1); 170 174 171 md.dsl.global_average_thermosteric_sea_level _change=[0;0];172 md.dsl.sea_surface_height_ change_above_geoid=zeros(md.mesh.numberofvertices+1,1);173 md.dsl.sea_water_pressure_ change_at_sea_floor=zeros(md.mesh.numberofvertices+1,1);175 md.dsl.global_average_thermosteric_sea_level=[0;0]; 176 md.dsl.sea_surface_height_above_geoid=zeros(md.mesh.numberofvertices+1,1); 177 md.dsl.sea_water_pressure_at_sea_floor=zeros(md.mesh.numberofvertices+1,1); 174 178 175 179 end %}}} 176 180 % material properties: {{{ … … 312 316 %geometry: {{{ 313 317 di=md.materials.rho_ice/md.materials.rho_water; 314 318 md.geometry.bed=-ones(md.mesh.numberofvertices,1); 319 md.geometry.base=md.geometry.bed; 320 md.geometry.thickness=1000*ones(md.mesh.numberofvertices,1); 321 md.geometry.surface=md.geometry.bed+md.geometry.thickness; 315 322 % }}} 316 323 %materials: {{{ 317 324 md.materials=materials('hydro'); … … 345 352 sl.transfer('mask.ice_levelset'); 346 353 sl.transfer('mask.ocean_levelset'); 347 354 sl.transfer('geometry.bed'); 355 sl.transfer('geometry.surface'); 356 sl.transfer('geometry.thickness'); 357 sl.transfer('geometry.base'); 348 358 sl.transfer('mesh.lat'); 349 359 sl.transfer('mesh.long'); 350 360 sl.transfer('masstransport.spcthickness'); … … 399 409 md.transient.ismasstransport=1; 400 410 md.transient.isslc=1; 401 411 412 %Initializations: 413 md.basalforcings.groundedice_melting_rate=zeros(md.mesh.numberofvertices,1); 414 md.basalforcings.floatingice_melting_rate=zeros(md.mesh.numberofvertices,1); 415 md.initialization.vx=zeros(md.mesh.numberofvertices,1); 416 md.initialization.vy=zeros(md.mesh.numberofvertices,1); 417 md.initialization.sealevel=zeros(md.mesh.numberofvertices,1); 418 md.initialization.bottompressure=zeros(md.mesh.numberofvertices,1); 419 md.initialization.dsl=zeros(md.mesh.numberofvertices,1); 420 md.initialization.str=0; 421 md.smb.mass_balance=zeros(md.mesh.numberofvertices,1); 402 422 403 423 %max number of iterations reverted back to 10 (i.e. the original default value) 404 424 md.solidearth.settings.maxiter=10;
Note:
See TracBrowser
for help on using the repository browser.