Changeset 12885


Ignore:
Timestamp:
08/03/12 10:00:46 (13 years ago)
Author:
lemorzad
Message:

isdelta18o update

Location:
issm/trunk-jpl/src/c/classes/objects/Elements
Files:
2 edited

Legend:

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

    r12832 r12885  
    687687/*FUNCTION Penta::Delta18oParameterization{{{*/
    688688void  Penta::Delta18oParameterization(void){
    689 
     689        /*Are we on the base? If not, return*/
     690        if(!IsOnBed()) return;
     691
     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;
     
    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();
     
    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*/
     
    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                 }
    742         }
     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);
     747        }
     748
    743749        this->inputs->AddInput(NewTemperatureInput);
    744750        this->inputs->AddInput(NewPrecipitationInput);
     751
     752        this->InputExtrude(SurfaceforcingsMonthlytemperaturesEnum,ElementEnum);
     753        this->InputExtrude(SurfaceforcingsPrecipitationEnum,ElementEnum);
    745754
    746755        /*clean-up*/
  • issm/trunk-jpl/src/c/classes/objects/Elements/Tria.cpp

    r12870 r12885  
    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;
     
    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);
Note: See TracChangeset for help on using the changeset viewer.