sdat2 / seager19

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.
https://seager19.readthedocs.io/
MIT License
6 stars 0 forks source link
atmosphere-model climate-change-impacts coupled-model nature-climate-change ocean-model ocean-sciences pacific tropics

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

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:

<img src='https://deep-convection.org/wp-content/uploads/2020/02/DC_logo_small_rectangular.png' alt='Deep Convection: Season 1 Episode 5' width='150' />

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

Code

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

<img src='https://worldsummit.ai/wp-content/uploads/sites/4/2020/06/columbia-university-logo-png-columbia-university-crown.jpg', width='150'>

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