BUGSrad: Radiative Transfer with Gases & Clouds



Atmospheric Scenario


Gases


Water Cloud


Ice Cloud

Vertical Profiles: Control & Perturbation Runs

Control Atmosphere:

Vertical Profile

Control Global Properties


Modified Atmosphere:

Vertical Profile

Modified Global Properties

Control Atmosphere:

Net (Downward) Radiative Fluxes

Control Heating Rates


Modified Atmosphere:

Net (Downward) Radiative Fluxes

Modified Heating Rates

MODEL DESCRIPTION

Basic Overview of the Project

In this project, you will use a simple “off-the-shelf” broadband radiation code developed at CSU to calculate shortwave (SW) and longwave (LW) fluxes and heating rates for model atmospheric profiles. In doing so, you will:

  • Gain understanding of what flux & heating rate profiles look like.

  • Explore how these flux & heating rates change due to changes in atmospheric consituents, such as changes in the gas amounts (water vapor, co2, ozone) and in clouds.

For more information about the underlying physics and numerics of the radiative transfer model, please see:

  • Fu, Q., and K-N. Liou, 1992: On the correlated k-distribution method for radiative transfer in nonhomogeneous atmospheres. J. Atmos. Sci, 49, 2139–2156.

  • Stephens, G  L., P  M. Gabriel, and P  T. Partain, 2001: Parameterization of atmospheric radiative transfer. Part I: Validity of simple models. J. Atmos. Sci., 58, 3391–3409.

A doubling of CO2 is expected to increase downwelling forcing at 200 mbar by about 5.3 W/m2. See e.g.

  • Collins, W. D., et al. “Radiative forcing by well‐mixed greenhouse gases: Estimates from climate models in the Intergovernmental Panel on Climate Change (IPCC) Fourth Assessment Report (AR4).” Journal of Geophysical Research: Atmospheres 111.D14 (2006).

There is currently some argument above what the global mean downwelling longwave flux is at the surface. Part of this argument stems from uncertainties in cloud measurements. See:

  • Stephens, Graeme L., et al. “The global character of the flux of downward longwave radiation.” Journal of Climate 25.7 (2012): 2329-2340.

The program that controls this website is surprisingly simple! It is all written in the programming language R. You can read all about it on the “Website Code” tab to the right.

How this website works (including all the code!)

This website is controlled using the R package “shiny.” There are three important components:

  • The user interface (ui.R) that controls the sliders and passes inputs to the model
  • The “server” (server.R) that responds to user interface events in the web browser
  • A fortran program (BUGSrad) that performs the broadband radiative transfer calculations

Scroll down or click links in the list above to read all about it!


This is the user interface that actually controls this website

ui.R:

library(shiny)
library(markdown)

# Define user interface for atmospheric radiative transfer model
shinyUI(pageWithSidebar(

  #  Application title
  headerPanel("BUGSrad: Radiative Transfer with Gases & Clouds"),

  # Sidebar on the left with controls for the user to specify atmospheric properties
  sidebarPanel(

    br(),
    # Decide whether to plot with log of pressure for vertical coordinate
    checkboxInput('logp', 'Plot log(pressure)', value = FALSE),

    br(),
    # Choose a baseline atmospheric profile for the control run
    h4('Atmospheric Scenario'),            
    selectInput("atmosphere", "McClatchey Profile:",
                list("Tropical" = "tropical", 
                     "Subarctic Winter" = "subarctic_winter")
                     ),
    br(),
    # Vary concentrations of absorbing gases for perturbation run
    h4('Gases'),            
    sliderInput("CO2.ppm", "CO2 (ppm)", 
                min = 1, max = 2000, value = 380, step= 1),
    sliderInput("vapor.mult", "water vapor (multiple of baseline)", 
                min = 0, max = 3, value = 1, step= 0.1),
    sliderInput("O3.mult", "Ozone (multiple of baseline)", 
                min = 0, max = 3, value = 1, step= 0.1),

    br(),
    # Add liquid water clouds: base, top, mixing ratio, and cloud fraction
    h4('Water Cloud'),            
    sliderInput("water.cloud", "Water Cloud Base and Top (mb)", 
                min = 200, max = 900, value = c(700,900), step= 50),
    sliderInput("cloud.liq.mix", "Water Mixing Ratio (g/kg)", 
                min = 0, max = 2, value = 0, step= .01),
    sliderInput("cloud.liq.fraction", "Water cloud fraction (0 to 100%)", 
                min = 0, max = 100, value = 0, step= 1),

    br(),
    # Add ice clouds: base, top, mixing ratio, and cloud fraction
    h4('Ice Cloud'),            
    sliderInput("ice.cloud", "Ice Cloud Base and Top (mb)", 
                min = 100, max = 700, value = c(200,300), step= 50),
    sliderInput("cloud.ice.mix", "Ice Mixing Ratio (g/kg)", 
                min = 0, max = 1, value = 0, step= 0.01),
    sliderInput("cloud.ice.fraction", "Ice cloud fraction (0 to 100%)", 
                min = 0, max = 100, value = 0, step=.01)  
  ),

  # Show a tabset in the main panel of the browser that displays model output
  mainPanel(
    tabsetPanel(

      # First tab shows plots of model output for both control and modified atmosphere
      tabPanel("Profile Plots", 
               h4('Vertical Profiles: Control & Perturbation Runs'), plotOutput('four.panel'),
               tags$style(type="text/css", ".tab-content { overflow: visible; }")), 

      # Second tab displays tables of model input
      tabPanel("Model Input", 
               h4('Control Atmosphere:'),
               h4('Vertical Profile'),
               tableOutput("control.profile"),
               h4('Control Global Properties'),
               tableOutput("control.global"),
               br(),
               h4('Modified Atmosphere:'),
               h4('Vertical Profile'),
               tableOutput("modified.profile"),
               h4('Modified Global Properties'),
               tableOutput("modified.global")
      ),

      # Third tab displays tables of model ouput
      tabPanel("Model Output", 
               h4('Control Atmosphere:'),
               h4('Net (Downward) Radiative Fluxes'),
               tableOutput("control.flux"),
               h4('Control Heating Rates'),
               tableOutput("control.rate"),
               br(),
               h4('Modified Atmosphere:'),
               h4('Net (Downward) Radiative Fluxes'),
               tableOutput("modified.flux"),
               h4('Modified Heating Rates'),
               tableOutput("modified.rate")
      ),

      # Fourth tab displays a brief model description
      tabPanel("Model Description", 
               includeMarkdown('doc/model.description.md'))
    )
  )
))

server.R:

library(shiny)

# Source required R scripts
source('model/run.BUGSrad.R')        
source('model/plot.output.R')        

shinyServer(function(input, output) {

  # Capture model input for later display
  model.input <- reactive({
    modelInput(input$atmosphere)
  })

  # Capture model output for later display
  model.output <- reactive({
    modelOutput(input$atmosphere)
  })

  # 4-panel plot of model output
  output$four.panel <- renderPlot(
      run.BUGSrad(CO2.ppm=input$CO2.ppm, O3.mult=input$O3.mult, 
                  vapor.mult=input$vapor.mult, logp=input$logp,
                  cloud.base.liq=input$water.cloud[2], 
                  cloud.top.liq=input$water.cloud[1], 
                  cloud.liq.mix=input$cloud.liq.mix,
                  cloud.liq.fraction=input$cloud.liq.fraction,
                  cloud.base.ice=input$ice.cloud[2], 
                  cloud.top.ice=input$ice.cloud[1], 
                  cloud.ice.mix=input$cloud.ice.mix,
                  cloud.ice.fraction=input$cloud.ice.fraction,
                  atmosphere=input$atmosphere), height=800, width=600)

  # Display model input:
  output$control.profile <- renderTable(model.input()$control.profile)
  output$control.global <- renderTable(model.input()$control.global)
  output$modified.profile <- renderTable(model.input()$modified.profile)
  output$modified.global <- renderTable(model.input()$modified.global)

  # Display model output:
  output$control.flux <- renderTable(model.output()$control.flux)
  output$control.rate <- renderTable(model.output()$control.rate)
  output$modified.flux <- renderTable(model.output()$modified.flux)
  output$modified.rate <- renderTable(model.output()$modified.rate)

})