Browse Source

Changed default cfrac to use height_agl as the type. Since NCL never advertised this function, and it never really worked correctly before, breaking backwards compatibility is less of an issue.

lon0
Bill Ladwig 7 years ago
parent
commit
1cc072b2a9
  1. 482
      doc/source/_templates/product_table.txt
  2. 20
      src/wrf/g_cloudfrac.py
  3. 13
      test/utests.py

482
doc/source/_templates/product_table.txt

@ -1,240 +1,244 @@
+--------------------+---------------------------------------------------------------+-----------------------------+-----------------------------------------------------------------------------------------------+ +--------------------+---------------------------------------------------------------+-----------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------+
| Variable Name | Description | Available Units | Additional Keyword Arguments | | Variable Name | Description | Available Units | Additional Keyword Arguments |
+====================+===============================================================+=============================+===============================================================================================+ +====================+===============================================================+=============================+=========================================================================================================================================================+
| avo | Absolute Vorticity | 10-5 s-1 | | | avo | Absolute Vorticity | 10-5 s-1 | |
+--------------------+---------------------------------------------------------------+-----------------------------+-----------------------------------------------------------------------------------------------+ +--------------------+---------------------------------------------------------------+-----------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------+
| eth/theta_e | Equivalent Potential Temperature | K | **units** (str) : Set to desired units. Default is *'K'*. | | eth/theta_e | Equivalent Potential Temperature | K | **units** (str) : Set to desired units. Default is *'K'*. |
| | | | | | | | | |
| | | degC | | | | | degC | |
| | | | | | | | | |
| | | degF | | | | | degF | |
+--------------------+---------------------------------------------------------------+-----------------------------+-----------------------------------------------------------------------------------------------+ +--------------------+---------------------------------------------------------------+-----------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------+
| cape_2d | 2D cape (mcape/mcin/lcl/lfc) | J kg-1 ; J kg-1 ; m ; m | **missing** (float): Fill value for output only | | cape_2d | 2D cape (mcape/mcin/lcl/lfc) | J kg-1 ; J kg-1 ; m ; m | **missing** (float): Fill value for output only |
+--------------------+---------------------------------------------------------------+-----------------------------+-----------------------------------------------------------------------------------------------+ +--------------------+---------------------------------------------------------------+-----------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------+
| cape_3d | 3D cape and cin | J kg-1 | **missing** (float): Fill value for output only | | cape_3d | 3D cape and cin | J kg-1 | **missing** (float): Fill value for output only |
+--------------------+---------------------------------------------------------------+-----------------------------+-----------------------------------------------------------------------------------------------+ +--------------------+---------------------------------------------------------------+-----------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------+
| ctt | Cloud Top Temperature | degC | **units** (str) : Set to desired units. Default is *'degC'*. | | ctt | Cloud Top Temperature | degC | **units** (str) : Set to desired units. Default is *'degC'*. |
| | | | | | | | | |
| | | K | | | | | K | |
| | | | | | | | | |
| | | degF | | | | | degF | |
+--------------------+---------------------------------------------------------------+-----------------------------+-----------------------------------------------------------------------------------------------+ +--------------------+---------------------------------------------------------------+-----------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------+
| cloudfrac | Cloud Fraction | % | | | cloudfrac | Cloud Fraction | % | **vert_type** (str): The vertical coordinate type for the cloud thresholds. Must be 'height_agl', 'height_msl', or 'pres'. Default is 'height_agl'. |
+--------------------+---------------------------------------------------------------+-----------------------------+-----------------------------------------------------------------------------------------------+ | | | | |
| dbz | Reflectivity | dBZ | **do_variant** (boolean): Set to True to enable variant calculation. Default is *False*. | | | | | **low_thresh** (float): The low cloud threshold (meters for 'height_agl' and 'height_msl', pascals for 'pres'). Default is 300 m (97000 Pa) |
| | | | | | | | | |
| | | | **do_liqskin** (boolean): Set to True to enable liquid skin calculation. Default is *False*. | | | | | **mid_thresh** (float): The mid cloud threshold (meters for 'height_agl' and 'height_msl', pascals for 'pres'). Default is 2000 m (80000 Pa) |
+--------------------+---------------------------------------------------------------+-----------------------------+-----------------------------------------------------------------------------------------------+ | | | | |
| mdbz | Maximum Reflectivity | dBZ | **do_variant** (boolean): Set to True to enable variant calculation. Default is *False*. | | | | | **high_thresh** (float): The high cloud threshold (meters for 'height_agl' and 'height_msl', pascals for 'pres'). Default is 6000 m (45000 Pa) |
| | | | | +--------------------+---------------------------------------------------------------+-----------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------+
| | | | **do_liqskin** (boolean): Set to True to enable liquid skin calculation. Default is *False*. | | dbz | Reflectivity | dBZ | **do_variant** (boolean): Set to True to enable variant calculation. Default is *False*. |
+--------------------+---------------------------------------------------------------+-----------------------------+-----------------------------------------------------------------------------------------------+ | | | | |
| geopt/geopotential | Full Model Geopotential | m2 s-2 | | | | | | **do_liqskin** (boolean): Set to True to enable liquid skin calculation. Default is *False*. |
+--------------------+---------------------------------------------------------------+-----------------------------+-----------------------------------------------------------------------------------------------+ +--------------------+---------------------------------------------------------------+-----------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------+
| helicity | Storm Relative Helicity | m2 s-2 | **top** (float): The top level for the calculation in meters. Default is *3000.0*. | | mdbz | Maximum Reflectivity | dBZ | **do_variant** (boolean): Set to True to enable variant calculation. Default is *False*. |
+--------------------+---------------------------------------------------------------+-----------------------------+-----------------------------------------------------------------------------------------------+ | | | | |
| lat | Latitude | decimal degrees | | | | | | **do_liqskin** (boolean): Set to True to enable liquid skin calculation. Default is *False*. |
+--------------------+---------------------------------------------------------------+-----------------------------+-----------------------------------------------------------------------------------------------+ +--------------------+---------------------------------------------------------------+-----------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------+
| lon | Longitude | decimal degrees | | | geopt/geopotential | Full Model Geopotential | m2 s-2 | |
+--------------------+---------------------------------------------------------------+-----------------------------+-----------------------------------------------------------------------------------------------+ +--------------------+---------------------------------------------------------------+-----------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------+
| omg/omega | Omega | Pa s-1 | | | helicity | Storm Relative Helicity | m2 s-2 | **top** (float): The top level for the calculation in meters. Default is *3000.0*. |
+--------------------+---------------------------------------------------------------+-----------------------------+-----------------------------------------------------------------------------------------------+ +--------------------+---------------------------------------------------------------+-----------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------+
| p/pres | Full Model Pressure | Pa | **units** (str) : Set to desired units. Default is *'Pa'*. | | lat | Latitude | decimal degrees | |
| | | | | +--------------------+---------------------------------------------------------------+-----------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------+
| | (in specified units) | hPa | | | lon | Longitude | decimal degrees | |
| | | | | +--------------------+---------------------------------------------------------------+-----------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------+
| | | mb | | | omg/omega | Omega | Pa s-1 | |
| | | | | +--------------------+---------------------------------------------------------------+-----------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------+
| | | torr | | | p/pres | Full Model Pressure | Pa | **units** (str) : Set to desired units. Default is *'Pa'*. |
| | | | | | | | | |
| | | mmhg | | | | (in specified units) | hPa | |
| | | | | | | | | |
| | | atm | | | | | mb | |
+--------------------+---------------------------------------------------------------+-----------------------------+-----------------------------------------------------------------------------------------------+ | | | | |
| pressure | Full Model Pressure (hPa) | hPa | | | | | torr | |
+--------------------+---------------------------------------------------------------+-----------------------------+-----------------------------------------------------------------------------------------------+ | | | | |
| pvo | Potential Vorticity | PVU | | | | | mmhg | |
+--------------------+---------------------------------------------------------------+-----------------------------+-----------------------------------------------------------------------------------------------+ | | | | |
| pw | Precipitable Water | kg m-2 | | | | | atm | |
+--------------------+---------------------------------------------------------------+-----------------------------+-----------------------------------------------------------------------------------------------+ +--------------------+---------------------------------------------------------------+-----------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------+
| rh | Relative Humidity | % | | | pressure | Full Model Pressure (hPa) | hPa | |
+--------------------+---------------------------------------------------------------+-----------------------------+-----------------------------------------------------------------------------------------------+ +--------------------+---------------------------------------------------------------+-----------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------+
| rh2 | 2m Relative Humidity | % | | | pvo | Potential Vorticity | PVU | |
+--------------------+---------------------------------------------------------------+-----------------------------+-----------------------------------------------------------------------------------------------+ +--------------------+---------------------------------------------------------------+-----------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------+
| slp | Sea Level Pressure | hPa | **units** (str) : Set to desired units. Default is *'hPa'*. | | pw | Precipitable Water | kg m-2 | |
| | | | | +--------------------+---------------------------------------------------------------+-----------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------+
| | | hPa | | | rh | Relative Humidity | % | |
| | | | | +--------------------+---------------------------------------------------------------+-----------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------+
| | | mb | | | rh2 | 2m Relative Humidity | % | |
| | | | | +--------------------+---------------------------------------------------------------+-----------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------+
| | | torr | | | slp | Sea Level Pressure | hPa | **units** (str) : Set to desired units. Default is *'hPa'*. |
| | | | | | | | | |
| | | mmhg | | | | | hPa | |
| | | | | | | | | |
| | | atm | | | | | mb | |
+--------------------+---------------------------------------------------------------+-----------------------------+-----------------------------------------------------------------------------------------------+ | | | | |
| ter | Model Terrain Height | m | **units** (str) : Set to desired units. Default is *'m'*. | | | | torr | |
| | | | | | | | | |
| | | km | | | | | mmhg | |
| | | | | | | | | |
| | | dm | | | | | atm | |
| | | | | +--------------------+---------------------------------------------------------------+-----------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------+
| | | ft | | | ter | Model Terrain Height | m | **units** (str) : Set to desired units. Default is *'m'*. |
| | | | | | | | | |
| | | mi | | | | | km | |
+--------------------+---------------------------------------------------------------+-----------------------------+-----------------------------------------------------------------------------------------------+ | | | | |
| td2 | 2m Dew Point Temperature | degC | **units** (str) : Set to desired units. Default is *'degC'*. | | | | dm | |
| | | | | | | | | |
| | | K | | | | | ft | |
| | | | | | | | | |
| | | degF | | | | | mi | |
+--------------------+---------------------------------------------------------------+-----------------------------+-----------------------------------------------------------------------------------------------+ +--------------------+---------------------------------------------------------------+-----------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------+
| td | Dew Point Temperature | degC | **units** (str) : Set to desired units. Default is *'degC'*. | | td2 | 2m Dew Point Temperature | degC | **units** (str) : Set to desired units. Default is *'degC'*. |
| | | | | | | | | |
| | | K | | | | | K | |
| | | | | | | | | |
| | | degF | | | | | degF | |
+--------------------+---------------------------------------------------------------+-----------------------------+-----------------------------------------------------------------------------------------------+ +--------------------+---------------------------------------------------------------+-----------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------+
| tc | Temperature in Celsius | degC | | | td | Dew Point Temperature | degC | **units** (str) : Set to desired units. Default is *'degC'*. |
+--------------------+---------------------------------------------------------------+-----------------------------+-----------------------------------------------------------------------------------------------+ | | | | |
| th/theta | Potential Temperature | K | **units** (str) : Set to desired units. Default is *'K'*. | | | | K | |
| | | | | | | | | |
| | | degC | | | | | degF | |
| | | | | +--------------------+---------------------------------------------------------------+-----------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------+
| | | degF | | | tc | Temperature in Celsius | degC | |
+--------------------+---------------------------------------------------------------+-----------------------------+-----------------------------------------------------------------------------------------------+ +--------------------+---------------------------------------------------------------+-----------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------+
| temp | Temperature (in specified units) | K | **units** (str) : Set to desired units. Default is *'K'*. | | th/theta | Potential Temperature | K | **units** (str) : Set to desired units. Default is *'K'*. |
| | | | | | | | | |
| | | degC | | | | | degC | |
| | | | | | | | | |
| | | degF | | | | | degF | |
+--------------------+---------------------------------------------------------------+-----------------------------+-----------------------------------------------------------------------------------------------+ +--------------------+---------------------------------------------------------------+-----------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------+
| tk | Temperature in Kelvin | K | | | temp | Temperature (in specified units) | K | **units** (str) : Set to desired units. Default is *'K'*. |
+--------------------+---------------------------------------------------------------+-----------------------------+-----------------------------------------------------------------------------------------------+ | | | | |
| times | Times in the File or Sequence | | | | | | degC | |
+--------------------+---------------------------------------------------------------+-----------------------------+-----------------------------------------------------------------------------------------------+ | | | | |
| xtimes | XTIME Coordinate | minutes since | | | | | degF | |
| | | | | +--------------------+---------------------------------------------------------------+-----------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------+
| | (if applicable) | start of | | | tk | Temperature in Kelvin | K | |
| | | | | +--------------------+---------------------------------------------------------------+-----------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------+
| | | model run | | | times | Times in the File or Sequence | | |
+--------------------+---------------------------------------------------------------+-----------------------------+-----------------------------------------------------------------------------------------------+ +--------------------+---------------------------------------------------------------+-----------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------+
| tv | Virtual Temperature | K | **units** (str) : Set to desired units. Default is *'K'*. | | xtimes | XTIME Coordinate | minutes since | |
| | | | | | | | | |
| | | degC | | | | (if applicable) | start of | |
| | | | | | | | | |
| | | degF | | | | | model run | |
+--------------------+---------------------------------------------------------------+-----------------------------+-----------------------------------------------------------------------------------------------+ +--------------------+---------------------------------------------------------------+-----------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------+
| twb | Wet Bulb Temperature | K | **units** (str) : Set to desired units. Default is *'K'*. | | tv | Virtual Temperature | K | **units** (str) : Set to desired units. Default is *'K'*. |
| | | | | | | | | |
| | | degC | | | | | degC | |
| | | | | | | | | |
| | | degF | | | | | degF | |
+--------------------+---------------------------------------------------------------+-----------------------------+-----------------------------------------------------------------------------------------------+ +--------------------+---------------------------------------------------------------+-----------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------+
| updraft_helicity | Updraft Helicity | m2 s-2 | **bottom** (float): The bottom level for the calculation in meters. Default is *2000.0*. | | twb | Wet Bulb Temperature | K | **units** (str) : Set to desired units. Default is *'K'*. |
| | | | | | | | | |
| | | | **top** (float): The top level for the calculation in meters. Default is *5000.0*. | | | | degC | |
+--------------------+---------------------------------------------------------------+-----------------------------+-----------------------------------------------------------------------------------------------+ | | | | |
| ua | U-component of Wind on Mass Points | m s-1 | **units** (str) : Set to desired units. Default is *'m s-1'*. | | | | degF | |
| | | | | +--------------------+---------------------------------------------------------------+-----------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------+
| | | km h-1 | | | updraft_helicity | Updraft Helicity | m2 s-2 | **bottom** (float): The bottom level for the calculation in meters. Default is *2000.0*. |
| | | | | | | | | |
| | | mi h-1 | | | | | | **top** (float): The top level for the calculation in meters. Default is *5000.0*. |
| | | | | +--------------------+---------------------------------------------------------------+-----------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------+
| | | kt | | | ua | U-component of Wind on Mass Points | m s-1 | **units** (str) : Set to desired units. Default is *'m s-1'*. |
| | | | | | | | | |
| | | ft s-1 | | | | | km h-1 | |
+--------------------+---------------------------------------------------------------+-----------------------------+-----------------------------------------------------------------------------------------------+ | | | | |
| va | V-component of Wind on Mass Points | m s-1 | **units** (str) : Set to desired units. Default is *'m s-1'*. | | | | mi h-1 | |
| | | | | | | | | |
| | | km h-1 | | | | | kt | |
| | | | | | | | | |
| | | mi h-1 | | | | | ft s-1 | |
| | | | | +--------------------+---------------------------------------------------------------+-----------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------+
| | | kt | | | va | V-component of Wind on Mass Points | m s-1 | **units** (str) : Set to desired units. Default is *'m s-1'*. |
| | | | | | | | | |
| | | ft s-1 | | | | | km h-1 | |
+--------------------+---------------------------------------------------------------+-----------------------------+-----------------------------------------------------------------------------------------------+ | | | | |
| wa | W-component of Wind on Mass Points | m s-1 | **units** (str) : Set to desired units. Default is *'m s-1'*. | | | | mi h-1 | |
| | | | | | | | | |
| | | km h-1 | | | | | kt | |
| | | | | | | | | |
| | | mi h-1 | | | | | ft s-1 | |
| | | | | +--------------------+---------------------------------------------------------------+-----------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------+
| | | kt | | | wa | W-component of Wind on Mass Points | m s-1 | **units** (str) : Set to desired units. Default is *'m s-1'*. |
| | | | | | | | | |
| | | ft s-1 | | | | | km h-1 | |
+--------------------+---------------------------------------------------------------+-----------------------------+-----------------------------------------------------------------------------------------------+ | | | | |
| uvmet10 | 10 m U and V Components of Wind | m s-1 | **units** (str) : Set to desired units. Default is *'m s-1'*. | | | | mi h-1 | |
| | | | | | | | | |
| | Rotated to Earth Coordinates | km h-1 | | | | | kt | |
| | | | | | | | | |
| | | mi h-1 | | | | | ft s-1 | |
| | | | | +--------------------+---------------------------------------------------------------+-----------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------+
| | | kt | | | uvmet10 | 10 m U and V Components of Wind | m s-1 | **units** (str) : Set to desired units. Default is *'m s-1'*. |
| | | | | | | | | |
| | | ft s-1 | | | | Rotated to Earth Coordinates | km h-1 | |
+--------------------+---------------------------------------------------------------+-----------------------------+-----------------------------------------------------------------------------------------------+ | | | | |
| uvmet | U and V Components of Wind | m s-1 | **units** (str) : Set to desired units. Default is *'m s-1'*. | | | | mi h-1 | |
| | | | | | | | | |
| | Rotated to Earth Coordinates | km h-1 | | | | | kt | |
| | | | | | | | | |
| | | mi h-1 | | | | | ft s-1 | |
| | | | | +--------------------+---------------------------------------------------------------+-----------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------+
| | | kt | | | uvmet | U and V Components of Wind | m s-1 | **units** (str) : Set to desired units. Default is *'m s-1'*. |
| | | | | | | | | |
| | | ft s-1 | | | | Rotated to Earth Coordinates | km h-1 | |
+--------------------+---------------------------------------------------------------+-----------------------------+-----------------------------------------------------------------------------------------------+ | | | | |
| wspd_wdir | Wind Speed and Direction (wind_from_direction) | m s-1 | **units** (str) : Set to desired units. Default is *'m s-1'*. | | | | mi h-1 | |
| | | | | | | | | |
| | in Grid Coordinates | km h-1 | | | | | kt | |
| | | | | | | | | |
| | | mi h-1 | | | | | ft s-1 | |
| | | | | +--------------------+---------------------------------------------------------------+-----------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------+
| | | kt | | | wspd_wdir | Wind Speed and Direction (wind_from_direction) | m s-1 | **units** (str) : Set to desired units. Default is *'m s-1'*. |
| | | | | | | | | |
| | | ft s-1 | | | | in Grid Coordinates | km h-1 | |
+--------------------+---------------------------------------------------------------+-----------------------------+-----------------------------------------------------------------------------------------------+ | | | | |
| wspd_wdir10 | 10m Wind Speed and Direction (wind_from_direction) | m s-1 | **units** (str) : Set to desired units. Default is *'m s-1'*. | | | | mi h-1 | |
| | | | | | | | | |
| | in Grid Coordinates | km h-1 | | | | | kt | |
| | | | | | | | | |
| | | mi h-1 | | | | | ft s-1 | |
| | | | | +--------------------+---------------------------------------------------------------+-----------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------+
| | | kt | | | wspd_wdir10 | 10m Wind Speed and Direction (wind_from_direction) | m s-1 | **units** (str) : Set to desired units. Default is *'m s-1'*. |
| | | | | | | | | |
| | | ft s-1 | | | | in Grid Coordinates | km h-1 | |
+--------------------+---------------------------------------------------------------+-----------------------------+-----------------------------------------------------------------------------------------------+ | | | | |
| uvmet_wspd_wdir | Wind Speed and Direction (wind_from_direction) | m s-1 | **units** (str) : Set to desired units. Default is *'m s-1'*. | | | | mi h-1 | |
| | | | | | | | | |
| | Rotated to Earth Coordinates | km h-1 | | | | | kt | |
| | | | | | | | | |
| | | mi h-1 | | | | | ft s-1 | |
| | | | | +--------------------+---------------------------------------------------------------+-----------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------+
| | | kt | | | uvmet_wspd_wdir | Wind Speed and Direction (wind_from_direction) | m s-1 | **units** (str) : Set to desired units. Default is *'m s-1'*. |
| | | | | | | | | |
| | | ft s-1 | | | | Rotated to Earth Coordinates | km h-1 | |
+--------------------+---------------------------------------------------------------+-----------------------------+-----------------------------------------------------------------------------------------------+ | | | | |
| uvmet10_wspd_wdir | 10m Wind Speed and Direction (wind_from_direction) | m s-1 | **units** (str) : Set to desired units. Default is *'m s-1'*. | | | | mi h-1 | |
| | | | | | | | | |
| | Rotated to Earth Coordinates | km h-1 | | | | | kt | |
| | | | | | | | | |
| | | mi h-1 | | | | | ft s-1 | |
| | | | | +--------------------+---------------------------------------------------------------+-----------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------+
| | | kt | | | uvmet10_wspd_wdir | 10m Wind Speed and Direction (wind_from_direction) | m s-1 | **units** (str) : Set to desired units. Default is *'m s-1'*. |
| | | | | | | | | |
| | | ft s-1 | | | | Rotated to Earth Coordinates | km h-1 | |
+--------------------+---------------------------------------------------------------+-----------------------------+-----------------------------------------------------------------------------------------------+ | | | | |
| z/height | Full Model Height on Mass Levels | m | **msl** (boolean): Set to False to return AGL values. True is for MSL. Default is *True*. | | | | mi h-1 | |
| | | | | | | | | |
| | | km | **units** (str) : Set to desired units. Default is *'m'*. | | | | kt | |
| | | | | | | | | |
| | | dm | | | | | ft s-1 | |
| | | | | +--------------------+---------------------------------------------------------------+-----------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------+
| | | ft | | | z/height | Full Model Height on Mass Levels | m | **msl** (boolean): Set to False to return AGL values. True is for MSL. Default is *True*. |
| | | | | | | | | |
| | | mi | | | | | km | **units** (str) : Set to desired units. Default is *'m'*. |
+--------------------+---------------------------------------------------------------+-----------------------------+-----------------------------------------------------------------------------------------------+ | | | | |
| | | dm | |
| | | | |
| | | ft | |
| | | | |
| | | mi | |
+--------------------+---------------------------------------------------------------+-----------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------+

20
src/wrf/g_cloudfrac.py

@ -14,7 +14,7 @@ from .g_geoht import _get_geoht
@set_cloudfrac_metadata() @set_cloudfrac_metadata()
def get_cloudfrac(wrfin, timeidx=0, method="cat", squeeze=True, def get_cloudfrac(wrfin, timeidx=0, method="cat", squeeze=True,
cache=None, meta=True, _key=None, cache=None, meta=True, _key=None,
vert_type="pres", low_thresh=None, mid_thresh=None, vert_type="height_agl", low_thresh=None, mid_thresh=None,
high_thresh=None, missing=default_fill(np.float64)): high_thresh=None, missing=default_fill(np.float64)):
"""Return the cloud fraction for low, mid, and high level clouds. """Return the cloud fraction for low, mid, and high level clouds.
@ -24,13 +24,6 @@ def get_cloudfrac(wrfin, timeidx=0, method="cat", squeeze=True,
- return_val[0,...] will contain LOW level cloud fraction - return_val[0,...] will contain LOW level cloud fraction
- return_val[1,...] will contain MID level cloud fraction - return_val[1,...] will contain MID level cloud fraction
- return_val[2,...] will contain HIGH level cloud fraction - return_val[2,...] will contain HIGH level cloud fraction
For backwards compatibility, the default vertical coordinate type is
pressure, with default cloud levels defined as:
97000 Pa <= low_cloud < 80000 Pa
80000 Pa <= mid_cloud < 45000 Pa
45000 Pa <= high_cloud
If the vertical coordinate type is 'height_agl' or 'height_msl', the If the vertical coordinate type is 'height_agl' or 'height_msl', the
default cloud levels are defined as: default cloud levels are defined as:
@ -38,6 +31,12 @@ def get_cloudfrac(wrfin, timeidx=0, method="cat", squeeze=True,
300 m <= low_cloud < 2000 m 300 m <= low_cloud < 2000 m
2000 m <= mid_cloud < 6000 m 2000 m <= mid_cloud < 6000 m
6000 m <= high_cloud 6000 m <= high_cloud
For 'pres', the default cloud levels are defined as:
97000 Pa <= low_cloud < 80000 Pa
80000 Pa <= mid_cloud < 45000 Pa
45000 Pa <= high_cloud
Note that the default low cloud levels are chosen to Note that the default low cloud levels are chosen to
exclude clouds near the surface (fog). If you want fog included, set exclude clouds near the surface (fog). If you want fog included, set
@ -95,9 +94,8 @@ def get_cloudfrac(wrfin, timeidx=0, method="cat", squeeze=True,
purposes only. Default is None. purposes only. Default is None.
vert_type (:obj:`str`, optional): The type of vertical coordinate used vert_type (:obj:`str`, optional): The type of vertical coordinate used
to determine cloud type thresholds. Must be 'pres', 'height_msl', to determine cloud type thresholds. Must be 'height_agl',
or 'height_agl'. For backwards compatibility, the default 'height_msl', or 'pres'. The default is 'height_agl'.
is 'pres'.
low_thresh (:obj:`float`, optional): The lower bound for what is low_thresh (:obj:`float`, optional): The lower bound for what is
considered a low cloud. If *vert_type* is 'pres', the default is considered a low cloud. If *vert_type* is 'pres', the default is

13
test/utests.py

@ -138,6 +138,13 @@ def make_test(varname, wrf_in, referent, multi=False, repeat=3, pynio=False):
tol = 1/100. tol = 1/100.
atol = .1 # Note: NCL uses 273.16 as conversion for some reason atol = .1 # Note: NCL uses 273.16 as conversion for some reason
nt.assert_allclose(to_np(my_vals), ref_vals, tol, atol) nt.assert_allclose(to_np(my_vals), ref_vals, tol, atol)
elif (varname == "cfrac"):
# Change the vert_type to height_agl when NCL gets updated.
my_vals = getvar(in_wrfnc, "cfrac", timeidx=timeidx,
vert_type="pres")
tol = 1/100.
atol = .1 # Note: NCL uses 273.16 as conversion for some reason
nt.assert_allclose(to_np(my_vals), ref_vals, tol, atol)
elif (varname == "pw"): elif (varname == "pw"):
my_vals = getvar(in_wrfnc, "pw", timeidx=timeidx) my_vals = getvar(in_wrfnc, "pw", timeidx=timeidx)
tol = .5/100.0 tol = .5/100.0
@ -611,6 +618,12 @@ class WRFLatLonTest(ut.TestCase):
if __name__ == "__main__": if __name__ == "__main__":
from wrf import (omp_set_num_threads, omp_set_schedule, omp_get_schedule,
omp_set_dynamic, Constants)
omp_set_num_threads(6)
omp_set_schedule(Constants.OMP_SCHED_STATIC, 0)
omp_set_dynamic(False)
ignore_vars = [] # Not testable yet ignore_vars = [] # Not testable yet
wrf_vars = ["avo", "eth", "cape_2d", "cape_3d", "ctt", "dbz", "mdbz", wrf_vars = ["avo", "eth", "cape_2d", "cape_3d", "ctt", "dbz", "mdbz",
"geopt", "helicity", "lat", "lon", "omg", "p", "pressure", "geopt", "helicity", "lat", "lon", "omg", "p", "pressure",

Loading…
Cancel
Save