Vertical Regridding in ExtData2G - GEOS-ESM/MAPL GitHub Wiki
Introduction
Starting at version x.y.z
(right now just in develop
branch) of MAPL ExtData will support vertical regridding of inputs in very specific cases. The details of this will be described in detail in this wiki page. Note that the file format was my best attempt following the CF conventions. Here are the relevant links to the specific sections:
Cell Boundaries for Hybrid Sigma Levels
Supported Use Cases
The first implementation supports regridding from one set of GEOS hybrid sigma levels (as defined in the input files) to another set of hybrid sigma levels (as defined by the model).
In addition this is only supported for quantities in the following units mol mol-1
, kg kg-1
, and kg m-2
. In addition all these can be be per second, I.E. kg m-2 s-1
or mol mol-1 s-1
. Note that the input files and the units in the GEOS fields being delivered to ExtData must agree.
Prerequisites
In order to enable vertical regridding, several conditions must be true.
ExtData Must Import PLE and Q
To regrid in the vertical ExtData needs the 3D edge pressures imported from dynamics. In addition volume mixing regridding requires the specific humidity from the moist component. To do this add the following to the CAP.rc
, NOTE, NO SPACES BEFORE OR AFTER THE COMMA:
EXTDATA_IMPORTS:
PLE,DYN
QV,MOIST
::
Enable Vertical Regridding
Next for each rule that you want to enable vertical regridding in you must add this to the rule:
enable_vertical_regrid: true
Files Must Have Proper Format
This is just that. The files must follow the conventions that will be laid out in the next section, but he short of it is the file must have the information needed to construct the time vary edge pressures which is PS,AK and BK.
File Format for Vertical Regridding
Note this is my best attempt to interpret the CF conventions. If this is too cumbersome it is not too late to change. Here is an example file.
Format for Hybrid Sigma Pressure Levels (What GEOS Uses)
dimensions:
lon = 180 ;
lat = 91 ;
lev = 72 ;
bnds = 2 ;
time = 1 ;
variables:
float lon(lon) ;
lon:long_name = "longitude" ;
lon:units = "degrees_east" ;
float lat(lat) ;
lat:long_name = "latitude" ;
lat:units = "degrees_north" ;
float lev(lev) ;
lev:long_name = "vertical level" ;
lev:units = "layer" ;
lev:positive = "down" ;
lev:coordinate = "eta" ;
lev:formula_terms = "ap: ak b: bk ps: PS" ;
lev:bounds = "lev_bnds" ;
lev:standard_name = "atmosphere_hybrid_sigma_pressure_coordinate" ;
float lev_bnds(lev, bnds) ;
lev_bnds:formula_terms = "ap: ak_bnds b: bk_bnds ps: PS" ;
float ak(lev, bnds) ;
float bk(lev, bnds) ;
float ak_bnds(lev, bnds) ;
float bk_bnds(lev, bnds) ;
float PS(time, lat, lon) ;
PS:_FillValue = 1.e+15f ;
PS:long_name = "surface_pressure" ;
PS:units = "Pa" ;
PS:missing_value = 1.e+15f ;
PS:fmissing_value = 1.e+15f ;
PS:scale_factor = 1.f ;
PS:add_offset = 0.f ;
PS:standard_name = "surface_pressure" ;
PS:vmin = -1.e+15f ;
PS:vmax = 1.e+15f ;
Let's analyze this file.
First let's discuss the lev
dimension. The standard_name
of the lev
variable is what tells us this is the hybrid sigma model levels. The formula_terms
define what variables are used to compute the 3D pressures. Finally the bounds
define how you compute the edges.
So, in this example is says surface pressure is a variable named PS
which is the time dependent surface pressure.
Next let's discuss the AK and BKs. Now we normally say that if we have 72 "levels" (I will refer to this number as nlev
) we have 73 AK and 73 BK that with PS define the edge pressure. I will call the AK and BK we think of in GEOS as AK_GEOS
and BK_GEOS
that run from 1 to nlev+1. Unfortunately this is not friendly to CF so what I have here is my best reading of the conventions. So what is in these 4 variables ak
, bk
, ak_bnds
, and bk_bnds
? Sticking with the 72 level example, ak
has a size of [72], and ak_bnds
has size [72,2]. These are related to the AK_GEOS
and BK_GEOS
are as follows:
ak(i) = (AK_GEOS(i) + AK_GEOS(i+1))/2 for i=1,nlev
# For i=1,nlev
ak_bnds(i,1) = AK_GEOS(i)
ak_bnds(i,2) = AK_GEOS(i+1)
Note that the ak_bnds
and bk_bounds
do contain duplicate information.
Extra Items for Volume Mixing Regridding
If you want to regrid volume mixing quantities you need 2 extra items in the input file.
First you need to specify the molecular weight of the species as an attribute on the variable you will be regridding with an attribute named molecular_weight
in units of kg/Kmole
.
Next you need to have the specific humidity in the file. This is identified by a variable with a standard_name
of specific_humidity
.
Where can I find AK and BK?
Unfortunately these are hard coded in source code although I am working on a script to extract them from the source code and put them in a yaml file. The hard coded AK and BK's are in this file.
I also have extract the L72 values. They are here on Discover in a yaml file: /discover/nobackup/bmauer/akbk_file/akbk.yaml
.
There is also a python script in that directory that can read this file and add the AK and BK to an existing file in the format described earlier. This script is named add_akbkps.py
.