Changeset 8561
- Timestamp:
- 06/08/11 14:02:04 (14 years ago)
- Location:
- issm/trunk/src/c
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk/src/c/objects/Elements/Tria.cpp
r8549 r8561 991 991 double Ke_gg_gaussian2[numdof][numdof] ={0.0}; 992 992 double Ke_gg_gaussian3[numdof][numdof] ={0.0}; 993 double hydro_ gamma,hydro_p,hydro_q,hydro_CR,hydro_n,rho_water,g;993 double hydro_p,hydro_q,hydro_CR,hydro_n,rho_water,g,gamma; 994 994 double DL_scalar1; 995 995 double DL_scalar2; … … 1005 1005 1006 1006 /*retrieve material parameters: */ 1007 // hydro_gamma=matpar->GetGamma(); 1008 g =matpar->GetG(); 1009 rho_water =matpar->GetRhoWater(); 1010 hydro_p =matpar->GetHydroP(); 1011 hydro_q =matpar->GetHydroQ(); 1012 hydro_CR =matpar->GetHydroCR(); 1013 hydro_n =matpar->GetHydroN(); 1014 1015 hydro_gamma=1/(hydro_n*pow(hydro_CR,hydro_p)*pow((rho_water*g),hydro_q)); 1007 g =matpar->GetG(); 1008 rho_water=matpar->GetRhoWater(); 1009 hydro_p =matpar->GetHydroP(); 1010 hydro_q =matpar->GetHydroQ(); 1011 hydro_CR =matpar->GetHydroCR(); 1012 hydro_n =matpar->GetHydroN(); 1013 gamma=1/(hydro_n*pow(hydro_CR,hydro_p)*pow((rho_water*g),hydro_q)); 1016 1014 1017 1015 /* Start looping on the number of gaussian points: */ … … 1024 1022 GetNodalFunctions(&L[0],gauss); 1025 1023 GetNodalFunctionsDerivatives(&dL[0][0],&xyz_list[0][0],gauss); 1026 1024 //printf("NUMVERTICES=%d, Jdettria=%f\n",NUMVERTICES,Jdettria); //BK 1027 1025 for(i=0;i<NUMVERTICES;i++)dLx[i]=dL[0][i]; 1028 1029 1030 1031 printf("dLx[%d]=%f, L[%d]=%f\n",i,dLx[i]),i,L[i];}1032 for(i=0;i<NUMVERTICES;i++)1033 1034 1026 for(i=0;i<NUMVERTICES;i++)dLy[i]=dL[1][i]; 1027 /* for(i=0;i<NUMVERTICES;i++) 1028 { dLx[i]=dL[0][i]; 1029 printf("dLx[%d]=%f, L[%d]=%f\n",i,dLx[i]),i,L[i];} 1030 for(i=0;i<NUMVERTICES;i++) 1031 { dLy[i]=dL[1][i]; 1032 printf("dLy[%d]=%f\n",i,dLy[i]);} */ 1035 1033 1036 1034 /*Get K parameter: */ 1037 1035 GetHydrologyK(&K[0],&xyz_list[0][0],gauss); 1038 //printf("K[0]=%g,K[1]=%g\n",K[0],K[1]);1036 //printf("K[0]=%g,K[1]=%g\n",K[0],K[1]); 1039 1037 1040 1038 if(dt){ … … 1047 1045 1048 1046 if(dt){ 1049 DL_scalar2=-gauss->weight*Jdettria* hydro_gamma*K[0]*dt; //don't forget the -1050 DL_scalar3=-gauss->weight*Jdettria* hydro_gamma*K[1]*dt; //don't forget the -1047 DL_scalar2=-gauss->weight*Jdettria*gamma*K[0]*dt; //don't forget the - 1048 DL_scalar3=-gauss->weight*Jdettria*gamma*K[1]*dt; //don't forget the - 1051 1049 1052 1050 } 1053 1051 else{ 1054 DL_scalar2=-gauss->weight*Jdettria* hydro_gamma*K[0]; //don't forget the -1055 DL_scalar3=-gauss->weight*Jdettria* hydro_gamma*K[1]; //don't forget the -1052 DL_scalar2=-gauss->weight*Jdettria*gamma*K[0]; //don't forget the - 1053 DL_scalar3=-gauss->weight*Jdettria*gamma*K[1]; //don't forget the - 1056 1054 } 1057 1055 … … 2105 2103 basal_melting_input->GetParameterValue(&basal_melting_g,gauss); 2106 2104 old_watercolumn_input->GetParameterValue(&old_watercolumn_g,gauss); 2107 //printf("ig=%d, old_watercolumn_g=%f,Jdettria=%f\n",ig,old_watercolumn_g,Jdettria);//bk2108 //if(old_watercolumn_g<0) printf("old_watercolumn_g=%g,Jdettria=%f\n",old_watercolumn_g,Jdettria);//bk2105 //printf("ig=%d, old_watercolumn_g=%f,Jdettria=%f\n",ig,old_watercolumn_g,Jdettria);//bk 2106 //if(old_watercolumn_g<0) printf("old_watercolumn_g=%g,Jdettria=%f\n",old_watercolumn_g,Jdettria);//bk 2109 2107 2110 2108 if(dt)for(i=0;i<numdof;i++) pe->values[i]+=Jdettria*gauss->weight*(old_watercolumn_g+dt*basal_melting_g)*L[i]; … … 2715 2713 watercolumn_input->GetParameterValue(&watercolumn,gauss); 2716 2714 values[i]=watercolumn; 2717 // if((values[i])<0)values[i]=0;2718 2715 } 2719 2716 … … 2803 2800 2804 2801 //bk 2805 // K[0]=fabs(pow(w,2)*(rho_ice*g*dsdx+(rho_water/rho_ice-1)*rho_ice*g*dbdx) - rho_ice * g * kn* w * (dsdx - dbdx ) * surface_slope); 2806 // K[1]=fabs(pow(w,2)*(rho_ice*g*dsdy+(rho_water/rho_ice-1)*rho_ice*g*dbdy) - rho_ice * g * kn *w * (dsdy - dbdy ) * surface_slope); 2807 // printf("K[0]=%g,K[1]=%g,w=%g\n",K[0],K[1],w); //bk 2808 // if (w<0) {printf("negative w!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n"); 2809 // printf("K[0]=%g,K[1]=%g,w=%g\n",K[0],K[1],w);} 2810 2811 2812 } 2813 2802 //K[0]=fabs(pow(w,2)*(rho_ice*g*dsdx+(rho_water/rho_ice-1)*rho_ice*g*dbdx) - rho_ice * g * kn* w * (dsdx - dbdx ) * surface_slope); 2803 //K[1]=fabs(pow(w,2)*(rho_ice*g*dsdy+(rho_water/rho_ice-1)*rho_ice*g*dbdy) - rho_ice * g * kn *w * (dsdy - dbdy ) * surface_slope); 2804 //printf("K[0]=%g,K[1]=%g,w=%g\n",K[0],K[1],w); //bk 2805 //if (w<0) {printf("negative w!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n"); 2806 //printf("K[0]=%g,K[1]=%g,w=%g\n",K[0],K[1],w);} 2807 } 2814 2808 /*}}}*/ 2815 2809 /*FUNCTION Tria::Gradj {{{1*/ … … 3940 3934 values[i]=solution[doflist[i]]; 3941 3935 if(isnan(values[i])) _error_("NaN found in solution vector"); 3942 //if (values[i]<pow(10,-10))values[i]=pow(10,-10); //correcting the water column to positive values3936 //if (values[i]<pow(10,-10))values[i]=pow(10,-10); //correcting the water column to positive values 3943 3937 3944 3938 } -
issm/trunk/src/c/objects/IoModel.cpp
r8551 r8561 226 226 IoModelFetchData(&this->numforcings,iomodel_handle,"numforcings"); 227 227 228 /*!Get hydrology parameters: */ 229 // IoModelFetchData(&this->hydro_gamma,iomodel_handle,"hydro_gamma"); 228 /*!Get hydrology parameters: */ 230 229 IoModelFetchData(&this->hydro_kn,iomodel_handle,"hydro_kn"); 231 230 IoModelFetchData(&this->hydro_p,iomodel_handle,"hydro_p"); … … 233 232 IoModelFetchData(&this->hydro_CR,iomodel_handle,"hydro_CR"); 234 233 IoModelFetchData(&this->hydro_n,iomodel_handle,"hydro_n"); 234 235 235 /*qmu: */ 236 236 if(this->qmu_analysis){ -
issm/trunk/src/c/objects/IoModel.h
r8549 r8561 227 227 int constraintcounter; //keep track of how many constraints are being created in each analysis type 228 228 229 /*hydrology parameters: */ 230 // double hydro_gamma; 231 double hydro_kn; 232 double hydro_p; 233 double hydro_q; 234 double hydro_CR; 235 double hydro_n; 229 /*hydrology parameters: */ 230 double hydro_kn; 231 double hydro_p; 232 double hydro_q; 233 double hydro_CR; 234 double hydro_n; 236 235 /*}}}*/ 237 236 /*Methods: {{{1*/ -
issm/trunk/src/c/objects/Materials/Matpar.cpp
r8549 r8561 36 36 double matpar_thermal_exchange_velocity; 37 37 double matpar_g; 38 double matpar_gamma;39 38 double matpar_kn; 40 39 … … 50 49 matpar_mixed_layer_capacity=iomodel->mixed_layer_capacity; 51 50 matpar_thermal_exchange_velocity=iomodel->thermal_exchange_velocity; 52 // matpar_gamma=iomodel->hydro_gamma;53 51 matpar_kn=iomodel->hydro_kn; 54 52 … … 65 63 this->thermal_exchange_velocity=matpar_thermal_exchange_velocity; 66 64 this->g=matpar_g; 67 this->gamma=matpar_gamma;68 65 this->kn=matpar_kn; 69 66 this->hydro_p=iomodel->hydro_p; … … 96 93 printf(" thermal_exchange_velocity: %g\n",thermal_exchange_velocity); 97 94 printf(" g: %g\n",g); 98 printf(" gamma: %g\n",gamma);99 95 printf(" kn: %g\n",kn); 100 96 return; … … 117 113 printf(" thermal_exchange_velocity: %g\n",thermal_exchange_velocity); 118 114 printf(" g: %g\n",g); 119 printf(" gamma: %g\n",gamma);120 115 printf(" kn: %g\n",kn); 121 116 return; … … 159 154 memcpy(marshalled_dataset,&thermal_exchange_velocity,sizeof(thermal_exchange_velocity));marshalled_dataset+=sizeof(thermal_exchange_velocity); 160 155 memcpy(marshalled_dataset,&g,sizeof(g));marshalled_dataset+=sizeof(g); 161 memcpy(marshalled_dataset,&gamma,sizeof(gamma));marshalled_dataset+=sizeof(gamma);162 156 memcpy(marshalled_dataset,&kn,sizeof(kn));marshalled_dataset+=sizeof(kn); 163 157 … … 181 175 sizeof(thermal_exchange_velocity)+ 182 176 sizeof(g)+ 183 sizeof(gamma)+184 177 sizeof(kn)+ 185 178 sizeof(int); //sizeof(int) for enum type … … 209 202 memcpy(&thermal_exchange_velocity,marshalled_dataset,sizeof(thermal_exchange_velocity));marshalled_dataset+=sizeof(thermal_exchange_velocity); 210 203 memcpy(&g,marshalled_dataset,sizeof(g));marshalled_dataset+=sizeof(g); 211 memcpy(&gamma,marshalled_dataset,sizeof(gamma));marshalled_dataset+=sizeof(gamma);212 204 memcpy(&kn,marshalled_dataset,sizeof(kn));marshalled_dataset+=sizeof(kn); 213 205 … … 393 385 double Matpar::GetThermalExchangeVelocity(){ 394 386 return thermal_exchange_velocity; 395 }396 /*}}}1*/397 /*FUNCTION Matpar::GetGamma {{{1*/398 double Matpar::GetGamma(){399 return gamma;400 387 } 401 388 /*}}}1*/ -
issm/trunk/src/c/objects/Materials/Matpar.h
r8549 r8561 30 30 /*hydrology: */ 31 31 double kn; 32 double gamma;33 32 double hydro_p; 34 33 double hydro_q; 35 34 double hydro_CR; 36 35 double hydro_n; 36 37 37 public: 38 39 38 Matpar(); 40 41 39 Matpar(int matpar_id, IoModel* iomodel); 42 40 ~Matpar(); … … 83 81 double GetMeltingPoint(); 84 82 double GetReferenceTemperature(); 85 double GetGamma();86 83 double GetKn(); 87 84 double GetHydroP(); 88 85 double GetHydroQ(); 89 90 86 double GetHydroCR(); 87 double GetHydroN(); 91 88 double TMeltingPoint(double pressure); 92 89 double PureIceEnthalpy(double pressure); -
issm/trunk/src/c/solutions/hydrology_core.cpp
r8549 r8561 46 46 time=(i+1)*dt; 47 47 48 // printf("time step=%d=============================\n",i+1);//bk49 48 /*call hydrology_core step: */ 50 49 hydrology_core_step(femmodel,i,time);
Note:
See TracChangeset
for help on using the changeset viewer.