-
Notifications
You must be signed in to change notification settings - Fork 70
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from m-kreuzer/changes_moritz
Changes moritz
- Loading branch information
Showing
7 changed files
with
132 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from budyko_transport import BudykoTransport |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
from climlab.process.energy_budget import EnergyBudget | ||
from climlab.domain.field import global_mean | ||
|
||
|
||
class BudykoTransport(EnergyBudget): | ||
''' module which calculates the ebm heat transport as the difference | ||
between the local temperature and the global mean temperature. | ||
parameters: b - budyko transport parameter | ||
implemented by Moritz Kreuzer | ||
''' | ||
def __init__(self, b=3.81, **kwargs): | ||
super(BudykoTransport, self).__init__(**kwargs) | ||
self.b = b | ||
|
||
@property | ||
def b(self): | ||
return self._b | ||
@b.setter | ||
def b(self, value): | ||
self._b = value | ||
self.param['b'] = value | ||
|
||
def _compute_heating_rates(self): | ||
'''Compute energy flux convergences to get heating rates in W / m**2.''' | ||
for varname, value in self.state.iteritems(): | ||
self.heating_rate[varname] = - self.b * (value - global_mean(value)) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
from climlab import constants as const | ||
from climlab.process.energy_budget import EnergyBudget | ||
|
||
|
||
class Boltzmann(EnergyBudget): | ||
'''a radiation subprocess which computes longwave radiation | ||
with the Stefan-Boltzmann law for black/grey body radiation | ||
parameter: eps - emissivity | ||
tau - transmissivity | ||
implemented by Moritz Kreuzer | ||
''' | ||
def __init__(self, eps= 0.65, tau=0.95, **kwargs): | ||
super(Boltzmann, self).__init__(**kwargs) | ||
self.eps = eps | ||
self.tau = tau | ||
|
||
@property | ||
def eps(self): | ||
return self._eps | ||
@eps.setter | ||
def eps(self, value): | ||
self._eps = value | ||
self.param['eps'] = value | ||
|
||
@property | ||
def tau(self): | ||
return self._tau | ||
@tau.setter | ||
def tau(self, value): | ||
self._tau = value | ||
self.param['tau'] = value | ||
|
||
def emission(self): | ||
for varname, value in self.state.iteritems(): | ||
flux = self.eps * self.tau * const.sigma * (value + const.tempCtoK)**4. | ||
self.OLR = flux | ||
self.diagnostics['OLR'] = self.OLR | ||
|
||
def _compute_heating_rates(self): | ||
'''Compute energy flux convergences to get heating rates in W / m**2.''' | ||
self.emission() | ||
for varname, value in self.state.iteritems(): | ||
self.heating_rate[varname] = -self.OLR |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters