source: issm/oecreview/Archive/19101-20495/ISSM-19172-19173.diff@ 20498

Last change on this file since 20498 was 20498, checked in by Mathieu Morlighem, 9 years ago

CHG: done with Archive/19101-20495

File size: 7.1 KB
  • ../trunk-jpl/test/NightlyRun/test2361.m

     
     1%Test Name: SquareShelfTranIspddIsdeltaSSA2d
     2md=triangle(model(),'../Exp/Square.exp',150000.);
     3md=setmask(md,'all','');
     4md=parameterize(md,'../Par/SquareShelf.par');
     5
     6%md.verbose=verbose('all');
     7
     8% Use of ispdd and isdelta18o methods
     9md.surfaceforcings = SMBpdd();
     10md.surfaceforcings.isd18opd=1;
     11%md.surfaceforcings.precipitation(1:md.mesh.numberofvertices,1:12)=0;
     12%md.surfaceforcings.monthlytemperatures(1:md.mesh.numberofvertices,1:12)=273;
     13
     14% Add temperature, precipitation and delta18o needed to measure the surface mass balance
     15%  creating delta18o
     16load '../Data/delta18o.data'
     17md.surfaceforcings.delta18o=delta18o;
     18% creating delta18oSurface
     19md.surfaceforcings.delta18o_surface(1,1:(length(delta18o))) = 0;
     20md.surfaceforcings.delta18o_surface(2,:) = delta18o(2,:);
     21
     22% creating Present day  temperatures
     23% Same temperature over the all region:
     24tmonth(1:12)=238.15+20.;
     25for imonth=0:11
     26    md.surfaceforcings.temperatures_presentday(1:md.mesh.numberofvertices,imonth+1)=tmonth(imonth+1);
     27    % Time for the last line:
     28    md.surfaceforcings.temperatures_presentday(md.mesh.numberofvertices+1,imonth+1)=((imonth+1)/12);
     29end
     30
     31% creating initialization and spc temperatures initialization and
     32% spc
     33md.thermal.spctemperature=mean(md.surfaceforcings.temperatures_presentday(1:md.mesh.numberofvertices,1:12),2)-10; %-10*ones(md.mesh.numberofvertices,1);
     34
     35md.initialization.temperature=md.thermal.spctemperature; %md.surfaceforcings.temperatures_presentday(1:md.mesh.numberofvertices,1);
     36
     37% creating precipitation
     38for imonth=0:11
     39    md.surfaceforcings.precipitations_presentday(1:md.mesh.numberofvertices,imonth+1)=-0.4*10^(-6)*md.mesh.y+0.5;
     40    % Time for the last line:
     41    md.surfaceforcings.precipitations_presentday(md.mesh.numberofvertices+1,imonth+1)=((imonth+1)/12);
     42end
     43
     44% time steps and resolution
     45md.timestepping.time_step=20;
     46md.settings.output_frequency=1;
     47md.timestepping.final_time=60;
     48
     49%
     50md.transient.requested_outputs={'default','SurfaceforcingsMonthlytemperatures'};
     51md=setflowequation(md,'SSA','all');
     52md.cluster=generic('name',oshostname(),'np',1); % 3 for the cluster
     53md=solve(md,TransientSolutionEnum());
     54
     55%Fields and tolerances to track changes
     56field_names     ={'Vx1','Vy1','Vel1','Pressure1','Bed1','Surface1','Thickness1','Vx2','Vy2','Vel2','Pressure2','Bed2','Surface2','Thickness2','Vx3','Vy3','Vel3','Pressure3','Bed3','Surface3','Thickness3'};
     57field_tolerances={1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,...
     58        1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,...
     59        1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13};
     60field_values={...
     61        (md.results.TransientSolution(1).Vx),...
     62        (md.results.TransientSolution(1).Vy),...
     63        (md.results.TransientSolution(1).Vel),...
     64        (md.results.TransientSolution(1).Pressure),...
     65        (md.results.TransientSolution(1).Base),...
     66        (md.results.TransientSolution(1).Surface),...
     67        (md.results.TransientSolution(1).Thickness),...
     68        (md.results.TransientSolution(1).SurfaceforcingsMonthlytemperatures),...
     69        (md.results.TransientSolution(1).SurfaceforcingsMassBalance),...
     70        (md.results.TransientSolution(2).Vx),...
     71        (md.results.TransientSolution(2).Vy),...
     72        (md.results.TransientSolution(2).Vel),...
     73        (md.results.TransientSolution(2).Pressure),...
     74        (md.results.TransientSolution(2).Base),...
     75        (md.results.TransientSolution(2).Surface),...
     76        (md.results.TransientSolution(2).Thickness),...
     77        (md.results.TransientSolution(2).SurfaceforcingsMonthlytemperatures),...
     78        (md.results.TransientSolution(2).SurfaceforcingsMassBalance),...
     79        (md.results.TransientSolution(3).Vx),...
     80        (md.results.TransientSolution(3).Vy),...
     81        (md.results.TransientSolution(3).Vel),...
     82        (md.results.TransientSolution(3).Pressure),...
     83        (md.results.TransientSolution(3).Base),...
     84        (md.results.TransientSolution(3).Surface),...
     85        (md.results.TransientSolution(3).Thickness),...
     86        (md.results.TransientSolution(3).SurfaceforcingsMonthlytemperatures),...
     87        (md.results.TransientSolution(3).SurfaceforcingsMassBalance),...
     88        };
  • ../trunk-jpl/src/c/shared/Elements/ComputeD18OTemperaturePrecipitationFromPD.cpp

     
     1/* file:  ComputeTemperaturePrecipitationfrom018.cpp
     2 Scale present day monthly precipitation and temperature fields
     3 along the NGRIP oxygen isotope record.
     4 */
     5
     6#include "./elements.h"
     7#include "../Numerics/numerics.h"
     8
     9void ComputeD18OTemperaturePrecipitationFromPD(IssmDouble d018,IssmDouble dpermil,
     10                                               IssmDouble* PrecipitationPresentday,IssmDouble* TemperaturePresentday,
     11                                               IssmDouble* monthlytemperaturesout, IssmDouble* monthlyprecout){
     12 
     13  IssmDouble monthlytemperaturestmp[12],monthlyprectmp[12];
     14  IssmDouble deltaTemp;
     15 
     16  /* Constants */
     17  // dpermil = 2.4;/*degrees C per mil*/
     18 
     19  /*Create Delta Temp to be applied to monthly temps and used in precip scaling*/
     20  deltaTemp = dpermil * (d018+34.83);   
     21   
     22  for (int imonth = 0; imonth<12; imonth++){
     23   
     24    monthlytemperaturesout[imonth] = TemperaturePresentday[imonth] + deltaTemp;
     25    monthlyprecout[imonth] = PrecipitationPresentday[imonth]*exp((0.169/dpermil)*deltaTemp);
     26   
     27    /*Assign output pointer*/
     28    *(monthlytemperaturesout+imonth) = monthlytemperaturestmp[imonth];
     29    *(monthlyprecout+imonth) = monthlyprectmp[imonth];
     30  }
     31}
  • ../trunk-jpl/src/m/enum/SurfaceforcingsDpermilEnum.m

     
     1function macro=SurfaceforcingsDpermilEnum()
     2%SURFACEFORCINGSDPERMILENUM - Enum of SurfaceforcingsDpermil
     3%
     4%   WARNING: DO NOT MODIFY THIS FILE
     5%            this file has been automatically generated by src/c/shared/Enum/Synchronize.sh
     6%            Please read src/c/shared/Enum/README for more information
     7%
     8%   Usage:
     9%      macro=SurfaceforcingsDpermilEnum()
     10
     11macro=StringToEnum('SurfaceforcingsDpermil');
  • ../trunk-jpl/src/m/enum/SurfaceforcingsIsd18opdEnum.m

     
     1function macro=SurfaceforcingsIsd18opdEnum()
     2%SURFACEFORCINGSISD18OPDENUM - Enum of SurfaceforcingsIsd18opd
     3%
     4%   WARNING: DO NOT MODIFY THIS FILE
     5%            this file has been automatically generated by src/c/shared/Enum/Synchronize.sh
     6%            Please read src/c/shared/Enum/README for more information
     7%
     8%   Usage:
     9%      macro=SurfaceforcingsIsd18opdEnum()
     10
     11macro=StringToEnum('SurfaceforcingsIsd18opd');
Note: See TracBrowser for help on using the repository browser.