Changeset 12866
- Timestamp:
- 08/02/12 08:45:54 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/c/classes/objects/Elements/Tria.cpp
r12832 r12866 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++){ … … 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); … … 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: */ … … 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 … … 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 } … … 2181 2182 rho_ice=matpar->GetRhoIce(); 2182 2183 rho_water=matpar->GetRhoFreshwater(); 2184 2185 //if(id==1) printf(" monthlytemperatures %f\n",monthlytemperatures[1][0]); 2186 //if(id==1) printf("monthlyprec %f\n",monthlyprec[1][0]); 2183 2187 2184 2188 /*measure the surface mass balance*/
Note:
See TracChangeset
for help on using the changeset viewer.