Ice Sheet System Model  4.18
Code documentation
ComputeDelta18oTemperaturePrecipitation.cpp
Go to the documentation of this file.
1 /* file: ComputeTemperaturePrecipitation.cpp
2  Compute the temperature and precipitation at time t from
3  the data at present day and delta18O
4  */
5 
6 #include "./elements.h"
7 #include "../Numerics/numerics.h"
8 #include <cmath>
9 
10 void ComputeDelta18oTemperaturePrecipitation(IssmDouble Delta18oSurfacePresent, IssmDouble Delta18oSurfaceLgm, IssmDouble Delta18oSurfaceTime,
11  IssmDouble Delta18oPresent, IssmDouble Delta18oLgm, IssmDouble Delta18oTime,
12  IssmDouble* PrecipitationsPresentday,
13  IssmDouble* TemperaturesLgm, IssmDouble* TemperaturesPresentday,
14  IssmDouble* monthlytemperaturesout, IssmDouble* monthlyprecout){
15 
16  IssmDouble monthlytemperaturestmp[12],monthlyprectmp[12];
17  IssmDouble delta18oLapseRate=-6.2*pow(10.,-3);
18  IssmDouble glacialindex; // used to vary present day temperature
19 
20  glacialindex = (Delta18oTime-Delta18oPresent-delta18oLapseRate*(Delta18oSurfaceTime-Delta18oSurfacePresent))
21  /(Delta18oLgm-Delta18oPresent-delta18oLapseRate*(Delta18oSurfaceLgm-Delta18oSurfacePresent)); // Tarasov 2004 paper
22 
23  for (int imonth = 0; imonth<12; imonth++){
24  monthlytemperaturestmp[imonth] = glacialindex*TemperaturesLgm[imonth] + (1.-glacialindex)*TemperaturesPresentday[imonth];
25  monthlyprectmp[imonth] = PrecipitationsPresentday[imonth];
26 
27  /*Assign output pointer*/
28  *(monthlytemperaturesout+imonth) = monthlytemperaturestmp[imonth];
29  *(monthlyprecout+imonth) = monthlyprectmp[imonth];
30  }
31 }
IssmDouble
double IssmDouble
Definition: types.h:37
elements.h
prototypes for elements.h
ComputeDelta18oTemperaturePrecipitation
void ComputeDelta18oTemperaturePrecipitation(IssmDouble Delta18oSurfacePresent, IssmDouble Delta18oSurfaceLgm, IssmDouble Delta18oSurfaceTime, IssmDouble Delta18oPresent, IssmDouble Delta18oLgm, IssmDouble Delta18oTime, IssmDouble *PrecipitationsPresentday, IssmDouble *TemperaturesLgm, IssmDouble *TemperaturesPresentday, IssmDouble *monthlytemperaturesout, IssmDouble *monthlyprecout)
Definition: ComputeDelta18oTemperaturePrecipitation.cpp:10