Changeset 24353
- Timestamp:
- 11/18/19 21:32:19 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/c/classes/Elements/Element.cpp
r24349 r24353 3742 3742 Input2 *Tz_input = this->GetInput2(SmbTzEnum); _assert_(Tz_input); 3743 3743 Input2 *Vz_input = this->GetInput2(SmbVzEnum); _assert_(Vz_input); 3744 Input *Ta_input = this->GetInput(SmbTaEnum); _assert_(Ta_input);3745 Input *V_input = this->GetInput(SmbVEnum); _assert_(V_input);3746 Input *Dlwr_input = this->GetInput(SmbDlwrfEnum); _assert_(Dlwr_input);3747 Input *Dswr_input = this->GetInput(SmbDswrfEnum); _assert_(Dswr_input);3748 Input *P_input = this->GetInput(SmbPEnum); _assert_(P_input);3749 Input *eAir_input = this->GetInput(SmbEAirEnum); _assert_(eAir_input);3750 Input *pAir_input = this->GetInput(SmbPAirEnum); _assert_(pAir_input);3751 3744 Input2 *teValue_input = this->GetInput2(SmbTeValueEnum); _assert_(teValue_input); 3752 3745 Input2 *aValue_input = this->GetInput2(SmbAValueEnum); _assert_(aValue_input); 3746 3747 TransientInput2 *Ta_input = this->inputs2->GetTransientInput(SmbTaEnum); _assert_(Ta_input); 3748 TransientInput2 *V_input = this->inputs2->GetTransientInput(SmbVEnum); _assert_(V_input); 3749 TransientInput2 *Dlwr_input = this->inputs2->GetTransientInput(SmbDlwrfEnum); _assert_(Dlwr_input); 3750 TransientInput2 *Dswr_input = this->inputs2->GetTransientInput(SmbDswrfEnum); _assert_(Dswr_input); 3751 TransientInput2 *P_input = this->inputs2->GetTransientInput(SmbPEnum); _assert_(P_input); 3752 TransientInput2 *eAir_input = this->inputs2->GetTransientInput(SmbEAirEnum); _assert_(eAir_input); 3753 TransientInput2 *pAir_input = this->inputs2->GetTransientInput(SmbPAirEnum); _assert_(pAir_input); 3753 3754 3754 3755 /*Retrieve input values:*/ … … 3882 3883 if (isclimatology){ 3883 3884 //If this is a climatology, we need to repeat the forcing after the final time 3884 offsetend =dynamic_cast<TransientInput*>(Ta_input)->GetTimeInputOffset(finaltime);3885 time0 =dynamic_cast<TransientInput*>(Ta_input)->GetTimeByOffset(-1);3886 timeend =dynamic_cast<TransientInput*>(Ta_input)->GetTimeByOffset(offsetend);3885 offsetend = Ta_input->GetTimeInputOffset(finaltime); 3886 time0 = Ta_input->GetTimeByOffset(-1); 3887 timeend = Ta_input->GetTimeByOffset(offsetend); 3887 3888 if (time>time0 & timeend>time0){ 3888 3889 delta=(time-time0) - (timeend-time0)*(reCast<int,IssmDouble>((time-time0)/(timeend-time0))); … … 3897 3898 if(VerboseSmb() && this->Sid()==0 && IssmComm::GetRank()==0)_printf0_("Time: t=" << setprecision(8) << t/365.0/24.0/3600.0 << " yr/" << (time+dt)/365.0/24.0/3600.0 << " yr" << setprecision(3) << " Step: " << count << "\n"); 3898 3899 3900 Input2* Ta_input2 = this->GetInput2(SmbTaEnum,t-time+timeclim); _assert_(Ta_input2); 3901 Input2 *V_input2 = this->GetInput2(SmbVEnum,t-time+timeclim); _assert_(V_input); 3902 Input2 *Dlwr_input2= this->GetInput2(SmbDlwrfEnum,t-time+timeclim); _assert_(Dlwr_input); 3903 Input2 *Dswr_input2= this->GetInput2(SmbDswrfEnum,t-time+timeclim); _assert_(Dswr_input); 3904 Input2 *P_input2 = this->GetInput2(SmbPEnum,t-time+timeclim); _assert_(P_input); 3905 Input2 *eAir_input2= this->GetInput2(SmbEAirEnum,t-time+timeclim); _assert_(eAir_input); 3906 Input2 *pAir_input2= this->GetInput2(SmbPAirEnum,t-time+timeclim); _assert_(pAir_input); 3907 3899 3908 /*extract daily data:{{{*/ 3900 Ta_input ->GetInputValue(&Ta,gauss,t-time+timeclim);//screen level air temperature [K]3901 V_input->GetInputValue(&V,gauss ,t-time+timeclim); //wind speed [m s-1]3902 Dlwr_input->GetInputValue(&dlw,gauss ,t-time+timeclim); //downward longwave radiation flux [W m-2]3903 Dswr_input->GetInputValue(&dsw,gauss ,t-time+timeclim); //downward shortwave radiation flux [W m-2]3904 P_input->GetInputValue(&P,gauss ,t-time+timeclim); //precipitation [kg m-2]3905 eAir_input->GetInputValue(&eAir,gauss ,t-time+timeclim); //screen level vapor pressure [Pa]3906 pAir_input->GetInputValue(&pAir,gauss ,t-time+timeclim); // screen level air pressure [Pa]3909 Ta_input2->GetInputValue(&Ta,gauss);//screen level air temperature [K] 3910 V_input->GetInputValue(&V,gauss); //wind speed [m s-1] 3911 Dlwr_input->GetInputValue(&dlw,gauss); //downward longwave radiation flux [W m-2] 3912 Dswr_input->GetInputValue(&dsw,gauss); //downward shortwave radiation flux [W m-2] 3913 P_input->GetInputValue(&P,gauss); //precipitation [kg m-2] 3914 eAir_input->GetInputValue(&eAir,gauss); //screen level vapor pressure [Pa] 3915 pAir_input->GetInputValue(&pAir,gauss); // screen level air pressure [Pa] 3907 3916 teValue_input->GetInputValue(&teValue,gauss); // Emissivity [0-1] 3908 3917 aValue_input->GetInputValue(&aValue,gauss); // screen level air pressure [Pa] … … 4021 4030 this->AddInput(new DoubleArrayInput(SmbWEnum,W,m)); 4022 4031 this->AddInput(new DoubleArrayInput(SmbAEnum,a,m)); 4023 this-> AddInput(new DoubleInput(SmbMassBalanceEnum,(sumP + sumEC -sumR)/dt/rho_ice));4024 this-> AddInput(new DoubleInput(SmbMeltEnum,sumM/dt/rho_ice));4025 this-> AddInput(new DoubleInput(SmbRunoffEnum,sumR/dt/rho_ice));4026 this-> AddInput(new DoubleInput(SmbPrecipitationEnum,sumP/dt/rho_ice));4027 this-> AddInput(new DoubleInput(SmbMeanULWEnum,meanULW));4028 this-> AddInput(new DoubleInput(SmbNetLWEnum,netLW));4029 this-> AddInput(new DoubleInput(SmbNetSWEnum,netSW));4030 this-> AddInput(new DoubleInput(SmbMeanLHFEnum,meanLHF));4031 this-> AddInput(new DoubleInput(SmbMeanSHFEnum,meanSHF));4032 this-> AddInput(new DoubleInput(SmbDzAddEnum,sumdz_add));4033 this-> AddInput(new DoubleInput(SmbMAddEnum,sumMassAdd/dt));4034 this-> AddInput(new DoubleInput(SmbFACEnum,fac/1000)); // output in meters4032 this->SetElementInput(SmbMassBalanceEnum,(sumP + sumEC -sumR)/dt/rho_ice); 4033 this->SetElementInput(SmbMeltEnum,sumM/dt/rho_ice); 4034 this->SetElementInput(SmbRunoffEnum,sumR/dt/rho_ice); 4035 this->SetElementInput(SmbPrecipitationEnum,sumP/dt/rho_ice); 4036 this->SetElementInput(SmbMeanULWEnum,meanULW); 4037 this->SetElementInput(SmbNetLWEnum,netLW); 4038 this->SetElementInput(SmbNetSWEnum,netSW); 4039 this->SetElementInput(SmbMeanLHFEnum,meanLHF); 4040 this->SetElementInput(SmbMeanSHFEnum,meanSHF); 4041 this->SetElementInput(SmbDzAddEnum,sumdz_add); 4042 this->SetElementInput(SmbMAddEnum,sumMassAdd/dt); 4043 this->SetElementInput(SmbFACEnum,fac/1000.); // output in meters 4035 4044 4036 4045 /*Free allocations:{{{*/
Note:
See TracChangeset
for help on using the changeset viewer.