-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathProgram.cs
More file actions
98 lines (71 loc) · 3.01 KB
/
Program.cs
File metadata and controls
98 lines (71 loc) · 3.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using LayerCanopyPhotosynthesis;
namespace DCaPS
{
class Program
{
static void Main(string[] args)
{
//C3-------------------------------------------------------------
//Create an instance of the PM Model
PhotosynthesisModel PM = new PhotosynthesisModel();
//Set the desired photosynthetic pathway
PM.photoPathway = PhotosynthesisModel.PhotoPathway.C3;
//Set the latitiude
PM.envModel.latitude = new Angle(-27.5, AngleType.Deg);
//Set Ambient air CO2 partial pressure
PM.canopy.Ca = 400;
//Set the daily environmental variables
PM.envModel.DOY = 298;
PM.envModel.maxT = 21;
PM.envModel.minT = 7;
//Set the leaf angle
PM.canopy.leafAngle = 60;
//Set daily LAI and SLN values
PM.canopy.LAI = 6;
PM.canopy.CPath.SLNAv = 1.45;
//Set initialised flag - there are several 'notifiers' that run when a property is changed
// so these are set after cahnges have been made
PM.envModel.initilised = true;
PM.initialised = true;
//Run the model
PM.runDaily();
Console.WriteLine("---C3 Test -------------");
Console.WriteLine("Daily assimilation :" + PM.dailyBiomass.ToString("0.00") + " g / m2");
Console.WriteLine("------------------------");
//C4-------------------------------------------------------------
//Create an instance of the PM Model
PM = new PhotosynthesisModel();
//Set the desired photosynthetic pathway
PM.photoPathway = PhotosynthesisModel.PhotoPathway.C4;
//Set the latitiude
PM.envModel.latitude = new Angle(-27.5, AngleType.Deg);
//Set Ambient air CO2 partial pressure
PM.canopy.Ca = 400;
//Set the daily environmental variables
PM.envModel.DOY = 298;
PM.envModel.maxT = 30;
PM.envModel.minT = 20;
//Set the leaf angle
PM.canopy.leafAngle = 60;
//Set daily LAI and SLN values
PM.canopy.LAI = 6;
PM.canopy.CPath.SLNAv = 1.36;
//Set initialised flag - there are several 'notifiers' that run when a property is changed
// so flag is set after changes have been made
PM.envModel.initilised = true;
PM.initialised = true;
//Run the model
PM.runDaily();
Console.WriteLine("---C4 Test -------------");
Console.WriteLine("Daily assimilation :" + PM.dailyBiomass.ToString("0.00") + " g / m2");
Console.WriteLine("------------------------");
Console.WriteLine("Press any key to exit...");
Console.ReadKey();
}
}
}