Changeset 12885
- Timestamp:
- 08/03/12 10:00:46 (13 years ago)
- Location:
- issm/trunk-jpl/src/c/classes/objects/Elements
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/c/classes/objects/Elements/Penta.cpp
r12832 r12885 687 687 /*FUNCTION Penta::Delta18oParameterization{{{*/ 688 688 void Penta::Delta18oParameterization(void){ 689 689 /*Are we on the base? If not, return*/ 690 if(!IsOnBed()) return; 691 692 int i; 690 693 IssmDouble monthlytemperatures[NUMVERTICES][12],monthlyprec[NUMVERTICES][12]; 691 694 IssmDouble TemperaturesPresentday[NUMVERTICES][12],TemperaturesLgm[NUMVERTICES][12]; 692 695 IssmDouble PrecipitationsPresentday[NUMVERTICES][12]; 696 IssmDouble tmp[NUMVERTICES]; 693 697 IssmDouble Delta18oPresent,Delta18oLgm,Delta18oTime; 694 698 IssmDouble Delta18oSurfacePresent,Delta18oSurfaceLgm,Delta18oSurfaceTime; … … 699 703 700 704 /*Recover present day temperature and precipitation*/ 701 Input* input=inputs->GetInput(SurfaceforcingsTemperaturesPresentdayEnum); _assert_(input);702 Input* input2=inputs->GetInput(SurfaceforcingsTemperaturesLgmEnum); _assert_(input2);705 Input* input=inputs->GetInput(SurfaceforcingsTemperaturesPresentdayEnum); _assert_(input); 706 Input* input2=inputs->GetInput(SurfaceforcingsTemperaturesLgmEnum); _assert_(input2); 703 707 Input* input3=inputs->GetInput(SurfaceforcingsPrecipitationsPresentdayEnum); _assert_(input3); 704 708 GaussPenta* gauss=new GaussPenta(); … … 714 718 715 719 /*Recover delta18o and Delta18oSurface at present day, lgm and at time t*/ 716 this->parameters->FindParam(&Delta18oPresent,SurfaceforcingsDelta18oEnum,finaltime *yts);717 this->parameters->FindParam(&Delta18oLgm,SurfaceforcingsDelta18oEnum, (finaltime-21000)*yts);718 this->parameters->FindParam(&Delta18oTime,SurfaceforcingsDelta18oEnum,time *yts);719 this->parameters->FindParam(&Delta18oSurfacePresent,SurfaceforcingsDelta18oSurfaceEnum,finaltime *yts);720 this->parameters->FindParam(&Delta18oSurfaceLgm,SurfaceforcingsDelta18oSurfaceEnum, (finaltime-21000)*yts);721 this->parameters->FindParam(&Delta18oSurfaceTime,SurfaceforcingsDelta18oSurfaceEnum,time *yts);720 this->parameters->FindParam(&Delta18oPresent,SurfaceforcingsDelta18oEnum,finaltime); 721 this->parameters->FindParam(&Delta18oLgm,SurfaceforcingsDelta18oEnum,finaltime-(21000*yts)); 722 this->parameters->FindParam(&Delta18oTime,SurfaceforcingsDelta18oEnum,time); 723 this->parameters->FindParam(&Delta18oSurfacePresent,SurfaceforcingsDelta18oSurfaceEnum,finaltime); 724 this->parameters->FindParam(&Delta18oSurfaceLgm,SurfaceforcingsDelta18oSurfaceEnum,finaltime-(21000*yts)); 725 this->parameters->FindParam(&Delta18oSurfaceTime,SurfaceforcingsDelta18oSurfaceEnum,time); 722 726 723 727 /*Compute the temperature and precipitation*/ … … 734 738 TransientInput* NewPrecipitationInput = new TransientInput(SurfaceforcingsPrecipitationEnum); 735 739 for (int imonth=0;imonth<12;imonth++) { 736 for(int iv=0;iv<NUMVERTICES;iv++) { 737 PentaP1Input* newmonthinput1 = new PentaP1Input(SurfaceforcingsMonthlytemperaturesEnum,&monthlytemperatures[iv][imonth]); 738 NewTemperatureInput->AddTimeInput(newmonthinput1,imonth/12.*yts); 739 PentaP1Input* newmonthinput2 = new PentaP1Input(SurfaceforcingsPrecipitationEnum,&monthlyprec[iv][imonth]); 740 NewPrecipitationInput->AddTimeInput(newmonthinput2,imonth/12.*yts); 741 } 742 } 740 for(i=0;i<NUMVERTICES;i++) tmp[i]=monthlytemperatures[i][imonth]; 741 PentaP1Input* newmonthinput1 = new PentaP1Input(SurfaceforcingsMonthlytemperaturesEnum,&tmp[0]); 742 NewTemperatureInput->AddTimeInput(newmonthinput1,time+imonth/12.*yts); 743 744 for(i=0;i<NUMVERTICES;i++) tmp[i]=monthlyprec[i][imonth]; 745 PentaP1Input* newmonthinput2 = new PentaP1Input(SurfaceforcingsPrecipitationEnum,&tmp[0]); 746 NewPrecipitationInput->AddTimeInput(newmonthinput2,time+imonth/12.*yts); 747 } 748 743 749 this->inputs->AddInput(NewTemperatureInput); 744 750 this->inputs->AddInput(NewPrecipitationInput); 751 752 this->InputExtrude(SurfaceforcingsMonthlytemperaturesEnum,ElementEnum); 753 this->InputExtrude(SurfaceforcingsPrecipitationEnum,ElementEnum); 745 754 746 755 /*clean-up*/ -
issm/trunk-jpl/src/c/classes/objects/Elements/Tria.cpp
r12870 r12885 915 915 IssmDouble TemperaturesPresentday[NUMVERTICES][12],TemperaturesLgm[NUMVERTICES][12]; 916 916 IssmDouble PrecipitationsPresentday[NUMVERTICES][12]; 917 IssmDouble t emp[NUMVERTICES];917 IssmDouble tmp[NUMVERTICES]; 918 918 IssmDouble Delta18oPresent,Delta18oLgm,Delta18oTime; 919 919 IssmDouble Delta18oSurfacePresent,Delta18oSurfaceLgm,Delta18oSurfaceTime; … … 961 961 TransientInput* NewPrecipitationInput = new TransientInput(SurfaceforcingsPrecipitationEnum); 962 962 for (int imonth=0;imonth<12;imonth++) { 963 for(i=0;i<NUMVERTICES;i++) temp[i]=TemperaturesPresentday[i][imonth]; 964 TriaP1Input* newmonthinput1 = new TriaP1Input(SurfaceforcingsMonthlytemperaturesEnum,&temp[0]); 965 //TriaP1Input* newmonthinput1 = new TriaP1Input(SurfaceforcingsMonthlytemperaturesEnum,&monthlytemperatures[0][imonth]); 963 for(i=0;i<NUMVERTICES;i++) tmp[i]=monthlytemperatures[i][imonth]; 964 TriaP1Input* newmonthinput1 = new TriaP1Input(SurfaceforcingsMonthlytemperaturesEnum,&tmp[0]); 966 965 NewTemperatureInput->AddTimeInput(newmonthinput1,time+imonth/12.*yts); 967 for(i=0;i<NUMVERTICES;i++) temp[i]=monthlyprec[i][imonth]; 968 TriaP1Input* newmonthinput2 = new TriaP1Input(SurfaceforcingsPrecipitationEnum,&temp[0]); 966 967 for(i=0;i<NUMVERTICES;i++) tmp[i]=monthlyprec[i][imonth]; 968 TriaP1Input* newmonthinput2 = new TriaP1Input(SurfaceforcingsPrecipitationEnum,&tmp[0]); 969 969 NewPrecipitationInput->AddTimeInput(newmonthinput2,time+imonth/12.*yts); 970 970 } 971 971 972 this->inputs->AddInput(NewTemperatureInput); 972 973 this->inputs->AddInput(NewPrecipitationInput);
Note:
See TracChangeset
for help on using the changeset viewer.