Menu

Answer to Homework

Maarten Krol

self.Emission = em(read_optim_emis, optim_emis_filename)

Answer:

We found out that em points to an object defined in Emissions.py. Now if you write
em(args) you refer to a method called __call__. However, this method is not in the file
Emissions.py. You can find it in Emissions_base.py and the functionality in that file is inherited by the class dummy_Emissions:

from Emissions_base import Emissions

class dummy_Emissions(Emissions):
....

Indeed we find the method __call__:

    def __call__(self, read_optim_emis=False, optim_emis_filename=None):
        if read_optim_emis:
            self.readEmission(optim_emis_filename)
        else:
            self.LoopThroughPeriods()
        self.WriteEmissions()
        return self.Emission

Note that we do not use the possibility to read optimized emissions (read_optim_emis=False in the call).
The call self.LoopThrough_Periods() points to a method in Emissions.py and calculates the emissions. WriteEmisssions() is a method in Emissions_base.py and writes the emissions in a file for use by TM5. The output of the python script looks like:

[krol@int1 tm5-code-0]$ ./scripts/run_fwd.py --emis -s 2000,1,1 -e 2000,1,2 rc/nam1x1-dummy_tr.rc
glb600x400 monthly
Total Emissions 0 glb600x400 0.127288336137  Tg
glb600x400 weekly
Total Emissions 0 glb600x400 0.0370188662559  Tg
nam300x200 monthly
Total Emissions 0 nam300x200 0.0188976316725  Tg
nam300x200 weekly
Total Emissions 0 nam300x200 0.00812735318266  Tg
nam300x200 three-daily
Total Emissions 0 nam300x200 0.0436728446388  Tg
nam100x100 three-daily
Total Emissions 0 nam100x100 0.0466092317889  Tg
nam100x100 rest
Total Emissions 0 nam100x100 0.00524134801962  Tg
glb600x400 monthly monthly   Optimize?: 0 (1, 45, 60)
glb600x400 weekly daily+7   Optimize?: 1 (1, 45, 60)
nam300x200 monthly monthly   Optimize?: 0 (1, 36, 38)
nam300x200 weekly daily+7   Optimize?: 1 (1, 36, 38)
nam300x200 three-daily daily+3   Optimize?: 1 (1, 36, 38)
nam100x100 three-daily daily+3   Optimize?: 1 (1, 44, 72)
nam100x100 rest daily+7   Optimize?: 0 (1, 44, 72)
========================================
Caterogy marked for optimization: ('weekly', '  500.0-e ', ' 3.0-e-daily+7 ')
----->region: glb600x400 error: 100.0
----->region: nam300x200 error: 100.0
========================================
========================================
Caterogy marked for optimization: ('three-daily', '  200.0-e ', ' 0.5-e-daily+3 ')
----->region: nam300x200 error: 50.0
----->region: nam100x100 error: 50.0
========================================
========================================
end info parsed from emission routine
========================================

This output summarizes

  1. The emissions classes
    • monthly
    • weekly
    • three-daily
    • rest
  2. The regions on which these emissions are added
    • glb600x400: monhtly / weekly
    • nam300x200: monthly / weekly /three-daily
    • nam100x100: three-daily / rest
  3. The timescale on which the emission vary:
    • global: monthly
    • weekly: daily+7
    • three-daily: daily+3
    • rest: daily+7
  4. Whether the emissions are optimized or not
  5. The dimension of the emission array (depends on run-time)
  6. A summary of the emissions that are optimized
    • name
    • regions on which they will be optimized
    • the error setting
      • spatial correlation length
      • temporal correlation length
      • the grid-scale error (%)

The emissions are written to file by python. They will be read by TM5.
The TM5 forward run will be discussed next
[TM5 forward run]


Related

Wiki: Home
Wiki: SetupEmissions
Wiki: TM5 forward run

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.