Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/matlab/install.sh =================================================================== --- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/matlab/install.sh (revision 12747) +++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/matlab/install.sh (revision 12748) @@ -4,12 +4,14 @@ rm -rf install #Select or create a new simlink -ln -s /usr/local/pkgs/matlab-7.6/ install +#ln -s /usr/local/pkgs/matlab-7.6/ install #ln -s /discover/vis/mathworks/matlab_r2011b/ install #ln -s /usr/local/matlab704/ install #ln -s /usr/local/matlab711/ install #ln -s /usr/local/matlab712/ install +ln -s /home/kevin/perso.dir/matlab10 install + # Macintosh (OSX) simlink #ln -s /Applications/MATLAB_R2008a/ install #ln -s /Applications/MATLAB_R2009a.app/ install Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/prognostic_core.cpp =================================================================== --- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/prognostic_core.cpp (revision 12747) +++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/prognostic_core.cpp (revision 12748) @@ -15,7 +15,6 @@ /*parameters: */ bool save_results; - bool ispdd; bool issmbgradients; /*activate formulation: */ @@ -23,13 +22,8 @@ /*recover parameters: */ femmodel->parameters->FindParam(&save_results,SaveResultsEnum); - femmodel->parameters->FindParam(&ispdd,SurfaceforcingsIspddEnum); femmodel->parameters->FindParam(&issmbgradients,SurfaceforcingsIssmbgradientsEnum); - if(ispdd){ - if(VerboseSolution()) _pprintLine_(" call positive degree day module"); - PositiveDegreeDayx(femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters); - } if(issmbgradients){ _printf_(VerboseSolution()," call smb gradients module\n"); Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/transient_core.cpp =================================================================== --- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/transient_core.cpp (revision 12747) +++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/solutions/transient_core.cpp (revision 12748) @@ -23,7 +23,7 @@ /*parameters: */ IssmDouble starttime,finaltime,dt,yts; - bool isdiagnostic,isprognostic,isthermal,isgroundingline,isenthalpy; + bool isdiagnostic,isprognostic,isthermal,isgroundingline,isenthalpy,ispdd,isdelta18o; bool save_results,dakota_analysis; bool time_adapt=false; int output_frequency; @@ -52,6 +52,8 @@ if(isgroundingline) femmodel->parameters->FindParam(&groundingline_migration,GroundinglineMigrationEnum); femmodel->parameters->FindParam(&numoutputs,TransientNumRequestedOutputsEnum); if(numoutputs) femmodel->parameters->FindParam(&requested_outputs,&numoutputs,TransientRequestedOutputsEnum); + femmodel->parameters->FindParam(&ispdd,SurfaceforcingsIspddEnum); + femmodel->parameters->FindParam(&isdelta18o,SurfaceforcingsIsdelta18oEnum); /*initialize: */ step=0; @@ -105,6 +107,15 @@ _error2_("ISSM was not compiled with thermal capabilities. Exiting"); #endif } + + if(ispdd){ + if(isdelta18o){ + if(VerboseSolution()) _pprintLine_(" call Delta18oParametrization module"); + Delta18oParameterizationx(femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters); + } + if(VerboseSolution()) _pprintLine_(" call positive degree day module"); + PositiveDegreeDayx(femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters); + } if(isdiagnostic){ if(VerboseSolution()) _pprintLine_(" computing new velocity"); Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/EnumDefinitions/EnumDefinitions.h =================================================================== --- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/EnumDefinitions/EnumDefinitions.h (revision 12747) +++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/EnumDefinitions/EnumDefinitions.h (revision 12748) @@ -148,6 +148,12 @@ SettingsOutputFrequencyEnum, SettingsResultsAsPatchesEnum, SettingsWaitonlockEnum, + SurfaceforcingsDelta18oEnum, + SurfaceforcingsDelta18oTemperaturesPresentdayEnum, + SurfaceforcingsDelta18oTemperaturesLgmEnum, + SurfaceforcingsDelta18oSurfaceEnum, + SurfaceforcingsIsdelta18oEnum, + SurfaceforcingsPrecipitationsPresentdayEnum, DebugProfilingEnum, ProfilingCurrentMemEnum, ProfilingCurrentFlopsEnum, Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Elements/elements.h =================================================================== --- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Elements/elements.h (revision 12747) +++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Elements/elements.h (revision 12748) @@ -12,7 +12,13 @@ IssmDouble Paterson(IssmDouble temperature); IssmDouble Arrhenius(IssmDouble temperature,IssmDouble depth,IssmDouble n); -IssmDouble PddSurfaceMassBlance(IssmDouble* monthlytemperatures, IssmDouble* monthlyprec, IssmDouble* pdds, IssmDouble* pds, IssmDouble signorm, IssmDouble yts, IssmDouble h, IssmDouble s, IssmDouble rho_ice, IssmDouble rho_water); +IssmDouble PddSurfaceMassBlance(IssmDouble* monthlytemperatures, IssmDouble* monthlyprec, IssmDouble* pdds, IssmDouble* pds, + IssmDouble signorm, IssmDouble yts, IssmDouble h, IssmDouble s, IssmDouble rho_ice, IssmDouble rho_water); +void ComputeDelta18oTemperaturePrecipitation(IssmDouble Delta18oSurfacePresent, IssmDouble Delta18oSurfaceLgm, IssmDouble Delta18oSurfaceTime, + IssmDouble Delta18oPresent, IssmDouble Delta18oLgm, IssmDouble Delta18oTime, + IssmDouble* PrecipitationsPresentday, + IssmDouble* Delta18oTemperaturesLgm, IssmDouble* Delta18oTemperaturesPresentday, + IssmDouble* monthlytemperaturesout, IssmDouble* monthlyprecout); void GetVerticesCoordinates(IssmDouble* xyz, Node** nodes, int numvertices); int GetNumberOfDofs( Node** nodes,int numnodes,int setenum,int approximation_enum); int* GetLocalDofList( Node** nodes,int numnodes,int setenum,int approximation_enum); Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Elements/ComputeDelta18oTemperaturePrecipitation.cpp =================================================================== --- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Elements/ComputeDelta18oTemperaturePrecipitation.cpp (revision 0) +++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Elements/ComputeDelta18oTemperaturePrecipitation.cpp (revision 12748) @@ -0,0 +1,30 @@ +/* file: ComputeTemperaturePrecipitation.cpp + Compute the temperature and precipitation at time t from + the data at present day and delta18O + */ + +#include "./elements.h" + +void ComputeDelta18oTemperaturePrecipitation(IssmDouble Delta18oSurfacePresent, IssmDouble Delta18oSurfaceLgm, IssmDouble Delta18oSurfaceTime, + IssmDouble Delta18oPresent, IssmDouble Delta18oLgm, IssmDouble Delta18oTime, + IssmDouble* PrecipitationsPresentday, + IssmDouble* Delta18oTemperaturesLgm, IssmDouble* Delta18oTemperaturesPresentday, + IssmDouble* monthlytemperaturesout, IssmDouble* monthlyprecout){ + + IssmDouble monthlytemperaturestmp[12],monthlyprectmp[12]; + IssmDouble delta18oLapseRate=-6.2*pow(10.,-3); + IssmDouble glacialindex; // used to vary present day temperature + + glacialindex = (Delta18oTime-Delta18oPresent-delta18oLapseRate*(Delta18oSurfaceTime-Delta18oSurfacePresent)) + /(Delta18oLgm-Delta18oPresent-delta18oLapseRate*(Delta18oSurfaceLgm-Delta18oSurfacePresent)); + + for (int imonth = 0; imonth<12; imonth++){ + monthlytemperaturestmp[imonth] = glacialindex*Delta18oTemperaturesLgm[imonth] + (1-glacialindex)*Delta18oTemperaturesPresentday[imonth]; + monthlyprectmp[imonth] = 1.5*pow(2,((monthlytemperaturestmp[imonth]-0)/10)); //equation from rob's paper + /*Assign output pointer*/ + *(monthlytemperaturesout+imonth) = monthlytemperaturestmp[imonth]; + *(monthlyprecout+imonth) = monthlyprectmp[imonth]; + } + + +} Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Elements/PddSurfaceMassBalance.cpp =================================================================== --- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Elements/PddSurfaceMassBalance.cpp (revision 12747) +++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Elements/PddSurfaceMassBalance.cpp (revision 12748) @@ -42,7 +42,7 @@ IssmDouble pdd = 0.; IssmDouble frzndd = 0.; - IssmDouble tstar; // monthly mean surface temp + IssmDouble tstar; // monthly mean surface temp IssmDouble Tsum= 0.; // average summer (JJA) temperature IssmDouble Tsurf = 0.; // average annual temperature Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/StringToEnumx/StringToEnumx.cpp =================================================================== --- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/StringToEnumx/StringToEnumx.cpp (revision 12747) +++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/StringToEnumx/StringToEnumx.cpp (revision 12748) @@ -157,6 +157,12 @@ else if (strcmp(name,"SettingsOutputFrequency")==0) return SettingsOutputFrequencyEnum; else if (strcmp(name,"SettingsResultsAsPatches")==0) return SettingsResultsAsPatchesEnum; else if (strcmp(name,"SettingsWaitonlock")==0) return SettingsWaitonlockEnum; + else if (strcmp(name,"SurfaceforcingsDelta18o")==0) return SurfaceforcingsDelta18oEnum; + else if (strcmp(name,"SurfaceforcingsDelta18oTemperaturesPresentday")==0) return SurfaceforcingsDelta18oTemperaturesPresentdayEnum; + else if (strcmp(name,"SurfaceforcingsDelta18oTemperaturesLgm")==0) return SurfaceforcingsDelta18oTemperaturesLgmEnum; + else if (strcmp(name,"SurfaceforcingsDelta18oSurface")==0) return SurfaceforcingsDelta18oSurfaceEnum; + else if (strcmp(name,"SurfaceforcingsIsdelta18o")==0) return SurfaceforcingsIsdelta18oEnum; + else if (strcmp(name,"SurfaceforcingsPrecipitationsPresentday")==0) return SurfaceforcingsPrecipitationsPresentdayEnum; else if (strcmp(name,"DebugProfiling")==0) return DebugProfilingEnum; else if (strcmp(name,"ProfilingCurrentMem")==0) return ProfilingCurrentMemEnum; else if (strcmp(name,"ProfilingCurrentFlops")==0) return ProfilingCurrentFlopsEnum; @@ -254,16 +260,16 @@ else if (strcmp(name,"Contour")==0) return ContourEnum; else if (strcmp(name,"ControlInput")==0) return ControlInputEnum; else if (strcmp(name,"DatasetInput")==0) return DatasetInputEnum; - else if (strcmp(name,"DofIndexing")==0) return DofIndexingEnum; + else stage=3; + } + if(stage==3){ + if (strcmp(name,"DofIndexing")==0) return DofIndexingEnum; else if (strcmp(name,"DoubleInput")==0) return DoubleInputEnum; else if (strcmp(name,"DoubleMatArrayParam")==0) return DoubleMatArrayParamEnum; else if (strcmp(name,"DoubleMatParam")==0) return DoubleMatParamEnum; else if (strcmp(name,"DoubleParam")==0) return DoubleParamEnum; else if (strcmp(name,"DoubleVecParam")==0) return DoubleVecParamEnum; - else stage=3; - } - if(stage==3){ - if (strcmp(name,"Element")==0) return ElementEnum; + else if (strcmp(name,"Element")==0) return ElementEnum; else if (strcmp(name,"ElementResult")==0) return ElementResultEnum; else if (strcmp(name,"ExternalResult")==0) return ExternalResultEnum; else if (strcmp(name,"FileParam")==0) return FileParamEnum; @@ -377,16 +383,16 @@ else if (strcmp(name,"RheologyBbarAbsGradient")==0) return RheologyBbarAbsGradientEnum; else if (strcmp(name,"DragCoefficientAbsGradient")==0) return DragCoefficientAbsGradientEnum; else if (strcmp(name,"TransientInput")==0) return TransientInputEnum; - else if (strcmp(name,"Outputfilename")==0) return OutputfilenameEnum; + else stage=4; + } + if(stage==4){ + if (strcmp(name,"Outputfilename")==0) return OutputfilenameEnum; else if (strcmp(name,"Waterfraction")==0) return WaterfractionEnum; else if (strcmp(name,"Watercolumn")==0) return WatercolumnEnum; else if (strcmp(name,"BasalFriction")==0) return BasalFrictionEnum; else if (strcmp(name,"ViscousHeating")==0) return ViscousHeatingEnum; else if (strcmp(name,"QmuTemperature")==0) return QmuTemperatureEnum; - else stage=4; - } - if(stage==4){ - if (strcmp(name,"HydrologyWaterVx")==0) return HydrologyWaterVxEnum; + else if (strcmp(name,"HydrologyWaterVx")==0) return HydrologyWaterVxEnum; else if (strcmp(name,"HydrologyWaterVy")==0) return HydrologyWaterVyEnum; else if (strcmp(name,"StressTensor")==0) return StressTensorEnum; else if (strcmp(name,"StressTensorxx")==0) return StressTensorxxEnum; Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/EnumToStringx/EnumToStringx.cpp =================================================================== --- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/EnumToStringx/EnumToStringx.cpp (revision 12747) +++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/EnumToStringx/EnumToStringx.cpp (revision 12748) @@ -153,6 +153,12 @@ case SettingsOutputFrequencyEnum : return "SettingsOutputFrequency"; case SettingsResultsAsPatchesEnum : return "SettingsResultsAsPatches"; case SettingsWaitonlockEnum : return "SettingsWaitonlock"; + case SurfaceforcingsDelta18oEnum : return "SurfaceforcingsDelta18o"; + case SurfaceforcingsDelta18oTemperaturesPresentdayEnum : return "SurfaceforcingsDelta18oTemperaturesPresentday"; + case SurfaceforcingsDelta18oTemperaturesLgmEnum : return "SurfaceforcingsDelta18oTemperaturesLgm"; + case SurfaceforcingsDelta18oSurfaceEnum : return "SurfaceforcingsDelta18oSurface"; + case SurfaceforcingsIsdelta18oEnum : return "SurfaceforcingsIsdelta18o"; + case SurfaceforcingsPrecipitationsPresentdayEnum : return "SurfaceforcingsPrecipitationsPresentday"; case DebugProfilingEnum : return "DebugProfiling"; case ProfilingCurrentMemEnum : return "ProfilingCurrentMem"; case ProfilingCurrentFlopsEnum : return "ProfilingCurrentFlops"; Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/modules.h =================================================================== --- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/modules.h (revision 12747) +++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/modules.h (revision 12748) @@ -24,6 +24,7 @@ #include "./CostFunctionx/CostFunctionx.h" #include "./CreateNodalConstraintsx/CreateNodalConstraintsx.h" #include "./DakotaResponsesx/DakotaResponsesx.h" +#include "./Delta18oParameterizationx/Delta18oParameterizationx.h" #include "./DragCoefficientAbsGradientx/DragCoefficientAbsGradientx.h" #include "./ElementConnectivityx/ElementConnectivityx.h" #include "./EnumToStringx/EnumToStringx.h" Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/Prognostic/UpdateElementsPrognostic.cpp =================================================================== --- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/Prognostic/UpdateElementsPrognostic.cpp (revision 12747) +++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/Prognostic/UpdateElementsPrognostic.cpp (revision 12748) @@ -19,7 +19,6 @@ int numberofelements; int stabilization; bool dakota_analysis; - bool ispdd; bool issmbgradients; /*Fetch data needed: */ @@ -28,7 +27,6 @@ iomodel->Constant(&stabilization,PrognosticStabilizationEnum); iomodel->Constant(&dakota_analysis,QmuIsdakotaEnum); iomodel->FetchData(1,MeshElementsEnum); - iomodel->Constant(&ispdd,SurfaceforcingsIspddEnum); iomodel->Constant(&issmbgradients,SurfaceforcingsIssmbgradientsEnum); /*Update elements: */ @@ -68,24 +66,18 @@ iomodel->FetchDataToInput(elements,PressureEnum); iomodel->FetchDataToInput(elements,TemperatureEnum); } - if(ispdd){ - iomodel->FetchDataToInput(elements,VyEnum); - iomodel->FetchDataToInput(elements,ThermalSpctemperatureEnum); - iomodel->FetchDataToInput(elements,SurfaceforcingsPrecipitationEnum); - iomodel->FetchDataToInput(elements,SurfaceforcingsMonthlytemperaturesEnum); - } if(issmbgradients){ - iomodel->FetchDataToInput(elements,SurfaceforcingsHcEnum); - iomodel->FetchDataToInput(elements,SurfaceforcingsSmbPosMaxEnum); - iomodel->FetchDataToInput(elements,SurfaceforcingsSmbPosMinEnum); - iomodel->FetchDataToInput(elements,SurfaceforcingsAPosEnum); - iomodel->FetchDataToInput(elements,SurfaceforcingsBPosEnum); - iomodel->FetchDataToInput(elements,SurfaceforcingsANegEnum); - iomodel->FetchDataToInput(elements,SurfaceforcingsBNegEnum); + iomodel->FetchDataToInput(elements,SurfaceforcingsHcEnum); + iomodel->FetchDataToInput(elements,SurfaceforcingsSmbPosMaxEnum); + iomodel->FetchDataToInput(elements,SurfaceforcingsSmbPosMinEnum); + iomodel->FetchDataToInput(elements,SurfaceforcingsAPosEnum); + iomodel->FetchDataToInput(elements,SurfaceforcingsBPosEnum); + iomodel->FetchDataToInput(elements,SurfaceforcingsANegEnum); + iomodel->FetchDataToInput(elements,SurfaceforcingsBNegEnum); } - else{ - iomodel->FetchDataToInput(elements,SurfaceforcingsMassBalanceEnum); - } + //else{ + // iomodel->FetchDataToInput(elements,SurfaceforcingsMassBalanceEnum); + //} /*Free data: */ iomodel->DeleteData(1,MeshElementsEnum); Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/Transient/UpdateElementsTransient.cpp =================================================================== --- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/Transient/UpdateElementsTransient.cpp (revision 12747) +++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/Transient/UpdateElementsTransient.cpp (revision 12748) @@ -15,6 +15,30 @@ void UpdateElementsTransient(Elements* elements, Parameters* parameters,IoModel* iomodel,int analysis_counter,int analysis_type){ - /*nothing for now: */ + bool ispdd; + bool isdelta18o; + IssmDouble *size, Delta18oTimeSerie,Delta18oSurfaceTimeSerie ; + /*Fetch data needed: */ + iomodel->Constant(&ispdd,SurfaceforcingsIspddEnum); + iomodel->Constant(&isdelta18o,SurfaceforcingsIsdelta18oEnum); + + if(ispdd){ + iomodel->FetchDataToInput(elements,ThermalSpctemperatureEnum); + if(isdelta18o){ + iomodel->FetchDataToInput(elements,SurfaceforcingsDelta18oEnum); + iomodel->FetchDataToInput(elements,SurfaceforcingsDelta18oSurfaceEnum); + + iomodel->FetchDataToInput(elements,SurfaceforcingsDelta18oTemperaturesLgmEnum); + iomodel->FetchDataToInput(elements,SurfaceforcingsDelta18oTemperaturesPresentdayEnum); + iomodel->FetchDataToInput(elements,SurfaceforcingsPrecipitationsPresentdayEnum); + } + else{ + iomodel->FetchDataToInput(elements,SurfaceforcingsPrecipitationEnum); + iomodel->FetchDataToInput(elements,SurfaceforcingsMonthlytemperaturesEnum); + } + } + else{ + iomodel->FetchDataToInput(elements,SurfaceforcingsMassBalanceEnum); + } } Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/CreateParameters.cpp =================================================================== --- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/CreateParameters.cpp (revision 12747) +++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/ModelProcessorx/CreateParameters.cpp (revision 12748) @@ -24,7 +24,10 @@ int numoutputs; Parameters *parameters = NULL; IssmDouble *requestedoutputs = NULL; - + bool isdelta18o; + IssmDouble *Delta18oT, *Delta18oSurfaceT; + int nlinesD18o, ncolsD18o, nlinesD18osurf, ncolsD18osurf; + if(*pparameters)return; //do not create parameters twice! /*Initialize dataset: */ @@ -89,8 +92,20 @@ parameters->AddObject(iomodel->CopyConstantObject(InversionIscontrolEnum)); parameters->AddObject(iomodel->CopyConstantObject(InversionTaoEnum)); parameters->AddObject(iomodel->CopyConstantObject(SurfaceforcingsIspddEnum)); + parameters->AddObject(iomodel->CopyConstantObject(SurfaceforcingsIsdelta18oEnum)); parameters->AddObject(iomodel->CopyConstantObject(SurfaceforcingsIssmbgradientsEnum)); + iomodel->Constant(&isdelta18o,SurfaceforcingsIsdelta18oEnum); + if(isdelta18o){ + iomodel->FetchData(&Delta18oT,&nlinesD18o,&ncolsD18o,SurfaceforcingsDelta18oEnum); + _assert_(nlinesD18o==2); + parameters->AddObject(new TransientParam(SurfaceforcingsDelta18oEnum,&Delta18oT[0],&Delta18oT[ncolsD18o],ncolsD18o)); + + iomodel->FetchData(&Delta18oSurfaceT,&nlinesD18osurf,&ncolsD18osurf,SurfaceforcingsDelta18oSurfaceEnum); + _assert_(nlinesD18osurf==2); + parameters->AddObject(new TransientParam(SurfaceforcingsDelta18oSurfaceEnum,&Delta18oSurfaceT[0],&Delta18oSurfaceT[ncolsD18osurf],ncolsD18osurf)); + } + /*some parameters that did not come with the iomodel: */ parameters->AddObject(new IntParam(SolutionTypeEnum,solution_type)); parameters->AddObject(new IntParam(AnalysisTypeEnum,analysis_type)); Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Delta18oParameterizationx/Delta18oParameterizationx.cpp =================================================================== --- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Delta18oParameterizationx/Delta18oParameterizationx.cpp (revision 0) +++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Delta18oParameterizationx/Delta18oParameterizationx.cpp (revision 12748) @@ -0,0 +1,23 @@ +/*!\file Delta18oParameterizationx + * \brief: Create past temperature field from present day fields + */ + +#include "./Delta18oParameterizationx.h" +#include "../../shared/shared.h" +#include "../../include/include.h" +#include "../../io/io.h" +#include "../../toolkits/toolkits.h" +#include "../../EnumDefinitions/EnumDefinitions.h" + +void Delta18oParameterizationx(Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads,Materials* materials, Parameters* parameters){ + + /*Intermediary*/ + int i; + Element* element = NULL; + + /*Compute temperature and precipitation fields: */ + for(i=0;iSize();i++){ + element=(Element*)elements->GetObjectByOffset(i); + element->Delta18oParameterization(); + } +} Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Delta18oParameterizationx/Delta18oParameterizationx.h =================================================================== --- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Delta18oParameterizationx/Delta18oParameterizationx.h (revision 0) +++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/modules/Delta18oParameterizationx/Delta18oParameterizationx.h (revision 12748) @@ -0,0 +1,14 @@ +/*!\file: Delta18oParameterizationx.cpp + * \brief header file for + */ + +#ifndef _DELTA18OPARAMETERIZATIONX_H +#define _DELTA18OPARAMETERIZATIONX_H + +#include "../../Container/Container.h" +#include "../../objects/objects.h" + +/* local prototypes: */ +void Delta18oParameterizationx(Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads,Materials* materials, Parameters* parameters); + +#endif /* _DELTA18OPARAMETERIZATIONX_H*/ Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/Makefile.am =================================================================== --- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/Makefile.am (revision 12747) +++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/Makefile.am (revision 12748) @@ -211,6 +211,7 @@ ./shared/Elements/GetGlobalDofList.cpp\ ./shared/Elements/GetNumberOfDofs.cpp\ ./shared/Elements/PddSurfaceMassBalance.cpp\ + ./shared/Elements/ComputeDelta18oTemperaturePrecipitation.cpp\ ./shared/String/sharedstring.h\ ./shared/Wrapper/wrappershared.h\ ./shared/Wrapper/ModuleBoot.cpp\ @@ -293,6 +294,8 @@ ./modules/SpcNodesx/SpcNodesx.cpp\ ./modules/PositiveDegreeDayx/PositiveDegreeDayx.h\ ./modules/PositiveDegreeDayx/PositiveDegreeDayx.cpp\ + ./modules/Delta18oParameterizationx/Delta18oParameterizationx.h\ + ./modules/Delta18oParameterizationx/Delta18oParameterizationx.cpp\ ./modules/SmbGradientsx/SmbGradientsx.h\ ./modules/SmbGradientsx/SmbGradientsx.cpp\ ./modules/UpdateConstraintsx/UpdateConstraintsx.h\ @@ -817,7 +820,7 @@ #Matlab and Petsc sources {{{ matlabpetsc_sources= ./matlab/io/MatlabMatrixToPetscMatrix.cpp\ ./matlab/io/MatlabVectorToPetscVector.cpp - + #}}} #Modules sources{{{ module_sources= ./objects/Options/Option.cpp\ Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Elements/Element.h =================================================================== --- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Elements/Element.h (revision 12747) +++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Elements/Element.h (revision 12748) @@ -71,6 +71,7 @@ virtual void MigrateGroundingLine(IssmDouble* old_floating_ice,IssmDouble* sheet_ungrounding)=0; virtual void PotentialSheetUngrounding(Vector* potential_sheet_ungrounding)=0; virtual void PositiveDegreeDay(IssmDouble* pdds,IssmDouble* pds,IssmDouble signorm)=0; + virtual void Delta18oParameterization(void)=0; virtual void SmbGradients()=0; virtual int UpdatePotentialSheetUngrounding(IssmDouble* potential_sheet_ungrounding,Vector* vec_nodes_on_iceshelf,IssmDouble* nodes_on_iceshelf)=0; virtual void ResetCoordinateSystem()=0; Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Elements/Tria.cpp =================================================================== --- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Elements/Tria.cpp (revision 12747) +++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Elements/Tria.cpp (revision 12748) @@ -907,6 +907,66 @@ } /*}}}*/ +/*FUNCTION Tria::Delta18oParameterization{{{*/ +void Tria::Delta18oParameterization(void){ + + IssmDouble monthlytemperatures[NUMVERTICES][12],monthlyprec[NUMVERTICES][12]; + IssmDouble Delta18oTemperaturesPresentday[NUMVERTICES][12],Delta18oTemperaturesLgm[NUMVERTICES][12]; + IssmDouble PrecipitationsPresentday[NUMVERTICES][12]; + IssmDouble Delta18oPresent,Delta18oLgm,Delta18oTime; + IssmDouble Delta18oSurfacePresent,Delta18oSurfaceLgm,Delta18oSurfaceTime; + IssmDouble time,yts,finaltime; + this->parameters->FindParam(&time,TimeEnum); + this->parameters->FindParam(&yts,ConstantsYtsEnum); + this->parameters->FindParam(&finaltime,TimesteppingFinalTimeEnum); + + /*Recover present day temperature and precipitation*/ + Input* input=inputs->GetInput(SurfaceforcingsDelta18oTemperaturesPresentdayEnum); _assert_(input); + Input* input2=inputs->GetInput(SurfaceforcingsDelta18oTemperaturesLgmEnum); _assert_(input2); + Input* input3=inputs->GetInput(SurfaceforcingsPrecipitationsPresentdayEnum); _assert_(input3); + GaussTria* gauss=new GaussTria(); + for(int month=0;month<12;month++) { + for(int iv=0;ivGaussVertex(iv); + input->GetInputValue(&Delta18oTemperaturesPresentday[iv][month],gauss,month/12.*yts); + input2->GetInputValue(&Delta18oTemperaturesLgm[iv][month],gauss,month/12.*yts); + input3->GetInputValue(&PrecipitationsPresentday[iv][month],gauss,month/12.*yts); + monthlyprec[iv][month]=monthlyprec[iv][month]*yts; // convertion to m/yr + } + } + + /*Recover delta18o and Delta18oSurface at present day, lgm and at time t*/ + this->parameters->FindParam(&Delta18oPresent,SurfaceforcingsDelta18oEnum,finaltime*yts); + this->parameters->FindParam(&Delta18oLgm,SurfaceforcingsDelta18oEnum,(finaltime-21000)*yts); + this->parameters->FindParam(&Delta18oTime,SurfaceforcingsDelta18oEnum,time*yts); + this->parameters->FindParam(&Delta18oSurfacePresent,SurfaceforcingsDelta18oSurfaceEnum,finaltime*yts); + this->parameters->FindParam(&Delta18oSurfaceLgm,SurfaceforcingsDelta18oSurfaceEnum,(finaltime-21000)*yts); + this->parameters->FindParam(&Delta18oSurfaceTime,SurfaceforcingsDelta18oSurfaceEnum,time*yts); + + /*Compute the temperature and precipitation*/ + for(int iv=0;ivAddTimeInput(newmonthinput1,imonth/12.*yts); + TriaP1Input* newmonthinput2 = new TriaP1Input(SurfaceforcingsPrecipitationEnum,&monthlyprec[iv][imonth]); + NewPrecipitationInput->AddTimeInput(newmonthinput2,imonth/12.*yts); + } + } + this->inputs->AddInput(NewTemperatureInput); + this->inputs->AddInput(NewPrecipitationInput); +} +/*}}}*/ /*FUNCTION Tria::Echo{{{*/ void Tria::Echo(void){ _printLine_("Tria:"); Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Elements/Tria.h =================================================================== --- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Elements/Tria.h (revision 12747) +++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Elements/Tria.h (revision 12748) @@ -79,6 +79,7 @@ void CreateKMatrix(Matrix* Kff, Matrix* Kfs,Vector* df); void CreatePVector(Vector* pf); void CreateJacobianMatrix(Matrix* Jff); + void Delta18oParameterization(void); int GetNodeIndex(Node* node); int Sid(); bool IsOnBed(); Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Elements/Penta.cpp =================================================================== --- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Elements/Penta.cpp (revision 12747) +++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Elements/Penta.cpp (revision 12748) @@ -684,6 +684,66 @@ } /*}}}*/ +/*FUNCTION Penta::Delta18oParameterization{{{*/ +void Penta::Delta18oParameterization(void){ + + IssmDouble monthlytemperatures[NUMVERTICES][12],monthlyprec[NUMVERTICES][12]; + IssmDouble Delta18oTemperaturesPresentday[NUMVERTICES][12],Delta18oTemperaturesLgm[NUMVERTICES][12]; + IssmDouble PrecipitationsPresentday[NUMVERTICES][12]; + IssmDouble Delta18oPresent,Delta18oLgm,Delta18oTime; + IssmDouble Delta18oSurfacePresent,Delta18oSurfaceLgm,Delta18oSurfaceTime; + IssmDouble time,yts,finaltime; + this->parameters->FindParam(&time,TimeEnum); + this->parameters->FindParam(&yts,ConstantsYtsEnum); + this->parameters->FindParam(&finaltime,TimesteppingFinalTimeEnum); + + /*Recover present day temperature and precipitation*/ + Input* input=inputs->GetInput(SurfaceforcingsDelta18oTemperaturesPresentdayEnum); _assert_(input); + Input* input2=inputs->GetInput(SurfaceforcingsDelta18oTemperaturesLgmEnum); _assert_(input2); + Input* input3=inputs->GetInput(SurfaceforcingsPrecipitationsPresentdayEnum); _assert_(input3); + GaussPenta* gauss=new GaussPenta(); + for(int month=0;month<12;month++) { + for(int iv=0;ivGaussVertex(iv); + input->GetInputValue(&Delta18oTemperaturesPresentday[iv][month],gauss,month/12.*yts); + input2->GetInputValue(&Delta18oTemperaturesLgm[iv][month],gauss,month/12.*yts); + input3->GetInputValue(&PrecipitationsPresentday[iv][month],gauss,month/12.*yts); + monthlyprec[iv][month]=monthlyprec[iv][month]*yts; // convertion to m/yr + } + } + + /*Recover delta18o and Delta18oSurface at present day, lgm and at time t*/ + this->parameters->FindParam(&Delta18oPresent,SurfaceforcingsDelta18oEnum,finaltime*yts); + this->parameters->FindParam(&Delta18oLgm,SurfaceforcingsDelta18oEnum,(finaltime-21000)*yts); + this->parameters->FindParam(&Delta18oTime,SurfaceforcingsDelta18oEnum,time*yts); + this->parameters->FindParam(&Delta18oSurfacePresent,SurfaceforcingsDelta18oSurfaceEnum,finaltime*yts); + this->parameters->FindParam(&Delta18oSurfaceLgm,SurfaceforcingsDelta18oSurfaceEnum,(finaltime-21000)*yts); + this->parameters->FindParam(&Delta18oSurfaceTime,SurfaceforcingsDelta18oSurfaceEnum,time*yts); + + /*Compute the temperature and precipitation*/ + for(int iv=0;ivAddTimeInput(newmonthinput1,imonth/12.*yts); + PentaP1Input* newmonthinput2 = new PentaP1Input(SurfaceforcingsPrecipitationEnum,&monthlyprec[iv][imonth]); + NewPrecipitationInput->AddTimeInput(newmonthinput2,imonth/12.*yts); + } + } + this->inputs->AddInput(NewTemperatureInput); + this->inputs->AddInput(NewPrecipitationInput); +} +/*}}}*/ /*FUNCTION Penta::Echo{{{*/ void Penta::Echo(void){ Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Elements/Penta.h =================================================================== --- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Elements/Penta.h (revision 12747) +++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/objects/Elements/Penta.h (revision 12748) @@ -83,6 +83,7 @@ void CreateKMatrix(Matrix* Kff, Matrix* Kfs,Vector* df); void CreatePVector(Vector* pf); void CreateJacobianMatrix(Matrix* Jff); + void Delta18oParameterization(void); void DeleteResults(void); int GetNodeIndex(Node* node); void GetSolutionFromInputs(Vector* solution); Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/SurfaceforcingsIsdelta18oEnum.m =================================================================== --- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/SurfaceforcingsIsdelta18oEnum.m (revision 0) +++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/SurfaceforcingsIsdelta18oEnum.m (revision 12748) @@ -0,0 +1,11 @@ +function macro=SurfaceforcingsIsdelta18oEnum() +%SURFACEFORCINGSISDELTA18OENUM - Enum of SurfaceforcingsIsdelta18o +% +% WARNING: DO NOT MODIFY THIS FILE +% this file has been automatically generated by src/c/EnumDefinitions/Synchronize.sh +% Please read src/c/EnumDefinitions/README for more information +% +% Usage: +% macro=SurfaceforcingsIsdelta18oEnum() + +macro=StringToEnum('SurfaceforcingsIsdelta18o'); Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/SurfaceforcingsDelta18oEnum.m =================================================================== --- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/SurfaceforcingsDelta18oEnum.m (revision 0) +++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/SurfaceforcingsDelta18oEnum.m (revision 12748) @@ -0,0 +1,11 @@ +function macro=SurfaceforcingsDelta18oEnum() +%SURFACEFORCINGSDELTA18OENUM - Enum of SurfaceforcingsDelta18o +% +% WARNING: DO NOT MODIFY THIS FILE +% this file has been automatically generated by src/c/EnumDefinitions/Synchronize.sh +% Please read src/c/EnumDefinitions/README for more information +% +% Usage: +% macro=SurfaceforcingsDelta18oEnum() + +macro=StringToEnum('SurfaceforcingsDelta18o'); Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/SurfaceforcingsDelta18oSurfaceEnum.m =================================================================== --- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/SurfaceforcingsDelta18oSurfaceEnum.m (revision 0) +++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/SurfaceforcingsDelta18oSurfaceEnum.m (revision 12748) @@ -0,0 +1,11 @@ +function macro=SurfaceforcingsDelta18oSurfaceEnum() +%SURFACEFORCINGSDELTA18OSURFACEENUM - Enum of SurfaceforcingsDelta18oSurface +% +% WARNING: DO NOT MODIFY THIS FILE +% this file has been automatically generated by src/c/EnumDefinitions/Synchronize.sh +% Please read src/c/EnumDefinitions/README for more information +% +% Usage: +% macro=SurfaceforcingsDelta18oSurfaceEnum() + +macro=StringToEnum('SurfaceforcingsDelta18oSurface'); Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/SurfaceforcingsPrecipitationsPresentdayEnum.m =================================================================== --- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/SurfaceforcingsPrecipitationsPresentdayEnum.m (revision 0) +++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/SurfaceforcingsPrecipitationsPresentdayEnum.m (revision 12748) @@ -0,0 +1,11 @@ +function macro=SurfaceforcingsPrecipitationsPresentdayEnum() +%SURFACEFORCINGSPRECIPITATIONSPRESENTDAYENUM - Enum of SurfaceforcingsPrecipitationsPresentday +% +% WARNING: DO NOT MODIFY THIS FILE +% this file has been automatically generated by src/c/EnumDefinitions/Synchronize.sh +% Please read src/c/EnumDefinitions/README for more information +% +% Usage: +% macro=SurfaceforcingsPrecipitationsPresentdayEnum() + +macro=StringToEnum('SurfaceforcingsPrecipitationsPresentday'); Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/SurfaceforcingsDelta18oTemperaturesPresentdayEnum.m =================================================================== --- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/SurfaceforcingsDelta18oTemperaturesPresentdayEnum.m (revision 0) +++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/SurfaceforcingsDelta18oTemperaturesPresentdayEnum.m (revision 12748) @@ -0,0 +1,11 @@ +function macro=SurfaceforcingsDelta18oTemperaturesPresentdayEnum() +%SURFACEFORCINGSDELTA18OTEMPERATURESPRESENTDAYENUM - Enum of SurfaceforcingsDelta18oTemperaturesPresentday +% +% WARNING: DO NOT MODIFY THIS FILE +% this file has been automatically generated by src/c/EnumDefinitions/Synchronize.sh +% Please read src/c/EnumDefinitions/README for more information +% +% Usage: +% macro=SurfaceforcingsDelta18oTemperaturesPresentdayEnum() + +macro=StringToEnum('SurfaceforcingsDelta18oTemperaturesPresentday'); Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/SurfaceforcingsDelta18oTemperaturesLgmEnum.m =================================================================== --- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/SurfaceforcingsDelta18oTemperaturesLgmEnum.m (revision 0) +++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/SurfaceforcingsDelta18oTemperaturesLgmEnum.m (revision 12748) @@ -0,0 +1,11 @@ +function macro=SurfaceforcingsDelta18oTemperaturesLgmEnum() +%SURFACEFORCINGSDELTA18OTEMPERATURESLGMENUM - Enum of SurfaceforcingsDelta18oTemperaturesLgm +% +% WARNING: DO NOT MODIFY THIS FILE +% this file has been automatically generated by src/c/EnumDefinitions/Synchronize.sh +% Please read src/c/EnumDefinitions/README for more information +% +% Usage: +% macro=SurfaceforcingsDelta18oTemperaturesLgmEnum() + +macro=StringToEnum('SurfaceforcingsDelta18oTemperaturesLgm'); Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/MaximumNumberOfEnums.m =================================================================== --- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/MaximumNumberOfEnums.m (revision 12747) +++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/MaximumNumberOfEnums.m (revision 12748) @@ -8,4 +8,4 @@ % Usage: % macro=MaximumNumberOfEnums() -macro=449; +macro=455; Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/EnumDefinitions.py =================================================================== --- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/EnumDefinitions.py (revision 12747) +++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/enum/EnumDefinitions.py (revision 12748) @@ -1376,6 +1376,66 @@ return StringToEnum('SettingsWaitonlock') +def SurfaceforcingsDelta18oEnum(): + """ + SURFACEFORCINGSDELTA18OENUM - Enum of SurfaceforcingsDelta18o + + Usage: + macro=SurfaceforcingsDelta18oEnum() + """ + + return StringToEnum('SurfaceforcingsDelta18o') + +def SurfaceforcingsDelta18oTemperaturesPresentdayEnum(): + """ + SURFACEFORCINGSDELTA18OTEMPERATURESPRESENTDAYENUM - Enum of SurfaceforcingsDelta18oTemperaturesPresentday + + Usage: + macro=SurfaceforcingsDelta18oTemperaturesPresentdayEnum() + """ + + return StringToEnum('SurfaceforcingsDelta18oTemperaturesPresentday') + +def SurfaceforcingsDelta18oTemperaturesLgmEnum(): + """ + SURFACEFORCINGSDELTA18OTEMPERATURESLGMENUM - Enum of SurfaceforcingsDelta18oTemperaturesLgm + + Usage: + macro=SurfaceforcingsDelta18oTemperaturesLgmEnum() + """ + + return StringToEnum('SurfaceforcingsDelta18oTemperaturesLgm') + +def SurfaceforcingsDelta18oSurfaceEnum(): + """ + SURFACEFORCINGSDELTA18OSURFACEENUM - Enum of SurfaceforcingsDelta18oSurface + + Usage: + macro=SurfaceforcingsDelta18oSurfaceEnum() + """ + + return StringToEnum('SurfaceforcingsDelta18oSurface') + +def SurfaceforcingsIsdelta18oEnum(): + """ + SURFACEFORCINGSISDELTA18OENUM - Enum of SurfaceforcingsIsdelta18o + + Usage: + macro=SurfaceforcingsIsdelta18oEnum() + """ + + return StringToEnum('SurfaceforcingsIsdelta18o') + +def SurfaceforcingsPrecipitationsPresentdayEnum(): + """ + SURFACEFORCINGSPRECIPITATIONSPRESENTDAYENUM - Enum of SurfaceforcingsPrecipitationsPresentday + + Usage: + macro=SurfaceforcingsPrecipitationsPresentdayEnum() + """ + + return StringToEnum('SurfaceforcingsPrecipitationsPresentday') + def DebugProfilingEnum(): """ DEBUGPROFILINGENUM - Enum of DebugProfiling @@ -4504,5 +4564,5 @@ macro=MaximumNumberOfEnums() """ - return 449 + return 455 Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/surfaceforcings.m =================================================================== --- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/surfaceforcings.m (revision 12747) +++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/surfaceforcings.m (revision 12748) @@ -9,6 +9,7 @@ mass_balance = NaN; ispdd = 0; issmbgradients = 0; + isdelta18o = 0; hc = NaN; smb_pos_max = NaN; smb_pos_min = NaN; @@ -17,6 +18,11 @@ a_neg = NaN; b_neg = NaN; monthlytemperatures = NaN; + delta18o = NaN; + delta18o_surface = NaN; + temperatures_presentday = NaN; + temperatures_lgm = NaN; + precipitations_presentday = NaN; end methods function obj = surfaceforcings(varargin) % {{{ @@ -32,6 +38,7 @@ %pdd method not used in default mode obj.ispdd=0; obj.issmbgradients=0; + obj.isdelta18o=0; end % }}} function md = checkconsistency(obj,md,solution,analyses) % {{{ @@ -40,7 +47,16 @@ md = checkfield(md,'surfaceforcings.ispdd','numel',1,'values',[0 1]); checkfield(md,'surfaceforcings.issmbgradients','numel',1,'values',[0 1]); if(obj.ispdd) - md = checkfield(md,'surfaceforcings.monthlytemperatures','forcing',1,'NaN',1); + if(obj.isdelta18o==0) + md = checkfield(md,'surfaceforcings.monthlytemperatures','forcing',1,'NaN',1); + md = checkfield(md,'surfaceforcings.precipitation','forcing',1,'NaN',1); + else + md = checkfield(md,'surfaceforcings.delta18o','NaN',1); + md = checkfield(md,'surfaceforcings.delta18o_surface','NaN',1); + md = checkfield(md,'surfaceforcings.temperatures_presentday','size',[md.mesh.numberofvertices+1 12],'NaN',1); + md = checkfield(md,'surfaceforcings.temperatures_lgm','size',[md.mesh.numberofvertices+1 12],'NaN',1); + md = checkfield(md,'surfaceforcings.precipitations_presentday','size',[md.mesh.numberofvertices+1 12],'NaN',1); + end elseif(obj.issmbgradients) checkfield(md,'surfaceforcings.hc','forcing',1,'NaN',1); checkfield(md,'surfaceforcings.smb_pos_max','forcing',1,'NaN',1); @@ -60,10 +76,15 @@ function disp(obj) % {{{ disp(sprintf(' surface forcings parameters:')); - fielddisplay(obj,'precipitation','surface precipitation [m/yr water eq]'); fielddisplay(obj,'mass_balance','surface mass balance [m/yr ice eq]'); fielddisplay(obj,'ispdd','is pdd activated (0 or 1, default is 0)'); - fielddisplay(obj,'monthlytemperatures','monthly surface temperatures required if pdd is activated'); + fielddisplay(obj,'isdelta18o','is temperature and precipitation delta18o parametrisation activated (0 or 1, default is 0)'); + fielddisplay(obj,'monthlytemperatures','monthly surface temperatures [Kelvin], required if pdd is activated and delta18o not activated'); + fielddisplay(obj,'precipitation','surface precipitation [m/yr water eq]'); + fielddisplay(obj,'temperatures_presentday','monthly present day surface temperatures [Kelvin], required if pdd is activated and delta18o activated'); + fielddisplay(obj,'temperatures_lgm','monthly LGM surface temperatures [Kelvin], required if pdd is activated and delta18o activated'); + fielddisplay(obj,'precipitations_presentday','monthly surface precipitation [m/yr water eq], required if pdd is activated and delta18o activated'); + fielddisplay(obj,'delta18o_surface','surface elevation of the delta18o site, required if pdd is activated and delta18o activated'); fielddisplay(obj,'issmbgradients','is smb gradients method activated (0 or 1, default is 0)'); fielddisplay(obj,'hc',' elevation of intersection between accumulation and ablation regime required if smb gradients is activated'); fielddisplay(obj,'smb_pos_max',' maximum value of positive smb required if smb gradients is activated'); @@ -78,8 +99,17 @@ WriteData(fid,'object',obj,'fieldname','precipitation','format','DoubleMat','mattype',1); WriteData(fid,'object',obj,'fieldname','mass_balance','format','DoubleMat','mattype',1); WriteData(fid,'object',obj,'fieldname','ispdd','format','Boolean'); + WriteData(fid,'object',obj,'fieldname','isdelta18o','format','Boolean'); if obj.ispdd, + if obj.isdelta18o + WriteData(fid,'object',obj,'fieldname','temperatures_presentday','format','DoubleMat','mattype',1); + WriteData(fid,'object',obj,'fieldname','temperatures_lgm','format','DoubleMat','mattype',1); + WriteData(fid,'object',obj,'fieldname','precipitations_presentday','format','DoubleMat','mattype',1); + WriteData(fid,'object',obj,'fieldname','delta18o_surface','format','DoubleMat','mattype',1); + else WriteData(fid,'object',obj,'fieldname','monthlytemperatures','format','DoubleMat','mattype',1); + WriteData(fid,'object',obj,'fieldname','precipitation','format','DoubleMat','mattype',1); + end end WriteData(fid,'object',obj,'fieldname','issmbgradients','format','Boolean'); if obj.issmbgradients,