Coder Social home page Coder Social logo

sdat2 / seager19 Goto Github PK

View Code? Open in Web Editor NEW
6.0 2.0 0.0 219.03 MB

Replication of Seager et al. (2019) Nat. Clim. Chan. They used a simple-as-possible coupled model to explain the bias in the nino3.4 trend in climate models (CMIP5). This repository replicates/reproduces their work, shows that it also applies to CMIP6, and varies some of the parameters.

Home Page: https://seager19.readthedocs.io/

License: MIT License

Jupyter Notebook 94.28% Python 2.72% Makefile 0.05% C 0.74% Fortran 1.77% Shell 0.02% Dockerfile 0.02% Pascal 0.41%
nature-climate-change pacific ocean-model atmosphere-model coupled-model tropics ocean-sciences climate-change-impacts

seager19's Introduction

seager19

Binder License: MIT Code style: black Python 3.8 Documentation Status Build Status Coverage Status python fort-c DOI

Model run results: https://wandb.ai/sdat2/seager19

Docker image for gfortran/gcc/cdf/conda: https://hub.docker.com/repository/docker/sdat2/seager19

Coupling over iterations with c_d=2.25e-3 over the Pacific with the land masked out in green

Purpose

A repository to contain, analyze, and expand upon the model from:

Seager et al. 2019, Nature Climate Change, Strengthening Tropical Pacific Zonal Sea Surface Temperature Gradient Consistent with Rising Greenhouse Gases

https://doi.org/10.1038/s41558-019-0505-x

Summary of their paper

  • There is a west-east warm-to-cold contrast in the Pacific.

  • State-of-the-art GCMs predict weakening contrast with GHG concentration.

  • In observations, it has increased.

  • Their simple linear equatorial coupled model agrees with observations when forced with ECMWF reanalysis product.

  • When forced with CMIP5 ensemble relative humidity and windspeed their model can reproduce the bias, highlighting these fields as the mechanism through which it is created.

Citation

The citation for their paper is:

@article{seager2019strengthening,
  title={Strengthening tropical Pacific zonal sea surface temperature gradient consistent with rising greenhouse gases},
  author={Seager, Richard and Cane, Mark and Henderson, Naomi and Lee, Dong-Eun and Abernathey, Ryan and Zhang, Honghai},
  journal={Nature Climate Change},
  volume={9},
  number={7},
  pages={517--522},
  year={2019},
  url={https://doi.org/10.1038/s41558-019-0505-x},
  publisher={Nature Publishing Group}
}

Podcast

The paper is discussed in a podcast available at Deep Convection Season 1 Episode 5:

Deep Convection: Season 1 Episode 5

Specifically the time period 33:00-44:30.

Code

The code and data were taken from a Columbia University website:

This website is blocked from some IP addresses, such as the Cambridge VPN (probably my fault), and so you may need to try a different connection method if it doesn't load.

Setup

Get the Github repository

    git clone https://github.com/sdat2/seager19.git

    cd seager19

If you have root access and can install Linux packages

    # Enforcing these versions is necessary to be able to use 70s fortran.
    # If you would rather not change your version, you might be better off
    # Using the docker image instead.

    sudo apt-get install gfortran-4.8

    sudo apt-get install gcc-4.8

    sudo apt-get install --fix-missing libnetcdf-dev libnetcdff-dev

    sudo apt-get install cloc  # brew install cloc for mac

If you want to make the docker environment yourself

    docker build . -t sdat2/seager19:g4.8

    docker push sdat2/seager19:g4.8

If you need to install the singularity environment

    
    # on jasmin you would need to make a new tmp directory in your home directory
    # to be able to install the quite large singularity environment e.g:

    mkdir /home/users/sithom/tmp

    # and then call the command to create the singularity object

    TMPDIR=/home/users/sithom/tmp SINGULARITY_CACHEDIR=/home/users/sithom/tmp singularity pull docker://sdat2/seager19:g4.8

    # and then to launch the envirnonment

    singularity run seager19_g4.8.sif

Making the environment and testing it works (either in singularity or not)

    # in case conda isn't activated:

    conda init bash

    source ~/.bash_profile

    # activate the environment

    conda activate ./env/

    # test that the environment and package work before using:

    make test        # Also downloads the data if needed.

Add optional features

    make jupyter_pro  # adds timing etc.

    make vscode_pro  # sets up nice autodoc, pylint etc.

    make jupyter_dark  # dark mode for jupyter notebooks

    # and to reverse this:

    make jupyter_light

Examples of running the model

    # default run:

    python src/main.py name=cd_2.25 coup.c_d=2.25e-3

    # Sweep through different levels of Raleigh friction

    # values near the value in the paper
    python src/main.py atm.eps_days=1.05,0.95,0.85,0.75,0.65,0.55 -m

    python src/main.py atm.eps_days=1.7,1.8,1.85 -m 

    python src/main.py atm.eps_days=0.7,0.8 -m 


    # values from other papers quoted in the introduction to Romps (2014) "Raleigh Damping in the Free Troposphere"
    python src/main.py atm.eps_days=1.25,1.8,2,2.5,3,5,10 -m

    python src/main.py atm.eps_days=2.1,1.75,1.9 -m

    # Seager91, Matsuno66, Yu97, Gill80, Chang82, Sugiyama09, Wu00
    # breaks at 5, 10: Sugiyama09, Wu00. Breaks through tau.
    # looks pretty strange at 3: Chang82.

    python src/main.py atm.k_days=7,8,9,10 -m

    # uncoupled run without syncing:
    python src/main.py name=it_1 coup.iterations=1 coup.c_d=2.25e-3 wandb=false

To look at the commands to relicate the paper figures, see replicate.md.

Other handy commands for development of repo

Make a notebook with helpful magic functions for dark mode

    make notebook name=your-notebook-name

New python script

    make py name=src/to-new.py

Update docs of the src directory

    make autodoc

Check where a variable is referenced in the ocean model

   grep -R "f1prime" ocean/SRC

Get CMIP5 multimodel means from Columbia

http://kage.ldeo.columbia.edu:81/SOURCES/.LDEO/.ClimateGroup/.PROJECTS/.IPCC/.CMIP5/.MultiModelMeans/.MMM-v2.3/.historical/.Surface/data.cdf

http://kage.ldeo.columbia.edu:81/SOURCES/.LDEO/.ClimateGroup/.PROJECTS/.IPCC/.CMIP5/.MultiModelMeans/.MMM-v2.3/.rcp85/.Surface/data.cdf

CMIP6/CMIP5 bias mechanism data

https://docs.google.com/spreadsheets/d/1QrCLil7uHMRJECOoSL18uk2mvBwMLxqesXbZpUWh3ko/edit?usp=sharing

seager19's People

Contributors

dependabot[bot] avatar sdat2 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

seager19's Issues

Re-code ocean model in pure python

The model will be much easier to use if it were written in python. To deal with Python slowness, I will need to try and use numba and/or xarray. Ideally xarray should be used as much as possible, as it is very popular in the field. pint and pint-xarray could be used so that unit are propagated alongside values, as this is a form of error correction.

  • Calculate baroclinic mode and baroclinic modes.
  • Simulate thermocline with baroclinic modes alone.
  • Add INC (Israeli, Naik, Cane) integration scheme.
  • with the calculation of upwelling.
  • Add Ekman mode and test if the result sensibly propagates wind stress.
  • Add full temperature propagation.
  • Add surface fluxes.
  • Add geometry to allow land blocks to be added.
  • Add more physical tests.
  • Make sure units propagate through the whole model by default (if this does not significantly negatively impact the model).
  • [Once thoroughly tested] Add python model as pip package.

Questions to answer:

  • Does a realistic coupling period affect the long term trends?
  • Does a realistic coupling period produce reasonable magnitudes for ENSO.
  • Does the integration scheme affect the results?
  • Can the python model be made to have similar computational efficiency to the Fortran model?

Thorough sensitivity analysis varying as many param as possible

It would be great to conduct an automated experiment to explore the parameter space.

  • Experiment with emulkit.
  • Calculate weighted distance along the data between the model and the reanalysis for the reanalysis inputs.
  • Optimise to minimise this distance.

Hypothesis: There exists a set of parameters that could reproduce the same results for nino3.4 (i.e. the solution is not unique)
H0: The model only has one set of parameters that could reasonably reproduce the model results.

Hypothesis: A different set of parameters from a reasonable range could more closely fit the observed data over the whole tropical Pacific.
H0: The model is tuned to the best set of parameters to replicate the behaviour of the tropical Pacific.

Advanced documentation / clean-up

  • Fix issue with documentation not compiling.
  • Add a related work section to keep track of all of the different papers using a similar model.
  • Delete as many files as possible.
  • Add formulae to doc-strings.
  • Add bibtex citations to docstrings.
  • Add documentation page describing model in a simple way.
  • Write a full-as-possible derivation of the model.
  • Create youtube video to go through model.

Do the tropical cyclone genesis indices track this bias in nino3.4 as we would expect? I.e does the bias propagate into hazards with which there are teleconnections?

  • Calculate tropical cyclone indices on reanalysis, and try and find comparable results to check it has been correctly coded.
  • See if we can replicate the results from Carmargo Emanuel and Sobel, 2007 that there is a link with sheer.
  • Calculate on CMIP6 ensemble members in the most efficient manner.
  • Do the biases in CMIP6 ensemble members influence their trend in tropical cyclone genesis indices?

Some initial paper suggestions from Prof. Dan Chavas (Purdue University)

Question: Do the tropical cyclone genesis indices track this bias in nino3.4?
Hypothesis: The trend in the tropical cyclone genesis indices corresponds to that which would have been expected given the trend in nino3.4 and is statistically significant, and robust to the start year of the trend.
H0: There is no significant trend in the tropical cyclone genesis indices over the North Atlantic.

@article{camargo2016tropical,
  title={Tropical cyclones in climate models},
  author={Camargo, Suzana J and Wing, Allison A},
  journal={Wiley Interdisciplinary Reviews: Climate Change},
  volume={7},
  number={2},
  pages={211--237},
  year={2016},
  publisher={Wiley Online Library}
}

@article{camargo2007use,
  title={Use of a genesis potential index to diagnose ENSO effects on tropical cyclone genesis},
  author={Camargo, Suzana J and Emanuel, Kerry A and Sobel, Adam H},
  journal={Journal of Climate},
  volume={20},
  number={19},
  pages={4819--4834},
  year={2007}
}

@article{hoogewind2020exploring,
  title={Exploring controls on tropical cyclone count through the geography of environmental favorability},
  author={Hoogewind, Kimberly A and Chavas, Daniel R and Schenkel, Benjamin A and O’Neill, Morgan E},
  journal={Journal of Climate},
  volume={33},
  number={5},
  pages={1725--1745},
  year={2020},
  publisher={American Meteorological Society}
}

@article{tang2012ventilation,
  title={A ventilation index for tropical cyclones},
  author={Tang, Brian and Emanuel, Kerry},
  journal={Bulletin of the American Meteorological Society},
  volume={93},
  number={12},
  pages={1901--1912},
  year={2012},
  publisher={American Meteorological Society}
}

@article{camargo2014testing,
  title={Testing the performance of tropical cyclone genesis indices in future climates using the HiRAM model},
  author={Camargo, Suzana J and Tippett, Michael K and Sobel, Adam H and Vecchi, Gabriel A and Zhao, Ming},
  journal={Journal of Climate},
  volume={27},
  number={24},
  pages={9171--9196},
  year={2014}
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.