Changeset 12866


Ignore:
Timestamp:
08/02/12 08:45:54 (13 years ago)
Author:
lemorzad
Message:

delta18o update

File:
1 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/src/c/classes/objects/Elements/Tria.cpp

    r12832 r12866  
    931931                        input2->GetInputValue(&TemperaturesLgm[iv][month],gauss,month/12.*yts);
    932932                        input3->GetInputValue(&PrecipitationsPresentday[iv][month],gauss,month/12.*yts);
    933                         monthlyprec[iv][month]=monthlyprec[iv][month]*yts; // convertion to m/yr
     933                        PrecipitationsPresentday[iv][month]=PrecipitationsPresentday[iv][month]/yts; // converion in m/sec
    934934                }
    935935        }
    936936        /*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       
    944944        /*Compute the temperature and precipitation*/
    945945        for(int iv=0;iv<NUMVERTICES;iv++){
     
    950950                                        &monthlytemperatures[iv][0], &monthlyprec[iv][0]);
    951951        }
     952        //if(id==1)     printf(" monthlytemperatures1 %f\n",monthlytemperatures[iv][0]);
     953        //if(id==1)     printf(" monthlyprec1 %f\n",monthlyprec[iv][0]*yts);
    952954        /*Update inputs*/
    953955        TransientInput* NewTemperatureInput = new TransientInput(SurfaceforcingsMonthlytemperaturesEnum);
    954956        TransientInput* NewPrecipitationInput = new TransientInput(SurfaceforcingsPrecipitationEnum);
    955957        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);
    962963        }
    963964        this->inputs->AddInput(NewTemperatureInput);
     
    13851386
    13861387        int    i;
    1387         Input *input = NULL;
     1388        Input *input = NULL;   
    13881389
    13891390        /*Go through all the input objects, and find the one corresponding to enum_type, if it exists: */
     
    21542155   IssmDouble agd[NUMVERTICES];             // surface mass balance
    21552156   IssmDouble monthlytemperatures[NUMVERTICES][12],monthlyprec[NUMVERTICES][12];
    2156    IssmDouble h[NUMVERTICES],s[NUMVERTICES]; // ,b
     2157   IssmDouble h[NUMVERTICES],s[NUMVERTICES];
    21572158   IssmDouble rho_water,rho_ice;
    21582159
     
    21702171       monthlytemperatures[iv][month]=monthlytemperatures[iv][month]-273.15; // conversion from Kelvin to celcius
    21712172       input2->GetInputValue(&monthlyprec[iv][month],gauss,time+month/12.*yts);
    2172        monthlyprec[iv][month]=monthlyprec[iv][month]*yts; // convertion to m/yr
     2173       monthlyprec[iv][month]=monthlyprec[iv][month]*yts; // convertion in m/y
    21732174     }
    21742175   }
     
    21812182  rho_ice=matpar->GetRhoIce();
    21822183  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]);
    21832187
    21842188   /*measure the surface mass balance*/
Note: See TracChangeset for help on using the changeset viewer.