Index: ../trunk-jpl/test/NightlyRun/test472.m =================================================================== --- ../trunk-jpl/test/NightlyRun/test472.m (nonexistent) +++ ../trunk-jpl/test/NightlyRun/test472.m (revision 23799) @@ -0,0 +1,88 @@ +%Test Name: ISMIP6MeltRateTest +md=triangle(model(),'../Exp/Square.exp',90000.); +md=setmask(md,'../Exp/SquareShelf.exp',''); +md=parameterize(md,'../Par/SquareSheetShelf.par'); +md.initialization.vx(:)=1.; +md.initialization.vy(:)=1.; +md.geometry.thickness(:)=500-md.mesh.x/10000; +md.geometry.bed =-100-md.mesh.x/1000; +md.geometry.base=-md.geometry.thickness*md.materials.rho_ice/md.materials.rho_water; +md.mask.groundedice_levelset=md.geometry.thickness+md.materials.rho_water/md.materials.rho_ice*md.geometry.bed; +pos=find(md.mask.groundedice_levelset>=0); +md.geometry.base(pos)=md.geometry.bed(pos); +md.geometry.surface=md.geometry.base+md.geometry.thickness; +md=setflowequation(md,'SSA','all'); + +%Set ISMIP6 melt rate parameters +md.basalforcings = basalforcingsismip6(md.basalforcings); +md.basalforcings.basin_id = zeros(md.mesh.numberofelements,1); +yE = mean(md.mesh.y(md.mesh.elements),2); +pos1 = find(yE>=5e5); md.basalforcings.basin_id(pos1)=1; +pos2 = find(yE<5e5); md.basalforcings.basin_id(pos2)=2; +md.basalforcings.num_basins = 2; +md.basalforcings.delta_t = [0.1 0.2]; +md.basalforcings.tf_depths = [0 -1000 -2000]; +md.basalforcings.gamma_0 = 14477; + +%Build an artificial tf field (for times 0 and 1, 3 depth layers) +temp1a = 1.*ones(md.mesh.numberofvertices,1); temp1b = 1.5.*ones(md.mesh.numberofvertices,1); A = [temp1a temp1b ; [0. 1.]]; +temp2a = 2.*ones(md.mesh.numberofvertices,1); temp2b = 2.5.*ones(md.mesh.numberofvertices,1); B = [temp2a temp2b ; [0. 1.]]; +temp3a = 3.*ones(md.mesh.numberofvertices,1); temp3b = 3.5.*ones(md.mesh.numberofvertices,1); C = [temp3a temp3b ; [0. 1.]]; +D = cell(1,1,3); D(:,:,1)={A}; D(:,:,2)={B}; D(:,:,3)={C}; +md.basalforcings.tf = D; + +%Boundary conditions: +md.mask.ice_levelset=-ones(md.mesh.numberofvertices,1); +md.mask.ice_levelset(find(md.mesh.x==max(md.mesh.x)))=0; + +%Model conditions +md.transient.isthermal=0; +md.transient.isstressbalance=1; +md.transient.isgroundingline=1; +md.transient.ismasstransport=1; +md.transient.issmb=1; +md.transient.requested_outputs={'default','BasalforcingsFloatingiceMeltingRate','BasalforcingsIsmp6TfShelf'}; +md.groundingline.migration='SubelementMigration'; +md.groundingline.friction_interpolation='SubelementFriction1'; +md.groundingline.melt_interpolation='SubelementMelt1'; +md.timestepping.final_time=1.5; +md.timestepping.time_step=0.5; + +md.cluster=generic('name',oshostname(),'np',1); +md=solve(md,'Transient'); + +field_names ={'Bed1','Surface1','Thickness1','Floatingice1','Vx1','Vy1','Pressure1','FloatingiceMeltingrate1','ThermalForcing1',... + 'Bed2','Surface2','Thickness2','Floatingice2','Vx2','Vy2','Pressure2','FloatingiceMeltingrate2','ThermalForcing2',... + 'Bed3','Surface3','Thickness3','Floatingice3','Vx3','Vy3','Pressure3','FloatingiceMeltingrate3','ThermalForcing3'}; +field_tolerances={7e-09,8e-09,8e-09,7e-09,6e-08,7e-08,6e-09,8e-10,7e-08,... + 7e-09,8e-09,8e-09,7e-09,6e-08,7e-08,6e-09,8e-10,7e-08,... + 7e-09,8e-09,8e-09,7e-09,6e-08,7e-08,6e-09,8e-10,7e-08}; +field_values={... + (md.results.TransientSolution(1).Base),... + (md.results.TransientSolution(1).Surface),... + (md.results.TransientSolution(1).Thickness),... + (md.results.TransientSolution(1).MaskGroundediceLevelset),... + (md.results.TransientSolution(1).Vx),... + (md.results.TransientSolution(1).Vy),... + (md.results.TransientSolution(1).Pressure),... + (md.results.TransientSolution(1).BasalforcingsFloatingiceMeltingRate),... + (md.results.TransientSolution(1).BasalforcingsIsmp6TfShelf),... + (md.results.TransientSolution(2).Base),... + (md.results.TransientSolution(2).Surface),... + (md.results.TransientSolution(2).Thickness),... + (md.results.TransientSolution(2).MaskGroundediceLevelset),... + (md.results.TransientSolution(2).Vx),... + (md.results.TransientSolution(2).Vy),... + (md.results.TransientSolution(2).Pressure),... + (md.results.TransientSolution(2).BasalforcingsFloatingiceMeltingRate),... + (md.results.TransientSolution(2).BasalforcingsIsmp6TfShelf),... + (md.results.TransientSolution(3).Base),... + (md.results.TransientSolution(3).Surface),... + (md.results.TransientSolution(3).Thickness),... + (md.results.TransientSolution(3).MaskGroundediceLevelset),... + (md.results.TransientSolution(3).Vx),... + (md.results.TransientSolution(3).Vy),... + (md.results.TransientSolution(3).Pressure),... + (md.results.TransientSolution(3).BasalforcingsFloatingiceMeltingRate),... + (md.results.TransientSolution(3).BasalforcingsIsmp6TfShelf),... + }; Index: ../trunk-jpl/test/Archives/Archive472.arch =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: ../trunk-jpl/test/Archives/Archive472.arch =================================================================== --- ../trunk-jpl/test/Archives/Archive472.arch (nonexistent) +++ ../trunk-jpl/test/Archives/Archive472.arch (revision 23799) Property changes on: ../trunk-jpl/test/Archives/Archive472.arch ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +application/octet-stream \ No newline at end of property Index: ../trunk-jpl/src/m/classes/basalforcingsismip6.m =================================================================== --- ../trunk-jpl/src/m/classes/basalforcingsismip6.m (revision 23798) +++ ../trunk-jpl/src/m/classes/basalforcingsismip6.m (revision 23799) @@ -82,7 +82,7 @@ WriteData(fid,prefix,'name','md.basalforcings.model','data',7,'format','Integer'); WriteData(fid,prefix,'object',self,'fieldname','num_basins','format','Integer'); WriteData(fid,prefix,'object',self,'fieldname','basin_id','data',self.basin_id-1,'name','md.basalforcings.basin_id','format','IntMat','mattype',2); %0-indexed - WriteData(fid,prefix,'object',self,'fieldname','gamma_0','format','Double'); + WriteData(fid,prefix,'object',self,'fieldname','gamma_0','format','Double','scale',1./yts); WriteData(fid,prefix,'object',self,'fieldname','tf_depths','format','DoubleMat','name','md.basalforcings.tf_depths'); WriteData(fid,prefix,'object',self,'fieldname','tf','format','MatArray','name','md.basalforcings.tf','timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts); WriteData(fid,prefix,'object',self,'fieldname','delta_t','format','DoubleMat','name','md.basalforcings.delta_t','timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts); Index: ../trunk-jpl/src/c/modules/ModelProcessorx/CreateParameters.cpp =================================================================== --- ../trunk-jpl/src/c/modules/ModelProcessorx/CreateParameters.cpp (revision 23798) +++ ../trunk-jpl/src/c/modules/ModelProcessorx/CreateParameters.cpp (revision 23799) @@ -227,12 +227,11 @@ case BasalforcingsIsmip6Enum: parameters->AddObject(iomodel->CopyConstantObject("md.basalforcings.num_basins",BasalforcingsIsmp6NumBasinsEnum)); parameters->AddObject(iomodel->CopyConstantObject("md.basalforcings.gamma_0",BasalforcingsIsmp6Gamma0Enum)); - iomodel->FindConstant(&temp_n,"md.basalforcings.num_basins"); - iomodel->FetchData(&transparam,NULL,&M,"md.basalforcings.delta_t"); - parameters->AddObject(new DoubleVecParam(BasalforcingsIsmp6DeltaTEnum,transparam,temp_n)); + iomodel->FetchData(&transparam,&M,&N,"md.basalforcings.delta_t"); + parameters->AddObject(new DoubleVecParam(BasalforcingsIsmp6DeltaTEnum,transparam,N)); xDelete(transparam); - iomodel->FetchData(&transparam,NULL,NULL,"md.basalforcings.tf_depths"); - parameters->AddObject(new DoubleVecParam(BasalforcingsIsmp6TfDepthsEnum,transparam,3)); + iomodel->FetchData(&transparam,&M,&N,"md.basalforcings.tf_depths"); + parameters->AddObject(new DoubleVecParam(BasalforcingsIsmp6TfDepthsEnum,transparam,N)); xDelete(transparam); break; default: Index: ../trunk-jpl/src/c/modules/FloatingiceMeltingRatex/FloatingiceMeltingRatex.cpp =================================================================== --- ../trunk-jpl/src/c/modules/FloatingiceMeltingRatex/FloatingiceMeltingRatex.cpp (revision 23798) +++ ../trunk-jpl/src/c/modules/FloatingiceMeltingRatex/FloatingiceMeltingRatex.cpp (revision 23799) @@ -87,7 +87,7 @@ IssmDouble* areas_summed = xNewZeroInit(num_basins); IssmDouble* areas_summed_cpu = xNewZeroInit(num_basins); - /*TEST: Set tf=2 for all ice shelf elements*/ + /*Get TF at each ice shelf point - linearly intepolate in depth and time*/ for(int i=0;ielements->Size();i++){ Element* element = xDynamicCast(femmodel->elements->GetObjectByOffset(i)); int numvertices = element->GetNumberOfVertices(); @@ -129,7 +129,7 @@ tf_input->GetInputValue(&tf_test[iv],gauss,num_depths-1); } else { - /*get values between two times [offset:offset+1[, Interpolate linearly*/ + /*get values between two times [offset:offset+1], Interpolate linearly*/ _assert_(depth>=tf_depths[offset] && depthAddInput(BasalforcingsIsmp6TfShelfEnum,tf_test,P1Enum); xDelete(tf_test); xDelete(depth_vertices); + delete gauss; } /*Compute sums of tf*area and shelf-area per cpu*/