1 C ****************************************************************
3 C InitSaveData - Opens the data file for writing
6 C ****************************************************************
8 SUBROUTINE InitSaveData
()
10 INCLUDE
'KPP_ROOT_Parameters.h'
12 open
(10, file
='KPP_ROOT.dat')
17 C End of InitSaveData function
18 C ****************************************************************
20 C ****************************************************************
22 C SaveData - Write LOOKAT species in the data file
25 C ****************************************************************
27 SUBROUTINE SaveData
()
29 INCLUDE
'KPP_ROOT_Parameters.h'
30 INCLUDE
'KPP_ROOT_Global.h'
34 WRITE(10,999) (TIME
-TSTART
)/3600.D0
,
35 * (C
(LOOKAT
(i
))/CFACTOR
, i
=1,NLOOKAT
)
36 999 FORMAT(E24
.16
,100(1X
,E24
.16
))
41 C End of SaveData function
42 C ****************************************************************
44 C ****************************************************************
46 C CloseSaveData - Close the data file
49 C ****************************************************************
51 SUBROUTINE CloseSaveData
()
53 INCLUDE
'KPP_ROOT_Parameters.h'
60 C End of CloseSaveData function
61 C ****************************************************************
63 C ****************************************************************
65 C GenerateMatlab - Generates MATLAB file to load the data file
67 C It will have a character string to prefix each
70 C ****************************************************************
72 SUBROUTINE GenerateMatlab
( PREFIX
)
74 INCLUDE
'KPP_ROOT_Parameters.h'
75 INCLUDE
'KPP_ROOT_Global.h'
80 open
(20, file
='KPP_ROOT.m')
81 write(20,*) 'load KPP_ROOT.dat;'
83 990 FORMAT(A1
,'c = KPP_ROOT;')
84 write(20,*) 'clear KPP_ROOT;'
85 write(20,991) PREFIX
, PREFIX
86 991 FORMAT(A1
,'t=',A1
,'c(:,1);')
88 992 FORMAT(A1
,'c(:,1)=[];')
91 write(20,993) PREFIX
, SPC_NAMES
(LOOKAT
(i
)), PREFIX
, i
92 993 FORMAT(A1
,A6
,' = ',A1
,'c(:,',I2
,');')
100 C End of GenerateMatlab function
101 C ****************************************************************