[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 12865)
|
---|
| 4 | +++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Elements/Tria.cpp (revision 12866)
|
---|
| 5 | @@ -930,17 +930,17 @@
|
---|
| 6 | input->GetInputValue(&TemperaturesPresentday[iv][month],gauss,month/12.*yts);
|
---|
| 7 | input2->GetInputValue(&TemperaturesLgm[iv][month],gauss,month/12.*yts);
|
---|
| 8 | input3->GetInputValue(&PrecipitationsPresentday[iv][month],gauss,month/12.*yts);
|
---|
| 9 | - monthlyprec[iv][month]=monthlyprec[iv][month]*yts; // convertion to m/yr
|
---|
| 10 | + PrecipitationsPresentday[iv][month]=PrecipitationsPresentday[iv][month]/yts; // converion in m/sec
|
---|
| 11 | }
|
---|
| 12 | }
|
---|
| 13 | /*Recover delta18o and Delta18oSurface at present day, lgm and at time t*/
|
---|
| 14 | - this->parameters->FindParam(&Delta18oPresent,SurfaceforcingsDelta18oEnum,finaltime*yts);
|
---|
| 15 | - this->parameters->FindParam(&Delta18oLgm,SurfaceforcingsDelta18oEnum,(finaltime-21000)*yts);
|
---|
| 16 | - this->parameters->FindParam(&Delta18oTime,SurfaceforcingsDelta18oEnum,time*yts);
|
---|
| 17 | - this->parameters->FindParam(&Delta18oSurfacePresent,SurfaceforcingsDelta18oSurfaceEnum,finaltime*yts);
|
---|
| 18 | - this->parameters->FindParam(&Delta18oSurfaceLgm,SurfaceforcingsDelta18oSurfaceEnum,(finaltime-21000)*yts);
|
---|
| 19 | - this->parameters->FindParam(&Delta18oSurfaceTime,SurfaceforcingsDelta18oSurfaceEnum,time*yts);
|
---|
| 20 | -
|
---|
| 21 | + this->parameters->FindParam(&Delta18oPresent,SurfaceforcingsDelta18oEnum,finaltime);
|
---|
| 22 | + this->parameters->FindParam(&Delta18oLgm,SurfaceforcingsDelta18oEnum,(finaltime-(21000*yts)));
|
---|
| 23 | + this->parameters->FindParam(&Delta18oTime,SurfaceforcingsDelta18oEnum,time);
|
---|
| 24 | + this->parameters->FindParam(&Delta18oSurfacePresent,SurfaceforcingsDelta18oSurfaceEnum,finaltime);
|
---|
| 25 | + this->parameters->FindParam(&Delta18oSurfaceLgm,SurfaceforcingsDelta18oSurfaceEnum,(finaltime-(21000*yts)));
|
---|
| 26 | + this->parameters->FindParam(&Delta18oSurfaceTime,SurfaceforcingsDelta18oSurfaceEnum,time);
|
---|
| 27 | +
|
---|
| 28 | /*Compute the temperature and precipitation*/
|
---|
| 29 | for(int iv=0;iv<NUMVERTICES;iv++){
|
---|
| 30 | ComputeDelta18oTemperaturePrecipitation(Delta18oSurfacePresent, Delta18oSurfaceLgm, Delta18oSurfaceTime,
|
---|
| 31 | @@ -949,16 +949,17 @@
|
---|
| 32 | &TemperaturesLgm[iv][0], &TemperaturesPresentday[iv][0],
|
---|
| 33 | &monthlytemperatures[iv][0], &monthlyprec[iv][0]);
|
---|
| 34 | }
|
---|
| 35 | + //if(id==1) printf(" monthlytemperatures1 %f\n",monthlytemperatures[iv][0]);
|
---|
| 36 | + //if(id==1) printf(" monthlyprec1 %f\n",monthlyprec[iv][0]*yts);
|
---|
| 37 | /*Update inputs*/
|
---|
| 38 | TransientInput* NewTemperatureInput = new TransientInput(SurfaceforcingsMonthlytemperaturesEnum);
|
---|
| 39 | TransientInput* NewPrecipitationInput = new TransientInput(SurfaceforcingsPrecipitationEnum);
|
---|
| 40 | for (int imonth=0;imonth<12;imonth++) {
|
---|
| 41 | - for(int iv=0;iv<NUMVERTICES;iv++) {
|
---|
| 42 | - TriaP1Input* newmonthinput1 = new TriaP1Input(SurfaceforcingsMonthlytemperaturesEnum,&monthlytemperatures[iv][imonth]);
|
---|
| 43 | - NewTemperatureInput->AddTimeInput(newmonthinput1,imonth/12.*yts);
|
---|
| 44 | - TriaP1Input* newmonthinput2 = new TriaP1Input(SurfaceforcingsPrecipitationEnum,&monthlyprec[iv][imonth]);
|
---|
| 45 | - NewPrecipitationInput->AddTimeInput(newmonthinput2,imonth/12.*yts);
|
---|
| 46 | - }
|
---|
| 47 | + TriaP1Input* newmonthinput1 = new TriaP1Input(SurfaceforcingsMonthlytemperaturesEnum,&TemperaturesPresentday[0][imonth]);
|
---|
| 48 | + //TriaP1Input* newmonthinput1 = new TriaP1Input(SurfaceforcingsMonthlytemperaturesEnum,&monthlytemperatures[0][imonth]);
|
---|
| 49 | + NewTemperatureInput->AddTimeInput(newmonthinput1,time+imonth/12.*yts);
|
---|
| 50 | + TriaP1Input* newmonthinput2 = new TriaP1Input(SurfaceforcingsPrecipitationEnum,&monthlyprec[0][imonth]);
|
---|
| 51 | + NewPrecipitationInput->AddTimeInput(newmonthinput2,time+imonth/12.*yts);
|
---|
| 52 | }
|
---|
| 53 | this->inputs->AddInput(NewTemperatureInput);
|
---|
| 54 | this->inputs->AddInput(NewPrecipitationInput);
|
---|
| 55 | @@ -1384,7 +1385,7 @@
|
---|
| 56 | void Tria::InputToResult(int enum_type,int step,IssmDouble time){
|
---|
| 57 |
|
---|
| 58 | int i;
|
---|
| 59 | - Input *input = NULL;
|
---|
| 60 | + Input *input = NULL;
|
---|
| 61 |
|
---|
| 62 | /*Go through all the input objects, and find the one corresponding to enum_type, if it exists: */
|
---|
| 63 | if (enum_type==MaterialsRheologyBbarEnum) input=this->matice->inputs->GetInput(enum_type);
|
---|
| 64 | @@ -2153,7 +2154,7 @@
|
---|
| 65 |
|
---|
| 66 | IssmDouble agd[NUMVERTICES]; // surface mass balance
|
---|
| 67 | IssmDouble monthlytemperatures[NUMVERTICES][12],monthlyprec[NUMVERTICES][12];
|
---|
| 68 | - IssmDouble h[NUMVERTICES],s[NUMVERTICES]; // ,b
|
---|
| 69 | + IssmDouble h[NUMVERTICES],s[NUMVERTICES];
|
---|
| 70 | IssmDouble rho_water,rho_ice;
|
---|
| 71 |
|
---|
| 72 | /*Recover monthly temperatures and precipitation*/
|
---|
| 73 | @@ -2169,7 +2170,7 @@
|
---|
| 74 | input->GetInputValue(&monthlytemperatures[iv][month],gauss,time+month/12.*yts);
|
---|
| 75 | monthlytemperatures[iv][month]=monthlytemperatures[iv][month]-273.15; // conversion from Kelvin to celcius
|
---|
| 76 | input2->GetInputValue(&monthlyprec[iv][month],gauss,time+month/12.*yts);
|
---|
| 77 | - monthlyprec[iv][month]=monthlyprec[iv][month]*yts; // convertion to m/yr
|
---|
| 78 | + monthlyprec[iv][month]=monthlyprec[iv][month]*yts; // convertion in m/y
|
---|
| 79 | }
|
---|
| 80 | }
|
---|
| 81 |
|
---|
| 82 | @@ -2181,6 +2182,9 @@
|
---|
| 83 | rho_ice=matpar->GetRhoIce();
|
---|
| 84 | rho_water=matpar->GetRhoFreshwater();
|
---|
| 85 |
|
---|
| 86 | + //if(id==1) printf(" monthlytemperatures %f\n",monthlytemperatures[1][0]);
|
---|
| 87 | + //if(id==1) printf("monthlyprec %f\n",monthlyprec[1][0]);
|
---|
| 88 | +
|
---|
| 89 | /*measure the surface mass balance*/
|
---|
| 90 | for (int iv = 0; iv<NUMVERTICES; iv++){
|
---|
| 91 | agd[iv]=PddSurfaceMassBlance(&monthlytemperatures[iv][0], &monthlyprec[iv][0], pdds, pds, signorm, yts, h[iv], s[iv], rho_ice, rho_water);
|
---|