 |
Ice Sheet System Model
4.18
Code documentation
|
Go to the documentation of this file.
2 #include "../toolkits/toolkits.h"
3 #include "../classes/classes.h"
4 #include "../shared/shared.h"
5 #include "../modules/modules.h"
26 bool isdelta18o,ismungsm,isd18opd,issetpddfac,isprecipscaled,istemperaturescaled,isfirnwarming;
33 element->
Update(inputs2,i,iomodel,analysis_counter,analysis_type,
P1Enum);
83 if(isdelta18o || ismungsm){
96 iomodel->
FindConstant(&isfirnwarming,
"md.smb.isfirnwarming");
104 iomodel->
FindConstant(&istemperaturescaled,
"md.smb.istemperaturescaled");
105 iomodel->
FindConstant(&isprecipscaled,
"md.smb.isprecipscaled");
108 iomodel->
FindConstant(&issetpddfac,
"md.smb.issetpddfac");
115 if(!istemperaturescaled){
119 iomodel->
FetchData(&doublearray,&M,&N,
"md.smb.temperatures_reconstructed");
121 if(N%12!=0)
_error_(
"md.smb.temperatures_reconstructed should have a multiple of 12 columns (since it is monthly)");
124 int* ids = xNew<int>(N);
for(
int i=0;i<N;i++) ids[i] = i;
126 for(
int i=0;i<elements->
Size();i++){
131 iomodel->
DeleteData(doublearray,
"md.smb.temperatures_reconstructed");
137 iomodel->
FetchData(&doublearray,&M,&N,
"md.smb.precipitations_reconstructed");
139 if(N%12!=0)
_error_(
"md.smb.precipitations_reconstructed should have a multiple of 12 columns (since it is monthly)");
142 int* ids = xNew<int>(N);
for(
int i=0;i<N;i++) ids[i] = i;
144 for(
int i=0;i<elements->
Size();i++){
149 iomodel->
DeleteData(doublearray,
"md.smb.precipitations_reconstructed");
208 char** requestedoutputs = NULL;
209 bool isdelta18o,ismungsm,isd18opd,issetpddfac,interp,isfirnwarming;
210 int smb_model, smbslices, averaging;
217 iomodel->
FindConstant(&interp,
"md.timestepping.interp_forcings");
219 iomodel->
FindConstant(&smbslices,
"md.smb.steps_per_step");
282 iomodel->
DeleteData(temp,
"md.smb.delta18o_surface");
295 iomodel->
FindConstant(&issetpddfac,
"md.smb.issetpddfac");
305 bool istemperaturescaled,isprecipscaled;
307 iomodel->
FindConstant(&istemperaturescaled,
"md.smb.istemperaturescaled");
308 iomodel->
FindConstant(&isprecipscaled,
"md.smb.isprecipscaled");
309 if(!istemperaturescaled){
313 iomodel->
FetchData(&doublearray,&M,&N,
"md.smb.temperatures_reconstructed");
315 if(N%12!=0)
_error_(
"md.smb.temperatures_reconstructed should have a multiple of 12 columns (since it is monthly)");
316 int numyears = N/12;
_assert_(numyears*12==N);
320 for(
int i=0;i<numyears;i++){
321 for(
int j=1;j<12;j++){
323 _assert_(doublearray[(M-1)*N+i*12+j]>doublearray[(M-1)*N+i*12+j-1]);
329 IssmDouble* times = xNew<IssmDouble>(numyears);
for(
int i=0;i<numyears;i++) times[i] = doublearray[(M-1)*N+i*12];
331 xDelete<IssmDouble>(times);
332 iomodel->
DeleteData(doublearray,
"md.smb.temperatures_reconstructed");
338 iomodel->
FetchData(&doublearray,&M,&N,
"md.smb.precipitations_reconstructed");
340 if(N%12!=0)
_error_(
"md.smb.precipitations_reconstructed should have a multiple of 12 columns (since it is monthly)");
341 int numyears = N/12;
_assert_(numyears*12==N);
345 for(
int i=0;i<numyears;i++){
346 for(
int j=1;j<12;j++){
348 _assert_(doublearray[(M-1)*N+i*12+j]>doublearray[(M-1)*N+i*12+j-1]);
354 IssmDouble* times = xNew<IssmDouble>(numyears);
for(
int i=0;i<numyears;i++) times[i] = doublearray[(M-1)*N+i*12];
356 xDelete<IssmDouble>(times);
357 iomodel->
DeleteData(doublearray,
"md.smb.precipitations_reconstructed");
398 iomodel->
FindConstant(&requestedoutputs,&numoutputs,
"md.smb.requested_outputs");
401 iomodel->
DeleteData(&requestedoutputs,numoutputs,
"md.smb.requested_outputs");
422 bool isdelta18o,ismungsm;
482 _error_(
"SEMIC not installed");
483 #endif //_HAVE_SEMIC_
497 _error_(
"not implemented yet");
500 _error_(
"not implemented yet");
503 _error_(
"not implemented yet");
506 _error_(
"Not implemented yet");
509 _error_(
"not implemented yet");
@ SmbRequestedOutputsEnum
@ SmbTemperaturesReconstructedEnum
void Delta18opdParameterizationx(FemModel *femmodel)
Declaration of Nodes class.
@ SmbDailydsradiationEnum
#define _printf0_(StreamArgs)
void SmbGradientsElax(FemModel *femmodel)
void GetSolutionFromInputs(Vector< IssmDouble > *solution, Element *element)
void Delta18oParameterizationx(FemModel *femmodel)
Declaration of Parameters class.
Declaration of Constraints class.
Declaration of Elements class.
@ SmbPrecipitationsReconstructedYearsEnum
void CreateLoads(Loads *loads, IoModel *iomodel)
@ SmbDailytemperatureEnum
ElementMatrix * CreateKMatrix(Element *element)
ElementVector * CreatePVector(Element *element)
void InputUpdateFromSolution(IssmDouble *solution, Element *element)
@ SmbPrecipitationsPresentdayEnum
void GradientJ(Vector< IssmDouble > *gradient, Element *element, int control_type, int control_index)
void PositiveDegreeDaySicopolisx(FemModel *femmodel)
@ SmbTemperaturesAnomalyEnum
void AddObject(Param *newparam)
ElementMatrix * CreateJacobianMatrix(Element *element)
@ ThermalSpctemperatureEnum
@ SmbIstemperaturescaledEnum
@ SmbTemperaturesPresentdayEnum
void DeleteData(int num,...)
Param * CopyConstantObject(const char *constant_name, int param_enum)
void PositiveDegreeDayx(FemModel *femmodel)
void CreateConstraints(Constraints *constraints, IoModel *iomodel)
void SmbForcingx(FemModel *femmodel)
const char * EnumToStringx(int enum_in)
@ SMBgradientscomponentsEnum
void FindConstant(bool *pvalue, const char *constant_name)
@ SmbIsconstrainsurfaceTEnum
void UpdateConstraints(FemModel *femmodel)
@ SmbPrecipitationsLgmEnum
void FetchData(bool *pboolean, const char *data_name)
void SmbComponentsx(FemModel *femmodel)
void UpdateParameters(Parameters *parameters, IoModel *iomodel, int solution_enum, int analysis_enum)
void SmbMeltComponentsx(FemModel *femmodel)
void Core(FemModel *femmodel)
@ SmbPrecipitationsReconstructedEnum
void SmbGradientsComponentsx(FemModel *femmodel)
ElementVector * CreateDVector(Element *element)
void SmbGradientsx(FemModel *femmodel)
void Gembx(FemModel *femmodel)
virtual void DatasetInputCreate(IssmDouble *array, int M, int N, int *individual_enums, int num_inputs, Inputs2 *inputs2, IoModel *iomodel, int input_enum)
Declaration of Loads class.
: header file for generic external result object
#define _error_(StreamArgs)
int DofsPerNode(int **doflist, int domaintype, int approximation)
bool VerboseSolution(void)
Object * GetObjectByOffset(int offset)
@ SmbMonthlytemperaturesEnum
virtual void Update(Inputs2 *inputs2, int index, IoModel *iomodel, int analysis_counter, int analysis_type, int finite_element)=0
void SmbSemicx(FemModel *femmodel)
@ SmbNumRequestedOutputsEnum
@ SmbDailyairhumidityEnum
void FindParam(bool *pinteger, int enum_type)
@ SmbInitDensityScalingEnum
@ SmbPrecipitationsAnomalyEnum
void MungsmtpParameterizationx(FemModel *femmodel)
void FetchDataToInput(Inputs2 *inputs2, Elements *elements, const char *vector_name, int input_enum)
void FetchDataToDatasetInput(Inputs2 *inputs2, Elements *elements, const char *vector_name, int input_enum)
void UpdateElements(Elements *elements, Inputs2 *inputs2, IoModel *iomodel, int analysis_counter, int analysis_type)
void CreateNodes(Nodes *nodes, IoModel *iomodel, bool isamr=false)
@ SmbTemperaturesReconstructedYearsEnum
@ SmbDailydlradiationEnum
@ SmbThermoDeltaTScalingEnum
void SmbHenningx(FemModel *femmodel)