Skip to content
wolfiex edited this page Aug 17, 2018 · 3 revisions

Debug Page

Occasionally it happens that something goes wrong with the model which is not chemistry based. Although the results up to the point of failure are saved within the hdf5 file, it occasionally serves that there may be a problem somewhere else. For this reason a series of programs have been put together.

Flux mismatch

One of the eaiest unit tests would be to run the testropa.py module. This calculates the flux for a random selection using the manual method (ropa) and compares it to the flux value pulled from the model.

Test pythonpython ztestflux.py methane.h5

Output:

---------
9.58775683617e-07 rate
-5.3445216861e-53 CH3NO3
CH3NO3-->HCHO+HO2+NO2 11
flux -5.1241974332e-59 ropa -5.1241974332e-59
diff 0.0
-------------------------
6.37127736969e-15 rate
-9.29646782262e-49 CH4
2.32730113408e+13 OH
CH4+OH-->CH3O2 4
flux -1.3784691904e-49 ropa -1.3784691904e-49
diff -1.89911354915e-65
-------------------------
5.43779643334e-60 rate
-8.2406656508e-49 CH3O2
CH3O2-->HCHO 9
flux -4.48110622843e-108 ropa -4.48110622843e-108
diff 0.0

Checking the unformatted binary files from fortran.

Load zfortranread.py and call the readf90 function.

run zfortranread.py
df = asdf(file[1]) 
df.OH.plot()

Which mechanism? (provided you have named your mechanisms)

type ./model 0 0 --version