source:
issm/oecreview/Archive/19101-20495/ISSM-19136-19137.diff@
20498
Last change on this file since 20498 was 20498, checked in by , 9 years ago | |
---|---|
File size: 5.5 KB |
-
../trunk-jpl/src/c/classes/Elements/Tria.cpp
2573 2573 int i; 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 :*/ 2582 2584 rho_water=matpar->GetMaterialParameter(MaterialsRhoSeawaterEnum); … … 2589 2591 rlaps=matpar->GetMaterialParameter(SurfaceforcingsRlapsEnum); 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); 2595 2597 GaussTria* gauss=new GaussTria(); … … 2597 2599 this->parameters->FindParam(&time,TimeEnum); 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: 2611 2613 This parameters are used to interpolate the temperature … … 2625 2627 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*/ 2635 2637 // TransientInput* NewTemperatureInput = new TransientInput(SurfaceforcingsMonthlytemperaturesEnum); … … 2647 2649 // NewPrecipitationInput->Configure(this->parameters); 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); 2653 2656 // this->inputs->AddInput(new TriaVertexInput(ThermalSpcTemperatureEnum,&Tsurf[0])); -
../trunk-jpl/src/c/classes/Elements/Penta.cpp
2165 2165 int i; 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 :*/ 2174 2176 rho_water=matpar->GetMaterialParameter(MaterialsRhoSeawaterEnum); … … 2193 2195 for(int iv=0;iv<NUMVERTICES;iv++) { 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 } 2199 2202 } … … 2240 2243 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); 2245 2249 // this->inputs->AddInput(NewPrecipitationInput); 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); 2250 2255
Note:
See TracBrowser
for help on using the repository browser.