[13394] | 1 | Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Elements/Tria.cpp
|
---|
| 2 | ===================================================================
|
---|
| 3 | --- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Elements/Tria.cpp (revision 12884)
|
---|
| 4 | +++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Elements/Tria.cpp (revision 12885)
|
---|
| 5 | @@ -914,7 +914,7 @@
|
---|
| 6 | IssmDouble monthlytemperatures[NUMVERTICES][12],monthlyprec[NUMVERTICES][12];
|
---|
| 7 | IssmDouble TemperaturesPresentday[NUMVERTICES][12],TemperaturesLgm[NUMVERTICES][12];
|
---|
| 8 | IssmDouble PrecipitationsPresentday[NUMVERTICES][12];
|
---|
| 9 | - IssmDouble temp[NUMVERTICES];
|
---|
| 10 | + IssmDouble tmp[NUMVERTICES];
|
---|
| 11 | IssmDouble Delta18oPresent,Delta18oLgm,Delta18oTime;
|
---|
| 12 | IssmDouble Delta18oSurfacePresent,Delta18oSurfaceLgm,Delta18oSurfaceTime;
|
---|
| 13 | IssmDouble time,yts,finaltime;
|
---|
| 14 | @@ -960,14 +960,15 @@
|
---|
| 15 | TransientInput* NewTemperatureInput = new TransientInput(SurfaceforcingsMonthlytemperaturesEnum);
|
---|
| 16 | TransientInput* NewPrecipitationInput = new TransientInput(SurfaceforcingsPrecipitationEnum);
|
---|
| 17 | for (int imonth=0;imonth<12;imonth++) {
|
---|
| 18 | - for(i=0;i<NUMVERTICES;i++) temp[i]=TemperaturesPresentday[i][imonth];
|
---|
| 19 | - TriaP1Input* newmonthinput1 = new TriaP1Input(SurfaceforcingsMonthlytemperaturesEnum,&temp[0]);
|
---|
| 20 | - //TriaP1Input* newmonthinput1 = new TriaP1Input(SurfaceforcingsMonthlytemperaturesEnum,&monthlytemperatures[0][imonth]);
|
---|
| 21 | + for(i=0;i<NUMVERTICES;i++) tmp[i]=monthlytemperatures[i][imonth];
|
---|
| 22 | + TriaP1Input* newmonthinput1 = new TriaP1Input(SurfaceforcingsMonthlytemperaturesEnum,&tmp[0]);
|
---|
| 23 | NewTemperatureInput->AddTimeInput(newmonthinput1,time+imonth/12.*yts);
|
---|
| 24 | - for(i=0;i<NUMVERTICES;i++) temp[i]=monthlyprec[i][imonth];
|
---|
| 25 | - TriaP1Input* newmonthinput2 = new TriaP1Input(SurfaceforcingsPrecipitationEnum,&temp[0]);
|
---|
| 26 | +
|
---|
| 27 | + for(i=0;i<NUMVERTICES;i++) tmp[i]=monthlyprec[i][imonth];
|
---|
| 28 | + TriaP1Input* newmonthinput2 = new TriaP1Input(SurfaceforcingsPrecipitationEnum,&tmp[0]);
|
---|
| 29 | NewPrecipitationInput->AddTimeInput(newmonthinput2,time+imonth/12.*yts);
|
---|
| 30 | }
|
---|
| 31 | +
|
---|
| 32 | this->inputs->AddInput(NewTemperatureInput);
|
---|
| 33 | this->inputs->AddInput(NewPrecipitationInput);
|
---|
| 34 |
|
---|
| 35 | Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Elements/Penta.cpp
|
---|
| 36 | ===================================================================
|
---|
| 37 | --- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Elements/Penta.cpp (revision 12884)
|
---|
| 38 | +++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Elements/Penta.cpp (revision 12885)
|
---|
| 39 | @@ -686,10 +686,14 @@
|
---|
| 40 | /*}}}*/
|
---|
| 41 | /*FUNCTION Penta::Delta18oParameterization{{{*/
|
---|
| 42 | void Penta::Delta18oParameterization(void){
|
---|
| 43 | + /*Are we on the base? If not, return*/
|
---|
| 44 | + if(!IsOnBed()) return;
|
---|
| 45 |
|
---|
| 46 | + int i;
|
---|
| 47 | IssmDouble monthlytemperatures[NUMVERTICES][12],monthlyprec[NUMVERTICES][12];
|
---|
| 48 | IssmDouble TemperaturesPresentday[NUMVERTICES][12],TemperaturesLgm[NUMVERTICES][12];
|
---|
| 49 | IssmDouble PrecipitationsPresentday[NUMVERTICES][12];
|
---|
| 50 | + IssmDouble tmp[NUMVERTICES];
|
---|
| 51 | IssmDouble Delta18oPresent,Delta18oLgm,Delta18oTime;
|
---|
| 52 | IssmDouble Delta18oSurfacePresent,Delta18oSurfaceLgm,Delta18oSurfaceTime;
|
---|
| 53 | IssmDouble time,yts,finaltime;
|
---|
| 54 | @@ -698,8 +702,8 @@
|
---|
| 55 | this->parameters->FindParam(&finaltime,TimesteppingFinalTimeEnum);
|
---|
| 56 |
|
---|
| 57 | /*Recover present day temperature and precipitation*/
|
---|
| 58 | - Input* input=inputs->GetInput(SurfaceforcingsTemperaturesPresentdayEnum); _assert_(input);
|
---|
| 59 | - Input* input2=inputs->GetInput(SurfaceforcingsTemperaturesLgmEnum); _assert_(input2);
|
---|
| 60 | + Input* input=inputs->GetInput(SurfaceforcingsTemperaturesPresentdayEnum); _assert_(input);
|
---|
| 61 | + Input* input2=inputs->GetInput(SurfaceforcingsTemperaturesLgmEnum); _assert_(input2);
|
---|
| 62 | Input* input3=inputs->GetInput(SurfaceforcingsPrecipitationsPresentdayEnum); _assert_(input3);
|
---|
| 63 | GaussPenta* gauss=new GaussPenta();
|
---|
| 64 | for(int month=0;month<12;month++) {
|
---|
| 65 | @@ -713,12 +717,12 @@
|
---|
| 66 | }
|
---|
| 67 |
|
---|
| 68 | /*Recover delta18o and Delta18oSurface at present day, lgm and at time t*/
|
---|
| 69 | - this->parameters->FindParam(&Delta18oPresent,SurfaceforcingsDelta18oEnum,finaltime*yts);
|
---|
| 70 | - this->parameters->FindParam(&Delta18oLgm,SurfaceforcingsDelta18oEnum,(finaltime-21000)*yts);
|
---|
| 71 | - this->parameters->FindParam(&Delta18oTime,SurfaceforcingsDelta18oEnum,time*yts);
|
---|
| 72 | - this->parameters->FindParam(&Delta18oSurfacePresent,SurfaceforcingsDelta18oSurfaceEnum,finaltime*yts);
|
---|
| 73 | - this->parameters->FindParam(&Delta18oSurfaceLgm,SurfaceforcingsDelta18oSurfaceEnum,(finaltime-21000)*yts);
|
---|
| 74 | - this->parameters->FindParam(&Delta18oSurfaceTime,SurfaceforcingsDelta18oSurfaceEnum,time*yts);
|
---|
| 75 | + this->parameters->FindParam(&Delta18oPresent,SurfaceforcingsDelta18oEnum,finaltime);
|
---|
| 76 | + this->parameters->FindParam(&Delta18oLgm,SurfaceforcingsDelta18oEnum,finaltime-(21000*yts));
|
---|
| 77 | + this->parameters->FindParam(&Delta18oTime,SurfaceforcingsDelta18oEnum,time);
|
---|
| 78 | + this->parameters->FindParam(&Delta18oSurfacePresent,SurfaceforcingsDelta18oSurfaceEnum,finaltime);
|
---|
| 79 | + this->parameters->FindParam(&Delta18oSurfaceLgm,SurfaceforcingsDelta18oSurfaceEnum,finaltime-(21000*yts));
|
---|
| 80 | + this->parameters->FindParam(&Delta18oSurfaceTime,SurfaceforcingsDelta18oSurfaceEnum,time);
|
---|
| 81 |
|
---|
| 82 | /*Compute the temperature and precipitation*/
|
---|
| 83 | for(int iv=0;iv<NUMVERTICES;iv++){
|
---|
| 84 | @@ -733,16 +737,21 @@
|
---|
| 85 | TransientInput* NewTemperatureInput = new TransientInput(SurfaceforcingsMonthlytemperaturesEnum);
|
---|
| 86 | TransientInput* NewPrecipitationInput = new TransientInput(SurfaceforcingsPrecipitationEnum);
|
---|
| 87 | for (int imonth=0;imonth<12;imonth++) {
|
---|
| 88 | - for(int iv=0;iv<NUMVERTICES;iv++) {
|
---|
| 89 | - PentaP1Input* newmonthinput1 = new PentaP1Input(SurfaceforcingsMonthlytemperaturesEnum,&monthlytemperatures[iv][imonth]);
|
---|
| 90 | - NewTemperatureInput->AddTimeInput(newmonthinput1,imonth/12.*yts);
|
---|
| 91 | - PentaP1Input* newmonthinput2 = new PentaP1Input(SurfaceforcingsPrecipitationEnum,&monthlyprec[iv][imonth]);
|
---|
| 92 | - NewPrecipitationInput->AddTimeInput(newmonthinput2,imonth/12.*yts);
|
---|
| 93 | - }
|
---|
| 94 | + for(i=0;i<NUMVERTICES;i++) tmp[i]=monthlytemperatures[i][imonth];
|
---|
| 95 | + PentaP1Input* newmonthinput1 = new PentaP1Input(SurfaceforcingsMonthlytemperaturesEnum,&tmp[0]);
|
---|
| 96 | + NewTemperatureInput->AddTimeInput(newmonthinput1,time+imonth/12.*yts);
|
---|
| 97 | +
|
---|
| 98 | + for(i=0;i<NUMVERTICES;i++) tmp[i]=monthlyprec[i][imonth];
|
---|
| 99 | + PentaP1Input* newmonthinput2 = new PentaP1Input(SurfaceforcingsPrecipitationEnum,&tmp[0]);
|
---|
| 100 | + NewPrecipitationInput->AddTimeInput(newmonthinput2,time+imonth/12.*yts);
|
---|
| 101 | }
|
---|
| 102 | +
|
---|
| 103 | this->inputs->AddInput(NewTemperatureInput);
|
---|
| 104 | this->inputs->AddInput(NewPrecipitationInput);
|
---|
| 105 |
|
---|
| 106 | + this->InputExtrude(SurfaceforcingsMonthlytemperaturesEnum,ElementEnum);
|
---|
| 107 | + this->InputExtrude(SurfaceforcingsPrecipitationEnum,ElementEnum);
|
---|
| 108 | +
|
---|
| 109 | /*clean-up*/
|
---|
| 110 | delete gauss;
|
---|
| 111 | }
|
---|