source:
issm/oecreview/Archive/18296-19100/ISSM-18967-18968.diff@
19102
Last change on this file since 19102 was 19102, checked in by , 10 years ago | |
---|---|
File size: 92.1 KB |
-
../trunk-jpl/test/NightlyRun/test236.py
15 15 # Use of ispdd and isdelta18o methods 16 16 md.surfaceforcings = SMBpdd(); 17 17 md.surfaceforcings.isdelta18o=1 18 md.surfaceforcings.ismungsm=0 18 19 19 20 # Add temperature, precipitation and delta18o needed to measure the surface mass balance 20 21 # creating delta18o … … 49 50 for imonth in xrange(0,12): 50 51 md.surfaceforcings.precipitations_presentday[0:md.mesh.numberofvertices,imonth]=-0.4*10**(-6)*md.mesh.y+0.5 51 52 md.surfaceforcings.precipitations_presentday[md.mesh.numberofvertices,imonth]=((float(imonth)+1.)/12.) 53 md.surfaceforcings.precipitations_lgm[0:md.mesh.numberofvertices,imonth]=-0.4*10**(-6)*md.mesh.y+0.5 54 md.surfaceforcings.precipitations_lgm[md.mesh.numberofvertices,imonth]=((float(imonth)+1.)/12.) 52 55 56 # Interpolation factors 57 md.surfaceforcings.Tdiff[1,1:md.timestepping.final_time]=0.5; 58 md.surfaceforcings.sealev[1,1:md.timestepping.final_time]=0.5; 59 # Year of each data point 60 md.surfaceforcings.Tdiff[2,1:md.timestepping.final_time]=1:1:md.timestepping.final_time; 61 md.surfaceforcings.sealev[2,1:md.timestepping.final_time]=1:1:md.timestepping.final_time; 62 53 63 # time steps and resolution 54 64 md.timestepping.time_step=20. 55 65 md.timestepping.final_time=60. 56 66 57 md.surfaceforcings.Pfac=[1,1]58 md.surfaceforcings.Tdiff=[1,1]59 md.surfaceforcings.sealev=[1,1]60 67 61 68 # 62 69 md.transient.requested_outputs=['default','SurfaceforcingsMonthlytemperatures'] -
../trunk-jpl/test/NightlyRun/test237.py
11 11 12 12 md=triangle(model(),'../Exp/Square.exp',600000) #180000 13 13 md=setmask(md,'all','') 14 md=parameterize(md,'../Par/SquareShelf.py') 14 15 15 16 # Use of ispdd and isdelta18o methods 16 17 md.surfaceforcings = SMBpdd(); 17 md.surfaceforcings.isdelta18o=1 18 md.surfaceforcings.isdelta18o=0 19 md.surfaceforcings.ismungsm=1 18 20 19 md=parameterize(md,'../Par/SquareShelf.py')20 21 21 # Add temperature, precipitation and delta18o needed to measure the surface mass balance22 # creating delta18o23 delta18o=numpy.loadtxt('../Data/delta18o.data')24 md.surfaceforcings.delta18o=delta18o25 # creating delta18oSurface26 md.surfaceforcings.delta18o_surface = numpy.zeros((2,numpy.size(delta18o,axis=1)))27 md.surfaceforcings.delta18o_surface[1,:] = delta18o[1,:]22 # # Add temperature, precipitation and delta18o needed to measure the surface mass balance 23 # # creating delta18o 24 # delta18o=numpy.loadtxt('../Data/delta18o.data') 25 # md.surfaceforcings.delta18o=delta18o 26 # # creating delta18oSurface 27 # md.surfaceforcings.delta18o_surface = numpy.zeros((2,numpy.size(delta18o,axis=1))) 28 # md.surfaceforcings.delta18o_surface[1,:] = delta18o[1,:] 28 29 29 30 # creating Present day and lgm temperatures 30 31 # Same temperature over the all region: … … 51 52 for imonth in xrange(0,12): 52 53 md.surfaceforcings.precipitations_presentday[0:md.mesh.numberofvertices,imonth]=-0.4*10**(-6)*md.mesh.y+0.5 53 54 md.surfaceforcings.precipitations_presentday[md.mesh.numberofvertices,imonth]=((float(imonth)+1.)/12.) 55 md.surfaceforcings.precipitations_lgm[0:md.mesh.numberofvertices,imonth]=-0.4*10**(-6)*md.mesh.y+0.5 56 md.surfaceforcings.precipitations_lgm[md.mesh.numberofvertices,imonth]=((float(imonth)+1.)/12.) 54 57 58 # Interpolation factors 59 md.surfaceforcings.Pfac[1,1:md.timestepping.final_time]=0.5; 60 md.surfaceforcings.Tdiff[1,1:md.timestepping.final_time]=0.5; 61 md.surfaceforcings.sealev[1,1:md.timestepping.final_time]=0.5; 62 # Year of each data point 63 md.surfaceforcings.Pfac[2,1:md.timestepping.final_time]=1:1:md.timestepping.final_time; 64 md.surfaceforcings.Tdiff[2,1:md.timestepping.final_time]=1:1:md.timestepping.final_time; 65 md.surfaceforcings.sealev[2,1:md.timestepping.final_time]=1:1:md.timestepping.final_time; 66 55 67 # time steps and resolution 56 68 md.timestepping.time_step=20. 57 69 md.settings.output_frequency=1 58 70 md.timestepping.final_time=60. 59 71 60 md.surfaceforcings.Pfac=[1,1]61 md.surfaceforcings.Tdiff=[1,1]62 md.surfaceforcings.sealev=[1,1]63 64 72 # 65 73 md.transient.requested_outputs=['default','SurfaceforcingsMonthlytemperatures'] 66 74 md.extrude(3,1.) -
../trunk-jpl/test/NightlyRun/test236.m
2 2 md=setmask(md,'all',''); 3 3 md=parameterize(md,'../Par/SquareShelf.par'); 4 4 5 %md.verbose=verbose('all'); 6 5 7 % Use of ispdd and isdelta18o methods 6 8 md.surfaceforcings = SMBpdd(); 7 9 md.surfaceforcings.isdelta18o=1; 10 md.surfaceforcings.ismungsm=0; 8 11 12 %md.surfaceforcings.precipitation(1:md.mesh.numberofvertices,1:12)=0; 13 %md.surfaceforcings.monthlytemperatures(1:md.mesh.numberofvertices,1:12)=273; 14 9 15 % Add temperature, precipitation and delta18o needed to measure the surface mass balance 10 % creating delta18o16 % creating delta18o 11 17 load '../Data/delta18o.data' 12 18 md.surfaceforcings.delta18o=delta18o; 13 19 % creating delta18oSurface … … 25 31 md.surfaceforcings.temperatures_lgm(md.mesh.numberofvertices+1,imonth+1)=((imonth+1)/12); 26 32 end 27 33 28 % creating initialization and spc temperatures initialization and spc 34 % creating initialization and spc temperatures initialization and 35 % spc 29 36 md.thermal.spctemperature=mean(md.surfaceforcings.temperatures_lgm(1:md.mesh.numberofvertices,1:12),2); %-10*ones(md.mesh.numberofvertices,1); 30 37 md.thermal.spctemperature=repmat(md.thermal.spctemperature,1,md.timestepping.final_time/md.timestepping.time_step); 31 38 itemp=0:md.timestepping.time_step:md.timestepping.final_time-md.timestepping.time_step; … … 36 43 % creating precipitation 37 44 for imonth=0:11 38 45 md.surfaceforcings.precipitations_presentday(1:md.mesh.numberofvertices,imonth+1)=-0.4*10^(-6)*md.mesh.y+0.5; 46 md.surfaceforcings.precipitations_lgm(1:md.mesh.numberofvertices,imonth+1)=-0.4*10^(-6)*md.mesh.y+0.5; 47 % Time for the last line: 39 48 md.surfaceforcings.precipitations_presentday(md.mesh.numberofvertices+1,imonth+1)=((imonth+1)/12); 49 md.surfaceforcings.precipitations_lgm(md.mesh.numberofvertices+1,imonth+1)=((imonth+1)/12); 40 50 end 41 51 52 % Interpolation factors 53 md.surfaceforcings.Tdiff(1,1:md.timestepping.final_time)=0.5; 54 md.surfaceforcings.sealev(1,1:md.timestepping.final_time)=0.5; 55 % Year of each data point 56 md.surfaceforcings.Tdiff(2,1:md.timestepping.final_time)=1:1:md.timestepping.final_time; 57 md.surfaceforcings.sealev(2,1:md.timestepping.final_time)=1:1:md.timestepping.final_time; 58 42 59 % time steps and resolution 43 60 md.timestepping.time_step=20; 61 md.settings.output_frequency=1; 44 62 md.timestepping.final_time=60; 45 63 46 md.surfaceforcings.Pfac=[1;1];47 md.surfaceforcings.Tdiff=[1;1];48 md.surfaceforcings.sealev=[1;1];49 50 64 % 51 65 md.transient.requested_outputs={'default','SurfaceforcingsMonthlytemperatures'}; 52 66 md=setflowequation(md,'SSA','all'); 53 md.cluster=generic('name',oshostname(),'np', 3);67 md.cluster=generic('name',oshostname(),'np',1); % 3 for the cluster 54 68 md=solve(md,TransientSolutionEnum()); 55 69 56 70 %Fields and tolerances to track changes -
../trunk-jpl/test/NightlyRun/test237.m
1 1 md=triangle(model(),'../Exp/Square.exp',600000.);%180000 2 2 md=setmask(md,'all',''); 3 md=parameterize(md,'../Par/SquareShelf.par'); 3 4 4 % Use of ispdd and isdelta18o methods 5 %md.verbose=verbose('all'); 6 7 % Use of ispdd methods 5 8 md.surfaceforcings = SMBpdd(); 6 md.surfaceforcings.isdelta18o=1; 9 md.surfaceforcings.isdelta18o=0; 10 md.surfaceforcings.ismungsm=1; 7 11 8 md=parameterize(md,'../Par/SquareShelf.par'); 12 if md.surfaceforcings.isdelta18o==0 & md.surfaceforcings.ismungsm==0 13 md.surfaceforcings.precipitation=zeros(md.mesh.numberofvertices,1); 14 md.surfaceforcings.monthlytemperatures=273*ones(md.mesh.numberofvertices,1); 15 end 16 9 17 10 18 % Add temperature, precipitation and delta18o needed to measure the surface mass balance 11 % creating delta18o12 load '../Data/delta18o.data'13 md.surfaceforcings.delta18o=delta18o;14 % creating delta18oSurface15 md.surfaceforcings.delta18o_surface(1,1:(length(delta18o))) = 0;16 md.surfaceforcings.delta18o_surface(2,:) = delta18o(2,:);19 % % creating delta18o 20 % load '../Data/delta18o.data' 21 % md.surfaceforcings.delta18o=delta18o; 22 % % creating delta18oSurface 23 % md.surfaceforcings.delta18o_surface(1,1:(length(delta18o))) = 0; 24 % md.surfaceforcings.delta18o_surface(2,:) = delta18o(2,:); 17 25 18 26 % creating Present day and lgm temperatures 19 27 % Same temperature over the all region: … … 37 45 % creating precipitation 38 46 for imonth=0:11 39 47 md.surfaceforcings.precipitations_presentday(1:md.mesh.numberofvertices,imonth+1)=-0.4*10^(-6)*md.mesh.y+0.5; 48 md.surfaceforcings.precipitations_lgm(1:md.mesh.numberofvertices,imonth+1)=-0.4*10^(-6)*md.mesh.y+0.5; 49 % Time for the last line: 40 50 md.surfaceforcings.precipitations_presentday(md.mesh.numberofvertices+1,imonth+1)=((imonth+1)/12); 51 md.surfaceforcings.precipitations_lgm(md.mesh.numberofvertices+1,imonth+1)=((imonth+1)/12); 41 52 end 42 53 43 md.surfaceforcings.Pfac=[1;1]; 44 md.surfaceforcings.Tdiff=[1;1]; 45 md.surfaceforcings.sealev=[1;1]; 54 md.surfaceforcings.Pfac(1,1:md.timestepping.final_time)=0.5; 55 md.surfaceforcings.Tdiff(1,1:md.timestepping.final_time)=0.5; 56 md.surfaceforcings.sealev(1,1:md.timestepping.final_time)=0.5; 57 % Year of each data point 58 md.surfaceforcings.Pfac(2,1:md.timestepping.final_time)=1:1:md.timestepping.final_time; 59 md.surfaceforcings.Tdiff(2,1:md.timestepping.final_time)=1:1:md.timestepping.final_time; 60 md.surfaceforcings.sealev(2,1:md.timestepping.final_time)=1:1:md.timestepping.final_time; 46 61 47 62 % time steps and resolution 48 63 md.timestepping.time_step=20; … … 51 66 52 67 % 53 68 md.transient.requested_outputs={'default','SurfaceforcingsMonthlytemperatures'}; 54 md=extrude(md,3,1.); 69 md=extrude(md,3,1); 70 55 71 md=setflowequation(md,'SSA','all'); 56 md.cluster=generic('name',oshostname(),'np',1); 57 md=solve(md,TransientSolutionEnum ());72 md.cluster=generic('name',oshostname(),'np',1); % 3 for the cluster 73 md=solve(md,TransientSolutionEnum); 58 74 59 75 %Fields and tolerances to track changes 60 76 field_names ={'Vx1','Vy1','Vz1','Vel1','Pressure1','Bed1','Surface1','Thickness1','Temperature1','BasalforcingsGroundediceMeltingRate1', ... -
../trunk-jpl/src/c/analyses/MasstransportAnalysis.cpp
119 119 120 120 int stabilization,finiteelement,smb_model; 121 121 bool dakota_analysis; 122 bool isdelta18o ;122 bool isdelta18o,ismungsm; 123 123 bool isgroundingline; 124 124 bool islevelset; 125 125 … … 178 178 break; 179 179 case SMBpddEnum: 180 180 iomodel->Constant(&isdelta18o,SurfaceforcingsIsdelta18oEnum); 181 iomodel->Constant(&ismungsm,SurfaceforcingsIsmungsmEnum); 181 182 iomodel->FetchDataToInput(elements,ThermalSpctemperatureEnum); 182 if(isdelta18o ){183 if(isdelta18o || ismungsm){ 183 184 iomodel->FetchDataToInput(elements,SurfaceforcingsTemperaturesLgmEnum); 184 185 iomodel->FetchDataToInput(elements,SurfaceforcingsTemperaturesPresentdayEnum); 185 186 iomodel->FetchDataToInput(elements,SurfaceforcingsPrecipitationsPresentdayEnum); 186 187 iomodel->FetchDataToInput(elements,SurfaceforcingsPrecipitationsLgmEnum); 187 188 } 188 189 else{ 189 190 iomodel->FetchDataToInput(elements,SurfaceforcingsPrecipitationEnum); 190 191 iomodel->FetchDataToInput(elements,SurfaceforcingsMonthlytemperaturesEnum); 191 192 } 193 192 194 break; 193 195 case SMBgradientsEnum: 194 196 iomodel->FetchDataToInput(elements,SurfaceforcingsHrefEnum); -
../trunk-jpl/src/c/shared/Enum/EnumDefinitions.h
343 343 SurfaceforcingsDelta18oEnum, 344 344 SurfaceforcingsDelta18oSurfaceEnum, 345 345 SurfaceforcingsIsdelta18oEnum, 346 SurfaceforcingsIsmungsmEnum, 346 347 SurfaceforcingsPrecipitationsPresentdayEnum, 347 348 SurfaceforcingsPrecipitationsLgmEnum, 348 349 SurfaceforcingsTemperaturesPresentdayEnum, -
../trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp
349 349 case SurfaceforcingsDelta18oEnum : return "SurfaceforcingsDelta18o"; 350 350 case SurfaceforcingsDelta18oSurfaceEnum : return "SurfaceforcingsDelta18oSurface"; 351 351 case SurfaceforcingsIsdelta18oEnum : return "SurfaceforcingsIsdelta18o"; 352 case SurfaceforcingsIsmungsmEnum : return "SurfaceforcingsIsmungsm"; 352 353 case SurfaceforcingsPrecipitationsPresentdayEnum : return "SurfaceforcingsPrecipitationsPresentday"; 353 354 case SurfaceforcingsPrecipitationsLgmEnum : return "SurfaceforcingsPrecipitationsLgm"; 354 355 case SurfaceforcingsTemperaturesPresentdayEnum : return "SurfaceforcingsTemperaturesPresentday"; -
../trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp
355 355 else if (strcmp(name,"SurfaceforcingsDelta18o")==0) return SurfaceforcingsDelta18oEnum; 356 356 else if (strcmp(name,"SurfaceforcingsDelta18oSurface")==0) return SurfaceforcingsDelta18oSurfaceEnum; 357 357 else if (strcmp(name,"SurfaceforcingsIsdelta18o")==0) return SurfaceforcingsIsdelta18oEnum; 358 else if (strcmp(name,"SurfaceforcingsIsmungsm")==0) return SurfaceforcingsIsmungsmEnum; 358 359 else if (strcmp(name,"SurfaceforcingsPrecipitationsPresentday")==0) return SurfaceforcingsPrecipitationsPresentdayEnum; 359 360 else if (strcmp(name,"SurfaceforcingsPrecipitationsLgm")==0) return SurfaceforcingsPrecipitationsLgmEnum; 360 361 else if (strcmp(name,"SurfaceforcingsTemperaturesPresentday")==0) return SurfaceforcingsTemperaturesPresentdayEnum; … … 381 382 else if (strcmp(name,"SurfaceforcingsRunoff")==0) return SurfaceforcingsRunoffEnum; 382 383 else if (strcmp(name,"SMBmeltcomponents")==0) return SMBmeltcomponentsEnum; 383 384 else if (strcmp(name,"SurfaceforcingsMelt")==0) return SurfaceforcingsMeltEnum; 384 else if (strcmp(name,"SurfaceforcingsRefreeze")==0) return SurfaceforcingsRefreezeEnum;385 385 else stage=4; 386 386 } 387 387 if(stage==4){ 388 if (strcmp(name,"SurfaceforcingsIspdd")==0) return SurfaceforcingsIspddEnum; 388 if (strcmp(name,"SurfaceforcingsRefreeze")==0) return SurfaceforcingsRefreezeEnum; 389 else if (strcmp(name,"SurfaceforcingsIspdd")==0) return SurfaceforcingsIspddEnum; 389 390 else if (strcmp(name,"SurfaceforcingsIssmbgradients")==0) return SurfaceforcingsIssmbgradientsEnum; 390 391 else if (strcmp(name,"SolutionType")==0) return SolutionTypeEnum; 391 392 else if (strcmp(name,"AnalysisType")==0) return AnalysisTypeEnum; … … 504 505 else if (strcmp(name,"MatrixParam")==0) return MatrixParamEnum; 505 506 else if (strcmp(name,"Masscon")==0) return MassconEnum; 506 507 else if (strcmp(name,"MassconName")==0) return MassconNameEnum; 507 else if (strcmp(name,"MassconDefinitionenum")==0) return MassconDefinitionenumEnum;508 508 else stage=5; 509 509 } 510 510 if(stage==5){ 511 if (strcmp(name,"MassconLevelset")==0) return MassconLevelsetEnum; 511 if (strcmp(name,"MassconDefinitionenum")==0) return MassconDefinitionenumEnum; 512 else if (strcmp(name,"MassconLevelset")==0) return MassconLevelsetEnum; 512 513 else if (strcmp(name,"Massconaxpby")==0) return MassconaxpbyEnum; 513 514 else if (strcmp(name,"MassconaxpbyName")==0) return MassconaxpbyNameEnum; 514 515 else if (strcmp(name,"MassconaxpbyDefinitionenum")==0) return MassconaxpbyDefinitionenumEnum; … … 627 628 else if (strcmp(name,"DeviatoricStressxz")==0) return DeviatoricStressxzEnum; 628 629 else if (strcmp(name,"DeviatoricStressyy")==0) return DeviatoricStressyyEnum; 629 630 else if (strcmp(name,"DeviatoricStressyz")==0) return DeviatoricStressyzEnum; 630 else if (strcmp(name,"DeviatoricStresszz")==0) return DeviatoricStresszzEnum;631 631 else stage=6; 632 632 } 633 633 if(stage==6){ 634 if (strcmp(name,"StrainRate")==0) return StrainRateEnum; 634 if (strcmp(name,"DeviatoricStresszz")==0) return DeviatoricStresszzEnum; 635 else if (strcmp(name,"StrainRate")==0) return StrainRateEnum; 635 636 else if (strcmp(name,"StrainRatexx")==0) return StrainRatexxEnum; 636 637 else if (strcmp(name,"StrainRatexy")==0) return StrainRatexyEnum; 637 638 else if (strcmp(name,"StrainRatexz")==0) return StrainRatexzEnum; … … 750 751 else if (strcmp(name,"GroundinglineMigration")==0) return GroundinglineMigrationEnum; 751 752 else if (strcmp(name,"Gset")==0) return GsetEnum; 752 753 else if (strcmp(name,"Index")==0) return IndexEnum; 753 else if (strcmp(name,"Indexed")==0) return IndexedEnum;754 754 else stage=7; 755 755 } 756 756 if(stage==7){ 757 if (strcmp(name,"Intersect")==0) return IntersectEnum; 757 if (strcmp(name,"Indexed")==0) return IndexedEnum; 758 else if (strcmp(name,"Intersect")==0) return IntersectEnum; 758 759 else if (strcmp(name,"Nodal")==0) return NodalEnum; 759 760 else if (strcmp(name,"OldGradient")==0) return OldGradientEnum; 760 761 else if (strcmp(name,"OutputFilePointer")==0) return OutputFilePointerEnum; -
../trunk-jpl/src/c/shared/Elements/elements.h
12 12 IssmDouble Arrhenius(IssmDouble temperature,IssmDouble depth,IssmDouble n); 13 13 IssmDouble LliboutryDuval(IssmDouble enthalpy, IssmDouble pressure, IssmDouble n, IssmDouble betaCC, IssmDouble referencetemperature, IssmDouble heatcapacity, IssmDouble latentheat); 14 14 // IssmDouble LliboutryDuval(IssmDouble temperature, IssmDouble waterfraction, IssmDouble depth,IssmDouble n); 15 IssmDouble PddSurfaceMassBlance(IssmDouble* monthlytemperatures, IssmDouble* monthlyprec, 16 IssmDouble* TemperaturesLgm, IssmDouble* TemperaturesPresentday, 17 IssmDouble* PrecipitationsLgm, IssmDouble* PrecipitationsPresentday, 18 IssmDouble* pdds, IssmDouble* pds,IssmDouble signorm, IssmDouble yts, 19 IssmDouble h, IssmDouble s, IssmDouble desfac, 20 IssmDouble s0t,IssmDouble s0p, IssmDouble rlaps, IssmDouble rlapslgm, 21 IssmDouble PfacTime,IssmDouble TdiffTime,IssmDouble sealevTime); 15 IssmDouble PddSurfaceMassBalance(IssmDouble* monthlytemperatures, IssmDouble* monthlyprec, 16 IssmDouble* pdds, IssmDouble* pds,IssmDouble signorm, IssmDouble yts, 17 IssmDouble h, IssmDouble s, IssmDouble desfac,IssmDouble s0t, 18 IssmDouble s0p, IssmDouble rlaps, IssmDouble rlapslgm, 19 IssmDouble TdiffTime,IssmDouble sealevTime, 20 IssmDouble rho_water, IssmDouble rho_ice); 22 21 void ComputeDelta18oTemperaturePrecipitation(IssmDouble Delta18oSurfacePresent, IssmDouble Delta18oSurfaceLgm, IssmDouble Delta18oSurfaceTime, 23 IssmDouble Delta18oPresent, IssmDouble Delta18oLgm, IssmDouble Delta18oTime, 24 IssmDouble* PrecipitationsPresentday, 25 IssmDouble* TemperaturesLgm, IssmDouble* TemperaturesPresentday, 26 IssmDouble* monthlytemperaturesout, IssmDouble* monthlyprecout); 22 IssmDouble Delta18oPresent, IssmDouble Delta18oLgm, IssmDouble Delta18oTime, 23 IssmDouble* PrecipitationsPresentday, 24 IssmDouble* TemperaturesLgm, IssmDouble* TemperaturesPresentday, 25 IssmDouble* monthlytemperaturesout, IssmDouble* monthlyprecout); 26 void ComputeMungsmTemperaturePrecipitation(IssmDouble TdiffTime, IssmDouble PfacTime, 27 IssmDouble* PrecipitationsLgm,IssmDouble* PrecipitationsPresentday, 28 IssmDouble* TemperaturesLgm, IssmDouble* TemperaturesPresentday, 29 IssmDouble* monthlytemperaturesout, IssmDouble* monthlyprecout); 27 30 IssmDouble DrainageFunctionWaterfraction(IssmDouble waterfraction, IssmDouble dt=0.); 28 31 IssmDouble StressIntensityIntegralWeight(IssmDouble depth, IssmDouble water_depth, IssmDouble thickness); 29 32 -
../trunk-jpl/src/c/shared/Elements/PddSurfaceMassBalance.cpp
1 1 /* file: PddSurfaceMassBlance.cpp 2 2 Calculating the surface mass balance using the positive degree day method. 3 Updating the precipitation and temperature to the new elevation 3 4 */ 4 5 5 6 #include "./elements.h" 6 7 #include "../Numerics/numerics.h" 7 8 8 IssmDouble PddSurfaceMassBlance(IssmDouble* monthlytemperatures, IssmDouble* monthlyprec, 9 IssmDouble* TemperaturesLgm, IssmDouble* TemperaturesPresentday, 10 IssmDouble* PrecipitationsLgm, IssmDouble* PrecipitationsPresentday, 11 IssmDouble* pdds, IssmDouble* pds, IssmDouble signorm, 12 IssmDouble yts, IssmDouble h, IssmDouble s, IssmDouble desfac, 13 IssmDouble s0t, 14 IssmDouble s0p, IssmDouble rlaps, IssmDouble rlapslgm, 15 IssmDouble PfacTime,IssmDouble TdiffTime,IssmDouble sealevTime){ 9 IssmDouble PddSurfaceMassBalance(IssmDouble* monthlytemperatures, IssmDouble* monthlyprec, 10 IssmDouble* pdds, IssmDouble* pds, IssmDouble signorm, 11 IssmDouble yts, IssmDouble h, IssmDouble s, IssmDouble desfac, 12 IssmDouble s0t,IssmDouble s0p, IssmDouble rlaps,IssmDouble rlapslgm, 13 IssmDouble TdiffTime,IssmDouble sealevTime, 14 IssmDouble rho_water,IssmDouble rho_ice){ 16 15 17 // CURENTLY monthlytemperatures and monthlyprec ARE NOT USED HERE.18 // THEY ARE REPLACE BY tdiffh No usage of deltO18 anymore19 20 16 // output: 21 17 IssmDouble B; // surface mass balance, melt+accumulation 22 18 int iqj,imonth; … … 27 23 IssmDouble prect; // total precipitation during 1 year taking into account des. ef. 28 24 IssmDouble water; //water=rain + snowmelt 29 25 IssmDouble runoff; //meltwater only, does not include rain 26 IssmDouble sconv; //rhow_rain/rhoi / 12 months 30 27 31 28 //IssmDouble sealev=0.; // degrees per meter. 7.5 lev's 99 paper, 9 Marshall 99 paper 32 29 //IssmDouble Pfac=0.5,Tdiff=0.5; 33 IssmDouble 30 IssmDouble rtlaps; 34 31 // IssmDouble lapser=6.5 // lapse rate 35 32 // IssmDouble desfac = 0.3; // desert elevation factor 36 33 // IssmDouble s0p=0.; // should be set to elevation from precip source 37 34 // IssmDouble s0t=0.; // should be set to elevation from temperature source 38 IssmDouble tdiffh;39 35 IssmDouble st; // elevation between altitude of the temp record and current altitude 40 36 IssmDouble sp; // elevation between altitude of the prec record and current altitude 41 37 IssmDouble deselcut=1.0; … … 48 44 IssmDouble DT = 0.02; 49 45 IssmDouble pddt, pd; // pd: snow/precip fraction, precipitation falling as snow 50 46 51 IssmDouble premt; // monthly precipitation (m of ice equivalent)52 47 IssmDouble q, qmpt; // q is desert/elev. fact, hnpfac is huybrect fact, and pd is normal dist. 53 48 IssmDouble qm = 0.; // snow part of the precipitation 54 49 IssmDouble qmt = 0.; // precipitation without desertification effect adjustment … … 72 67 IssmDouble fsupT=0.5, fsupndd=0.5; // Tsurf mode factors for supice 73 68 IssmDouble pddtj, hmx2; 74 69 70 sconv=(rho_water/rho_ice)/12.; //rhow_rain/rhoi / 12 months 75 71 76 72 /*PDD constant*/ 77 73 siglim = 2.5*signorm; … … 89 85 rtlaps=TdiffTime*rlapslgm + (1.-TdiffTime)*rlaps; // lapse rate 90 86 91 87 /*********compute Surface temperature *******/ 92 tdiffh = TdiffTime*( TemperaturesLgm[imonth] - TemperaturesPresentday[imonth]);93 tstar = tdiffh + TemperaturesPresentday[imonth] - rtlaps *max(st,sealevTime*0.001);88 monthlytemperatures[imonth]=monthlytemperatures[imonth] - rtlaps *max(st,sealevTime*0.001); 89 tstar = monthlytemperatures[imonth]; 94 90 Tsurf = tstar*deltm+Tsurf; 95 91 96 92 /*********compute PD ****************/ … … 105 101 if (sp>0.0){q = exp(-desfac*sp);} 106 102 else {q = 1.0;} 107 103 108 premt =min(1.5, PrecipitationsPresentday[imonth] * pow(PrecipitationsLgm[imonth],PfacTime)); // [m/month] 109 110 qmt= qmt + premt; 111 qmpt= q*premt; 104 qmt= qmt + monthlyprec[imonth]*sconv; //*sconv to convert in m of ice equivalent per month 105 qmpt= q*monthlyprec[imonth]*sconv; 112 106 qmp= qmp + qmpt; 113 107 qm= qm + qmpt*pd; 114 108 … … 123 117 pdd = pdd + pddsig*deltm; 124 118 frzndd = frzndd - (tstar-pddsig)*deltm;} 125 119 else{frzndd = frzndd - tstar*deltm; } 120 121 /*Assign output pointer*/ 122 *(monthlytemperatures+imonth) = monthlytemperatures[imonth]; 123 *(monthlyprec+imonth) = monthlyprec[imonth]; 126 124 } // end of seasonal loop 127 125 //****************************************************************** 128 126 -
../trunk-jpl/src/c/modules/ModelProcessorx/CreateParameters.cpp
21 21 int numoutputs,materialtype,smb_model,basalforcing_model; 22 22 char** requestedoutputs = NULL; 23 23 IssmDouble time; 24 bool isdelta18o ;24 bool isdelta18o,ismungsm; 25 25 26 26 /*parameters for mass flux:*/ 27 27 int mass_flux_num_profiles = 0; … … 107 107 break; 108 108 case SMBpddEnum: 109 109 parameters->AddObject(iomodel->CopyConstantObject(SurfaceforcingsIsdelta18oEnum)); 110 parameters->AddObject(iomodel->CopyConstantObject(SurfaceforcingsIsmungsmEnum)); 110 111 parameters->AddObject(iomodel->CopyConstantObject(SurfaceforcingsDesfacEnum)); 111 112 parameters->AddObject(iomodel->CopyConstantObject(SurfaceforcingsS0pEnum)); 112 113 parameters->AddObject(iomodel->CopyConstantObject(SurfaceforcingsS0tEnum)); 113 114 parameters->AddObject(iomodel->CopyConstantObject(SurfaceforcingsRlapsEnum)); 114 115 parameters->AddObject(iomodel->CopyConstantObject(SurfaceforcingsRlapslgmEnum)); 115 116 iomodel->Constant(&isdelta18o,SurfaceforcingsIsdelta18oEnum); 117 iomodel->Constant(&ismungsm,SurfaceforcingsIsmungsmEnum); 116 118 117 iomodel->FetchData(&temp,&N,&M,SurfaceforcingsPfacEnum); _assert_(N==2); 118 for(i=0;i<M;i++) temp[M+i]=temp[M+i]; 119 parameters->AddObject(new TransientParam(SurfaceforcingsPfacEnum,&temp[0],&temp[M],M)); 120 iomodel->DeleteData(temp,SurfaceforcingsPfacEnum); 119 if(ismungsm){ 120 iomodel->FetchData(&temp,&N,&M,SurfaceforcingsPfacEnum); _assert_(N==2); 121 for(i=0;i<M;i++) temp[M+i]=temp[M+i]; 122 parameters->AddObject(new TransientParam(SurfaceforcingsPfacEnum,&temp[0],&temp[M],M)); 123 iomodel->DeleteData(temp,SurfaceforcingsPfacEnum); 121 124 122 iomodel->FetchData(&temp,&N,&M,SurfaceforcingsTdiffEnum); _assert_(N==2);123 for(i=0;i<M;i++) temp[M+i]=temp[M+i];124 parameters->AddObject(new TransientParam(SurfaceforcingsTdiffEnum,&temp[0],&temp[M],M));125 iomodel->DeleteData(temp,SurfaceforcingsTdiffEnum);125 iomodel->FetchData(&temp,&N,&M,SurfaceforcingsTdiffEnum); _assert_(N==2); 126 for(i=0;i<M;i++) temp[M+i]=temp[M+i]; 127 parameters->AddObject(new TransientParam(SurfaceforcingsTdiffEnum,&temp[0],&temp[M],M)); 128 iomodel->DeleteData(temp,SurfaceforcingsTdiffEnum); 126 129 127 iomodel->FetchData(&temp,&N,&M,SurfaceforcingsSealevEnum); _assert_(N==2); 128 for(i=0;i<M;i++) temp[M+i]=temp[M+i]; 129 parameters->AddObject(new TransientParam(SurfaceforcingsSealevEnum,&temp[0],&temp[M],M)); 130 iomodel->DeleteData(temp,SurfaceforcingsSealevEnum); 130 iomodel->FetchData(&temp,&N,&M,SurfaceforcingsSealevEnum); _assert_(N==2); 131 for(i=0;i<M;i++) temp[M+i]=temp[M+i]; 132 parameters->AddObject(new TransientParam(SurfaceforcingsSealevEnum,&temp[0],&temp[M],M)); 133 iomodel->DeleteData(temp,SurfaceforcingsSealevEnum); 134 } 131 135 132 136 if(isdelta18o){ 133 137 iomodel->Constant(&yts,ConstantsYtsEnum); -
../trunk-jpl/src/c/modules/SurfaceMassBalancex/SurfaceMassBalancex.h
11 11 void SurfaceMassBalancex(FemModel* femmodel); 12 12 void SmbGradientsx(FemModel* femmodel); 13 13 void Delta18oParameterizationx(FemModel* femmodel); 14 void MungsmtpParameterizationx(FemModel* femmodel); 14 15 void PositiveDegreeDayx(FemModel* femmodel); 15 16 void SmbHenningx(FemModel* femmodel); 16 17 void SmbComponentsx(FemModel* femmodel); -
../trunk-jpl/src/c/modules/SurfaceMassBalancex/SurfaceMassBalancex.cpp
10 10 11 11 /*Intermediaties*/ 12 12 int smb_model; 13 bool isdelta18o ;13 bool isdelta18o,ismungsm; 14 14 15 15 /*First, get SMB model from parameters*/ 16 16 femmodel->parameters->FindParam(&smb_model,SurfaceforcingsEnum); … … 22 22 break; 23 23 case SMBpddEnum: 24 24 femmodel->parameters->FindParam(&isdelta18o,SurfaceforcingsIsdelta18oEnum); 25 femmodel->parameters->FindParam(&ismungsm,SurfaceforcingsIsmungsmEnum); 25 26 if(isdelta18o){ 26 if(VerboseSolution()) _printf0_(" call Delta18oParamet rization module\n");27 if(VerboseSolution()) _printf0_(" call Delta18oParameterization module\n"); 27 28 Delta18oParameterizationx(femmodel); 28 29 } 30 if(ismungsm){ 31 if(VerboseSolution()) _printf0_(" call MungsmtpParameterization module\n"); 32 MungsmtpParameterizationx(femmodel); 33 } 29 34 if(VerboseSolution()) _printf0_(" call positive degree day module\n"); 30 35 PositiveDegreeDayx(femmodel); 31 36 break; … … 117 122 } 118 123 119 124 }/*}}}*/ 125 void MungsmtpParameterizationx(FemModel* femmodel){/*{{{*/ 126 127 for(int i=0;i<femmodel->elements->Size();i++){ 128 Element* element=xDynamicCast<Element*>(femmodel->elements->GetObjectByOffset(i)); 129 element->MungsmtpParameterization(); 130 } 131 132 }/*}}}*/ 120 133 void PositiveDegreeDayx(FemModel* femmodel){/*{{{*/ 121 134 122 135 // void PositiveDegreeDayx(hd,vTempsea,vPrec,agd,Tsurf,ni){ … … 143 156 IssmDouble PDup, PDCUT = 2.0; // PDcut: rain/snow cutoff temperature (C) 144 157 IssmDouble tstar; // monthly mean surface temp 145 158 159 bool ismungsm; 160 146 161 IssmDouble *pdds = NULL; 147 162 IssmDouble *pds = NULL; 148 163 Element *element = NULL; … … 150 165 pdds=xNew<IssmDouble>(NPDMAX+1); 151 166 pds=xNew<IssmDouble>(NPDCMAX+1); 152 167 168 // Get ismungsm parameter 169 femmodel->parameters->FindParam(&ismungsm,SurfaceforcingsIsmungsmEnum); 170 153 171 /* initialize PDD (creation of a lookup table)*/ 154 172 tstep = 0.1; 155 173 tsint = tstep*0.5; … … 204 222 205 223 for(i=0;i<femmodel->elements->Size();i++){ 206 224 element=xDynamicCast<Element*>(femmodel->elements->GetObjectByOffset(i)); 207 element->PositiveDegreeDay(pdds,pds,signorm );225 element->PositiveDegreeDay(pdds,pds,signorm,ismungsm); 208 226 } 209 210 227 /*free ressouces: */ 211 228 xDelete<IssmDouble>(pdds); 212 229 xDelete<IssmDouble>(pds); -
../trunk-jpl/src/c/Makefile.am
219 219 ./shared/Elements/PrintArrays.cpp\ 220 220 ./shared/Elements/PddSurfaceMassBalance.cpp\ 221 221 ./shared/Elements/ComputeDelta18oTemperaturePrecipitation.cpp\ 222 ./shared/Elements/ComputeMungsmTemperaturePrecipitation.cpp\ 222 223 ./shared/Elements/DrainageFunctionWaterfraction.cpp\ 223 224 ./shared/String/sharedstring.h\ 224 225 ./shared/String/DescriptorIndex.cpp\ -
../trunk-jpl/src/c/classes/Elements/Element.h
179 179 virtual void ControlInputSetGradient(IssmDouble* gradient,int enum_type,int control_index)=0; 180 180 virtual void ControlToVectors(Vector<IssmPDouble>* vector_control, Vector<IssmPDouble>* vector_gradient,int control_enum)=0; 181 181 virtual void Delta18oParameterization(void)=0; 182 virtual void MungsmtpParameterization(void)=0; 182 183 virtual void ElementResponse(IssmDouble* presponse,int response_enum)=0; 183 184 virtual void ElementSizes(IssmDouble* phx,IssmDouble* phy,IssmDouble* phz)=0; 184 185 virtual int FiniteElement(void)=0; … … 250 251 virtual void NormalTop(IssmDouble* normal,IssmDouble* xyz_list)=0; 251 252 virtual int NumberofNodesPressure(void)=0; 252 253 virtual int NumberofNodesVelocity(void)=0; 253 virtual void PositiveDegreeDay(IssmDouble* pdds,IssmDouble* pds,IssmDouble signorm )=0;254 virtual void PositiveDegreeDay(IssmDouble* pdds,IssmDouble* pds,IssmDouble signorm,bool ismungsm)=0; 254 255 virtual void PotentialUngrounding(Vector<IssmDouble>* potential_sheet_ungrounding)=0; 255 256 virtual int PressureInterpolation()=0; 256 257 virtual void ReduceMatrices(ElementMatrix* Ke,ElementVector* pe)=0; -
../trunk-jpl/src/c/classes/Elements/Tria.cpp
608 608 input->GetInputValue(&TemperaturesPresentday[iv][month],gauss,month/12.*yts); 609 609 input2->GetInputValue(&TemperaturesLgm[iv][month],gauss,month/12.*yts); 610 610 input3->GetInputValue(&PrecipitationsPresentday[iv][month],gauss,month/12.*yts); 611 PrecipitationsPresentday[iv][month]=PrecipitationsPresentday[iv][month]/yts; // converion in m/sec612 611 } 613 612 } 614 613 … … 650 649 /*clean-up*/ 651 650 delete gauss; 652 651 } 652 void Tria::MungsmtpParameterization(void){/*{{{*/ 653 /*Are we on the base? If not, return*/ 654 if(!IsOnBase()) return; 655 656 int i; 657 IssmDouble monthlytemperatures[NUMVERTICES][12],monthlyprec[NUMVERTICES][12]; 658 IssmDouble TemperaturesPresentday[NUMVERTICES][12],TemperaturesLgm[NUMVERTICES][12]; 659 IssmDouble PrecipitationsPresentday[NUMVERTICES][12],PrecipitationsLgm[NUMVERTICES][12]; 660 IssmDouble tmp[NUMVERTICES]; 661 IssmDouble TdiffTime,PfacTime; 662 IssmDouble time,yts; 663 this->parameters->FindParam(&time,TimeEnum); 664 this->parameters->FindParam(&yts,ConstantsYtsEnum); 665 666 /*Recover present day temperature and precipitation*/ 667 Input* input=inputs->GetInput(SurfaceforcingsTemperaturesPresentdayEnum); _assert_(input); 668 Input* input2=inputs->GetInput(SurfaceforcingsTemperaturesLgmEnum); _assert_(input2); 669 Input* input3=inputs->GetInput(SurfaceforcingsPrecipitationsPresentdayEnum); _assert_(input3); 670 Input* input4=inputs->GetInput(SurfaceforcingsPrecipitationsLgmEnum); _assert_(input4); 671 GaussTria* gauss=new GaussTria(); 672 for(int month=0;month<12;month++) { 673 for(int iv=0;iv<NUMVERTICES;iv++) { 674 gauss->GaussVertex(iv); 675 input->GetInputValue(&TemperaturesPresentday[iv][month],gauss,month/12.*yts); 676 input2->GetInputValue(&TemperaturesLgm[iv][month],gauss,month/12.*yts); 677 input3->GetInputValue(&PrecipitationsPresentday[iv][month],gauss,month/12.*yts); 678 input4->GetInputValue(&PrecipitationsLgm[iv][month],gauss,month/12.*yts); 679 } 680 } 681 682 /*Recover interpolation parameters at time t*/ 683 this->parameters->FindParam(&TdiffTime,SurfaceforcingsTdiffEnum,time); 684 this->parameters->FindParam(&PfacTime,SurfaceforcingsPfacEnum,time); 685 686 /*Compute the temperature and precipitation*/ 687 for(int iv=0;iv<NUMVERTICES;iv++){ 688 ComputeMungsmTemperaturePrecipitation(TdiffTime,PfacTime, 689 &PrecipitationsLgm[iv][0],&PrecipitationsPresentday[iv][0], 690 &TemperaturesLgm[iv][0], &TemperaturesPresentday[iv][0], 691 &monthlytemperatures[iv][0], &monthlyprec[iv][0]); 692 } 693 694 /*Update inputs*/ 695 TransientInput* NewTemperatureInput = new TransientInput(SurfaceforcingsMonthlytemperaturesEnum); 696 TransientInput* NewPrecipitationInput = new TransientInput(SurfaceforcingsPrecipitationEnum); 697 for (int imonth=0;imonth<12;imonth++) { 698 for(i=0;i<NUMVERTICES;i++) tmp[i]=monthlytemperatures[i][imonth]; 699 TriaInput* newmonthinput1 = new TriaInput(SurfaceforcingsMonthlytemperaturesEnum,&tmp[0],P1Enum); 700 NewTemperatureInput->AddTimeInput(newmonthinput1,time+imonth/12.*yts); 701 702 for(i=0;i<NUMVERTICES;i++) tmp[i]=monthlyprec[i][imonth]; 703 TriaInput* newmonthinput2 = new TriaInput(SurfaceforcingsPrecipitationEnum,&tmp[0],P1Enum); 704 NewPrecipitationInput->AddTimeInput(newmonthinput2,time+imonth/12.*yts); 705 } 706 NewTemperatureInput->Configure(this->parameters); 707 NewPrecipitationInput->Configure(this->parameters); 708 709 this->inputs->AddInput(NewTemperatureInput); 710 this->inputs->AddInput(NewPrecipitationInput); 711 712 /*clean-up*/ 713 delete gauss; 714 } 653 715 /*}}}*/ 654 716 int Tria::EdgeOnBaseIndex(void){/*{{{*/ 655 717 … … 2441 2503 return TriaRef::NumberofNodes(this->VelocityInterpolation()); 2442 2504 } 2443 2505 /*}}}*/ 2444 void Tria::PositiveDegreeDay(IssmDouble* pdds,IssmDouble* pds,IssmDouble signorm){/*{{{*/ 2445 2506 void Tria::PositiveDegreeDay(IssmDouble* pdds,IssmDouble* pds,IssmDouble signorm,bool ismungsm){/*{{{*/ 2507 2508 int i; 2446 2509 IssmDouble agd[NUMVERTICES]; // surface mass balance 2447 2510 IssmDouble monthlytemperatures[NUMVERTICES][12],monthlyprec[NUMVERTICES][12]; 2448 IssmDouble TemperaturesPresentday[NUMVERTICES][12],TemperaturesLgm[NUMVERTICES][12]; 2449 IssmDouble PrecipitationsPresentday[NUMVERTICES][12],PrecipitationsLgm[NUMVERTICES][12]; 2511 IssmDouble tmp[NUMVERTICES]; 2450 2512 IssmDouble h[NUMVERTICES],s[NUMVERTICES]; 2451 2513 IssmDouble rho_water,rho_ice,desfac,s0p,s0t,rlaps,rlapslgm; 2452 2514 IssmDouble PfacTime,TdiffTime,sealevTime; 2453 IssmDouble sconv; //rhow_rain/rhoi / 12 months2454 2515 2455 2516 /*Get material parameters :*/ 2456 2517 rho_water=matpar->GetMaterialParameter(MaterialsRhoSeawaterEnum); 2457 2518 rho_ice=matpar->GetMaterialParameter(MaterialsRhoIceEnum); 2458 //rho_ice=matpar->GetRhoIce();2459 //rho_water=matpar->GetRhoFreshwater();2460 2519 2461 sconv=(rho_water/rho_ice)/12.; //to convert monbthly prec in m of ice equivalent per month 2520 /*Get some pdd parameters*/ 2521 desfac=matpar->GetMaterialParameter(SurfaceforcingsDesfacEnum); 2522 s0p=matpar->GetMaterialParameter(SurfaceforcingsS0pEnum); 2523 s0t=matpar->GetMaterialParameter(SurfaceforcingsS0tEnum); 2524 rlaps=matpar->GetMaterialParameter(SurfaceforcingsRlapsEnum); 2525 rlapslgm=matpar->GetMaterialParameter(SurfaceforcingsRlapslgmEnum); 2462 2526 2463 2527 /*Recover monthly temperatures and precipitation and Present day and LGm ones*/ 2464 2528 Input* input=inputs->GetInput(SurfaceforcingsMonthlytemperaturesEnum); _assert_(input); 2465 2529 Input* input2=inputs->GetInput(SurfaceforcingsPrecipitationEnum); _assert_(input2); 2466 Input* input3=inputs->GetInput(SurfaceforcingsTemperaturesPresentdayEnum); _assert_(input3);2467 Input* input4=inputs->GetInput(SurfaceforcingsTemperaturesLgmEnum); _assert_(input4);2468 Input* input5=inputs->GetInput(SurfaceforcingsPrecipitationsPresentdayEnum); _assert_(input5);2469 Input* input6=inputs->GetInput(SurfaceforcingsPrecipitationsLgmEnum); _assert_(input6);2470 2530 GaussTria* gauss=new GaussTria(); 2471 2531 IssmDouble time,yts; 2472 2532 this->parameters->FindParam(&time,TimeEnum); 2473 2533 this->parameters->FindParam(&yts,ConstantsYtsEnum); 2534 2535 2474 2536 for(int month=0;month<12;month++) { 2475 2537 for(int iv=0;iv<NUMVERTICES;iv++) { 2476 2538 gauss->GaussVertex(iv); 2477 2539 input->GetInputValue(&monthlytemperatures[iv][month],gauss,time+month/12.*yts); 2478 2540 monthlytemperatures[iv][month]=monthlytemperatures[iv][month]-273.15; // conversion from Kelvin to celcius 2479 2541 input2->GetInputValue(&monthlyprec[iv][month],gauss,time+month/12.*yts); 2480 monthlyprec[iv][month]=monthlyprec[iv][month]*sconv*yts; // convertion in m/y2481 input3->GetInputValue(&TemperaturesPresentday[iv][month],gauss,month/12.*yts);2482 TemperaturesPresentday[iv][month]=TemperaturesPresentday[iv][month]-273.15; // conversion from Kelvin to celcius2483 input4->GetInputValue(&TemperaturesLgm[iv][month],gauss,month/12.*yts);2484 TemperaturesLgm[iv][month]=TemperaturesLgm[iv][month]-273.15; // conversion from Kelvin to celcius2485 input5->GetInputValue(&PrecipitationsPresentday[iv][month],gauss,month/12.*yts);2486 PrecipitationsPresentday[iv][month]=PrecipitationsPresentday[iv][month];2487 input6->GetInputValue(&PrecipitationsLgm[iv][month],gauss,month/12.*yts);2488 PrecipitationsLgm[iv][month]=PrecipitationsLgm[iv][month];2489 2542 } 2490 2543 } 2491 2544 2492 /*Recover Pfac, Tdiff and sealev at time t:*/ 2493 this->parameters->FindParam(&PfacTime,SurfaceforcingsPfacEnum,time); 2494 this->parameters->FindParam(&TdiffTime,SurfaceforcingsTdiffEnum,time); 2495 this->parameters->FindParam(&sealevTime,SurfaceforcingsSealevEnum,time); 2545 /*Recover Pfac, Tdiff and sealev at time t: 2546 This parameters are used to interpolate the temperature 2547 and precipitaton between PD and LGM when ismungsm==1 */ 2548 if (ismungsm==1){ 2549 this->parameters->FindParam(&TdiffTime,SurfaceforcingsTdiffEnum,time); 2550 this->parameters->FindParam(&sealevTime,SurfaceforcingsSealevEnum,time); 2551 } 2552 else { 2553 TdiffTime=0; 2554 sealevTime=0; 2555 } 2496 2556 2497 2557 /*Recover info at the vertices: */ 2498 2558 GetInputListOnVertices(&h[0],ThicknessEnum); 2499 2559 GetInputListOnVertices(&s[0],SurfaceEnum); 2500 2501 /*Get other pdd parameters*/2502 desfac=matpar->GetMaterialParameter(SurfaceforcingsDesfacEnum);2503 s0p=matpar->GetMaterialParameter(SurfaceforcingsS0pEnum);2504 s0t=matpar->GetMaterialParameter(SurfaceforcingsS0tEnum);2505 rlaps=matpar->GetMaterialParameter(SurfaceforcingsRlapsEnum);2506 rlapslgm=matpar->GetMaterialParameter(SurfaceforcingsRlapslgmEnum);2507 2560 2508 2561 /*measure the surface mass balance*/ 2509 for (int iv = 0; iv<NUMVERTICES; iv++){ 2510 agd[iv]=PddSurfaceMassBlance(&monthlytemperatures[iv][0], &monthlyprec[iv][0], 2511 &TemperaturesLgm[iv][0], &TemperaturesPresentday[iv][0], 2512 &PrecipitationsLgm[iv][0], &PrecipitationsPresentday[iv][0], 2562 for (int iv = 0; iv<NUMVERTICES; iv++){ 2563 agd[iv]=PddSurfaceMassBalance(&monthlytemperatures[iv][0], &monthlyprec[iv][0], 2513 2564 pdds, pds, signorm, yts, h[iv], s[iv], 2514 desfac, s0t, s0p,rlaps,rlapslgm,PfacTime,TdiffTime,sealevTime); 2565 desfac, s0t, s0p,rlaps,rlapslgm,TdiffTime,sealevTime, 2566 rho_water,rho_ice); 2515 2567 } 2516 2568 2517 2569 /*Update inputs*/ 2570 // TransientInput* NewTemperatureInput = new TransientInput(SurfaceforcingsMonthlytemperaturesEnum); 2571 // TransientInput* NewPrecipitationInput = new TransientInput(SurfaceforcingsPrecipitationEnum); 2572 // for (int imonth=0;imonth<12;imonth++) { 2573 // for(i=0;i<NUMVERTICES;i++) tmp[i]=monthlytemperatures[i][imonth]; 2574 // TriaInput* newmonthinput1 = new TriaInput(SurfaceforcingsMonthlytemperaturesEnum,&tmp[0],P1Enum); 2575 // NewTemperatureInput->AddTimeInput(newmonthinput1,time+imonth/12.*yts); 2576 // 2577 // for(i=0;i<NUMVERTICES;i++) tmp[i]=monthlyprec[i][imonth]; 2578 // TriaInput* newmonthinput2 = new TriaInput(SurfaceforcingsPrecipitationEnum,&tmp[0],P1Enum); 2579 // NewPrecipitationInput->AddTimeInput(newmonthinput2,time+imonth/12.*yts); 2580 // } 2581 // NewTemperatureInput->Configure(this->parameters); 2582 // NewPrecipitationInput->Configure(this->parameters); 2583 2584 2518 2585 this->inputs->AddInput(new TriaInput(SurfaceforcingsMassBalanceEnum,&agd[0],P1Enum)); 2586 // this->inputs->AddInput(NewTemperatureInput); 2587 // this->inputs->AddInput(NewPrecipitationInput); 2519 2588 // this->inputs->AddInput(new TriaVertexInput(ThermalSpcTemperatureEnum,&Tsurf[0])); 2520 2589 2590 //this->InputExtrude(SurfaceforcingsMassBalanceEnum,-1); 2591 // this->InputExtrude(SurfaceforcingsMonthlytemperaturesEnum,-1); 2592 // this->InputExtrude(SurfaceforcingsPrecipitationEnum,-1); 2593 2521 2594 /*clean-up*/ 2522 2595 delete gauss; 2523 2596 } -
../trunk-jpl/src/c/classes/Elements/Tria.h
62 62 void ControlInputSetGradient(IssmDouble* gradient,int enum_type,int control_index); 63 63 void ControlToVectors(Vector<IssmPDouble>* vector_control, Vector<IssmPDouble>* vector_gradient,int control_enum); 64 64 void Delta18oParameterization(void); 65 void MungsmtpParameterization(void); 65 66 int EdgeOnBaseIndex(); 66 67 void EdgeOnBaseIndices(int* pindex1,int* pindex); 67 68 int EdgeOnSurfaceIndex(); … … 108 109 int NodalValue(IssmDouble* pvalue, int index, int natureofdataenum); 109 110 int NumberofNodesPressure(void); 110 111 int NumberofNodesVelocity(void); 111 void PositiveDegreeDay(IssmDouble* pdds,IssmDouble* pds,IssmDouble signorm );112 void PositiveDegreeDay(IssmDouble* pdds,IssmDouble* pds,IssmDouble signorm,bool ismungsm); 112 113 void PotentialUngrounding(Vector<IssmDouble>* potential_sheet_ungrounding); 113 114 int PressureInterpolation(); 114 115 void ReduceMatrices(ElementMatrix* Ke,ElementVector* pe); -
../trunk-jpl/src/c/classes/Elements/Penta.cpp
607 607 input->GetInputValue(&TemperaturesPresentday[iv][month],gauss,month/12.*yts); 608 608 input2->GetInputValue(&TemperaturesLgm[iv][month],gauss,month/12.*yts); 609 609 input3->GetInputValue(&PrecipitationsPresentday[iv][month],gauss,month/12.*yts); 610 PrecipitationsPresentday[iv][month]=PrecipitationsPresentday[iv][month]/yts; // converion in m/sec611 610 } 612 611 } 613 612 … … 652 651 /*clean-up*/ 653 652 delete gauss; 654 653 } 654 void Penta::MungsmtpParameterization(void){/*{{{*/ 655 /*Are we on the base? If not, return*/ 656 if(!IsOnBase()) return; 657 658 int i; 659 IssmDouble monthlytemperatures[NUMVERTICES][12],monthlyprec[NUMVERTICES][12]; 660 IssmDouble TemperaturesPresentday[NUMVERTICES][12],TemperaturesLgm[NUMVERTICES][12]; 661 IssmDouble PrecipitationsPresentday[NUMVERTICES][12],PrecipitationsLgm[NUMVERTICES][12]; 662 IssmDouble tmp[NUMVERTICES]; 663 IssmDouble TdiffTime,PfacTime; 664 IssmDouble time,yts; 665 this->parameters->FindParam(&time,TimeEnum); 666 this->parameters->FindParam(&yts,ConstantsYtsEnum); 667 668 /*Recover present day temperature and precipitation*/ 669 Input* input=inputs->GetInput(SurfaceforcingsTemperaturesPresentdayEnum); _assert_(input); 670 Input* input2=inputs->GetInput(SurfaceforcingsTemperaturesLgmEnum); _assert_(input2); 671 Input* input3=inputs->GetInput(SurfaceforcingsPrecipitationsPresentdayEnum); _assert_(input3); 672 Input* input4=inputs->GetInput(SurfaceforcingsPrecipitationsLgmEnum); _assert_(input4); 673 GaussPenta* gauss=new GaussPenta(); 674 for(int month=0;month<12;month++) { 675 for(int iv=0;iv<NUMVERTICES;iv++) { 676 gauss->GaussVertex(iv); 677 input->GetInputValue(&TemperaturesPresentday[iv][month],gauss,month/12.*yts); 678 input2->GetInputValue(&TemperaturesLgm[iv][month],gauss,month/12.*yts); 679 input3->GetInputValue(&PrecipitationsPresentday[iv][month],gauss,month/12.*yts); 680 input4->GetInputValue(&PrecipitationsLgm[iv][month],gauss,month/12.*yts); 681 } 682 } 683 684 /*Recover interpolation parameters at time t*/ 685 this->parameters->FindParam(&TdiffTime,SurfaceforcingsTdiffEnum,time); 686 this->parameters->FindParam(&PfacTime,SurfaceforcingsPfacEnum,time); 687 688 /*Compute the temperature and precipitation*/ 689 for(int iv=0;iv<NUMVERTICES;iv++){ 690 ComputeMungsmTemperaturePrecipitation(TdiffTime,PfacTime, 691 &PrecipitationsLgm[iv][0],&PrecipitationsPresentday[iv][0], 692 &TemperaturesLgm[iv][0], &TemperaturesPresentday[iv][0], 693 &monthlytemperatures[iv][0], &monthlyprec[iv][0]); 694 } 695 696 /*Update inputs*/ 697 TransientInput* NewTemperatureInput = new TransientInput(SurfaceforcingsMonthlytemperaturesEnum); 698 TransientInput* NewPrecipitationInput = new TransientInput(SurfaceforcingsPrecipitationEnum); 699 for (int imonth=0;imonth<12;imonth++) { 700 for(i=0;i<NUMVERTICES;i++) tmp[i]=monthlytemperatures[i][imonth]; 701 PentaInput* newmonthinput1 = new PentaInput(SurfaceforcingsMonthlytemperaturesEnum,&tmp[0],P1Enum); 702 NewTemperatureInput->AddTimeInput(newmonthinput1,time+imonth/12.*yts); 703 704 for(i=0;i<NUMVERTICES;i++) tmp[i]=monthlyprec[i][imonth]; 705 PentaInput* newmonthinput2 = new PentaInput(SurfaceforcingsPrecipitationEnum,&tmp[0],P1Enum); 706 NewPrecipitationInput->AddTimeInput(newmonthinput2,time+imonth/12.*yts); 707 } 708 NewTemperatureInput->Configure(this->parameters); 709 NewPrecipitationInput->Configure(this->parameters); 710 711 this->inputs->AddInput(NewTemperatureInput); 712 this->inputs->AddInput(NewPrecipitationInput); 713 714 this->InputExtrude(SurfaceforcingsMonthlytemperaturesEnum,-1); 715 this->InputExtrude(SurfaceforcingsPrecipitationEnum,-1); 716 717 /*clean-up*/ 718 delete gauss; 719 } 655 720 /*}}}*/ 656 721 void Penta::ElementResponse(IssmDouble* presponse,int response_enum){/*{{{*/ 657 722 … … 2081 2146 2082 2147 } 2083 2148 /*}}}*/ 2084 void Penta::PositiveDegreeDay(IssmDouble* pdds,IssmDouble* pds,IssmDouble signorm ){/*{{{*/2149 void Penta::PositiveDegreeDay(IssmDouble* pdds,IssmDouble* pds,IssmDouble signorm,bool ismungsm){/*{{{*/ 2085 2150 2151 int i; 2086 2152 IssmDouble agd[NUMVERTICES]; // surface mass balance 2087 2153 IssmDouble monthlytemperatures[NUMVERTICES][12],monthlyprec[NUMVERTICES][12]; 2088 IssmDouble TemperaturesPresentday[NUMVERTICES][12],TemperaturesLgm[NUMVERTICES][12]; 2089 IssmDouble PrecipitationsPresentday[NUMVERTICES][12],PrecipitationsLgm[NUMVERTICES][12]; 2154 IssmDouble tmp[NUMVERTICES]; 2090 2155 IssmDouble h[NUMVERTICES],s[NUMVERTICES]; 2091 2156 IssmDouble rho_water,rho_ice,desfac,s0p,s0t,rlaps,rlapslgm; 2092 2157 IssmDouble PfacTime,TdiffTime,sealevTime; 2093 IssmDouble sconv; //rhow_rain/rhoi / 12 months2094 2158 2095 2159 /*Get material parameters :*/ 2096 2160 rho_water=matpar->GetMaterialParameter(MaterialsRhoSeawaterEnum); 2097 2161 rho_ice=matpar->GetMaterialParameter(MaterialsRhoIceEnum); 2098 //rho_ice=matpar->GetRhoIce();2099 //rho_water=matpar->GetRhoFreshwater();2100 2162 2101 sconv=(rho_water/rho_ice)/12.; //to convert monbthly prec in m of ice equivalent per month 2163 /*Get some pdd parameters*/ 2164 desfac=matpar->GetMaterialParameter(SurfaceforcingsDesfacEnum); 2165 s0p=matpar->GetMaterialParameter(SurfaceforcingsS0pEnum); 2166 s0t=matpar->GetMaterialParameter(SurfaceforcingsS0tEnum); 2167 rlaps=matpar->GetMaterialParameter(SurfaceforcingsRlapsEnum); 2168 rlapslgm=matpar->GetMaterialParameter(SurfaceforcingsRlapslgmEnum); 2102 2169 2103 2170 /*Recover monthly temperatures and precipitation*/ 2104 2171 Input* input=inputs->GetInput(SurfaceforcingsMonthlytemperaturesEnum); _assert_(input); 2105 2172 Input* input2=inputs->GetInput(SurfaceforcingsPrecipitationEnum); _assert_(input2); 2106 Input* input3=inputs->GetInput(SurfaceforcingsTemperaturesPresentdayEnum); _assert_(input3);2107 Input* input4=inputs->GetInput(SurfaceforcingsTemperaturesLgmEnum); _assert_(input4);2108 Input* input5=inputs->GetInput(SurfaceforcingsPrecipitationsPresentdayEnum); _assert_(input5);2109 Input* input6=inputs->GetInput(SurfaceforcingsPrecipitationsLgmEnum); _assert_(input6);2110 2173 GaussPenta* gauss=new GaussPenta(); 2111 2174 IssmDouble time,yts; 2112 2175 this->parameters->FindParam(&time,TimeEnum); … … 2118 2181 input->GetInputValue(&monthlytemperatures[iv][month],gauss,time+month/12.*yts); 2119 2182 monthlytemperatures[iv][month]=monthlytemperatures[iv][month]-273.15; // conversion from Kelvin to celcius 2120 2183 input2->GetInputValue(&monthlyprec[iv][month],gauss,time+month/12.*yts); 2121 monthlyprec[iv][month]=monthlyprec[iv][month]*sconv; // convertion to m/yr2122 input3->GetInputValue(&TemperaturesPresentday[iv][month],gauss,month/12.*yts);2123 TemperaturesPresentday[iv][month]=TemperaturesPresentday[iv][month]-273.15; // conversion from Kelvin to celcius2124 input4->GetInputValue(&TemperaturesLgm[iv][month],gauss,month/12.*yts);2125 TemperaturesLgm[iv][month]=TemperaturesLgm[iv][month]-273.15; // conversion from Kelvin to celcius2126 input5->GetInputValue(&PrecipitationsPresentday[iv][month],gauss,month/12.*yts);2127 PrecipitationsPresentday[iv][month]=PrecipitationsPresentday[iv][month];2128 input6->GetInputValue(&PrecipitationsLgm[iv][month],gauss,month/12.*yts);2129 PrecipitationsLgm[iv][month]=PrecipitationsLgm[iv][month];2130 2184 } 2131 2185 } 2132 2186 2133 /*Recover Pfac, Tdiff and sealev at time t:*/ 2134 this->parameters->FindParam(&PfacTime,SurfaceforcingsPfacEnum,time); 2135 this->parameters->FindParam(&TdiffTime,SurfaceforcingsTdiffEnum,time); 2136 this->parameters->FindParam(&sealevTime,SurfaceforcingsSealevEnum,time); 2187 /*Recover Pfac, Tdiff and sealev at time t: 2188 This parameters are used to interpolate the temperature 2189 and precipitaton between PD and LGM when ismungsm==1 */ 2190 if (ismungsm==1){ 2191 this->parameters->FindParam(&TdiffTime,SurfaceforcingsTdiffEnum,time); 2192 this->parameters->FindParam(&sealevTime,SurfaceforcingsSealevEnum,time); 2193 } 2194 else { 2195 TdiffTime=0; 2196 sealevTime=0; 2197 } 2137 2198 2138 2199 /*Recover info at the vertices: */ 2139 2200 GetInputListOnVertices(&h[0],ThicknessEnum); 2140 2201 GetInputListOnVertices(&s[0],SurfaceEnum); 2141 2202 2142 /*Get other pdd parameters*/2143 desfac=matpar->GetMaterialParameter(SurfaceforcingsDesfacEnum);2144 s0p=matpar->GetMaterialParameter(SurfaceforcingsS0pEnum);2145 s0t=matpar->GetMaterialParameter(SurfaceforcingsS0tEnum);2146 rlaps=matpar->GetMaterialParameter(SurfaceforcingsRlapsEnum);2147 rlapslgm=matpar->GetMaterialParameter(SurfaceforcingsRlapslgmEnum);2148 2203 2149 2204 /*measure the surface mass balance*/ 2150 2205 for (int iv = 0; iv < NUMVERTICES; iv++){ 2151 agd[iv]=PddSurfaceMassBlance(&monthlytemperatures[iv][0], &monthlyprec[iv][0], 2152 &TemperaturesLgm[iv][0], &TemperaturesPresentday[iv][0], 2153 &PrecipitationsLgm[iv][0], &PrecipitationsPresentday[iv][0], 2206 agd[iv]=PddSurfaceMassBalance(&monthlytemperatures[iv][0], &monthlyprec[iv][0], 2154 2207 pdds,pds, signorm, yts, h[iv], s[iv], 2155 desfac, s0t, s0p,rlaps,rlapslgm,PfacTime,TdiffTime,sealevTime); 2208 desfac, s0t, s0p,rlaps,rlapslgm,TdiffTime,sealevTime, 2209 rho_water,rho_ice); 2156 2210 } 2157 2211 2158 2212 /*Update inputs*/ 2213 // TransientInput* NewTemperatureInput = new TransientInput(SurfaceforcingsMonthlytemperaturesEnum); 2214 // TransientInput* NewPrecipitationInput = new TransientInput(SurfaceforcingsPrecipitationEnum); 2215 // for (int imonth=0;imonth<12;imonth++) { 2216 // for(i=0;i<NUMVERTICES;i++) tmp[i]=monthlytemperatures[i][imonth]; 2217 // PentaInput* newmonthinput1 = new PentaInput(SurfaceforcingsMonthlytemperaturesEnum,&tmp[0],P1Enum); 2218 // NewTemperatureInput->AddTimeInput(newmonthinput1,time+imonth/12.*yts); 2219 // 2220 // for(i=0;i<NUMVERTICES;i++) tmp[i]=monthlyprec[i][imonth]; 2221 // PentaInput* newmonthinput2 = new PentaInput(SurfaceforcingsPrecipitationEnum,&tmp[0],P1Enum); 2222 // NewPrecipitationInput->AddTimeInput(newmonthinput2,time+imonth/12.*yts); 2223 // } 2224 // NewTemperatureInput->Configure(this->parameters); 2225 // NewPrecipitationInput->Configure(this->parameters); 2226 2227 2228 2159 2229 this->inputs->AddInput(new PentaInput(SurfaceforcingsMassBalanceEnum,&agd[0],P1Enum)); 2160 //this->inputs->AddInput(new PentaVertexInput(ThermalSpcTemperatureEnum,&Tsurf[0])); 2161 this->InputExtrude(SurfaceforcingsMassBalanceEnum,-1); 2230 // this->inputs->AddInput(NewTemperatureInput); 2231 // this->inputs->AddInput(NewPrecipitationInput); 2232 // //this->inputs->AddInput(new PentaVertexInput(ThermalSpcTemperatureEnum,&Tsurf[0])); 2233 this->InputExtrude(SurfaceforcingsMassBalanceEnum,-1); 2234 // this->InputExtrude(SurfaceforcingsMonthlytemperaturesEnum,-1); 2235 // this->InputExtrude(SurfaceforcingsPrecipitationEnum,-1); 2162 2236 2163 2164 2237 /*clean-up*/ 2238 delete gauss; 2165 2239 } 2166 2240 /*}}}*/ 2167 2241 void Penta::PotentialUngrounding(Vector<IssmDouble>* potential_ungrounding){/*{{{*/ -
../trunk-jpl/src/c/classes/Elements/Penta.h
58 58 void ControlToVectors(Vector<IssmPDouble>* vector_control, Vector<IssmPDouble>* vector_gradient,int control_enum); 59 59 ElementMatrix* CreateBasalMassMatrix(void); 60 60 void Delta18oParameterization(void); 61 void MungsmtpParameterization(void); 61 62 void ElementResponse(IssmDouble* presponse,int response_enum); 62 63 void ElementSizes(IssmDouble* hx,IssmDouble* hy,IssmDouble* hz); 63 64 int FiniteElement(void); … … 136 137 int NodalValue(IssmDouble* pvalue, int index, int natureofdataenum); 137 138 int NumberofNodesPressure(void); 138 139 int NumberofNodesVelocity(void); 139 void PositiveDegreeDay(IssmDouble* pdds,IssmDouble* pds,IssmDouble signorm );140 void PositiveDegreeDay(IssmDouble* pdds,IssmDouble* pds,IssmDouble signorm,bool ismungsm); 140 141 void PotentialUngrounding(Vector<IssmDouble>* potential_sheet_ungrounding); 141 142 int PressureInterpolation(); 142 143 void ReduceMatrices(ElementMatrix* Ke,ElementVector* pe); -
../trunk-jpl/src/c/classes/Elements/Seg.h
53 53 void ControlInputSetGradient(IssmDouble* gradient,int enum_type,int control_index){_error_("not implemented yet");}; 54 54 void ControlToVectors(Vector<IssmPDouble>* vector_control, Vector<IssmPDouble>* vector_gradient,int control_enum){_error_("not implemented yet");}; 55 55 void Delta18oParameterization(void){_error_("not implemented yet");}; 56 void MungsmtpParameterization(void){_error_("not implemented yet");}; 56 57 void ElementResponse(IssmDouble* presponse,int response_enum){_error_("not implemented yet");}; 57 58 void ElementSizes(IssmDouble* hx,IssmDouble* hy,IssmDouble* hz){_error_("not implemented yet");}; 58 59 void FSContactMigration(Vector<IssmDouble>* vertexgrounded,Vector<IssmDouble>* vertexfloating){_error_("not implemented yet");}; … … 128 129 void NormalTop(IssmDouble* normal,IssmDouble* xyz_list){_error_("not implemented yet");}; 129 130 int NumberofNodesPressure(void){_error_("not implemented yet");}; 130 131 int NumberofNodesVelocity(void){_error_("not implemented yet");}; 131 void PositiveDegreeDay(IssmDouble* pdds,IssmDouble* pds,IssmDouble signorm ){_error_("not implemented yet");};132 void PositiveDegreeDay(IssmDouble* pdds,IssmDouble* pds,IssmDouble signorm,bool ismungsm){_error_("not implemented yet");}; 132 133 void PotentialUngrounding(Vector<IssmDouble>* potential_sheet_ungrounding){_error_("not implemented yet");}; 133 134 int PressureInterpolation(void){_error_("not implemented yet");}; 134 135 void ReduceMatrices(ElementMatrix* Ke,ElementVector* pe){_error_("not implemented yet");}; -
../trunk-jpl/src/c/classes/Elements/Tetra.h
53 53 void ControlInputSetGradient(IssmDouble* gradient,int enum_type,int control_index){_error_("not implemented yet");}; 54 54 void ControlToVectors(Vector<IssmPDouble>* vector_control, Vector<IssmPDouble>* vector_gradient,int control_enum){_error_("not implemented yet");}; 55 55 void Delta18oParameterization(void){_error_("not implemented yet");}; 56 void MungsmtpParameterization(void){_error_("not implemented yet");}; 56 57 IssmDouble DragCoefficientAbsGradient(void){_error_("not implemented yet");}; 57 58 void ElementResponse(IssmDouble* presponse,int response_enum){_error_("not implemented yet");}; 58 59 void ElementSizes(IssmDouble* hx,IssmDouble* hy,IssmDouble* hz); … … 134 135 void NormalTop(IssmDouble* normal,IssmDouble* xyz_list); 135 136 int NumberofNodesPressure(void); 136 137 int NumberofNodesVelocity(void); 137 void PositiveDegreeDay(IssmDouble* pdds,IssmDouble* pds,IssmDouble signorm ){_error_("not implemented yet");};138 void PositiveDegreeDay(IssmDouble* pdds,IssmDouble* pds,IssmDouble signorm,bool ismungsm){_error_("not implemented yet");}; 138 139 void PotentialUngrounding(Vector<IssmDouble>* potential_sheet_ungrounding){_error_("not implemented yet");}; 139 140 int PressureInterpolation(void); 140 141 void ResetFSBasalBoundaryCondition(void); -
../trunk-jpl/src/m/classes/SMBpdd.py
25 25 self.Tdiff = float('NaN') 26 26 self.sealev = float('NaN') 27 27 self.isdelta18o = 0 28 self.ismungsm = 0 28 29 self.delta18o = float('NaN') 29 30 self.delta18o_surface = float('NaN') 30 31 self.temperatures_presentday = float('NaN') 31 32 self.temperatures_lgm = float('NaN') 32 33 self.precipitations_presentday = float('NaN') 34 self.precipitations_lgm = float('NaN') 33 35 34 36 #set defaults 35 37 self.setdefaultparameters() … … 37 39 def __repr__(self): # {{{ 38 40 string=" surface forcings parameters:" 39 41 40 string="%s\n%s"%(string,fielddisplay(self,'precipitation','surface precipitation [m/yr water eq]')) 42 string="%s\n%s"%(string,fielddisplay(self,'isdelta18o','is temperature and precipitation delta18o parametrisation activated (0 or 1, default is 0)')) 43 string="%s\n%s"%(string,fielddisplay(self,'ismungsm','is temperature and precipitation mungsm parametrisation activated (0 or 1, default is 0)')) 41 44 string="%s\n%s"%(string,fielddisplay(self,'desfac','desertification elevation factor (between 0 and 1, default is 0.5) [m]')) 42 string="%s\n%s"%(string,fielddisplay(self,'isdelta18o','is temperature and precipitation delta18o parametrisation activated (0 or 1, default is 0)'))43 45 string="%s\n%s"%(string,fielddisplay(self,'s0p','should be set to elevation from precip source (between 0 and a few 1000s m, default is 0) [m]')) 44 46 string="%s\n%s"%(string,fielddisplay(self,'s0t','should be set to elevation from temperature source (between 0 and a few 1000s m, default is 0) [m]')) 45 47 string="%s\n%s"%(string,fielddisplay(self,'rlaps','present day lapse rate [degree/km]')) 46 48 string="%s\n%s"%(string,fielddisplay(self,'rlapslgm','LGM lapse rate [degree/km]')) 47 string="%s\n%s"%(string,fielddisplay(self,'Pfac','time interpolation parameter for precipitation, 1D (year)')) 48 string="%s\n%s"%(string,fielddisplay(self,'Tdiff','time interpolation parameter for temperature, 1D (year)')) 49 string="%s\n%s"%(string,fielddisplay(self,'sealev','sea level [m], 1D(year)')) 50 string="%s\n%s"%(string,fielddisplay(self,'monthlytemperatures','monthly surface temperatures [K], required if pdd is activated and delta18o not activated')) 51 string="%s\n%s"%(string,fielddisplay(self,'temperatures_presentday','monthly present day surface temperatures [K], required if pdd is activated and delta18o activated')) 52 string="%s\n%s"%(string,fielddisplay(self,'temperatures_lgm','monthly LGM surface temperatures [K], required if pdd is activated and delta18o activated')) 53 string="%s\n%s"%(string,fielddisplay(self,'precipitations_presentday','monthly surface precipitation [m/yr water eq], required if pdd is activated and delta18o activated')) 54 string="%s\n%s"%(string,fielddisplay(self,'delta18o','delta18o, required if pdd is activated and delta18o activated')) 55 string="%s\n%s"%(string,fielddisplay(self,'delta18o_surface','surface elevation of the delta18o site, required if pdd is activated and delta18o activated')) 56 49 if not (self.isdelta18o and self.ismungsm): 50 string="%s\n%s"%(string,fielddisplay(self,'monthlytemperatures',['monthly surface temperatures [K], required if pdd is activated and delta18o not activated'])) 51 string="%s\n%s"%(string,fielddisplay(self,'precipitation',['monthly surface precipitation [m/yr water eq], required if pdd is activated and delta18o or mungsm not activated'])) 52 if self.isdelta18o: 53 string="%s\n%s"%(string,fielddisplay(self,'delta18o','delta18o, required if pdd is activated and delta18o activated')) 54 string="%s\n%s"%(string,fielddisplay(self,'delta18o_surface','surface elevation of the delta18o site, required if pdd is activated and delta18o activated')) 55 string="%s\n%s"%(string,fielddisplay(self,'temperatures_presentday','monthly present day surface temperatures [K], required if delta18o/mungsm is activated')) 56 string="%s\n%s"%(string,fielddisplay(self,'temperatures_lgm','monthly LGM surface temperatures [K], required if delta18o or mungsm is activated')) 57 string="%s\n%s"%(string,fielddisplay(self,'precipitations_presentday','monthly surface precipitation [m/yr water eq], required if delta18o or mungsm is activated')) 58 string="%s\n%s"%(string,fielddisplay(self,'precipitations_lgm','monthly surface precipitation [m/yr water eq], required if delta18o or mungsm is activated')) 59 string="%s\n%s"%(string,fielddisplay(self,'Tdiff','time interpolation parameter for temperature, 1D(year), required if mungsm is activated')) 60 string="%s\n%s"%(string,fielddisplay(self,'sealev','sea level [m], 1D(year), required if mungsm is activated')) 61 if self.ismungsm: 62 string="%s\n%s"%(string,fielddisplay(self,'temperatures_presentday','monthly present day surface temperatures [K], required if delta18o/mungsm is activated')) 63 string="%s\n%s"%(string,fielddisplay(self,'temperatures_lgm','monthly LGM surface temperatures [K], required if delta18o or mungsm is activated')) 64 string="%s\n%s"%(string,fielddisplay(self,'precipitations_presentday','monthly surface precipitation [m/yr water eq], required if delta18o or mungsm is activated')) 65 string="%s\n%s"%(string,fielddisplay(self,'precipitations_lgm','monthly surface precipitation [m/yr water eq], required if delta18o or mungsm is activated')) 66 string="%s\n%s"%(string,fielddisplay(self,'Pfac','time interpolation parameter for precipitation, 1D(year), required if mungsm is activated')) 67 string="%s\n%s"%(string,fielddisplay(self,'Tdiff','time interpolation parameter for temperature, 1D(year), required if mungsm is activated')) 68 string="%s\n%s"%(string,fielddisplay(self,'sealev','sea level [m], 1D(year), required if mungsm is activated')) 57 69 return string 58 70 #}}} 59 71 def extrude(self,md): # {{{ 60 72 61 self.precipitation=project3d(md,'vector',self.precipitation,'type','node'); 62 self.monthlytemperatures=project3d(md,'vector',self.monthlytemperatures,'type','node'); 73 if not (self.isdelta18o and self.ismungsm): 74 self.precipitation=project3d(md,'vector',self.precipitation,'type','node') 75 self.monthlytemperatures=project3d(md,'vector',self.monthlytemperatures,'type','node') 63 76 if self.isdelta18o: self.temperatures_lgm=project3d(md,'vector',self.temperatures_lgm,'type','node') 64 77 if self.isdelta18o: self.temperatures_presentday=project3d(md,'vector',self.temperatures_presentday,'type','node') 65 78 if self.isdelta18o: self.precipitations_presentday=project3d(md,'vector',self.precipitations_presentday,'type','node') 79 if self.isdelta18o: self.precipitations_lgm=project3d(md,'vector',self.precipitations_lgm,'type','node') 80 if self.ismungsm: self.temperatures_lgm=project3d(md,'vector',self.temperatures_lgm,'type','node') 81 if self.ismungsm: self.temperatures_presentday=project3d(md,'vector',self.temperatures_presentday,'type','node') 82 if self.ismungsm: self.precipitations_presentday=project3d(md,'vector',self.precipitations_presentday,'type','node') 83 if self.ismungsm: self.precipitations_lgm=project3d(md,'vector',self.precipitations_lgm,'type','node') 66 84 return self 67 85 #}}} 68 86 def initialize(self,md): # {{{ 69 87 70 if numpy.all(numpy.isnan(self.precipitation)):71 self.precipitation=numpy.zeros((md.mesh.numberofvertices,1))72 print " no SMBpdd.precipitation specified: values set as zero"73 74 return self88 # if numpy.all(numpy.isnan(self.precipitation)): 89 # self.precipitation=numpy.zeros((md.mesh.numberofvertices,1)) 90 # print " no SMBpdd.precipitation specified: values set as zero" 91 # 92 # return self 75 93 #}}} 76 94 def setdefaultparameters(self): # {{{ 77 95 78 96 #pdd method not used in default mode 79 97 self.isdelta18o = 0 98 self.ismungsm = 0 80 99 self.desfac = 0.5 81 100 self.s0p = 0. 82 101 self.s0t = 0. … … 88 107 def checkconsistency(self,md,solution,analyses): # {{{ 89 108 90 109 if MasstransportAnalysisEnum() in analyses: 91 md = checkfield(md,'fieldname','surfaceforcings.desfac','<=',1,'numel',[1]); 92 md = checkfield(md,'fieldname','surfaceforcings.s0p','>=',0,'numel',[1]); 93 md = checkfield(md,'fieldname','surfaceforcings.s0t','>=',0,'numel',[1]); 94 md = checkfield(md,'fieldname','surfaceforcings.rlaps','>=',0,'numel',[1]); 95 md = checkfield(md,'fieldname','surfaceforcings.rlapslgm','>=',0,'numel',[1]); 96 md = checkfield(md,'fieldname','surfaceforcings.Pfac','NaN',1,'size',[2,numpy.nan]); 97 md = checkfield(md,'fieldname','surfaceforcings.Tdiff','NaN',1,'size',[2,numpy.nan]); 98 md = checkfield(md,'fieldname','surfaceforcings.sealev','NaN',1,'size',[2,numpy.nan]); 99 if not self.isdelta18o: 100 md = checkfield(md,'fieldname','surfaceforcings.monthlytemperatures','forcing',1,'NaN',1) 101 md = checkfield(md,'fieldname','surfaceforcings.precipitation','forcing',1,'NaN',1) 102 else: 110 md = checkfield(md,'fieldname','surfaceforcings.desfac','<=',1,'numel',[1]) 111 md = checkfield(md,'fieldname','surfaceforcings.s0p','>=',0,'numel',[1]) 112 md = checkfield(md,'fieldname','surfaceforcings.s0t','>=',0,'numel',[1]) 113 md = checkfield(md,'fieldname','surfaceforcings.rlaps','>=',0,'numel',[1]) 114 md = checkfield(md,'fieldname','surfaceforcings.rlapslgm','>=',0,'numel',[1]) 115 116 if not (self.isdelta18o and self.ismungsm): 117 md = checkfield(md,'fieldname','surfaceforcings.monthlytemperatures','NaN',1) 118 md = checkfield(md,'fieldname','surfaceforcings.precipitation','NaN',1) 119 elif self.isdelta18o: 103 120 md = checkfield(md,'fieldname','surfaceforcings.delta18o','NaN',1) 104 121 md = checkfield(md,'fieldname','surfaceforcings.delta18o_surface','NaN',1) 105 122 md = checkfield(md,'fieldname','surfaceforcings.temperatures_presentday','size',[md.mesh.numberofvertices+1,12],'NaN',1) 106 123 md = checkfield(md,'fieldname','surfaceforcings.temperatures_lgm','size',[md.mesh.numberofvertices+1,12],'NaN',1) 107 124 md = checkfield(md,'fieldname','surfaceforcings.precipitations_presentday','size',[md.mesh.numberofvertices+1,12],'NaN',1) 125 md = checkfield(md,'fieldname','surfaceforcings.precipitations_lgm','size',[md.mesh.numberofvertices+1 12],'NaN',1) 126 md = checkfield(md,'fieldname','surfaceforcings.Tdiff','NaN',1,'size',[2,numpy.nan]) 127 md = checkfield(md,'fieldname','surfaceforcings.sealev','NaN',1,'size',[2,numpy.nan]) 128 elif self.ismungsm: 129 md = checkfield(md,'fieldname','surfaceforcings.temperatures_presentday','size',[md.mesh.numberofvertices+1 12],'NaN',1) 130 md = checkfield(md,'fieldname','surfaceforcings.temperatures_lgm','size',[md.mesh.numberofvertices+1 12],'NaN',1) 131 md = checkfield(md,'fieldname','surfaceforcings.precipitations_presentday','size',[md.mesh.numberofvertices+1 12],'NaN',1) 132 md = checkfield(md,'fieldname','surfaceforcings.precipitations_lgm','size',[md.mesh.numberofvertices+1 12],'NaN',1) 133 md = checkfield(md,'fieldname','surfaceforcings.Pfac','NaN',1,'size',[2,numpy.nan]) 134 md = checkfield(md,'fieldname','surfaceforcings.Tdiff','NaN',1,'size',[2,numpy.nan]) 135 md = checkfield(md,'fieldname','surfaceforcings.sealev','NaN',1,'size',[2,numpy.nan]) 108 136 109 137 return md 110 138 # }}} … … 112 140 113 141 yts=365.0*24.0*3600.0 114 142 115 WriteData(fid,'enum',SurfaceforcingsEnum(),'data',SMBpddEnum(),'format','Integer') ;143 WriteData(fid,'enum',SurfaceforcingsEnum(),'data',SMBpddEnum(),'format','Integer') 116 144 117 WriteData(fid,'object',self,'class','surfaceforcings','fieldname','precipitation','format','DoubleMat','mattype',1,'scale',1./yts,'forcinglength',md.mesh.numberofvertices+1)118 145 WriteData(fid,'object',self,'class','surfaceforcings','fieldname','isdelta18o','format','Boolean') 119 WriteData(fid,'object',self,'class','surfaceforcings','fieldname','desfac','format','Double'); 120 WriteData(fid,'object',self,'class','surfaceforcings','fieldname','s0p','format','Double'); 121 WriteData(fid,'object',self,'class','surfaceforcings','fieldname','s0t','format','Double'); 122 WriteData(fid,'object',self,'class','surfaceforcings','fieldname','rlaps','format','Double'); 123 WriteData(fid,'object',self,'class','surfaceforcings','fieldname','rlapslgm','format','Double'); 124 WriteData(fid,'object',self,'class','surfaceforcings','fieldname','Pfac','format','DoubleMat','mattype',1); 125 WriteData(fid,'object',self,'class','surfaceforcings','fieldname','Tdiff','format','DoubleMat','mattype',1); 126 WriteData(fid,'object',self,'class','surfaceforcings','fieldname','sealev','format','DoubleMat','mattype',1); 127 if self.isdelta18o: 146 WriteData(fid,'object',self,'class','surfaceforcings','fieldname','ismungsm','format','Boolean') 147 WriteData(fid,'object',self,'class','surfaceforcings','fieldname','desfac','format','Double') 148 WriteData(fid,'object',self,'class','surfaceforcings','fieldname','s0p','format','Double') 149 WriteData(fid,'object',self,'class','surfaceforcings','fieldname','s0t','format','Double') 150 WriteData(fid,'object',self,'class','surfaceforcings','fieldname','rlaps','format','Double') 151 WriteData(fid,'object',self,'class','surfaceforcings','fieldname','rlapslgm','format','Double') 152 153 if not (self.isdelta18o and self.ismungsm): 154 WriteData(fid,'object',self,'class','surfaceforcings','fieldname','monthlytemperatures','format','DoubleMat','mattype',1) 155 WriteData(fid,'object',self,'class','surfaceforcings','fieldname','precipitation','format','DoubleMat','mattype',1,'scale',1./yts,'forcinglength',md.mesh.numberofvertices+1) 156 elif self.isdelta18o: 128 157 WriteData(fid,'object',self,'class','surfaceforcings','fieldname','temperatures_presentday','format','DoubleMat','mattype',1) 129 158 WriteData(fid,'object',self,'class','surfaceforcings','fieldname','temperatures_lgm','format','DoubleMat','mattype',1) 130 159 WriteData(fid,'object',self,'class','surfaceforcings','fieldname','precipitations_presentday','format','DoubleMat','mattype',1) 160 WriteData(fid,'object',self,'class','surfaceforcings','fieldname','precipitations_lgm','format','DoubleMat','mattype',1) 131 161 WriteData(fid,'object',self,'class','surfaceforcings','fieldname','delta18o_surface','format','DoubleMat','mattype',1) 132 162 WriteData(fid,'object',self,'class','surfaceforcings','fieldname','delta18o','format','DoubleMat','mattype',1) 133 else: 134 WriteData(fid,'object',self,'class','surfaceforcings','fieldname','monthlytemperatures','format','DoubleMat','mattype',1,'forcinglength',md.mesh.numberofvertices+1) 163 WriteData(fid,'object',self,'class','surfaceforcings','fieldname','Tdiff','format','DoubleMat','mattype',1) 164 WriteData(fid,'object',self,'class','surfaceforcings','fieldname','sealev','format','DoubleMat','mattype',1) 165 elif self.ismungsm: 166 WriteData(fid,'object',self,'class','surfaceforcings','fieldname','temperatures_presentday','format','DoubleMat','mattype',1) 167 WriteData(fid,'object',self,'class','surfaceforcings','fieldname','temperatures_lgm','format','DoubleMat','mattype',1) 168 WriteData(fid,'object',self,'class','surfaceforcings','fieldname','precipitations_presentday','format','DoubleMat','mattype',1) 169 WriteData(fid,'object',self,'class','surfaceforcings','fieldname','precipitations_lgm','format','DoubleMat','mattype',1) 170 WriteData(fid,'object',self,'class','surfaceforcings','fieldname','Pfac','format','DoubleMat','mattype',1) 171 WriteData(fid,'object',self,'class','surfaceforcings','fieldname','Tdiff','format','DoubleMat','mattype',1) 172 WriteData(fid,'object',self,'class','surfaceforcings','fieldname','sealev','format','DoubleMat','mattype',1) 135 173 # }}} -
../trunk-jpl/src/m/classes/SMBpdd.m
16 16 Tdiff = NaN; 17 17 sealev = NaN; 18 18 isdelta18o = 0; 19 ismungsm = 0; 19 20 delta18o = NaN; 20 21 delta18o_surface = NaN; 21 22 temperatures_presentday = NaN; … … 33 34 end 34 35 end % }}} 35 36 function self = extrude(self,md) % {{{ 36 37 self.precipitation=project3d(md,'vector',self.precipitation,'type','node'); 38 self.monthlytemperatures=project3d(md,'vector',self.monthlytemperatures,'type','node'); 37 if(self.isdelta18o==0 & self.ismungsm==0),self.precipitation=project3d(md,'vector',self.precipitation,'type','node');end 38 if(self.isdelta18o==0 & self.ismungsm==0),self.monthlytemperatures=project3d(md,'vector',self.monthlytemperatures,'type','node');end 39 39 if(self.isdelta18o),self.temperatures_lgm=project3d(md,'vector',self.temperatures_lgm,'type','node');end 40 40 if(self.isdelta18o),self.temperatures_presentday=project3d(md,'vector',self.temperatures_presentday,'type','node');end 41 41 if(self.isdelta18o),self.precipitations_presentday=project3d(md,'vector',self.precipitations_presentday,'type','node');end 42 42 if(self.isdelta18o),self.precipitations_lgm=project3d(md,'vector',self.precipitations_lgm,'type','node');end 43 if(self.ismungsm),self.temperatures_lgm=project3d(md,'vector',self.temperatures_lgm,'type','node');end 44 if(self.ismungsm),self.temperatures_presentday=project3d(md,'vector',self.temperatures_presentday,'type','node');end 45 if(self.ismungsm),self.precipitations_presentday=project3d(md,'vector',self.precipitations_presentday,'type','node');end 46 if(self.ismungsm),self.precipitations_lgm=project3d(md,'vector',self.precipitations_lgm,'type','node');end 43 47 44 45 48 end % }}} 46 49 function self = initialize(self,md) % {{{ 50 51 % if isnan(self.precipitation), 52 % self.precipitation=zeros(md.mesh.numberofvertices,1); 53 % disp(' no SMBpdd.precipitation specified: values set as zero'); 54 % end 47 55 48 if isnan(self.precipitation),49 self.precipitation=zeros(md.mesh.numberofvertices,1);50 disp(' no SMBpdd.precipitation specified: values set as zero');51 end52 53 56 end % }}} 54 57 function obj = setdefaultparameters(obj) % {{{ 55 58 56 59 obj.isdelta18o = 0; 60 obj.ismungsm = 0; 57 61 obj.desfac = 0.5; 58 62 obj.s0p = 0; 59 63 obj.s0t = 0; … … 69 73 md = checkfield(md,'fieldname','surfaceforcings.s0t','>=',0,'numel',1); 70 74 md = checkfield(md,'fieldname','surfaceforcings.rlaps','>=',0,'numel',1); 71 75 md = checkfield(md,'fieldname','surfaceforcings.rlapslgm','>=',0,'numel',1); 72 md = checkfield(md,'fieldname','surfaceforcings.Pfac','NaN',1,'size',[2,NaN]); 73 md = checkfield(md,'fieldname','surfaceforcings.Tdiff','NaN',1,'size',[2,NaN]); 74 md = checkfield(md,'fieldname','surfaceforcings.sealev','NaN',1,'size',[2,NaN]); 75 if(obj.isdelta18o==0) 76 md = checkfield(md,'fieldname','surfaceforcings.monthlytemperatures','forcing',1,'NaN',1); 77 md = checkfield(md,'fieldname','surfaceforcings.precipitation','forcing',1,'NaN',1); 78 else 79 md = checkfield(md,'fieldname','surfaceforcings.delta18o','NaN',1); 80 md = checkfield(md,'fieldname','surfaceforcings.delta18o_surface','NaN',1); 81 md = checkfield(md,'fieldname','surfaceforcings.temperatures_presentday','size',[md.mesh.numberofvertices+1 12],'NaN',1); 82 md = checkfield(md,'fieldname','surfaceforcings.temperatures_lgm','size',[md.mesh.numberofvertices+1 12],'NaN',1); 83 md = checkfield(md,'fieldname','surfaceforcings.precipitations_presentday','size',[md.mesh.numberofvertices+1 12],'NaN',1); 84 md = checkfield(md,'fieldname','surfaceforcings.precipitations_lgm','size',[md.mesh.numberofvertices+1 12],'NaN',1); 76 if(obj.isdelta18o==0 & obj.ismungsm==0) 77 md = checkfield(md,'fieldname','surfaceforcings.monthlytemperatures','forcing',1,'NaN',1); 78 md = checkfield(md,'fieldname','surfaceforcings.precipitation','forcing',1,'NaN',1); 79 elseif(obj.isdelta18o==1) 80 md = checkfield(md,'fieldname','surfaceforcings.delta18o','NaN',1); 81 md = checkfield(md,'fieldname','surfaceforcings.delta18o_surface','NaN',1); 82 md = checkfield(md,'fieldname','surfaceforcings.temperatures_presentday','size',[md.mesh.numberofvertices+1 12],'NaN',1); 83 md = checkfield(md,'fieldname','surfaceforcings.temperatures_lgm','size',[md.mesh.numberofvertices+1 12],'NaN',1); 84 md = checkfield(md,'fieldname','surfaceforcings.precipitations_presentday','size',[md.mesh.numberofvertices+1 12],'NaN',1); 85 md = checkfield(md,'fieldname','surfaceforcings.precipitations_lgm','size',[md.mesh.numberofvertices+1 12],'NaN',1); 86 md = checkfield(md,'fieldname','surfaceforcings.Tdiff','NaN',1); 87 md = checkfield(md,'fieldname','surfaceforcings.sealev','NaN',1); 88 elseif(obj.ismungsm==1) 89 md = checkfield(md,'fieldname','surfaceforcings.temperatures_presentday','size',[md.mesh.numberofvertices+1 12],'NaN',1); 90 md = checkfield(md,'fieldname','surfaceforcings.temperatures_lgm','size',[md.mesh.numberofvertices+1 12],'NaN',1); 91 md = checkfield(md,'fieldname','surfaceforcings.precipitations_presentday','size',[md.mesh.numberofvertices+1 12],'NaN',1); 92 md = checkfield(md,'fieldname','surfaceforcings.precipitations_lgm','size',[md.mesh.numberofvertices+1 12],'NaN',1); 93 md = checkfield(md,'fieldname','surfaceforcings.Pfac','NaN',1,'size',[2,NaN]); 94 md = checkfield(md,'fieldname','surfaceforcings.Tdiff','NaN',1); 95 md = checkfield(md,'fieldname','surfaceforcings.sealev','NaN',1); 85 96 end 86 97 end 87 98 end % }}} 88 99 function disp(obj) % {{{ 89 100 disp(sprintf(' surface forcings parameters:')); 90 101 91 102 disp(sprintf('\n PDD and deltaO18 parameters:')); 92 103 fielddisplay(obj,'isdelta18o','is temperature and precipitation delta18o parametrisation activated (0 or 1, default is 0)'); 104 fielddisplay(obj,'ismungsm','is temperature and precipitation mungsm parametrisation activated (0 or 1, default is 0)'); 93 105 fielddisplay(obj,'desfac','desertification elevation factor (between 0 and 1, default is 0.5) [m]'); 94 106 fielddisplay(obj,'s0p','should be set to elevation from precip source (between 0 and a few 1000s m, default is 0) [m]'); 95 107 fielddisplay(obj,'s0t','should be set to elevation from temperature source (between 0 and a few 1000s m, default is 0) [m]'); 96 108 fielddisplay(obj,'rlaps','present day lapse rate [degree/km]'); 97 109 fielddisplay(obj,'rlapslgm','LGM lapse rate [degree/km]'); 98 fielddisplay(obj,'Pfac','time interpolation parameter for precipitation, 1D(year)'); 99 fielddisplay(obj,'Tdiff','time interpolation parameter for temperature, 1D(year)'); 100 fielddisplay(obj,'sealev','sea level [m], 1D(year)'); 101 fielddisplay(obj,'monthlytemperatures',['CURRENTLY NOT USED monthly surface temperatures [K], required if pdd is activated and delta18o not activated']); 102 fielddisplay(obj,'precipitation',['CURRENTLY NOT USED monthly surface precipitation [m/yr water eq]']); 103 fielddisplay(obj,'temperatures_presentday','monthly present day surface temperatures [K], required if pdd is activated and delta18o activated'); 104 fielddisplay(obj,'temperatures_lgm','monthly LGM surface temperatures [K], required if pdd is activated and delta18o activated'); 105 fielddisplay(obj,'precipitations_presentday','monthly surface precipitation [m/yr water eq], required if pdd is activated and delta18o activated'); 106 fielddisplay(obj,'precipitations_lgm','monthly surface precipitation [m/yr water eq], required if pdd is activated and delta18o activated'); 107 fielddisplay(obj,'delta18o','delta18o, required if pdd is activated and delta18o activated'); 108 fielddisplay(obj,'delta18o_surface','surface elevation of the delta18o site, required if pdd is activated and delta18o activated'); 109 110 if(obj.isdelta18o==0 & obj.ismungsm==0) 111 fielddisplay(obj,'monthlytemperatures',['monthly surface temperatures [K], required if pdd is activated and delta18o not activated']); 112 fielddisplay(obj,'precipitation',['monthly surface precipitation [m/yr water eq], required if pdd is activated and delta18o or mungsm not activated']); 113 elseif(obj.isdelta18o==1) 114 fielddisplay(obj,'delta18o','delta18o, required if pdd is activated and delta18o activated'); 115 fielddisplay(obj,'delta18o_surface','surface elevation of the delta18o site, required if pdd is activated and delta18o activated'); 116 fielddisplay(obj,'temperatures_presentday','monthly present day surface temperatures [K], required if delta18o/mungsm is activated'); 117 fielddisplay(obj,'temperatures_lgm','monthly LGM surface temperatures [K], required if delta18o or mungsm is activated'); 118 fielddisplay(obj,'precipitations_presentday','monthly surface precipitation [m/yr water eq], required if delta18o or mungsm is activated'); 119 fielddisplay(obj,'precipitations_lgm','monthly surface precipitation [m/yr water eq], required if delta18o or mungsm is activated'); 120 fielddisplay(obj,'Tdiff','time interpolation parameter for temperature, 1D(year), required if mungsm is activated'); 121 fielddisplay(obj,'sealev','sea level [m], 1D(year), required if mungsm is activated'); 122 elseif(obj.ismungsm==1) 123 fielddisplay(obj,'temperatures_presentday','monthly present day surface temperatures [K], required if delta18o/mungsm is activated'); 124 fielddisplay(obj,'temperatures_lgm','monthly LGM surface temperatures [K], required if delta18o or mungsm is activated'); 125 fielddisplay(obj,'precipitations_presentday','monthly surface precipitation [m/yr water eq], required if delta18o or mungsm is activated'); 126 fielddisplay(obj,'precipitations_lgm','monthly surface precipitation [m/yr water eq], required if delta18o or mungsm is activated'); 127 fielddisplay(obj,'Pfac','time interpolation parameter for precipitation, 1D(year), required if mungsm is activated'); 128 fielddisplay(obj,'Tdiff','time interpolation parameter for temperature, 1D(year), required if mungsm is activated'); 129 fielddisplay(obj,'sealev','sea level [m], 1D(year), required if mungsm is activated'); 130 end 110 131 end % }}} 111 132 function marshall(obj,md,fid) % {{{ 112 133 … … 114 135 115 136 WriteData(fid,'enum',SurfaceforcingsEnum(),'data',SMBpddEnum(),'format','Integer'); 116 137 117 WriteData(fid,'object',obj,'class','surfaceforcings','fieldname','precipitation','format','DoubleMat','mattype',1,'scale',1./yts,'forcinglength',md.mesh.numberofvertices+1); 138 WriteData(fid,'object',obj,'class','surfaceforcings','fieldname','isdelta18o','format','Boolean'); 139 WriteData(fid,'object',obj,'class','surfaceforcings','fieldname','ismungsm','format','Boolean'); 118 140 WriteData(fid,'object',obj,'class','surfaceforcings','fieldname','desfac','format','Double'); 119 141 WriteData(fid,'object',obj,'class','surfaceforcings','fieldname','s0p','format','Double'); 120 142 WriteData(fid,'object',obj,'class','surfaceforcings','fieldname','s0t','format','Double'); 121 143 WriteData(fid,'object',obj,'class','surfaceforcings','fieldname','rlaps','format','Double'); 122 144 WriteData(fid,'object',obj,'class','surfaceforcings','fieldname','rlapslgm','format','Double'); 123 WriteData(fid,'object',obj,'class','surfaceforcings','fieldname','Pfac','format','DoubleMat','mattype',1); 124 WriteData(fid,'object',obj,'class','surfaceforcings','fieldname','Tdiff','format','DoubleMat','mattype',1); 125 WriteData(fid,'object',obj,'class','surfaceforcings','fieldname','sealev','format','DoubleMat','mattype',1); 126 WriteData(fid,'object',obj,'class','surfaceforcings','fieldname','isdelta18o','format','Boolean'); 127 if obj.isdelta18o 145 146 if(obj.isdelta18o==0 & obj.ismungsm==0) 147 %WriteData(fid,'object',obj,'class','surfaceforcings','fieldname','monthlytemperatures','format','DoubleMat','mattype',1); 148 WriteData(fid,'object',obj,'class','surfaceforcings','fieldname','monthlytemperatures','format','DoubleMat','mattype',1,'forcinglength',md.mesh.numberofvertices+1); 149 WriteData(fid,'object',obj,'class','surfaceforcings','fieldname','precipitation','format','DoubleMat','mattype',1,'scale',1./yts,'forcinglength',md.mesh.numberofvertices+1); 150 elseif obj.isdelta18o 128 151 WriteData(fid,'object',obj,'class','surfaceforcings','fieldname','temperatures_presentday','format','DoubleMat','mattype',1); 129 152 WriteData(fid,'object',obj,'class','surfaceforcings','fieldname','temperatures_lgm','format','DoubleMat','mattype',1); 130 153 WriteData(fid,'object',obj,'class','surfaceforcings','fieldname','precipitations_presentday','format','DoubleMat','mattype',1); 131 154 WriteData(fid,'object',obj,'class','surfaceforcings','fieldname','precipitations_lgm','format','DoubleMat','mattype',1); 132 155 WriteData(fid,'object',obj,'class','surfaceforcings','fieldname','delta18o_surface','format','DoubleMat','mattype',1); 133 156 WriteData(fid,'object',obj,'class','surfaceforcings','fieldname','delta18o','format','DoubleMat','mattype',1); 134 else 135 WriteData(fid,'object',obj,'class','surfaceforcings','fieldname','monthlytemperatures','format','DoubleMat','mattype',1,'forcinglength',md.mesh.numberofvertices+1); 157 WriteData(fid,'object',obj,'class','surfaceforcings','fieldname','Tdiff','format','DoubleMat','mattype',1); 158 WriteData(fid,'object',obj,'class','surfaceforcings','fieldname','sealev','format','DoubleMat','mattype',1); 159 elseif obj.ismungsm 160 WriteData(fid,'object',obj,'class','surfaceforcings','fieldname','temperatures_presentday','format','DoubleMat','mattype',1); 161 WriteData(fid,'object',obj,'class','surfaceforcings','fieldname','temperatures_lgm','format','DoubleMat','mattype',1); 162 WriteData(fid,'object',obj,'class','surfaceforcings','fieldname','precipitations_presentday','format','DoubleMat','mattype',1); 163 WriteData(fid,'object',obj,'class','surfaceforcings','fieldname','precipitations_lgm','format','DoubleMat','mattype',1); 164 WriteData(fid,'object',obj,'class','surfaceforcings','fieldname','Pfac','format','DoubleMat','mattype',1); 165 WriteData(fid,'object',obj,'class','surfaceforcings','fieldname','Tdiff','format','DoubleMat','mattype',1); 166 WriteData(fid,'object',obj,'class','surfaceforcings','fieldname','sealev','format','DoubleMat','mattype',1); 136 167 end 137 168 end % }}} 138 169 end -
../trunk-jpl/src/m/enum/EnumDefinitions.py
341 341 def SurfaceforcingsDelta18oEnum(): return StringToEnum("SurfaceforcingsDelta18o")[0] 342 342 def SurfaceforcingsDelta18oSurfaceEnum(): return StringToEnum("SurfaceforcingsDelta18oSurface")[0] 343 343 def SurfaceforcingsIsdelta18oEnum(): return StringToEnum("SurfaceforcingsIsdelta18o")[0] 344 def SurfaceforcingsIsmungsmEnum(): return StringToEnum("SurfaceforcingsIsmungsm")[0] 344 345 def SurfaceforcingsPrecipitationsPresentdayEnum(): return StringToEnum("SurfaceforcingsPrecipitationsPresentday")[0] 345 346 def SurfaceforcingsPrecipitationsLgmEnum(): return StringToEnum("SurfaceforcingsPrecipitationsLgm")[0] 346 347 def SurfaceforcingsTemperaturesPresentdayEnum(): return StringToEnum("SurfaceforcingsTemperaturesPresentday")[0]
Note:
See TracBrowser
for help on using the repository browser.