source:
issm/oecreview/Archive/12678-13393/ISSM-12865-12866.diff@
13394
Last change on this file since 13394 was 13394, checked in by , 13 years ago | |
---|---|
File size: 5.4 KB |
-
u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Elements/Tria.cpp
930 930 input->GetInputValue(&TemperaturesPresentday[iv][month],gauss,month/12.*yts); 931 931 input2->GetInputValue(&TemperaturesLgm[iv][month],gauss,month/12.*yts); 932 932 input3->GetInputValue(&PrecipitationsPresentday[iv][month],gauss,month/12.*yts); 933 monthlyprec[iv][month]=monthlyprec[iv][month]*yts; // convertion to m/yr933 PrecipitationsPresentday[iv][month]=PrecipitationsPresentday[iv][month]/yts; // converion in m/sec 934 934 } 935 935 } 936 936 /*Recover delta18o and Delta18oSurface at present day, lgm and at time t*/ 937 this->parameters->FindParam(&Delta18oPresent,SurfaceforcingsDelta18oEnum,finaltime *yts);938 this->parameters->FindParam(&Delta18oLgm,SurfaceforcingsDelta18oEnum,(finaltime-21000)*yts);939 this->parameters->FindParam(&Delta18oTime,SurfaceforcingsDelta18oEnum,time *yts);940 this->parameters->FindParam(&Delta18oSurfacePresent,SurfaceforcingsDelta18oSurfaceEnum,finaltime *yts);941 this->parameters->FindParam(&Delta18oSurfaceLgm,SurfaceforcingsDelta18oSurfaceEnum,(finaltime- 21000)*yts);942 this->parameters->FindParam(&Delta18oSurfaceTime,SurfaceforcingsDelta18oSurfaceEnum,time *yts);943 937 this->parameters->FindParam(&Delta18oPresent,SurfaceforcingsDelta18oEnum,finaltime); 938 this->parameters->FindParam(&Delta18oLgm,SurfaceforcingsDelta18oEnum,(finaltime-(21000*yts))); 939 this->parameters->FindParam(&Delta18oTime,SurfaceforcingsDelta18oEnum,time); 940 this->parameters->FindParam(&Delta18oSurfacePresent,SurfaceforcingsDelta18oSurfaceEnum,finaltime); 941 this->parameters->FindParam(&Delta18oSurfaceLgm,SurfaceforcingsDelta18oSurfaceEnum,(finaltime-(21000*yts))); 942 this->parameters->FindParam(&Delta18oSurfaceTime,SurfaceforcingsDelta18oSurfaceEnum,time); 943 944 944 /*Compute the temperature and precipitation*/ 945 945 for(int iv=0;iv<NUMVERTICES;iv++){ 946 946 ComputeDelta18oTemperaturePrecipitation(Delta18oSurfacePresent, Delta18oSurfaceLgm, Delta18oSurfaceTime, … … 949 949 &TemperaturesLgm[iv][0], &TemperaturesPresentday[iv][0], 950 950 &monthlytemperatures[iv][0], &monthlyprec[iv][0]); 951 951 } 952 //if(id==1) printf(" monthlytemperatures1 %f\n",monthlytemperatures[iv][0]); 953 //if(id==1) printf(" monthlyprec1 %f\n",monthlyprec[iv][0]*yts); 952 954 /*Update inputs*/ 953 955 TransientInput* NewTemperatureInput = new TransientInput(SurfaceforcingsMonthlytemperaturesEnum); 954 956 TransientInput* NewPrecipitationInput = new TransientInput(SurfaceforcingsPrecipitationEnum); 955 957 for (int imonth=0;imonth<12;imonth++) { 956 for(int iv=0;iv<NUMVERTICES;iv++) { 957 TriaP1Input* newmonthinput1 = new TriaP1Input(SurfaceforcingsMonthlytemperaturesEnum,&monthlytemperatures[iv][imonth]); 958 NewTemperatureInput->AddTimeInput(newmonthinput1,imonth/12.*yts); 959 TriaP1Input* newmonthinput2 = new TriaP1Input(SurfaceforcingsPrecipitationEnum,&monthlyprec[iv][imonth]); 960 NewPrecipitationInput->AddTimeInput(newmonthinput2,imonth/12.*yts); 961 } 958 TriaP1Input* newmonthinput1 = new TriaP1Input(SurfaceforcingsMonthlytemperaturesEnum,&TemperaturesPresentday[0][imonth]); 959 //TriaP1Input* newmonthinput1 = new TriaP1Input(SurfaceforcingsMonthlytemperaturesEnum,&monthlytemperatures[0][imonth]); 960 NewTemperatureInput->AddTimeInput(newmonthinput1,time+imonth/12.*yts); 961 TriaP1Input* newmonthinput2 = new TriaP1Input(SurfaceforcingsPrecipitationEnum,&monthlyprec[0][imonth]); 962 NewPrecipitationInput->AddTimeInput(newmonthinput2,time+imonth/12.*yts); 962 963 } 963 964 this->inputs->AddInput(NewTemperatureInput); 964 965 this->inputs->AddInput(NewPrecipitationInput); … … 1384 1385 void Tria::InputToResult(int enum_type,int step,IssmDouble time){ 1385 1386 1386 1387 int i; 1387 Input *input = NULL; 1388 Input *input = NULL; 1388 1389 1389 1390 /*Go through all the input objects, and find the one corresponding to enum_type, if it exists: */ 1390 1391 if (enum_type==MaterialsRheologyBbarEnum) input=this->matice->inputs->GetInput(enum_type); … … 2153 2154 2154 2155 IssmDouble agd[NUMVERTICES]; // surface mass balance 2155 2156 IssmDouble monthlytemperatures[NUMVERTICES][12],monthlyprec[NUMVERTICES][12]; 2156 IssmDouble h[NUMVERTICES],s[NUMVERTICES]; // ,b2157 IssmDouble h[NUMVERTICES],s[NUMVERTICES]; 2157 2158 IssmDouble rho_water,rho_ice; 2158 2159 2159 2160 /*Recover monthly temperatures and precipitation*/ … … 2169 2170 input->GetInputValue(&monthlytemperatures[iv][month],gauss,time+month/12.*yts); 2170 2171 monthlytemperatures[iv][month]=monthlytemperatures[iv][month]-273.15; // conversion from Kelvin to celcius 2171 2172 input2->GetInputValue(&monthlyprec[iv][month],gauss,time+month/12.*yts); 2172 monthlyprec[iv][month]=monthlyprec[iv][month]*yts; // convertion to m/yr2173 monthlyprec[iv][month]=monthlyprec[iv][month]*yts; // convertion in m/y 2173 2174 } 2174 2175 } 2175 2176 … … 2181 2182 rho_ice=matpar->GetRhoIce(); 2182 2183 rho_water=matpar->GetRhoFreshwater(); 2183 2184 2185 //if(id==1) printf(" monthlytemperatures %f\n",monthlytemperatures[1][0]); 2186 //if(id==1) printf("monthlyprec %f\n",monthlyprec[1][0]); 2187 2184 2188 /*measure the surface mass balance*/ 2185 2189 for (int iv = 0; iv<NUMVERTICES; iv++){ 2186 2190 agd[iv]=PddSurfaceMassBlance(&monthlytemperatures[iv][0], &monthlyprec[iv][0], pdds, pds, signorm, yts, h[iv], s[iv], rho_ice, rho_water);
Note:
See TracBrowser
for help on using the repository browser.