{ "cells": [ { "cell_type": "markdown", "id": "5f02ac0c", "metadata": {}, "source": [ "# Convert DEPHY forcing to UCLALES-SALSA forcing\n", "\n", "Based on the example by Tim Juliano from NCAR (last updated on 12/1/23)\n" ] }, { "cell_type": "markdown", "id": "8164704b", "metadata": {}, "source": [ "### Import libraries" ] }, { "cell_type": "code", "execution_count": 1, "id": "b6e2c74e", "metadata": { "tags": [] }, "outputs": [], "source": [ "import numpy as np\n", "import pandas as pd\n", "import xarray as xr\n", "from netCDF4 import Dataset\n", "import os\n", "import datetime as dt" ] }, { "cell_type": "markdown", "id": "e68367d4-8f12-4f95-aeef-87f036044975", "metadata": { "tags": [] }, "source": [ "## Specify local write directory\n", "\n", "If on the ARM JupyterHub, it is recommended to create and specify a local directory that is outside of the COMBLE-MIP repository to write input files in your model's format\n", "\n", "If on the ARM JupyterHub, these files can be conveniently downloaded to your local machine and will remain when you log out" ] }, { "cell_type": "code", "execution_count": 6, "id": "1d3ba6b7-b104-41ec-83a5-dd0f7a331e3a", "metadata": { "tags": [] }, "outputs": [], "source": [ "my_write_dir = '../../../inputs/'" ] }, { "cell_type": "markdown", "id": "e495d40a-bcec-4a67-812d-88ff33d51f3e", "metadata": { "tags": [] }, "source": [ "## Read the COMBLE-MIP forcing file\n" ] }, { "cell_type": "code", "execution_count": 7, "id": "1190a330-4b1d-4b69-a2db-3cadc1712b26", "metadata": { "tags": [] }, "outputs": [ { "data": { "text/html": [ "
<xarray.Dataset>\n", "Dimensions: (time: 21, lev: 136, zw_grid: 160)\n", "Coordinates:\n", " t0 datetime64[ns] 2020-03-12T22:00:00\n", " lat float32 74.5\n", " lon float32 9.9\n", " * time (time) datetime64[ns] 2020-03-12T22:00:00 ... 2020-03-13T1...\n", " * lev (lev) float64 18.17 37.83 59.35 ... 6.851e+04 7.117e+04\n", " * zw_grid (zw_grid) float64 0.0 20.0 45.0 ... 6.89e+03 6.95e+03 7e+03\n", "Data variables: (12/19)\n", " pressure (lev) float64 ...\n", " u (lev) float64 ...\n", " v (lev) float64 ...\n", " temp (lev) float64 ...\n", " theta (lev) float64 ...\n", " qv (lev) float64 ...\n", " ... ...\n", " theta_nudging (time, lev) float64 ...\n", " qv_nudging (time, lev) float64 ...\n", " w_nudging (time, lev) float64 ...\n", " ts (time) float64 ...\n", " lat_ref (time) float32 ...\n", " lon_ref (time) float32 ...\n", "Attributes: (12/30)\n", " title: Forcing and initial conditions for 13 Mar...\n", " reference: https://arm-development.github.io/comble-...\n", " authors: Timothy W. Juliano (NCAR/RAL, tjuliano@uc...\n", " version: Created on 2024-01-24\n", " format_version: DEPHY SCM format version 2.0\n", " script: create_comble_forcing_v2.4.ipynb\n", " ... ...\n", " lat: 74.5 deg N\n", " droplet_activation_diagnostic: droplet number concentration fixed to 20 ...\n", " ice_nucleation_diagnostic: total ice number concentration fixed to 2...\n", " droplet_activation_prognostic: time and space varying aerosol initialize...\n", " aerosol_surface_source: modal emissions based on Jaegle et al. (2...\n", " ice_nucleation_prognostic: assume that all sea spray mode and half o...