5 #include "../../Enum/EnumDefinitions.h"
6 #include "../../MemOps/MemOps.h"
7 #include "../../Exceptions/exceptions.h"
12 char* fieldname = NULL;
15 if(strcmp(string_in,
"Thickness")==0 || strcmp(string_in,
"md.geometry.thickness")==0){
16 const char* field =
"md.geometry.thickness";
18 fieldname=xNew<char>((strlen(field)+1)); xMemCpy<char>(fieldname,field,(strlen(field)+1));
20 else if(strcmp(string_in,
"MaterialsRheologyBbar")==0){
21 const char* field =
"md.materials.rheology_B";
23 fieldname=xNew<char>((strlen(field)+1)); xMemCpy<char>(fieldname,field,(strlen(field)+1));
25 else if(strcmp(string_in,
"MaterialsRheologyB")==0){
26 const char* field =
"md.materials.rheology_B";
28 fieldname=xNew<char>((strlen(field)+1)); xMemCpy<char>(fieldname,field,(strlen(field)+1));
30 else if(strcmp(string_in,
"SmbMassBalance")==0){
31 const char* field =
"md.smb.mass_balance";
33 fieldname=xNew<char>((strlen(field)+1)); xMemCpy<char>(fieldname,field,(strlen(field)+1));
35 else if(strcmp(string_in,
"SmbAccumulation")==0){
36 const char* field =
"md.smb.accumulation";
38 fieldname=xNew<char>((strlen(field)+1)); xMemCpy<char>(fieldname,field,(strlen(field)+1));
40 else if(strcmp(string_in,
"SmbMelt")==0){
41 const char* field =
"md.smb.melt";
43 fieldname=xNew<char>((strlen(field)+1)); xMemCpy<char>(fieldname,field,(strlen(field)+1));
45 else if(strcmp(string_in,
"SmbRefreeze")==0){
46 const char* field =
"md.smb.refreeze";
48 fieldname=xNew<char>((strlen(field)+1)); xMemCpy<char>(fieldname,field,(strlen(field)+1));
50 else if(strcmp(string_in,
"SmbRunoff")==0){
51 const char* field =
"md.smb.runoff";
53 fieldname=xNew<char>((strlen(field)+1)); xMemCpy<char>(fieldname,field,(strlen(field)+1));
55 else if(strcmp(string_in,
"SmbEvaporation")==0){
56 const char* field =
"md.smb.evaporation";
58 fieldname=xNew<char>((strlen(field)+1)); xMemCpy<char>(fieldname,field,(strlen(field)+1));
60 else if(strcmp(string_in,
"SmbTa")==0){
61 const char* field =
"md.smb.Ta";
63 fieldname=xNew<char>((strlen(field)+1)); xMemCpy<char>(fieldname,field,(strlen(field)+1));
65 else if(strcmp(string_in,
"SmbV")==0){
66 const char* field =
"md.smb.V";
68 fieldname=xNew<char>((strlen(field)+1)); xMemCpy<char>(fieldname,field,(strlen(field)+1));
70 else if(strcmp(string_in,
"SmbDswrf")==0){
71 const char* field =
"md.smb.dswrf";
73 fieldname=xNew<char>((strlen(field)+1)); xMemCpy<char>(fieldname,field,(strlen(field)+1));
75 else if(strcmp(string_in,
"SmbDlwrf")==0){
76 const char* field =
"md.smb.dlwrf";
78 fieldname=xNew<char>((strlen(field)+1)); xMemCpy<char>(fieldname,field,(strlen(field)+1));
80 else if(strcmp(string_in,
"SmbP")==0){
81 const char* field =
"md.smb.P";
83 fieldname=xNew<char>((strlen(field)+1)); xMemCpy<char>(fieldname,field,(strlen(field)+1));
85 else if(strcmp(string_in,
"SmbEAir")==0){
86 const char* field =
"md.smb.eAir";
88 fieldname=xNew<char>((strlen(field)+1)); xMemCpy<char>(fieldname,field,(strlen(field)+1));
90 else if(strcmp(string_in,
"SmbPAir")==0){
91 const char* field =
"md.smb.pAir";
93 fieldname=xNew<char>((strlen(field)+1)); xMemCpy<char>(fieldname,field,(strlen(field)+1));
95 else if(strcmp(string_in,
"SmbVz")==0){
96 const char* field =
"md.smb.Vz";
98 fieldname=xNew<char>((strlen(field)+1)); xMemCpy<char>(fieldname,field,(strlen(field)+1));
100 else if(strcmp(string_in,
"SmbTz")==0){
101 const char* field =
"md.smb.Tz";
103 fieldname=xNew<char>((strlen(field)+1)); xMemCpy<char>(fieldname,field,(strlen(field)+1));
105 else if(strcmp(string_in,
"SmbC")==0){
106 const char* field =
"md.smb.C";
108 fieldname=xNew<char>((strlen(field)+1)); xMemCpy<char>(fieldname,field,(strlen(field)+1));
110 else if(strcmp(string_in,
"BasalforcingsFloatingiceMeltingRate")==0){
111 const char* field =
"md.basalforcings.floatingice_melting_rate";
113 fieldname=xNew<char>((strlen(field)+1)); xMemCpy<char>(fieldname,field,(strlen(field)+1));
115 else if(strcmp(string_in,
"BasalforcingsGeothermalflux")==0){
116 const char* field =
"md.basalforcings.geothermalflux";
118 fieldname=xNew<char>((strlen(field)+1)); xMemCpy<char>(fieldname,field,(strlen(field)+1));
120 else if(strcmp(string_in,
"FrictionCoefficient")==0 || strcmp(string_in,
"md.friction.coefficient")==0){
121 const char* field =
"md.friction.coefficient";
123 fieldname=xNew<char>((strlen(field)+1)); xMemCpy<char>(fieldname,field,(strlen(field)+1));
125 else if(strcmp(string_in,
"FrictionEffectivePressure")==0){
126 const char* field =
"md.friction.effective_pressure";
128 fieldname=xNew<char>((strlen(field)+1)); xMemCpy<char>(fieldname,field,(strlen(field)+1));
130 else if(strcmp(string_in,
"Vx")==0){
131 const char* field =
"md.initialization.vx";
133 fieldname=xNew<char>((strlen(field)+1)); xMemCpy<char>(fieldname,field,(strlen(field)+1));
135 else if(strcmp(string_in,
"Vy")==0){
136 const char* field =
"md.initialization.vy";
138 fieldname=xNew<char>((strlen(field)+1)); xMemCpy<char>(fieldname,field,(strlen(field)+1));
140 else if(strcmp(string_in,
"BalancethicknessThickeningRate")==0){
141 const char* field =
"md.balancethickness.thickening_rate";
143 fieldname=xNew<char>((strlen(field)+1)); xMemCpy<char>(fieldname,field,(strlen(field)+1));
145 else if(strcmp(string_in,
"BalancethicknessSpcthickness")==0){
146 const char* field =
"md.balancethickness.spcthickness";
148 fieldname=xNew<char>((strlen(field)+1)); xMemCpy<char>(fieldname,field,(strlen(field)+1));
150 else if(strcmp(string_in,
"CalvingMeltingrate")==0){
151 const char* field =
"md.calving.meltingrate";
153 fieldname=xNew<char>((strlen(field)+1)); xMemCpy<char>(fieldname,field,(strlen(field)+1));
155 else if(strcmp(string_in,
"CalvingStressThresholdGroundedice")==0){
156 const char* field =
"md.calving.stress_threshold_groundedice";
158 fieldname=xNew<char>((strlen(field)+1)); xMemCpy<char>(fieldname,field,(strlen(field)+1));
160 else if(strcmp(string_in,
"DamageDbar")==0){
161 const char* field =
"md.damage.D";
163 fieldname=xNew<char>((strlen(field)+1)); xMemCpy<char>(fieldname,field,(strlen(field)+1));
165 else if(strcmp(string_in,
"SurfaceloadIceThicknessChange")==0){
166 const char* field =
"md.solidearth.surfaceload.iceheightchange";
168 fieldname=xNew<char>((strlen(field)+1)); xMemCpy<char>(fieldname,field,(strlen(field)+1));
170 else if(strcmp(string_in,
"NGiaRate")==0){
171 const char* field =
"md.gia.Ngia";
173 fieldname=xNew<char>((strlen(field)+1)); xMemCpy<char>(fieldname,field,(strlen(field)+1));
175 else if(strcmp(string_in,
"DslGlobalAverageThermostericSeaLevelChange")==0){
176 const char* field =
"md.dsl.global_average_thermosteric_sea_level_change";
178 fieldname=xNew<char>((strlen(field)+1)); xMemCpy<char>(fieldname,field,(strlen(field)+1));
180 else if(strcmp(string_in,
"SurfaceloadWaterHeightChange")==0){
181 const char* field =
"md.solidearth.surfaceload.waterheightchange";
183 fieldname=xNew<char>((strlen(field)+1)); xMemCpy<char>(fieldname,field,(strlen(field)+1));
185 else if(strcmp(string_in,
"UGiaRate")==0){
186 const char* field =
"md.gia.Ugia";
188 fieldname=xNew<char>((strlen(field)+1)); xMemCpy<char>(fieldname,field,(strlen(field)+1));
191 _error_(
"Field \""<<string_in<<
"\" not supported yet");
195 *out_enum = input_enum;
213 default:
_error_(
"Marshalled SMB code \""<<enum_in<<
"\" not supported yet");
226 default:
_error_(
"Marshalled Basal Forcings code \""<<enum_in<<
"\" not supported yet");
238 default:
_error_(
"Marshalled Calving law code \""<<enum_in<<
"\" not supported yet");
245 default:
_error_(
"Marshalled Frontalforcings code \""<<enum_in<<
"\" not supported yet");
255 default:
_error_(
"Marshalled hydrology code \""<<enum_in<<
"\" not supported yet");
267 default:
_error_(
"Marshalled materials code \""<<enum_in<<
"\" not supported yet");
279 default:
_error_(
"Marshalled materials nature code \""<<enum_in<<
"\" not supported yet");
286 default:
_error_(
"Marshalled materials code \""<<enum_in<<
"\" not supported yet");
293 default:
_error_(
"Marshalled AMR code \""<<enum_in<<
"\" not supported yet");
308 default:
_error_(
"Marshalled vertex equation code \""<<enum_in<<
"\" not supported yet.");
322 default:
_error_(
"Marshalled element equation code \""<<enum_in<<
"\" not supported yet.");
333 default:
_error_(
"Marshalled Riftfill enum \""<<enum_in<<
"\" not supported yet.");