Merge branch 'master' into devel
[wrffire.git] / wrfv2_fire / chem / KPP / kpp / kpp-2.1 / drv / exact.f
blobc6b97d4036a906d9a75c8f2f46cad7e194ad3d9d
1 PROGRAM driver
3 INCLUDE 'KPP_ROOT_Parameters.h'
4 INCLUDE 'KPP_ROOT_Global.h'
6 KPP_REAL DVAL(NSPEC)
7 INTEGER i
9 C ---- TIME VARIABLES ------------------
11 TSTART = 0
12 TEND = TSTART + 600
13 DT = 60.
14 TEMP = 298
16 STEPMIN = 0.01
17 STEPMAX = 900
19 RTOLS = 1e-8
20 do i=1,NVAR
21 RTOL(i) = RTOLS
22 ATOL(i) = 1e-3
23 end do
25 CALL Initialize()
27 C ********** TIME LOOP *************************
29 CALL InitSaveData()
31 write(6,990) (SPC_NAMES[MONITOR(i)], i=1,NMONITOR),
32 * (SMASS(i), i=1,NMASS )
33 990 FORMAT('done[%] Time[h] ',20(4X,A6))
35 TIME = TSTART
36 do while (TIME .lt. TEND)
38 CALL GetMass( C, DVAL )
39 write(6,991) (TIME-TSTART)/(TEND-TSTART)*100, TIME/3600.,
40 * (C(MONITOR(i))/CFACTOR, i=1,NMONITOR),
41 * (DVAL(i)/CFACTOR, i=1,NMASS)
42 991 FORMAT(F6.1,'% ',F7.2,3X,20(E10.4,2X))
44 CALL SaveData()
46 CALL Update_SUN()
47 CALL Update_RCONST()
49 CALL INTEGRATE( TIME, TIME+DT )
51 end do
53 CALL GetMass( C, DVAL )
54 write(6,991) (TIME-TSTART)/(TEND-TSTART)*100, TIME/3600.,
55 * (C(MONITOR(i))/CFACTOR, i=1,NMONITOR),
56 * (DVAL(i)/CFACTOR, i=1,NMASS)
58 CALL SaveData()
60 C *********** END TIME LOOP ********
62 CALL CloseSaveData()
63 CALL GenerateMatlab(' ')
65 STOP
66 END