Changeset 26550
- Timestamp:
- 11/05/21 15:15:23 (3 years ago)
- Location:
- issm/trunk-jpl/src
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/c/analyses/SmbAnalysis.cpp
r26477 r26550 75 75 iomodel->FetchDataToInput(inputs,elements,"md.smb.Sizeini",SmbSizeiniEnum); 76 76 iomodel->FetchDataToInput(inputs,elements,"md.smb.aValue",SmbAValueEnum); 77 iomodel->FetchDataToInput(inputs,elements,"md.smb.dulwrfValue",SmbDulwrfValueEnum); 77 78 iomodel->FetchDataToInput(inputs,elements,"md.smb.teValue",SmbTeValueEnum); 78 79 iomodel->FetchDataToInput(inputs,elements,"md.smb.szaValue",SmbSzaValueEnum); … … 242 243 case SMBgembEnum: 243 244 parameters->AddObject(iomodel->CopyConstantObject("md.smb.aIdx",SmbAIdxEnum)); 245 parameters->AddObject(iomodel->CopyConstantObject("md.smb.eIdx",SmbEIdxEnum)); 244 246 parameters->AddObject(iomodel->CopyConstantObject("md.smb.swIdx",SmbSwIdxEnum)); 245 247 parameters->AddObject(iomodel->CopyConstantObject("md.smb.denIdx",SmbDenIdxEnum)); … … 261 263 parameters->AddObject(iomodel->CopyConstantObject("md.smb.isturbulentflux",SmbIsturbulentfluxEnum)); 262 264 parameters->AddObject(iomodel->CopyConstantObject("md.smb.isconstrainsurfaceT",SmbIsconstrainsurfaceTEnum)); 265 parameters->AddObject(iomodel->CopyConstantObject("md.smb.isdeltaLWup",SmbIsdeltaLWupEnum)); 263 266 parameters->AddObject(iomodel->CopyConstantObject("md.smb.InitDensityScaling",SmbInitDensityScalingEnum)); 264 267 parameters->AddObject(iomodel->CopyConstantObject("md.smb.ThermoDeltaTScaling",SmbThermoDeltaTScalingEnum)); 265 268 parameters->AddObject(iomodel->CopyConstantObject("md.smb.adThresh",SmbAdThreshEnum)); 269 parameters->AddObject(iomodel->CopyConstantObject("md.smb.teThresh",SmbTeThreshEnum)); 266 270 break; 267 271 case SMBpddEnum: -
issm/trunk-jpl/src/c/classes/Elements/Element.cpp
r26526 r26550 3778 3778 IssmDouble teValue=1.0; 3779 3779 IssmDouble aValue=0.0; 3780 IssmDouble dulwrfValue=0.0; 3780 3781 IssmDouble szaValue=0.0; 3781 3782 IssmDouble cotValue=0.0; … … 3784 3785 IssmDouble dt,time,smb_dt; 3785 3786 int aIdx=0; 3787 int eIdx=0; 3786 3788 int denIdx=0; 3787 3789 int dsnowIdx=0; … … 3813 3815 bool isgraingrowth,isalbedo,isshortwave,isthermal,isaccumulation,ismelt,isdensification,isturbulentflux; 3814 3816 bool isconstrainsurfaceT=false; 3817 bool isdeltaLWup=false; 3815 3818 IssmDouble init_scaling=0.0; 3816 3819 IssmDouble thermo_scaling=1.0; 3817 3820 IssmDouble adThresh=1023.0; 3821 IssmDouble teThresh=10; 3818 3822 /*}}}*/ 3819 3823 /*Output variables:{{{ */ … … 3865 3869 parameters->FindParam(&smb_dt,SmbDtEnum); /*time period for the smb solution, usually smaller than the glaciological dt*/ 3866 3870 parameters->FindParam(&aIdx,SmbAIdxEnum); 3871 parameters->FindParam(&eIdx,SmbEIdxEnum); 3867 3872 parameters->FindParam(&denIdx,SmbDenIdxEnum); 3868 3873 parameters->FindParam(&swIdx,SmbSwIdxEnum); … … 3881 3886 parameters->FindParam(&isturbulentflux,SmbIsturbulentfluxEnum); 3882 3887 parameters->FindParam(&isconstrainsurfaceT,SmbIsconstrainsurfaceTEnum); 3888 parameters->FindParam(&isdeltaLWup,SmbIsdeltaLWupEnum); 3883 3889 parameters->FindParam(&init_scaling,SmbInitDensityScalingEnum); 3884 3890 parameters->FindParam(&thermo_scaling,SmbThermoDeltaTScalingEnum); 3885 3891 parameters->FindParam(&adThresh,SmbAdThreshEnum); 3892 parameters->FindParam(&teThresh,SmbTeThreshEnum); 3886 3893 /*}}}*/ 3887 3894 /*Retrieve inputs: {{{*/ … … 4073 4080 Input *teValue_input= this->GetInput(SmbTeValueEnum,timeinputs); _assert_(teValue_input); 4074 4081 Input *aValue_input= this->GetInput(SmbAValueEnum,timeinputs); _assert_(aValue_input); 4082 Input *dulwrfValue_input= this->GetInput(SmbDulwrfValueEnum,timeinputs); _assert_(dulwrfValue_input); 4075 4083 Input *szaValue_input= this->GetInput(SmbSzaValueEnum,timeinputs); _assert_(szaValue_input); 4076 4084 Input *cotValue_input= this->GetInput(SmbCotValueEnum,timeinputs); _assert_(cotValue_input); … … 4088 4096 pAir_input->GetInputValue(&pAir,gauss); // screen level air pressure [Pa] 4089 4097 teValue_input->GetInputValue(&teValue,gauss); // Emissivity [0-1] 4098 dulwrfValue_input->GetInputValue(&dulwrfValue,gauss); // LWup perturbation [W m-2] 4090 4099 aValue_input->GetInputValue(&aValue,gauss); // Albedo [0 1] 4091 4100 szaValue_input->GetInputValue(&szaValue,gauss); // Solar Zenith Angle [degree] … … 4113 4122 } 4114 4123 /*Thermal profile computation:*/ 4115 if(isthermal)thermo(&EC, &T, &ulw, dz, d, swf, dlw, Ta, V, eAir, pAir, teValue, W[0], smb_dt, m, Vz, Tz, thermo_scaling,rho_ice,this->Sid(),isconstrainsurfaceT);4124 if(isthermal)thermo(&EC, &T, &ulw, re, dz, d, swf, dlw, Ta, V, eAir, pAir, eIdx, teValue, dulwrfValue, teThresh, W[0], smb_dt, m, Vz, Tz, thermo_scaling,rho_ice,this->Sid(),isconstrainsurfaceT,isdeltaLWup); 4116 4125 4117 4126 /*Change in thickness of top cell due to evaporation/condensation assuming same density as top cell. -
issm/trunk-jpl/src/c/modules/SurfaceMassBalancex/Gembx.cpp
r26468 r26550 694 694 695 695 } /*}}}*/ 696 void thermo(IssmDouble* pEC, IssmDouble** pT, IssmDouble* pulwrf, IssmDouble* dz, IssmDouble* d, IssmDouble* swf, IssmDouble dlwrf, IssmDouble Ta, IssmDouble V, IssmDouble eAir, IssmDouble pAir, IssmDouble teValue, IssmDouble Ws, IssmDouble dt0, int m, IssmDouble Vz, IssmDouble Tz, IssmDouble thermo_scaling, IssmDouble dIce, int sid, bool isconstrainsurfaceT) { /*{{{*/696 void thermo(IssmDouble* pEC, IssmDouble** pT, IssmDouble* pulwrf, IssmDouble* re, IssmDouble* dz, IssmDouble* d, IssmDouble* swf, IssmDouble dlwrf, IssmDouble Ta, IssmDouble V, IssmDouble eAir, IssmDouble pAir, IssmDouble eIdx, IssmDouble teValue, IssmDouble dulwrfValue, IssmDouble teThresh, IssmDouble Ws, IssmDouble dt0, int m, IssmDouble Vz, IssmDouble Tz, IssmDouble thermo_scaling, IssmDouble dIce, int sid, bool isconstrainsurfaceT, bool isdeltaLWup) { /*{{{*/ 697 697 698 698 /* ENGLACIAL THERMODYNAMICS*/ … … 1010 1010 1011 1011 // upward longwave contribution 1012 //ulw = - (SB * pow(Ts,4.0)* teValue) * dt; // - deltatest here 1013 IssmDouble deltatest=0; 1014 ulw = - (SB * pow(Ts,4.0)* teValue - deltatest) * dt; // - deltatest here 1012 IssmDouble deltaULW=0.0; 1013 IssmDouble emissivity=1.0; 1014 //If user wants to set a upward long wave bias 1015 if(isdeltaLWup) deltaULW = dulwrfValue; 1016 //If user wants to directly set emissivity, or grain radius is larger than the 1017 // threshold, or eIdx is 2 and we have wet snow or ice, use prescribed emissivity 1018 if(eIdx==0 || (teThresh - re[0])<Gdntol || (eIdx==2 && z0>0.001)) emissivity = teValue; 1019 ulw = - (SB * pow(Ts,4.0)* emissivity + deltaULW) * dt; 1015 1020 ulwrf = ulwrf - ulw/dt0; 1016 1021 … … 2202 2207 if (fabs(adThresh - 820) < Dtol){ 2203 2208 // ERA5 new aIdx=1, swIdx=0, MODIS 820 2204 M0 = max(1.8230 - (0.1645 * log(C)),0.25); 2205 M1 = max(2.5134 - (0.3244 * log(C)),0.25); 2209 //M0 = max(1.8230 - (0.1645 * log(C)),0.25); 2210 //M1 = max(2.5134 - (0.3244 * log(C)),0.25); 2211 // ERA5 new aIdx=1, swIdx=0, MODIS 820, p90 new (ERA5, 40 and e97) 2212 M0 = max(1.3045 - (0.0988 * log(C)),0.25); 2213 M1 = max(1.3694 - (0.1354 * log(C)),0.25); 2206 2214 } 2207 2215 else{ … … 2246 2254 if (fabs(adThresh - 820) < Dtol){ 2247 2255 // ERA5 new aIdx=1, swIdx=0, MODIS 820 2248 M0 = max(1.4174 - (0.1037 * log(C)),0.25); 2249 M1 = max(2.2010 - (0.2460 * log(C)),0.25); 2256 //M0 = max(1.4174 - (0.1037 * log(C)),0.25); 2257 //M1 = max(2.2010 - (0.2460 * log(C)),0.25); 2258 // ERA5 new aIdx=1, swIdx=0, MODIS 820, p90 new (ERA5 lwt, 40 and e97) 2259 M0 = max(1.2138 - (0.1057 * log(C)),0.25); 2260 M1 = max(1.4946 - (0.1607 * log(C)),0.25); 2250 2261 } 2251 2262 else{ -
issm/trunk-jpl/src/c/modules/SurfaceMassBalancex/SurfaceMassBalancex.h
r26477 r26550 34 34 void albedo(IssmDouble** a, IssmDouble** adiff, int aIdx, IssmDouble* re, IssmDouble* dz, IssmDouble* d, IssmDouble cldFrac, IssmDouble aIce, IssmDouble aSnow, IssmDouble aValue, IssmDouble adThresh, IssmDouble* T, IssmDouble* W, IssmDouble P, IssmDouble EC, IssmDouble Msurf, IssmDouble clabSnow, IssmDouble clabIce, IssmDouble SZA, IssmDouble COT, IssmDouble t0wet, IssmDouble t0dry, IssmDouble K, IssmDouble dt, IssmDouble dIce, int m, int sid); 35 35 void shortwave(IssmDouble** pswf, int swIdx, int aIdx, IssmDouble dsw, IssmDouble dswdiff, IssmDouble as, IssmDouble asdiff, IssmDouble* d, IssmDouble* dz, IssmDouble* re, IssmDouble dIce, int m, int sid); 36 void thermo(IssmDouble* pEC, IssmDouble** T, IssmDouble* pulwrf, IssmDouble* dz, IssmDouble* d, IssmDouble* swf, IssmDouble dlw, IssmDouble Ta, IssmDouble V, IssmDouble eAir, IssmDouble pAir, IssmDouble teValue, IssmDouble Ws, IssmDouble dt0, int m, IssmDouble Vz, IssmDouble Tz, IssmDouble thermo_scaling, IssmDouble dIce, int sid, bool isconstrainsurfaceT);36 void thermo(IssmDouble* pEC, IssmDouble** T, IssmDouble* pulwrf, IssmDouble* re, IssmDouble* dz, IssmDouble* d, IssmDouble* swf, IssmDouble dlw, IssmDouble Ta, IssmDouble V, IssmDouble eAir, IssmDouble pAir, IssmDouble eIdx, IssmDouble teValue, IssmDouble dulwrfValue, IssmDouble teThresh, IssmDouble Ws, IssmDouble dt0, int m, IssmDouble Vz, IssmDouble Tz, IssmDouble thermo_scaling, IssmDouble dIce, int sid, bool isconstrainsurfaceT, bool isdeltaLWup); 37 37 void accumulation(IssmDouble** pT, IssmDouble** pdz, IssmDouble** pd, IssmDouble** pW, IssmDouble** pa, IssmDouble** padiff, IssmDouble** pre, IssmDouble** pgdn, IssmDouble** pgsp, IssmDouble* pRa, int* pm, int aIdx, int dsnowIdx, IssmDouble Tmean, IssmDouble Ta, IssmDouble P, IssmDouble dzMin, IssmDouble aSnow, IssmDouble C, IssmDouble V, IssmDouble Vmean, IssmDouble dIce, int sid); 38 38 void melt(IssmDouble* pM, IssmDouble* pMs, IssmDouble* pR, IssmDouble* pF, IssmDouble* pmAdd, IssmDouble* pdz_add, IssmDouble** pT, IssmDouble** pd, IssmDouble** pdz, IssmDouble** pW, IssmDouble** pa, IssmDouble** padiff, IssmDouble** pre, IssmDouble** pgdn, IssmDouble** pgsp, int* pn, IssmDouble Ra, IssmDouble dzMin, IssmDouble zMax, IssmDouble zMin, IssmDouble zTop, IssmDouble zY, IssmDouble dIce, int sid); -
issm/trunk-jpl/src/c/shared/Enum/Enum.vim
r26526 r26550 443 443 syn keyword cConstant SmbDtEnum 444 444 syn keyword cConstant SmbEnum 445 syn keyword cConstant SmbEIdxEnum 445 446 syn keyword cConstant SmbFEnum 446 447 syn keyword cConstant SmbInitDensityScalingEnum … … 451 452 syn keyword cConstant SmbIsdelta18oEnum 452 453 syn keyword cConstant SmbIsdensificationEnum 454 syn keyword cConstant SmbIsdeltaLWupEnum 453 455 syn keyword cConstant SmbIsfirnwarmingEnum 454 456 syn keyword cConstant SmbIsgraingrowthEnum … … 478 480 syn keyword cConstant SmbT0dryEnum 479 481 syn keyword cConstant SmbT0wetEnum 482 syn keyword cConstant SmbTeThreshEnum 480 483 syn keyword cConstant SmbTdiffEnum 481 484 syn keyword cConstant SmbThermoDeltaTScalingEnum … … 913 916 syn keyword cConstant SmbDiniEnum 914 917 syn keyword cConstant SmbDlwrfEnum 918 syn keyword cConstant SmbDulwrfValueEnum 915 919 syn keyword cConstant SmbDswrfEnum 916 920 syn keyword cConstant SmbDswdiffrfEnum -
issm/trunk-jpl/src/c/shared/Enum/EnumDefinitions.h
r26526 r26550 437 437 SmbDtEnum, 438 438 SmbEnum, 439 SmbEIdxEnum, 439 440 SmbFEnum, 440 441 SmbInitDensityScalingEnum, … … 445 446 SmbIsdelta18oEnum, 446 447 SmbIsdensificationEnum, 448 SmbIsdeltaLWupEnum, 447 449 SmbIsfirnwarmingEnum, 448 450 SmbIsgraingrowthEnum, … … 472 474 SmbT0dryEnum, 473 475 SmbT0wetEnum, 476 SmbTeThreshEnum, 474 477 SmbTdiffEnum, 475 478 SmbThermoDeltaTScalingEnum, … … 909 912 SmbDiniEnum, 910 913 SmbDlwrfEnum, 914 SmbDulwrfValueEnum, 911 915 SmbDswrfEnum, 912 916 SmbDswdiffrfEnum, -
issm/trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp
r26526 r26550 445 445 case SmbDtEnum : return "SmbDt"; 446 446 case SmbEnum : return "Smb"; 447 case SmbEIdxEnum : return "SmbEIdx"; 447 448 case SmbFEnum : return "SmbF"; 448 449 case SmbInitDensityScalingEnum : return "SmbInitDensityScaling"; … … 453 454 case SmbIsdelta18oEnum : return "SmbIsdelta18o"; 454 455 case SmbIsdensificationEnum : return "SmbIsdensification"; 456 case SmbIsdeltaLWupEnum : return "SmbIsdeltaLWup"; 455 457 case SmbIsfirnwarmingEnum : return "SmbIsfirnwarming"; 456 458 case SmbIsgraingrowthEnum : return "SmbIsgraingrowth"; … … 480 482 case SmbT0dryEnum : return "SmbT0dry"; 481 483 case SmbT0wetEnum : return "SmbT0wet"; 484 case SmbTeThreshEnum : return "SmbTeThresh"; 482 485 case SmbTdiffEnum : return "SmbTdiff"; 483 486 case SmbThermoDeltaTScalingEnum : return "SmbThermoDeltaTScaling"; … … 915 918 case SmbDiniEnum : return "SmbDini"; 916 919 case SmbDlwrfEnum : return "SmbDlwrf"; 920 case SmbDulwrfValueEnum : return "SmbDulwrfValue"; 917 921 case SmbDswrfEnum : return "SmbDswrf"; 918 922 case SmbDswdiffrfEnum : return "SmbDswdiffrf"; -
issm/trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp
r26526 r26550 454 454 else if (strcmp(name,"SmbDt")==0) return SmbDtEnum; 455 455 else if (strcmp(name,"Smb")==0) return SmbEnum; 456 else if (strcmp(name,"SmbEIdx")==0) return SmbEIdxEnum; 456 457 else if (strcmp(name,"SmbF")==0) return SmbFEnum; 457 458 else if (strcmp(name,"SmbInitDensityScaling")==0) return SmbInitDensityScalingEnum; … … 462 463 else if (strcmp(name,"SmbIsdelta18o")==0) return SmbIsdelta18oEnum; 463 464 else if (strcmp(name,"SmbIsdensification")==0) return SmbIsdensificationEnum; 465 else if (strcmp(name,"SmbIsdeltaLWup")==0) return SmbIsdeltaLWupEnum; 464 466 else if (strcmp(name,"SmbIsfirnwarming")==0) return SmbIsfirnwarmingEnum; 465 467 else if (strcmp(name,"SmbIsgraingrowth")==0) return SmbIsgraingrowthEnum; … … 489 491 else if (strcmp(name,"SmbT0dry")==0) return SmbT0dryEnum; 490 492 else if (strcmp(name,"SmbT0wet")==0) return SmbT0wetEnum; 493 else if (strcmp(name,"SmbTeThresh")==0) return SmbTeThreshEnum; 491 494 else if (strcmp(name,"SmbTdiff")==0) return SmbTdiffEnum; 492 495 else if (strcmp(name,"SmbThermoDeltaTScaling")==0) return SmbThermoDeltaTScalingEnum; … … 503 506 else if (strcmp(name,"StressbalanceAbstol")==0) return StressbalanceAbstolEnum; 504 507 else if (strcmp(name,"StressbalanceFSreconditioning")==0) return StressbalanceFSreconditioningEnum; 505 else if (strcmp(name,"StressbalanceIsnewton")==0) return StressbalanceIsnewtonEnum;506 else if (strcmp(name,"StressbalanceMaxiter")==0) return StressbalanceMaxiterEnum;507 else if (strcmp(name,"StressbalanceNumRequestedOutputs")==0) return StressbalanceNumRequestedOutputsEnum;508 508 else stage=5; 509 509 } 510 510 if(stage==5){ 511 if (strcmp(name,"StressbalancePenaltyFactor")==0) return StressbalancePenaltyFactorEnum; 511 if (strcmp(name,"StressbalanceIsnewton")==0) return StressbalanceIsnewtonEnum; 512 else if (strcmp(name,"StressbalanceMaxiter")==0) return StressbalanceMaxiterEnum; 513 else if (strcmp(name,"StressbalanceNumRequestedOutputs")==0) return StressbalanceNumRequestedOutputsEnum; 514 else if (strcmp(name,"StressbalancePenaltyFactor")==0) return StressbalancePenaltyFactorEnum; 512 515 else if (strcmp(name,"StressbalanceReltol")==0) return StressbalanceReltolEnum; 513 516 else if (strcmp(name,"StressbalanceRequestedOutputs")==0) return StressbalanceRequestedOutputsEnum; … … 626 629 else if (strcmp(name,"CalvingHabFraction")==0) return CalvingHabFractionEnum; 627 630 else if (strcmp(name,"CalvingMeltingrate")==0) return CalvingMeltingrateEnum; 628 else if (strcmp(name,"CalvingStressThresholdFloatingice")==0) return CalvingStressThresholdFloatingiceEnum;629 else if (strcmp(name,"CalvingStressThresholdGroundedice")==0) return CalvingStressThresholdGroundediceEnum;630 else if (strcmp(name,"CalvinglevermannCoeff")==0) return CalvinglevermannCoeffEnum;631 631 else stage=6; 632 632 } 633 633 if(stage==6){ 634 if (strcmp(name,"CalvingratexAverage")==0) return CalvingratexAverageEnum; 634 if (strcmp(name,"CalvingStressThresholdFloatingice")==0) return CalvingStressThresholdFloatingiceEnum; 635 else if (strcmp(name,"CalvingStressThresholdGroundedice")==0) return CalvingStressThresholdGroundediceEnum; 636 else if (strcmp(name,"CalvinglevermannCoeff")==0) return CalvinglevermannCoeffEnum; 637 else if (strcmp(name,"CalvingratexAverage")==0) return CalvingratexAverageEnum; 635 638 else if (strcmp(name,"Calvingratex")==0) return CalvingratexEnum; 636 639 else if (strcmp(name,"CalvingrateyAverage")==0) return CalvingrateyAverageEnum; … … 749 752 else if (strcmp(name,"HydrologySheetConductivity")==0) return HydrologySheetConductivityEnum; 750 753 else if (strcmp(name,"HydrologySheetThickness")==0) return HydrologySheetThicknessEnum; 751 else if (strcmp(name,"HydrologySheetThicknessOld")==0) return HydrologySheetThicknessOldEnum;752 else if (strcmp(name,"HydrologyTws")==0) return HydrologyTwsEnum;753 else if (strcmp(name,"HydrologyTwsSpc")==0) return HydrologyTwsSpcEnum;754 754 else stage=7; 755 755 } 756 756 if(stage==7){ 757 if (strcmp(name,"HydrologyTwsAnalysis")==0) return HydrologyTwsAnalysisEnum; 757 if (strcmp(name,"HydrologySheetThicknessOld")==0) return HydrologySheetThicknessOldEnum; 758 else if (strcmp(name,"HydrologyTws")==0) return HydrologyTwsEnum; 759 else if (strcmp(name,"HydrologyTwsSpc")==0) return HydrologyTwsSpcEnum; 760 else if (strcmp(name,"HydrologyTwsAnalysis")==0) return HydrologyTwsAnalysisEnum; 758 761 else if (strcmp(name,"HydrologyWatercolumnMax")==0) return HydrologyWatercolumnMaxEnum; 759 762 else if (strcmp(name,"HydrologyWaterVx")==0) return HydrologyWaterVxEnum; … … 872 875 else if (strcmp(name,"SealevelchangeIndices")==0) return SealevelchangeIndicesEnum; 873 876 else if (strcmp(name,"SealevelchangeG")==0) return SealevelchangeGEnum; 874 else if (strcmp(name,"SealevelchangeGU")==0) return SealevelchangeGUEnum;875 else if (strcmp(name,"SealevelchangeGE")==0) return SealevelchangeGEEnum;876 else if (strcmp(name,"SealevelchangeGN")==0) return SealevelchangeGNEnum;877 877 else stage=8; 878 878 } 879 879 if(stage==8){ 880 if (strcmp(name,"SealevelchangeGsubelOcean")==0) return SealevelchangeGsubelOceanEnum; 880 if (strcmp(name,"SealevelchangeGU")==0) return SealevelchangeGUEnum; 881 else if (strcmp(name,"SealevelchangeGE")==0) return SealevelchangeGEEnum; 882 else if (strcmp(name,"SealevelchangeGN")==0) return SealevelchangeGNEnum; 883 else if (strcmp(name,"SealevelchangeGsubelOcean")==0) return SealevelchangeGsubelOceanEnum; 881 884 else if (strcmp(name,"SealevelchangeGUsubelOcean")==0) return SealevelchangeGUsubelOceanEnum; 882 885 else if (strcmp(name,"SealevelchangeGEsubelOcean")==0) return SealevelchangeGEsubelOceanEnum; … … 936 939 else if (strcmp(name,"SmbDini")==0) return SmbDiniEnum; 937 940 else if (strcmp(name,"SmbDlwrf")==0) return SmbDlwrfEnum; 941 else if (strcmp(name,"SmbDulwrfValue")==0) return SmbDulwrfValueEnum; 938 942 else if (strcmp(name,"SmbDswrf")==0) return SmbDswrfEnum; 939 943 else if (strcmp(name,"SmbDswdiffrf")==0) return SmbDswdiffrfEnum; … … 994 998 else if (strcmp(name,"SmbTa")==0) return SmbTaEnum; 995 999 else if (strcmp(name,"SmbTeValue")==0) return SmbTeValueEnum; 996 else if (strcmp(name,"SmbTemperaturesAnomaly")==0) return SmbTemperaturesAnomalyEnum; 1000 else stage=9; 1001 } 1002 if(stage==9){ 1003 if (strcmp(name,"SmbTemperaturesAnomaly")==0) return SmbTemperaturesAnomalyEnum; 997 1004 else if (strcmp(name,"SmbTemperaturesLgm")==0) return SmbTemperaturesLgmEnum; 998 1005 else if (strcmp(name,"SmbTemperaturesPresentday")==0) return SmbTemperaturesPresentdayEnum; 999 1006 else if (strcmp(name,"SmbTemperaturesReconstructed")==0) return SmbTemperaturesReconstructedEnum; 1000 else stage=9; 1001 } 1002 if(stage==9){ 1003 if (strcmp(name,"SmbTini")==0) return SmbTiniEnum; 1007 else if (strcmp(name,"SmbTini")==0) return SmbTiniEnum; 1004 1008 else if (strcmp(name,"SmbTmean")==0) return SmbTmeanEnum; 1005 1009 else if (strcmp(name,"SmbTz")==0) return SmbTzEnum; … … 1117 1121 else if (strcmp(name,"Outputdefinition28")==0) return Outputdefinition28Enum; 1118 1122 else if (strcmp(name,"Outputdefinition29")==0) return Outputdefinition29Enum; 1119 else if (strcmp(name,"Outputdefinition2")==0) return Outputdefinition2Enum; 1123 else stage=10; 1124 } 1125 if(stage==10){ 1126 if (strcmp(name,"Outputdefinition2")==0) return Outputdefinition2Enum; 1120 1127 else if (strcmp(name,"Outputdefinition30")==0) return Outputdefinition30Enum; 1121 1128 else if (strcmp(name,"Outputdefinition31")==0) return Outputdefinition31Enum; 1122 1129 else if (strcmp(name,"Outputdefinition32")==0) return Outputdefinition32Enum; 1123 else stage=10; 1124 } 1125 if(stage==10){ 1126 if (strcmp(name,"Outputdefinition33")==0) return Outputdefinition33Enum; 1130 else if (strcmp(name,"Outputdefinition33")==0) return Outputdefinition33Enum; 1127 1131 else if (strcmp(name,"Outputdefinition34")==0) return Outputdefinition34Enum; 1128 1132 else if (strcmp(name,"Outputdefinition35")==0) return Outputdefinition35Enum; … … 1240 1244 else if (strcmp(name,"Cflevelsetmisfit")==0) return CflevelsetmisfitEnum; 1241 1245 else if (strcmp(name,"Channel")==0) return ChannelEnum; 1242 else if (strcmp(name,"ChannelArea")==0) return ChannelAreaEnum; 1246 else stage=11; 1247 } 1248 if(stage==11){ 1249 if (strcmp(name,"ChannelArea")==0) return ChannelAreaEnum; 1243 1250 else if (strcmp(name,"ChannelAreaOld")==0) return ChannelAreaOldEnum; 1244 1251 else if (strcmp(name,"ChannelDischarge")==0) return ChannelDischargeEnum; 1245 1252 else if (strcmp(name,"Closed")==0) return ClosedEnum; 1246 else stage=11; 1247 } 1248 if(stage==11){ 1249 if (strcmp(name,"Colinear")==0) return ColinearEnum; 1253 else if (strcmp(name,"Colinear")==0) return ColinearEnum; 1250 1254 else if (strcmp(name,"Constraints")==0) return ConstraintsEnum; 1251 1255 else if (strcmp(name,"Contact")==0) return ContactEnum; … … 1363 1367 else if (strcmp(name,"Intersect")==0) return IntersectEnum; 1364 1368 else if (strcmp(name,"InversionVzObs")==0) return InversionVzObsEnum; 1365 else if (strcmp(name,"J")==0) return JEnum; 1369 else stage=12; 1370 } 1371 if(stage==12){ 1372 if (strcmp(name,"J")==0) return JEnum; 1366 1373 else if (strcmp(name,"L1L2Approximation")==0) return L1L2ApproximationEnum; 1367 1374 else if (strcmp(name,"MLHOApproximation")==0) return MLHOApproximationEnum; 1368 1375 else if (strcmp(name,"L2ProjectionBaseAnalysis")==0) return L2ProjectionBaseAnalysisEnum; 1369 else stage=12; 1370 } 1371 if(stage==12){ 1372 if (strcmp(name,"L2ProjectionEPLAnalysis")==0) return L2ProjectionEPLAnalysisEnum; 1376 else if (strcmp(name,"L2ProjectionEPLAnalysis")==0) return L2ProjectionEPLAnalysisEnum; 1373 1377 else if (strcmp(name,"LACrouzeixRaviart")==0) return LACrouzeixRaviartEnum; 1374 1378 else if (strcmp(name,"LATaylorHood")==0) return LATaylorHoodEnum; … … 1486 1490 else if (strcmp(name,"SMBgemb")==0) return SMBgembEnum; 1487 1491 else if (strcmp(name,"SMBgradients")==0) return SMBgradientsEnum; 1488 else if (strcmp(name,"SMBgradientscomponents")==0) return SMBgradientscomponentsEnum; 1492 else stage=13; 1493 } 1494 if(stage==13){ 1495 if (strcmp(name,"SMBgradientscomponents")==0) return SMBgradientscomponentsEnum; 1489 1496 else if (strcmp(name,"SMBgradientsela")==0) return SMBgradientselaEnum; 1490 1497 else if (strcmp(name,"SMBhenning")==0) return SMBhenningEnum; 1491 1498 else if (strcmp(name,"SMBmeltcomponents")==0) return SMBmeltcomponentsEnum; 1492 else stage=13; 1493 } 1494 if(stage==13){ 1495 if (strcmp(name,"SMBpdd")==0) return SMBpddEnum; 1499 else if (strcmp(name,"SMBpdd")==0) return SMBpddEnum; 1496 1500 else if (strcmp(name,"SMBpddSicopolis")==0) return SMBpddSicopolisEnum; 1497 1501 else if (strcmp(name,"SMBsemic")==0) return SMBsemicEnum; -
issm/trunk-jpl/src/m/classes/SMBgemb.m
r26358 r26550 24 24 isconstrainsurfaceT; 25 25 isclimatology; 26 isdeltaLWup; 26 27 27 28 %inputs: … … 42 43 %optional inputs: 43 44 aValue = NaN; %Albedo forcing at every element. Used only if aIdx == 0, or density exceeds adThresh 44 teValue = NaN; %Outward longwave radiation thermal emissivity forcing at every element (default in code is 1) 45 teValue = NaN; %Outward longwave radiation thermal emissivity forcing at every element (default in code is 1). 46 %Used only if eIdx== 0, or effective grain radius exceeds teThresh 47 dulwrfValue = NaN; %Delta with which to perturn the long wave radiation upwards. Use if isdeltaLWup is true; 45 48 46 49 % Initialization of snow properties … … 59 62 %settings: 60 63 aIdx = NaN; %method for calculating albedo and subsurface absorption (default is 1) 61 % 0: direct input from aValue parameter 64 % 0: direct input from aValue parameter, no use of adThresh 62 65 % 1: effective grain radius [Gardner & Sharp, 2009] 63 66 % 2: effective grain radius [Brun et al., 1992; LeFebre et al., 2003]], with swIdx=1, SW penetration follows grain size in 3 spectral bands (Brun et al., 1992) 64 67 % 3: density and cloud amount [Greuell & Konzelmann, 1994] 65 68 % 4: exponential time decay & wetness [Bougamont & Bamber, 2005] 69 70 eIdx = NaN; %method for calculating emissivity (default is 1) 71 % 0: direct input from teValue parameter, no use of teThresh 72 % 1: default value of 1, in areas with grain radius below teThresh 73 % 2: default value of 1, in areas with grain radius below teThresh and areas of dry snow (not bare ice or wet) at the surface 66 74 67 75 swIdx = NaN; % apply all SW to top grid cell (0) or allow SW to penetrate surface (1) (default 1, if aIdx=2 function of effective radius (Brun et al., 1992) or else dependent on snow density (taken from Bassford, 2002)) … … 111 119 %or else apply direct input value from aValue, allowing albedo to be altered. 112 120 %Default value is rho water (1023 kg m-3). 121 teThresh = NaN; %Apply eIdx method to all areas with grain radii below this value, 122 %or else apply direct input value from teValue, allowing emissivity to be altered. 123 %Default value is a effective grain radius of 10 mm. 113 124 114 125 %densities: … … 152 163 fielddisplay(self,'isdensification','run densification module (default true)'); 153 164 fielddisplay(self,'isturbulentflux','run turbulant heat fluxes module (default true)'); 154 fielddisplay(self,'isconstrainsurfaceT','constrain surface temperatures to air temperature, turn off EC and surface flux contribution to surface temperature change'); 165 fielddisplay(self,'isconstrainsurfaceT','constrain surface temperatures to air temperature, turn off EC and surface flux contribution to surface temperature change (default false)'); 166 fielddisplay(self,'isdeltaLWup','set to true to invoke a bias in the long wave upward spatially, specified by dulwrfValue (default false)'); 155 167 fielddisplay(self,'Ta','2 m air temperature, in Kelvin'); 156 168 fielddisplay(self,'V','wind speed (m s-1)'); … … 183 195 '4: exponential time decay & wetness [Bougamont & Bamber, 2005]'}) 184 196 197 fielddisplay(self,'dulwrfValue','Specified bias to be applied to the outward long wave radiation every element (W/m-2, +upward)'); 185 198 fielddisplay(self,'teValue','Outward longwave radiation thermal emissivity forcing at every element (default in code is 1)'); 199 fielddisplay(self,'teThresh',{'Apply eIdx method to all areas with effective grain radius below this value,','or else apply direct input value from teValue, allowing emissivity to be altered.'}); 200 fielddisplay(self,'eIdx',{'method for calculating emissivity (default is 1)',... 201 '0: direct input from teValue parameter, no use of teThresh',... 202 '1: default value of 1, in areas with grain radius below teThresh',... 203 '2: default value of 1, in areas with grain radius below teThresh and areas of dry snow (not bare ice or wet) at the surface'}); 186 204 187 205 %snow properties init … … 299 317 self.cciceValue=project3d(md,'vector',self.cciceValue,'type','element'); 300 318 end 301 if (aIdx == 0) &~isnan(self.aValue)319 if ~isnan(self.aValue) 302 320 self.aValue=project3d(md,'vector',self.aValue,'type','element'); 303 321 end … … 305 323 self.teValue=project3d(md,'vector',self.teValue,'type','element'); 306 324 end 307 308 325 309 326 end % }}} … … 322 339 self.isturbulentflux=1; 323 340 self.isconstrainsurfaceT=0; 341 self.isdeltaLWup=0; 324 342 325 343 self.aIdx = 1; 344 self.eIdx = 1; 326 345 self.swIdx = 1; 327 346 self.denIdx = 2; … … 348 367 self.K = 7; 349 368 self.adThresh = 1023; 369 self.teThresh = 10; 350 370 351 371 self.teValue = ones(mesh.numberofelements,1); 352 372 self.aValue = self.aSnow*ones(mesh.numberofelements,1); 373 self.dulwrfValue = zeros(mesh.numberofelements,1); 353 374 354 375 self.dswdiffrf=0.0*ones(mesh.numberofelements,1); … … 384 405 md = checkfield(md,'fieldname','smb.isturbulentflux','values',[0 1]); 385 406 md = checkfield(md,'fieldname','smb.isconstrainsurfaceT','values',[0 1]); 407 md = checkfield(md,'fieldname','smb.isdeltaLWup','values',[0 1]); 386 408 387 409 md = checkfield(md,'fieldname','smb.Ta','timeseries',1,'NaN',1,'Inf',1,'>',273-100,'<',273+100); %-100/100 celsius min/max value … … 400 422 401 423 md = checkfield(md,'fieldname','smb.teValue','timeseries',1,'NaN',1,'Inf',1,'>=',0,'<=',1); 424 md = checkfield(md,'fieldname','smb.dulwrfValue','timeseries',1,'NaN',1,'Inf',1); 402 425 403 426 md = checkfield(md,'fieldname','smb.aIdx','NaN',1,'Inf',1,'values',[0,1,2,3,4]); 427 md = checkfield(md,'fieldname','smb.eIdx','NaN',1,'Inf',1,'values',[0,1,2]); 404 428 md = checkfield(md,'fieldname','smb.swIdx','NaN',1,'Inf',1,'values',[0,1]); 405 429 md = checkfield(md,'fieldname','smb.denIdx','NaN',1,'Inf',1,'values',[1,2,3,4,5,6,7]); … … 414 438 md = checkfield(md,'fieldname','smb.ThermoDeltaTScaling','NaN',1,'Inf',1,'>=',0,'<=',1); 415 439 md = checkfield(md,'fieldname','smb.adThresh','NaN',1,'Inf',1,'>=',0); 416 440 md = checkfield(md,'fieldname','smb.teThresh','NaN',1,'Inf',1,'>=',0); 441 442 md = checkfield(md,'fieldname','smb.aValue','timeseries',1,'NaN',1,'Inf',1,'>=',0,'<=',1); 417 443 switch self.aIdx, 418 case 0419 md = checkfield(md,'fieldname','smb.aValue','timeseries',1,'NaN',1,'Inf',1,'>=',0,'<=',1);420 444 case {1 2} 421 445 md = checkfield(md,'fieldname','smb.aSnow','NaN',1,'Inf',1,'>=',.64,'<=',.89); … … 460 484 WriteData(fid,prefix,'object',self,'class','smb','fieldname','isturbulentflux','format','Boolean'); 461 485 WriteData(fid,prefix,'object',self,'class','smb','fieldname','isconstrainsurfaceT','format','Boolean'); 486 WriteData(fid,prefix,'object',self,'class','smb','fieldname','isdeltaLWup','format','Boolean'); 462 487 463 488 WriteData(fid,prefix,'object',self,'class','smb','fieldname','Ta','format','DoubleMat','mattype',2,'timeserieslength',md.mesh.numberofelements+1,'yts',md.constants.yts); … … 483 508 484 509 WriteData(fid,prefix,'object',self,'class','smb','fieldname','aIdx','format','Integer'); 510 WriteData(fid,prefix,'object',self,'class','smb','fieldname','eIdx','format','Integer'); 485 511 WriteData(fid,prefix,'object',self,'class','smb','fieldname','swIdx','format','Integer'); 486 512 WriteData(fid,prefix,'object',self,'class','smb','fieldname','denIdx','format','Integer'); … … 496 522 WriteData(fid,prefix,'object',self,'class','smb','fieldname','K','format','Double'); 497 523 WriteData(fid,prefix,'object',self,'class','smb','fieldname','adThresh','format','Double'); 524 WriteData(fid,prefix,'object',self,'class','smb','fieldname','teThresh','format','Double'); 498 525 499 526 WriteData(fid,prefix,'object',self,'class','smb','fieldname','aValue','format','DoubleMat','mattype',2,'timeserieslength',md.mesh.numberofelements+1,'yts',md.constants.yts); 500 527 WriteData(fid,prefix,'object',self,'class','smb','fieldname','teValue','format','DoubleMat','mattype',2,'timeserieslength',md.mesh.numberofelements+1,'yts',md.constants.yts); 528 WriteData(fid,prefix,'object',self,'class','smb','fieldname','dulwrfValue','format','DoubleMat','mattype',2,'timeserieslength',md.mesh.numberofelements+1,'yts',md.constants.yts); 501 529 WriteData(fid,prefix,'object',self,'class','smb','fieldname','szaValue','format','DoubleMat','mattype',2,'timeserieslength',md.mesh.numberofelements+1,'yts',md.constants.yts); 502 530 WriteData(fid,prefix,'object',self,'class','smb','fieldname','cotValue','format','DoubleMat','mattype',2,'timeserieslength',md.mesh.numberofelements+1,'yts',md.constants.yts); … … 533 561 error('If GEMB forcing dswdiffrf is transient, it must have the same time steps as input Ta in the final row!'); 534 562 end 563 if size(md.smb.dulwrfValue,2)>1 & any(md.smb.dulwrfValue(end,:) - md.smb.Ta(end,:) ~= 0) 564 error('If GEMB forcing dulwrfValue is transient, it must have the same time steps as input Ta in the final row!'); 565 end 535 566 if size(md.smb.aValue,2)>1 & any(md.smb.aValue(end,:) - md.smb.Ta(end,:) ~= 0) 536 567 error('If GEMB forcing aValue is transient, it must have the same time steps as input Ta in the final row!'); -
issm/trunk-jpl/src/m/classes/SMBgemb.py
r26359 r26550 31 31 self.isturbulentflux = 0 32 32 self.isconstrainsurfaceT = 0 33 self.isdeltaLWup = 0 33 34 self.isclimatology = np.nan 34 35 … … 50 51 # Optional inputs 51 52 self.aValue = np.nan # Albedo forcing at every element. Used only if aIdx == 0, or density exceeds adThresh. 52 self.teValue = np.nan # Outward longwave radiation thermal emissivity forcing at every element (default in code is 1) 53 self.teValue = np.nan # Outward longwave radiation thermal emissivity forcing at every element (default in code is 1), Used only if eIdx== 0, or effective grain radius exceeds teThresh 54 dulwrfValue = np.nan #Delta with which to perturn the long wave radiation upwards. Use if isdeltaLWup is true 53 55 54 56 # Initialization of snow properties … … 67 69 # Settings 68 70 self.aIdx = np.nan # method for calculating albedo and subsurface absorption (default is 1) 69 # 0: direct input from aValue parameter 71 # 0: direct input from aValue parameter, no use of adThresh 70 72 # 1: effective grain radius [Gardner & Sharp, 2009] 71 73 # 2: effective grain radius [Brun et al., 1992; LeFebre et al., 2003], with swIdx=1, SW penetration follows grain size in 3 spectral bands (Brun et al., 1992) 72 74 # 3: density and cloud amount [Greuell & Konzelmann, 1994] 73 75 # 4: exponential time decay & wetness [Bougamont & Bamber, 2005] 76 77 self.eIdx = np.nan #method for calculating emissivity (default is 1) 78 # 0: direct input from teValue parameter, no use of teThresh 79 # 1: default value of 1, in areas with grain radius below teThresh 80 # 2: default value of 1, in areas with grain radius below teThresh and areas of dry snow (not bare ice or wet) at the surface 74 81 75 82 self.swIdx = np.nan # apply all SW to top grid cell (0) or allow SW to penetrate surface (1) (default 1, if aIdx=2 function of effective radius (Brun et al., 1992) or else dependent on snow density (taken from Bassford, 2002)) … … 119 126 # or else apply direct input value from aValue, allowing albedo to be altered. 120 127 # Default value is rho water (1023 kg m-3). 128 teThresh = np.nan #Apply eIdx method to all areas with grain radii below this value, 129 #or else apply direct input value from teValue, allowing emissivity to be altered. 130 #Default value is a effective grain radius of 10 mm. 121 131 122 132 # Densities … … 158 168 s += '{}\n'.format(fielddisplay(self, 'isdensification', 'run densification module (default true)')) 159 169 s += '{}\n'.format(fielddisplay(self, 'isturbulentflux', 'run turbulant heat fluxes module (default true)')) 160 s += '{}\n'.format(fielddisplay(self, 'isconstrainsurfaceT', 'constrain surface temperatures to air temperature, turn off EC and surface flux contribution to surface temperature change')) 170 s += '{}\n'.format(fielddisplay(self, 'isconstrainsurfaceT', 'constrain surface temperatures to air temperature, turn off EC and surface flux contribution to surface temperature change (default false)')) 171 s += '{}\n'.format(fielddisplay(self, 'isdeltaLWup', 'set to true to invoke a bias in the long wave upward spatially, specified by dulwrfValue (default false)')) 161 172 s += '{}\n'.format(fielddisplay(self, 'Ta', '2 m air temperature, in Kelvin')) 162 173 s += '{}\n'.format(fielddisplay(self, 'V', 'wind speed (m s-1)')) … … 188 199 '3: density and cloud amount [Greuell & Konzelmann, 1994]', 189 200 '4: exponential time decay & wetness [Bougamont & Bamber, 2005]'])) 201 202 s += '{}\n'.format(fielddisplay(self, 'dulwrfValue', 'Specified bias to be applied to the outward long wave radiation every element (W/m-2, +upward)')) 190 203 s += '{}\n'.format(fielddisplay(self, 'teValue', 'Outward longwave radiation thermal emissivity forcing at every element (default in code is 1)')) 204 s += '{}\n'.format(fielddisplay(self, 'teThresh', ['Apply eIdx method to all areas with effective grain radius below this value,', 'or else apply direct input value from teValue, allowing emissivity to be altered.'])) 205 s += '{}\n'.format(fielddisplay(self, 'eIdx', ['method for calculating emissivity (default is 1)', 206 '0: direct input from teValue parameter, no use of teThresh', 207 '1: default value of 1, in areas with grain radius below teThresh', 208 '2: default value of 1, in areas with grain radius below teThresh and areas of dry snow (not bare ice or wet) at the surface'])) 191 209 192 210 # Snow properties init … … 286 304 self.cciceValue=project3d(md,'vector',self.cciceValue,'type','element'); 287 305 288 if (self.aIdx == 0) and (not np.isnan(self.aValue)):306 if not np.isnan(self.aValue): 289 307 self.aValue = project3d(md, 'vector', self.aValue, 'type', 'element') 290 308 if not np.isnan(self.teValue): … … 308 326 self.isturbulentflux = 1 309 327 self.isconstrainsurfaceT = 0 328 self.isdeltaLWup = 0 310 329 311 330 self.aIdx = 1 331 self.eIdx = 1 312 332 self.swIdx = 1 313 333 self.denIdx = 2 … … 334 354 self.K = 7 335 355 self.adThresh = 1023 356 self.teThresh = 10 336 357 337 358 self.teValue = np.ones((mesh.numberofelements,)) 338 359 self.aValue = self.aSnow * np.ones(mesh.numberofelements,) 360 self.dulwrfValue = np.zeros((mesh.numberofelements,)) 339 361 340 362 self.dswdiffrf = 0.0 * np.ones(mesh.numberofelements,) … … 373 395 md = checkfield(md, 'fieldname', 'smb.isdensification', 'values', [0, 1]) 374 396 md = checkfield(md, 'fieldname', 'smb.isturbulentflux', 'values', [0, 1]) 397 md = checkfield(md, 'fieldname', 'smb.isdeltaLWup', 'values',[0, 1]) 375 398 md = checkfield(md, 'fieldname', 'smb.isconstrainsurfaceT', 'values', [0, 1]) 376 399 … … 390 413 391 414 md = checkfield(md, 'fieldname', 'smb.teValue', 'timeseries', 1, 'NaN', 1, 'Inf', 1, '>=', 0, '<=', 1) 415 md = checkfield(md, 'fieldname', 'smb.dulwrfValue', 'timeseries', 1, 'NaN', 1, 'Inf', 1) 392 416 393 417 md = checkfield(md, 'fieldname', 'smb.aIdx', 'NaN', 1, 'Inf', 1, 'values', [0, 1, 2, 3, 4]) 418 md = checkfield(md, 'fieldname', 'smb.eIdx', 'NaN', 1, 'Inf', 1, 'values', [0, 1, 2]) 394 419 md = checkfield(md, 'fieldname', 'smb.swIdx', 'NaN', 1, 'Inf', 1, 'values', [0, 1]) 395 420 md = checkfield(md, 'fieldname', 'smb.denIdx', 'NaN', 1, 'Inf', 1, 'values', [1, 2, 3, 4, 5, 6, 7]) … … 404 429 md = checkfield(md, 'fieldname', 'smb.ThermoDeltaTScaling', 'NaN', 1, 'Inf', 1, '> = ', 0, '< = ', 1) 405 430 md = checkfield(md, 'fieldname', 'smb.adThresh', 'NaN', 1, 'Inf', 1, '>=', 0) 406 407 if self.aIdx == 0:408 409 elif isinstance(self.aIdx, (list, type(np.array([1, 2])))) and (self.aIdx == [1, 2] or (1 in self.aIdx and 2 in self.aIdx)):431 md = checkfield(md, 'fieldname', 'smb.teThresh', 'NaN', 1, 'Inf',1,'>=',0) 432 433 md = checkfield(md, 'fieldname', 'smb.aValue', 'timeseries', 1, 'NaN', 1, 'Inf', 1, '>=', 0, '<=', 1) 434 if isinstance(self.aIdx, (list, type(np.array([1, 2])))) and (self.aIdx == [1, 2] or (1 in self.aIdx and 2 in self.aIdx)): 410 435 md = checkfield(md, 'fieldname', 'smb.aSnow', 'NaN', 1, 'Inf', 1, '> = ', .64, '< = ', .89) 411 436 md = checkfield(md, 'fieldname', 'smb.aIce', 'NaN', 1, 'Inf', 1, '> = ', .27, '< = ', .58) … … 446 471 WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'isturbulentflux', 'format', 'Boolean') 447 472 WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'isconstrainsurfaceT', 'format', 'Boolean') 473 WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'isdeltaLWup','format','Boolean') 448 474 449 475 WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'Ta', 'format', 'DoubleMat', 'mattype', 2, 'timeserieslength', md.mesh.numberofelements + 1, 'yts', yts) … … 469 495 470 496 WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'aIdx', 'format', 'Integer') 497 WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'eIdx', 'format', 'Integer') 471 498 WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'swIdx', 'format', 'Integer') 472 499 WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'denIdx', 'format', 'Integer') … … 482 509 WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'K', 'format', 'Double') 483 510 WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'adThresh', 'format', 'Double') 511 WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'teThresh', 'format', 'Double') 484 512 485 513 WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'aValue', 'format', 'DoubleMat', 'mattype', 2, 'timeserieslength', md.mesh.numberofelements + 1, 'yts', yts) 486 514 WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'teValue', 'format', 'DoubleMat', 'mattype', 2, 'timeserieslength', md.mesh.numberofelements + 1, 'yts', yts) 515 WriteData(fid,prefix,'object',self,'class','smb','fieldname','dulwrfValue','format','DoubleMat','mattype',2,'timeserieslength',md.mesh.numberofelements+1,'yts',md.constants.yts) 487 516 WriteData(fid,prefix,'object',self,'class','smb','fieldname','szaValue','format','DoubleMat','mattype',2,'timeserieslength',md.mesh.numberofelements+1,'yts',md.constants.yts) 488 517 WriteData(fid,prefix,'object',self,'class','smb','fieldname','cotValue','format','DoubleMat','mattype',2,'timeserieslength',md.mesh.numberofelements+1,'yts',md.constants.yts) … … 514 543 if ((np.ndim(self.aValue)>1) & np.any(self.aValue[-1] - self.Ta[-1] != 0)): 515 544 raise IOError('If GEMB forcing aValue is transient, it must have the same time steps as input Ta in the final row!') 545 if ((np.ndim(self.dulwrfValue)>1) & np.any(self.dulwrfValue[-1] - self.Ta[-1] != 0)): 546 raise IOError('If GEMB forcing dulwrfValue is transient, it must have the same time steps as input Ta in the final row!') 516 547 if ((np.ndim(self.szaValue)>1) & np.any(self.szaValue[-1] - self.Ta[-1] != 0)): 517 548 raise IOError('If GEMB forcing szaValue is transient, it must have the same time steps as input Ta in the final row!')
Note:
See TracChangeset
for help on using the changeset viewer.