-
Notifications
You must be signed in to change notification settings - Fork 46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
solar constant #19
Comments
Hello @SallyDa, I'm glad that you find this useful! Sorry for the change in API, but climt is under heavy You could use the new API to change the solar constant easily: climt/examples/full_radiation_gcm_energy_balanced.py Lines 45 to 46 in 0d87717
You should add this line before any components are created. This is a little longer than the previous API. But the advantage is that all components which use Also, since we intend climt to be more general in the future, we use the name |
Oh my gosh @JoyMonteiro Joy we need a cleaner, simpler API than that, and it should be accessible from Sympl also. Perhaps something like In general though @SallyDa, we're hoping the new way of having the constants set on the CliMT/Sympl level instead of as keyword arguments to each component should prevent users from writing code that has strange bugs that are hard to identify (by resulting in different components using different constants). It should also be just as easy, or easier, to set the constants (since you only have to do it once, and not for each component). |
Yes, that is kind of unwieldy!! I think it should be easy to add a |
OK, I've done it on the Sympl level in the current master. @SallyDa, you could either get the latest master and modify it there, or you can use a line like |
Also @JoyMonteiro, the function you have right now should probably be called If you want to do "modify_constant" instead of "set_constant", you should check the constant is in the default_constants dict when you wrap the Sympl function. |
@SallyDa just to clarify, with the latest master of sympl, you can do @mcgibbon, I think for now I will import set_constant into climt, and your name suggestions |
Great, thank you both :) |
Glad to be of help! If you think this solves your concern, I will close the issue. |
Hey, Thanks. It's updating the dictionary, but in the place I am using it, it is still not taking the updated value. I think the problem is in the following lines: climt/climt/_components/rrtmg/sw/component.py Lines 295 to 299 in cb779b5
And I think it should be: if use_internal_solar_constant:
self._solar_const = get_constant(
'stellar_irradiance')
else:
self._solar_const = 0 But the doc strings for |
Yes, the name I used for the argument is confusing; and the behaviour of the component is also confusing. I have fixed both in the latest commit. I think it should work now as you expect! let me know. |
Okay that makes sense, and it's working now as I wanted. Thanks for all the help :) |
Great! Closing. |
Hi,
I am working on a simple model using RRTMG thanks to the nice python wrapper you have written :) I would like to use it with a constant solar constant (no variability), but a different value to the standard one. I am currently using CliMT version 0.9.1 and have achieved this by changing the value in the init of the RRTMGShortwave class. I notice you have changed this in the development version of CliMT.
Please could you make a more user friendly way of changing this value? The aim is to make our model easy for other people to use, so that they run our model with CliMT installed but without needing to edit it.
Thanks,
Sally
The text was updated successfully, but these errors were encountered: