brian-rose / climatelaboratorybook Goto Github PK
View Code? Open in Web Editor NEWJupyterBook source for The Climate Laboratory
Home Page: https://brian-rose.github.io/ClimateLaboratoryBook
License: Other
JupyterBook source for The Climate Laboratory
Home Page: https://brian-rose.github.io/ClimateLaboratoryBook
License: Other
Several of the "advanced" chapters have redundant material that overlaps with the "regular" notes on that topic, e.g.
The overlaps are relics of the merging of the undergraduate and graduate versions of my lecture notes. Need to smooth out these rough edges.
It might be useful for readers and casual visitors to see where this document is headed, especially as there will be a lot of changes over the next few months.
Basically a map of what I expect the book to look like by the end of Spring 2020 semester.
Since the move to sphinx-based JupyterBook, seems that many figures are no longer rendering properly. Probably an incompatible image format issue.
A reader brought to my attention the fact that the abbreviation TOA (top of atmosphere) is first used in Chapter 7 but never defined.
Obviously I should define this term where it is first used, but maybe it would also be helpful to include a table of abbreviations in the Postamble.
Currently when you merge a PR it triggers a build-and-deploy action that overwrites the entire contents of the gh-pages
branch, which effectively deletes the previews not just of the merged PR but also any other previews that are currently open.
We need to preserve previews for open PRs and explicitly delete them upon merge.
I think the way to do the first part is to set keep_files: true
in the actions-gh-pages
step.
The second part... I already have code in place for this but can't really test it until we fix the first part.
As discussed in ProjectPythia/cmip6-cookbook#46, the link-checker is failing on all links to AGU journals following a change in their terms of use. The links themselves are fine but they don't play well with the sphinx link checker.
The workaround discussed at the above link is to always use the DOI link (which should be indefinitely persistent and thus not need checking) and then exclude the doi.org
pattern from the link-checker.
The book needs a nice-looking piece of cover art to greet readers on the landing page
It's currently pretty bleak.
I have some ideas about the graphics but I don't really have the skills to make it look good.
I tried to create a lot of content in this book that pulls from publicly available data, mostly via THREDDS servers. This has worked ok but does suffer from occasional outages. One example is climlab/climlab#177
Besides outages of THREDDS servers (including our own UAlbany-hosted server at http://thredds.atmos.albany.edu:8080/thredds/catalog.html), a bigger problem for interactive classroom use is the fact that THREDDS doesn't scale well to multiple simultaneous users.
A better alternative is cloud-native datasets served via public cloud storage buckets, or "Analysis-Ready, Cloud Optimized" (ARCO) data. A nice example of using ARCO-formatted ERA5 data is this Project Pythia Cookbook
The Binder links work fine, except for a fatal flaw. If we try to
import climlab
the Binder kernel hangs forever.
So the Binder links are effectively useless since we import climlab in almost every notebook.
Will use my recent courses as roadmaps here.
What's the optimal way to track citations of the book? I'm not sure.
It would be easy to attach DOIs to specific tagged releases. But these DOIs would point to the source repository, not to the book itself.
Need to look around to see how other people are handling this.
This may take a while to clean up. The notebooks have a number of broken "internal" links to other notebooks -- a legacy of the old structure in the ClimateModeling_courseware
repository.
Obviously I need to either get rid of the links or update them so they point to something.
Currently I have
number_equations: true
in the _config.yml
file, so every equation is automatically numbered in each notebook. This is nice, but the text doesn't actually make any use of the numbers.
From the JupyterBook docs, it's possible to use latex-style labels to refer and link to equations.
Adding references and links to numbered equations will improve the text in many places.
Same problem as described in brian-rose/ClimateModeling_courseware#8
The book has a References section that has just said "under construction" since the beginning.
JupyterBook docs for adding references and citations is here. I should probably get moving on this.
Hello,
I have just installed climlab on Google Colab with no errors. However, upon import, I receive the following warnings:
/usr/local/lib/python3.9/dist-packages/climlab/radiation/cam3.py:46: UserWarning: Cannot import and initialize compiled Fortran extension, CAM3 module will not be functional.
warnings.warn('Cannot import and initialize compiled Fortran extension, CAM3 module will not be functional.')
/usr/local/lib/python3.9/dist-packages/climlab/radiation/rrtm/rrtmg_lw.py:19: UserWarning: Cannot import and initialize compiled Fortran extension, RRTMG_LW module will not be functional.
warnings.warn('Cannot import and initialize compiled Fortran extension, RRTMG_LW module will not be functional.')
/usr/local/lib/python3.9/dist-packages/climlab/radiation/rrtm/rrtmg_sw.py:19: UserWarning: Cannot import and initialize compiled Fortran extension, RRTMG_SW module will not be functional.
warnings.warn('Cannot import and initialize compiled Fortran extension, RRTMG_SW module will not be functional.')
/usr/local/lib/python3.9/dist-packages/climlab/convection/emanuel_convection.py:14: UserWarning: Cannot import EmanuelConvection fortran extension, this module will not be functional.
warnings.warn('Cannot import EmanuelConvection fortran extension, this module will not be functional.')
Initializing a model is fine, but when I try to run the model forward in time I get the following error:
NameError Traceback (most recent call last)
[<ipython-input-14-b960f8fe0eca>](https://773tncaih8g-496ff2e9c6d22116-0-colab.googleusercontent.com/outputframe.html?vrz=colab-20230322-060151-RC00_518525591#) in <module>
----> 1 radmodel.step_forward()
6 frames
[/usr/local/lib/python3.9/dist-packages/climlab/process/time_dependent_process.py](https://773tncaih8g-496ff2e9c6d22116-0-colab.googleusercontent.com/outputframe.html?vrz=colab-20230322-060151-RC00_518525591#) in step_forward(self)
331
332 """
--> 333 tenddict = self.compute()
334 # Total tendency is applied as an explicit forward timestep
335 # (already accounting properly for order of operations in compute() )
[/usr/local/lib/python3.9/dist-packages/climlab/process/time_dependent_process.py](https://773tncaih8g-496ff2e9c6d22116-0-colab.googleusercontent.com/outputframe.html?vrz=colab-20230322-060151-RC00_518525591#) in compute(self)
211 tendencies = {}
212 ignored = self._compute_type('diagnostic')
--> 213 tendencies['explicit'] = self._compute_type('explicit')
214 # Tendencies due to implicit and adjustment processes need to be
215 # calculated from a state that is already adjusted after explicit stuff
[/usr/local/lib/python3.9/dist-packages/climlab/process/time_dependent_process.py](https://773tncaih8g-496ff2e9c6d22116-0-colab.googleusercontent.com/outputframe.html?vrz=colab-20230322-060151-RC00_518525591#) in _compute_type(self, proctype)
259 if self.time['steps'] % step_ratio == 0:
260 proc.time['active_now'] = True
--> 261 tenddict = proc.compute()
262 else:
263 # proc.tendencies is unchanged from last subprocess timestep if we didn't recompute it above
[/usr/local/lib/python3.9/dist-packages/climlab/process/time_dependent_process.py](https://773tncaih8g-496ff2e9c6d22116-0-colab.googleusercontent.com/outputframe.html?vrz=colab-20230322-060151-RC00_518525591#) in compute(self)
233 self.tendencies[varname] += tend
234 # Finally compute my own tendencies, if any
--> 235 self_tend = self._compute()
236 # Adjustment processes _compute method returns absolute adjustment
237 # Needs to be converted to rate of change
[/usr/local/lib/python3.9/dist-packages/climlab/process/energy_budget.py](https://773tncaih8g-496ff2e9c6d22116-0-colab.googleusercontent.com/outputframe.html?vrz=colab-20230322-060151-RC00_518525591#) in _compute(self)
70
71 def _compute(self):
---> 72 tendencies = self._temperature_tendencies()
73 return tendencies
74
[/usr/local/lib/python3.9/dist-packages/climlab/process/energy_budget.py](https://773tncaih8g-496ff2e9c6d22116-0-colab.googleusercontent.com/outputframe.html?vrz=colab-20230322-060151-RC00_518525591#) in _temperature_tendencies(self)
58
59 def _temperature_tendencies(self):
---> 60 self._compute_heating_rates()
61 tendencies = {}
62 for varname, value in self.state.items():
[/usr/local/lib/python3.9/dist-packages/climlab/radiation/rrtm/rrtmg_sw.py](https://773tncaih8g-496ff2e9c6d22116-0-colab.googleusercontent.com/outputframe.html?vrz=colab-20230322-060151-RC00_518525591#) in _compute_heating_rates(self)
206 # Call the Monte Carlo Independent Column Approximation (McICA, Pincus et al., JC, 2003)
207 (cldfmcl, ciwpmcl, clwpmcl, reicmcl, relqmcl, taucmcl,
--> 208 ssacmcl, asmcmcl, fsfcmcl) = _rrtmg_sw.climlab_mcica_subcol_sw(
209 ncol, nlay, icld, permuteseed, irng, play,
210 cldfrac, ciwp, clwp, reic, relq, tauc, ssac, asmc, fsfc)
NameError: name '_rrtmg_sw' is not defined```
This seems similar to another issue still open here with regards to binder.
Are there any workarounds? Thank you kindly.
One of the nice features of JupyterBook is the ability to hide cells in the rendered html, but provide a button to reveal if the user wants to see it:
https://jupyterbook.org/features/hiding.html
This is exactly the right feature to make some of the more "narrative" parts of my notes easier to read while preserving the full reproducibility.
Need to go through and implement this in lots of places (and mostly include a brief tutorial on it in the preamble).
In some notes we use the matplotlib animation toolkit to render animations directly into html.
These usually show up too wide for the page, e.g. here:
https://brian-rose.github.io/ClimateLaboratoryBook/courseware/seasonal-cycle.html#making-an-animation-of-the-ebm-solutions
Can we render these better so that the animation resizes itself to the current page width?
Basically just pointing users to the GitHub repository and issue tracker, with invitations to submit error, omissions, etc.
Some kind of failure of the cftime
indexing:
https://brian-rose.github.io/ClimateLaboratoryBook/courseware/introducing-cesm.html#exercise-plotting-a-global-average-timeseries
ValueError: invalid year provided in cftime.datetime(0, 1, 1, 0, 0, 0, 0, calendar='gregorian')
In the Orbital notes there are two different methods used to create arrays of days of the year:
days = np.linspace(0, const.days_per_year, 365)
and
days = np.linspace(1.,num,365)/num * const.days_per_year
The second version evenly samples the annual cycle while the first version double-counts day=0. Second version is better, particularly when we’re averaging over the array to take time averages. Make it consistent across the chapter.
Maps like these have an ugly white stripe at the Greenwich meridian.
There's an easy cartopy fix for this. Fix it.
Seems the path to the images from AMS publications has changed. Fixing is difficult since it's very hard to build the book from source anymore.
Need to finish #14 asap.
Climlab source has moved to https://github.com/climlab/climlab. Need to update links in the book and its README
The jupyter-book toolset has migrated away from Jekyll and now uses Sphinx as the static site generator. I can't build the book with the current version jupyter-book (0.8.3).
Looks like the most recent version of jupyter-book that will build this source is 0.6.5 (released April 28 2020)
pip install jupyter-book==0.6.5
On this section of the Seasonal Cycle notes I found a missing link to the Insolation notes, showing up as unrendered markdown:
[Insolation notes](Lecture11 – Insolation.ipynb)
This point was raised over email by @adriantompkins. The sign conventions for feedback parameters are not as consistent across all notes as they could be. And in some notebooks \lambda_0 is defined positive for a negative feedback while other feedbacks are defined positive for positive.
Need to go through and ensure consistency.
The short-term goal is for students to be able to click on the JupyterHub "interact" buttons and launch a fully functional session on our server.
This is supposed to be powered behind the scenes with nbgitpuller, which will issue silent git commands to keep the students' local copies of the notebooks up to date.
It's not working yet. Once logged into the JupyterHub, clicking on one of the links gives you a
404 : Not Found
error from the JupyterHub.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.