Changeset 19137
- Timestamp:
- 02/20/15 09:27:26 (10 years ago)
- Location:
- issm/trunk-jpl/src/c/classes/Elements
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified issm/trunk-jpl/src/c/classes/Elements/Penta.cpp ¶
r19061 r19137 2166 2166 IssmDouble agd[NUMVERTICES]; // surface mass balance 2167 2167 IssmDouble monthlytemperatures[NUMVERTICES][12],monthlyprec[NUMVERTICES][12]; 2168 IssmDouble yearlytemperatures[NUMVERTICES]={0.}; 2168 2169 IssmDouble tmp[NUMVERTICES]; 2169 2170 IssmDouble h[NUMVERTICES],s[NUMVERTICES]; 2170 2171 IssmDouble rho_water,rho_ice,desfac,s0p,s0t,rlaps,rlapslgm; 2171 2172 IssmDouble PfacTime,TdiffTime,sealevTime; 2173 IssmDouble mavg=1./12.; //factor for monthly average 2172 2174 2173 2175 /*Get material parameters :*/ … … 2194 2196 gauss->GaussVertex(iv); 2195 2197 input->GetInputValue(&monthlytemperatures[iv][month],gauss,time+month/12.*yts); 2196 monthlytemperatures[iv][month]=monthlytemperatures[iv][month]-273.15; // conversion from Kelvin to celcius 2198 yearlytemperatures[iv]=yearlytemperatures[iv]+monthlytemperatures[iv][month]*mavg; // Has to be in Kelvin 2199 monthlytemperatures[iv][month]=monthlytemperatures[iv][month]-273.15; // conversion from Kelvin to celcius for PDD module 2197 2200 input2->GetInputValue(&monthlyprec[iv][month],gauss,time+month/12.*yts); 2198 2201 } … … 2241 2244 2242 2245 2246 this->inputs->AddInput(new PentaInput(TemperatureEnum,&yearlytemperatures[0],P1Enum)); 2243 2247 this->inputs->AddInput(new PentaInput(SurfaceforcingsMassBalanceEnum,&agd[0],P1Enum)); 2244 2248 // this->inputs->AddInput(NewTemperatureInput); … … 2246 2250 // //this->inputs->AddInput(new PentaVertexInput(ThermalSpcTemperatureEnum,&Tsurf[0])); 2247 2251 this->InputExtrude(SurfaceforcingsMassBalanceEnum,-1); 2252 this->InputExtrude(TemperatureEnum,-1); 2248 2253 // this->InputExtrude(SurfaceforcingsMonthlytemperaturesEnum,-1); 2249 2254 // this->InputExtrude(SurfaceforcingsPrecipitationEnum,-1); -
TabularUnified issm/trunk-jpl/src/c/classes/Elements/Tria.cpp ¶
r19094 r19137 2574 2574 IssmDouble agd[NUMVERTICES]; // surface mass balance 2575 2575 IssmDouble monthlytemperatures[NUMVERTICES][12],monthlyprec[NUMVERTICES][12]; 2576 IssmDouble yearlytemperatures[NUMVERTICES]={0.}; 2576 2577 IssmDouble tmp[NUMVERTICES]; 2577 2578 IssmDouble h[NUMVERTICES],s[NUMVERTICES]; 2578 2579 IssmDouble rho_water,rho_ice,desfac,s0p,s0t,rlaps,rlapslgm; 2579 2580 IssmDouble PfacTime,TdiffTime,sealevTime; 2581 IssmDouble mavg=1./12.; //factor for monthly average 2580 2582 2581 2583 /*Get material parameters :*/ … … 2590 2592 rlapslgm=matpar->GetMaterialParameter(SurfaceforcingsRlapslgmEnum); 2591 2593 2592 /*Recover monthly temperatures and precipitation and Present day and LGm ones*/2594 /*Recover monthly temperatures and precipitation and compute the yearly mean temperatures*/ 2593 2595 Input* input=inputs->GetInput(SurfaceforcingsMonthlytemperaturesEnum); _assert_(input); 2594 2596 Input* input2=inputs->GetInput(SurfaceforcingsPrecipitationEnum); _assert_(input2); … … 2598 2600 this->parameters->FindParam(&yts,ConstantsYtsEnum); 2599 2601 2600 2601 2602 for(int month=0;month<12;month++) { 2602 2603 for(int iv=0;iv<NUMVERTICES;iv++) { 2603 2604 gauss->GaussVertex(iv); 2604 2605 input->GetInputValue(&monthlytemperatures[iv][month],gauss,time+month/12.*yts); 2605 monthlytemperatures[iv][month]=monthlytemperatures[iv][month]-273.15; // conversion from Kelvin to celcius 2606 yearlytemperatures[iv]=yearlytemperatures[iv]+monthlytemperatures[iv][month]*mavg; // Has to be in Kelvin 2607 monthlytemperatures[iv][month]=monthlytemperatures[iv][month]-273.15; // conversion from Kelvin to celcius for PDD module 2606 2608 input2->GetInputValue(&monthlyprec[iv][month],gauss,time+month/12.*yts); 2607 2609 } 2608 } 2610 } 2609 2611 2610 2612 /*Recover Pfac, Tdiff and sealev at time t: … … 2626 2628 /*measure the surface mass balance*/ 2627 2629 for (int iv = 0; iv<NUMVERTICES; iv++){ 2628 2630 agd[iv]=PddSurfaceMassBalance(&monthlytemperatures[iv][0], &monthlyprec[iv][0], 2629 2631 pdds, pds, signorm, yts, h[iv], s[iv], 2630 2632 desfac, s0t, s0p,rlaps,rlapslgm,TdiffTime,sealevTime, 2631 2633 rho_water,rho_ice); 2632 2634 } 2633 2635 2634 2636 /*Update inputs*/ … … 2648 2650 2649 2651 2650 this->inputs->AddInput(new TriaInput(SurfaceforcingsMassBalanceEnum,&agd[0],P1Enum)); 2652 this->inputs->AddInput(new TriaInput(TemperatureEnum,&yearlytemperatures[0],P1Enum)); 2653 this->inputs->AddInput(new TriaInput(SurfaceforcingsMassBalanceEnum,&agd[0],P1Enum)); 2651 2654 // this->inputs->AddInput(NewTemperatureInput); 2652 2655 // this->inputs->AddInput(NewPrecipitationInput);
Note:
See TracChangeset
for help on using the changeset viewer.