source: issm/oecreview/Archive/12678-13393/ISSM-12884-12885.diff@ 14312

Last change on this file since 14312 was 13394, checked in by Mathieu Morlighem, 13 years ago

Added 12678-13393

File size: 6.5 KB
  • u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Elements/Tria.cpp

     
    914914        IssmDouble monthlytemperatures[NUMVERTICES][12],monthlyprec[NUMVERTICES][12];
    915915        IssmDouble TemperaturesPresentday[NUMVERTICES][12],TemperaturesLgm[NUMVERTICES][12];
    916916        IssmDouble PrecipitationsPresentday[NUMVERTICES][12];
    917         IssmDouble temp[NUMVERTICES];
     917        IssmDouble tmp[NUMVERTICES];
    918918        IssmDouble Delta18oPresent,Delta18oLgm,Delta18oTime;
    919919        IssmDouble Delta18oSurfacePresent,Delta18oSurfaceLgm,Delta18oSurfaceTime;
    920920        IssmDouble time,yts,finaltime;
     
    960960        TransientInput* NewTemperatureInput = new TransientInput(SurfaceforcingsMonthlytemperaturesEnum);
    961961        TransientInput* NewPrecipitationInput = new TransientInput(SurfaceforcingsPrecipitationEnum);
    962962        for (int imonth=0;imonth<12;imonth++) {
    963                 for(i=0;i<NUMVERTICES;i++) temp[i]=TemperaturesPresentday[i][imonth];
    964                 TriaP1Input* newmonthinput1 = new TriaP1Input(SurfaceforcingsMonthlytemperaturesEnum,&temp[0]);
    965                 //TriaP1Input* newmonthinput1 = new TriaP1Input(SurfaceforcingsMonthlytemperaturesEnum,&monthlytemperatures[0][imonth]);
     963                for(i=0;i<NUMVERTICES;i++) tmp[i]=monthlytemperatures[i][imonth];
     964                TriaP1Input* newmonthinput1 = new TriaP1Input(SurfaceforcingsMonthlytemperaturesEnum,&tmp[0]);
    966965                NewTemperatureInput->AddTimeInput(newmonthinput1,time+imonth/12.*yts);
    967                 for(i=0;i<NUMVERTICES;i++) temp[i]=monthlyprec[i][imonth];
    968                 TriaP1Input* newmonthinput2 = new TriaP1Input(SurfaceforcingsPrecipitationEnum,&temp[0]);
     966
     967                for(i=0;i<NUMVERTICES;i++) tmp[i]=monthlyprec[i][imonth];
     968                TriaP1Input* newmonthinput2 = new TriaP1Input(SurfaceforcingsPrecipitationEnum,&tmp[0]);
    969969                NewPrecipitationInput->AddTimeInput(newmonthinput2,time+imonth/12.*yts);
    970970        }
     971
    971972        this->inputs->AddInput(NewTemperatureInput);
    972973        this->inputs->AddInput(NewPrecipitationInput);
    973974
  • u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Elements/Penta.cpp

     
    686686/*}}}*/
    687687/*FUNCTION Penta::Delta18oParameterization{{{*/
    688688void  Penta::Delta18oParameterization(void){
     689        /*Are we on the base? If not, return*/
     690        if(!IsOnBed()) return;
    689691
     692        int        i;
    690693        IssmDouble monthlytemperatures[NUMVERTICES][12],monthlyprec[NUMVERTICES][12];
    691694        IssmDouble TemperaturesPresentday[NUMVERTICES][12],TemperaturesLgm[NUMVERTICES][12];
    692695        IssmDouble PrecipitationsPresentday[NUMVERTICES][12];
     696        IssmDouble tmp[NUMVERTICES];
    693697        IssmDouble Delta18oPresent,Delta18oLgm,Delta18oTime;
    694698        IssmDouble Delta18oSurfacePresent,Delta18oSurfaceLgm,Delta18oSurfaceTime;
    695699        IssmDouble time,yts,finaltime;
     
    698702        this->parameters->FindParam(&finaltime,TimesteppingFinalTimeEnum);
    699703
    700704        /*Recover present day temperature and precipitation*/
    701         Input*     input=inputs->GetInput(SurfaceforcingsTemperaturesPresentdayEnum); _assert_(input);
    702         Input*     input2=inputs->GetInput(SurfaceforcingsTemperaturesLgmEnum); _assert_(input2);
     705        Input*     input=inputs->GetInput(SurfaceforcingsTemperaturesPresentdayEnum);    _assert_(input);
     706        Input*     input2=inputs->GetInput(SurfaceforcingsTemperaturesLgmEnum);          _assert_(input2);
    703707        Input*     input3=inputs->GetInput(SurfaceforcingsPrecipitationsPresentdayEnum); _assert_(input3);
    704708        GaussPenta* gauss=new GaussPenta();
    705709        for(int month=0;month<12;month++) {
     
    713717        }
    714718
    715719        /*Recover delta18o and Delta18oSurface at present day, lgm and at time t*/
    716         this->parameters->FindParam(&Delta18oPresent,SurfaceforcingsDelta18oEnum,finaltime*yts);
    717         this->parameters->FindParam(&Delta18oLgm,SurfaceforcingsDelta18oEnum,(finaltime-21000)*yts);
    718         this->parameters->FindParam(&Delta18oTime,SurfaceforcingsDelta18oEnum,time*yts);
    719         this->parameters->FindParam(&Delta18oSurfacePresent,SurfaceforcingsDelta18oSurfaceEnum,finaltime*yts);
    720         this->parameters->FindParam(&Delta18oSurfaceLgm,SurfaceforcingsDelta18oSurfaceEnum,(finaltime-21000)*yts);
    721         this->parameters->FindParam(&Delta18oSurfaceTime,SurfaceforcingsDelta18oSurfaceEnum,time*yts);
     720        this->parameters->FindParam(&Delta18oPresent,SurfaceforcingsDelta18oEnum,finaltime);
     721        this->parameters->FindParam(&Delta18oLgm,SurfaceforcingsDelta18oEnum,finaltime-(21000*yts));
     722        this->parameters->FindParam(&Delta18oTime,SurfaceforcingsDelta18oEnum,time);
     723        this->parameters->FindParam(&Delta18oSurfacePresent,SurfaceforcingsDelta18oSurfaceEnum,finaltime);
     724        this->parameters->FindParam(&Delta18oSurfaceLgm,SurfaceforcingsDelta18oSurfaceEnum,finaltime-(21000*yts));
     725        this->parameters->FindParam(&Delta18oSurfaceTime,SurfaceforcingsDelta18oSurfaceEnum,time);
    722726
    723727        /*Compute the temperature and precipitation*/
    724728        for(int iv=0;iv<NUMVERTICES;iv++){
     
    733737        TransientInput* NewTemperatureInput = new TransientInput(SurfaceforcingsMonthlytemperaturesEnum);
    734738        TransientInput* NewPrecipitationInput = new TransientInput(SurfaceforcingsPrecipitationEnum);
    735739        for (int imonth=0;imonth<12;imonth++) {
    736                 for(int iv=0;iv<NUMVERTICES;iv++) {
    737                         PentaP1Input* newmonthinput1 = new PentaP1Input(SurfaceforcingsMonthlytemperaturesEnum,&monthlytemperatures[iv][imonth]);
    738                         NewTemperatureInput->AddTimeInput(newmonthinput1,imonth/12.*yts);
    739                         PentaP1Input* newmonthinput2 = new PentaP1Input(SurfaceforcingsPrecipitationEnum,&monthlyprec[iv][imonth]);
    740                         NewPrecipitationInput->AddTimeInput(newmonthinput2,imonth/12.*yts);
    741                 }
     740                for(i=0;i<NUMVERTICES;i++) tmp[i]=monthlytemperatures[i][imonth];
     741                PentaP1Input* newmonthinput1 = new PentaP1Input(SurfaceforcingsMonthlytemperaturesEnum,&tmp[0]);
     742                NewTemperatureInput->AddTimeInput(newmonthinput1,time+imonth/12.*yts);
     743
     744                for(i=0;i<NUMVERTICES;i++) tmp[i]=monthlyprec[i][imonth];
     745                PentaP1Input* newmonthinput2 = new PentaP1Input(SurfaceforcingsPrecipitationEnum,&tmp[0]);
     746                NewPrecipitationInput->AddTimeInput(newmonthinput2,time+imonth/12.*yts);
    742747        }
     748
    743749        this->inputs->AddInput(NewTemperatureInput);
    744750        this->inputs->AddInput(NewPrecipitationInput);
    745751
     752        this->InputExtrude(SurfaceforcingsMonthlytemperaturesEnum,ElementEnum);
     753        this->InputExtrude(SurfaceforcingsPrecipitationEnum,ElementEnum);
     754
    746755        /*clean-up*/
    747756        delete gauss;
    748757}
Note: See TracBrowser for help on using the repository browser.