[20498] | 1 | Index: ../trunk-jpl/test/NightlyRun/test2361.m
|
---|
| 2 | ===================================================================
|
---|
| 3 | --- ../trunk-jpl/test/NightlyRun/test2361.m (revision 0)
|
---|
| 4 | +++ ../trunk-jpl/test/NightlyRun/test2361.m (revision 19173)
|
---|
| 5 | @@ -0,0 +1,88 @@
|
---|
| 6 | +%Test Name: SquareShelfTranIspddIsdeltaSSA2d
|
---|
| 7 | +md=triangle(model(),'../Exp/Square.exp',150000.);
|
---|
| 8 | +md=setmask(md,'all','');
|
---|
| 9 | +md=parameterize(md,'../Par/SquareShelf.par');
|
---|
| 10 | +
|
---|
| 11 | +%md.verbose=verbose('all');
|
---|
| 12 | +
|
---|
| 13 | +% Use of ispdd and isdelta18o methods
|
---|
| 14 | +md.surfaceforcings = SMBpdd();
|
---|
| 15 | +md.surfaceforcings.isd18opd=1;
|
---|
| 16 | +%md.surfaceforcings.precipitation(1:md.mesh.numberofvertices,1:12)=0;
|
---|
| 17 | +%md.surfaceforcings.monthlytemperatures(1:md.mesh.numberofvertices,1:12)=273;
|
---|
| 18 | +
|
---|
| 19 | +% Add temperature, precipitation and delta18o needed to measure the surface mass balance
|
---|
| 20 | +% creating delta18o
|
---|
| 21 | +load '../Data/delta18o.data'
|
---|
| 22 | +md.surfaceforcings.delta18o=delta18o;
|
---|
| 23 | +% creating delta18oSurface
|
---|
| 24 | +md.surfaceforcings.delta18o_surface(1,1:(length(delta18o))) = 0;
|
---|
| 25 | +md.surfaceforcings.delta18o_surface(2,:) = delta18o(2,:);
|
---|
| 26 | +
|
---|
| 27 | +% creating Present day temperatures
|
---|
| 28 | +% Same temperature over the all region:
|
---|
| 29 | +tmonth(1:12)=238.15+20.;
|
---|
| 30 | +for imonth=0:11
|
---|
| 31 | + md.surfaceforcings.temperatures_presentday(1:md.mesh.numberofvertices,imonth+1)=tmonth(imonth+1);
|
---|
| 32 | + % Time for the last line:
|
---|
| 33 | + md.surfaceforcings.temperatures_presentday(md.mesh.numberofvertices+1,imonth+1)=((imonth+1)/12);
|
---|
| 34 | +end
|
---|
| 35 | +
|
---|
| 36 | +% creating initialization and spc temperatures initialization and
|
---|
| 37 | +% spc
|
---|
| 38 | +md.thermal.spctemperature=mean(md.surfaceforcings.temperatures_presentday(1:md.mesh.numberofvertices,1:12),2)-10; %-10*ones(md.mesh.numberofvertices,1);
|
---|
| 39 | +
|
---|
| 40 | +md.initialization.temperature=md.thermal.spctemperature; %md.surfaceforcings.temperatures_presentday(1:md.mesh.numberofvertices,1);
|
---|
| 41 | +
|
---|
| 42 | +% creating precipitation
|
---|
| 43 | +for imonth=0:11
|
---|
| 44 | + md.surfaceforcings.precipitations_presentday(1:md.mesh.numberofvertices,imonth+1)=-0.4*10^(-6)*md.mesh.y+0.5;
|
---|
| 45 | + % Time for the last line:
|
---|
| 46 | + md.surfaceforcings.precipitations_presentday(md.mesh.numberofvertices+1,imonth+1)=((imonth+1)/12);
|
---|
| 47 | +end
|
---|
| 48 | +
|
---|
| 49 | +% time steps and resolution
|
---|
| 50 | +md.timestepping.time_step=20;
|
---|
| 51 | +md.settings.output_frequency=1;
|
---|
| 52 | +md.timestepping.final_time=60;
|
---|
| 53 | +
|
---|
| 54 | +%
|
---|
| 55 | +md.transient.requested_outputs={'default','SurfaceforcingsMonthlytemperatures'};
|
---|
| 56 | +md=setflowequation(md,'SSA','all');
|
---|
| 57 | +md.cluster=generic('name',oshostname(),'np',1); % 3 for the cluster
|
---|
| 58 | +md=solve(md,TransientSolutionEnum());
|
---|
| 59 | +
|
---|
| 60 | +%Fields and tolerances to track changes
|
---|
| 61 | +field_names ={'Vx1','Vy1','Vel1','Pressure1','Bed1','Surface1','Thickness1','Vx2','Vy2','Vel2','Pressure2','Bed2','Surface2','Thickness2','Vx3','Vy3','Vel3','Pressure3','Bed3','Surface3','Thickness3'};
|
---|
| 62 | +field_tolerances={1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,...
|
---|
| 63 | + 1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,...
|
---|
| 64 | + 1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13};
|
---|
| 65 | +field_values={...
|
---|
| 66 | + (md.results.TransientSolution(1).Vx),...
|
---|
| 67 | + (md.results.TransientSolution(1).Vy),...
|
---|
| 68 | + (md.results.TransientSolution(1).Vel),...
|
---|
| 69 | + (md.results.TransientSolution(1).Pressure),...
|
---|
| 70 | + (md.results.TransientSolution(1).Base),...
|
---|
| 71 | + (md.results.TransientSolution(1).Surface),...
|
---|
| 72 | + (md.results.TransientSolution(1).Thickness),...
|
---|
| 73 | + (md.results.TransientSolution(1).SurfaceforcingsMonthlytemperatures),...
|
---|
| 74 | + (md.results.TransientSolution(1).SurfaceforcingsMassBalance),...
|
---|
| 75 | + (md.results.TransientSolution(2).Vx),...
|
---|
| 76 | + (md.results.TransientSolution(2).Vy),...
|
---|
| 77 | + (md.results.TransientSolution(2).Vel),...
|
---|
| 78 | + (md.results.TransientSolution(2).Pressure),...
|
---|
| 79 | + (md.results.TransientSolution(2).Base),...
|
---|
| 80 | + (md.results.TransientSolution(2).Surface),...
|
---|
| 81 | + (md.results.TransientSolution(2).Thickness),...
|
---|
| 82 | + (md.results.TransientSolution(2).SurfaceforcingsMonthlytemperatures),...
|
---|
| 83 | + (md.results.TransientSolution(2).SurfaceforcingsMassBalance),...
|
---|
| 84 | + (md.results.TransientSolution(3).Vx),...
|
---|
| 85 | + (md.results.TransientSolution(3).Vy),...
|
---|
| 86 | + (md.results.TransientSolution(3).Vel),...
|
---|
| 87 | + (md.results.TransientSolution(3).Pressure),...
|
---|
| 88 | + (md.results.TransientSolution(3).Base),...
|
---|
| 89 | + (md.results.TransientSolution(3).Surface),...
|
---|
| 90 | + (md.results.TransientSolution(3).Thickness),...
|
---|
| 91 | + (md.results.TransientSolution(3).SurfaceforcingsMonthlytemperatures),...
|
---|
| 92 | + (md.results.TransientSolution(3).SurfaceforcingsMassBalance),...
|
---|
| 93 | + };
|
---|
| 94 | Index: ../trunk-jpl/src/c/shared/Elements/ComputeD18OTemperaturePrecipitationFromPD.cpp
|
---|
| 95 | ===================================================================
|
---|
| 96 | --- ../trunk-jpl/src/c/shared/Elements/ComputeD18OTemperaturePrecipitationFromPD.cpp (revision 0)
|
---|
| 97 | +++ ../trunk-jpl/src/c/shared/Elements/ComputeD18OTemperaturePrecipitationFromPD.cpp (revision 19173)
|
---|
| 98 | @@ -0,0 +1,31 @@
|
---|
| 99 | +/* file: ComputeTemperaturePrecipitationfrom018.cpp
|
---|
| 100 | + Scale present day monthly precipitation and temperature fields
|
---|
| 101 | + along the NGRIP oxygen isotope record.
|
---|
| 102 | + */
|
---|
| 103 | +
|
---|
| 104 | +#include "./elements.h"
|
---|
| 105 | +#include "../Numerics/numerics.h"
|
---|
| 106 | +
|
---|
| 107 | +void ComputeD18OTemperaturePrecipitationFromPD(IssmDouble d018,IssmDouble dpermil,
|
---|
| 108 | + IssmDouble* PrecipitationPresentday,IssmDouble* TemperaturePresentday,
|
---|
| 109 | + IssmDouble* monthlytemperaturesout, IssmDouble* monthlyprecout){
|
---|
| 110 | +
|
---|
| 111 | + IssmDouble monthlytemperaturestmp[12],monthlyprectmp[12];
|
---|
| 112 | + IssmDouble deltaTemp;
|
---|
| 113 | +
|
---|
| 114 | + /* Constants */
|
---|
| 115 | + // dpermil = 2.4;/*degrees C per mil*/
|
---|
| 116 | +
|
---|
| 117 | + /*Create Delta Temp to be applied to monthly temps and used in precip scaling*/
|
---|
| 118 | + deltaTemp = dpermil * (d018+34.83);
|
---|
| 119 | +
|
---|
| 120 | + for (int imonth = 0; imonth<12; imonth++){
|
---|
| 121 | +
|
---|
| 122 | + monthlytemperaturesout[imonth] = TemperaturePresentday[imonth] + deltaTemp;
|
---|
| 123 | + monthlyprecout[imonth] = PrecipitationPresentday[imonth]*exp((0.169/dpermil)*deltaTemp);
|
---|
| 124 | +
|
---|
| 125 | + /*Assign output pointer*/
|
---|
| 126 | + *(monthlytemperaturesout+imonth) = monthlytemperaturestmp[imonth];
|
---|
| 127 | + *(monthlyprecout+imonth) = monthlyprectmp[imonth];
|
---|
| 128 | + }
|
---|
| 129 | +}
|
---|
| 130 | Index: ../trunk-jpl/src/m/enum/SurfaceforcingsDpermilEnum.m
|
---|
| 131 | ===================================================================
|
---|
| 132 | --- ../trunk-jpl/src/m/enum/SurfaceforcingsDpermilEnum.m (revision 0)
|
---|
| 133 | +++ ../trunk-jpl/src/m/enum/SurfaceforcingsDpermilEnum.m (revision 19173)
|
---|
| 134 | @@ -0,0 +1,11 @@
|
---|
| 135 | +function macro=SurfaceforcingsDpermilEnum()
|
---|
| 136 | +%SURFACEFORCINGSDPERMILENUM - Enum of SurfaceforcingsDpermil
|
---|
| 137 | +%
|
---|
| 138 | +% WARNING: DO NOT MODIFY THIS FILE
|
---|
| 139 | +% this file has been automatically generated by src/c/shared/Enum/Synchronize.sh
|
---|
| 140 | +% Please read src/c/shared/Enum/README for more information
|
---|
| 141 | +%
|
---|
| 142 | +% Usage:
|
---|
| 143 | +% macro=SurfaceforcingsDpermilEnum()
|
---|
| 144 | +
|
---|
| 145 | +macro=StringToEnum('SurfaceforcingsDpermil');
|
---|
| 146 | Index: ../trunk-jpl/src/m/enum/SurfaceforcingsIsd18opdEnum.m
|
---|
| 147 | ===================================================================
|
---|
| 148 | --- ../trunk-jpl/src/m/enum/SurfaceforcingsIsd18opdEnum.m (revision 0)
|
---|
| 149 | +++ ../trunk-jpl/src/m/enum/SurfaceforcingsIsd18opdEnum.m (revision 19173)
|
---|
| 150 | @@ -0,0 +1,11 @@
|
---|
| 151 | +function macro=SurfaceforcingsIsd18opdEnum()
|
---|
| 152 | +%SURFACEFORCINGSISD18OPDENUM - Enum of SurfaceforcingsIsd18opd
|
---|
| 153 | +%
|
---|
| 154 | +% WARNING: DO NOT MODIFY THIS FILE
|
---|
| 155 | +% this file has been automatically generated by src/c/shared/Enum/Synchronize.sh
|
---|
| 156 | +% Please read src/c/shared/Enum/README for more information
|
---|
| 157 | +%
|
---|
| 158 | +% Usage:
|
---|
| 159 | +% macro=SurfaceforcingsIsd18opdEnum()
|
---|
| 160 | +
|
---|
| 161 | +macro=StringToEnum('SurfaceforcingsIsd18opd');
|
---|