-
Notifications
You must be signed in to change notification settings - Fork 3
/
LeafMetaRun.m
56 lines (52 loc) · 1.6 KB
/
LeafMetaRun.m
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
global pcfactor;
ProteinTotalRatio=0.973;
pcfactor=1/ProteinTotalRatio;
inE=importdata('MeM_input5_0.txt');
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%Input conversion
InputF=importdata('GrCM_output.txt');
DataCol=InputF.textdata(1,:);
idx = find(ismember(DataCol, 'Ele:Amb' ));
DataGeneID=InputF.textdata(:,1);
GeneNo=size(inE.textdata,1)-1;
ExpValue=ones(GeneNo,1);
for i=1:GeneNo
if find(ismember(DataGeneID,string(inE.textdata(i+1,1))))
idRow=find(ismember(DataGeneID,string(inE.textdata(i+1,1))));
ExpValue(i,1)=InputF.data(idRow-1,idx-2);
end
end
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%Einput=inE.data;
Einput=ExpValue;
Edata=importdata('Einput7.txt');
Eio=Edata.data(:,1);
MetaOnly=0;% if MetaOnly=1 run Metabolic model
WeatherTemp=25;
Air_CO2=400;
WeatherRH=0.6;
WeatherWind=5;
Radiation_PAR=470*0.85*0.85;%%%%
Convert=1E6/(2.35E5); %Convert W m^{-2} to u moles m^{-2} s^{-1}
Radiation_NIR=0;
Radiation_LW=0;
PhotosynthesisType=1.1;
Vcmax25=100;
Jmax25=200;
GRNC=1;
if MetaOnly==1
CO2i=Air_CO2*0.7; % intercellular CO2
PPFDi=Radiation_PAR*Convert;
NetAssimilation=EPS_Drive_GRNs(Einput,CO2i,PPFDi,WeatherTemp,GRNC,0,Eio);
else
LeafResult=Leaf(WeatherRH,WeatherTemp,Air_CO2,WeatherWind,Radiation_PAR,Radiation_NIR,Radiation_LW,PhotosynthesisType,Vcmax25,Jmax25,GRNC,Einput,Eio);
Ci=LeafResult(1);
NetAssimilation=LeafResult(2);
Gs=LeafResult(3);
LeafTemperature=LeafResult(4);
Transpirationi=LeafResult(5);
end
fileID = fopen('LeafmetaOut.txt','w');
fprintf(fileID,'%6s\n','A');
fprintf(fileID,'%6.2f\n',NetAssimilation);
fclose(fileID);