scripts to create and evaluate a vertical coordinate for ICON | Read-only mirror of https://github.com/MeteoSwiss-APN/vert_coord — MeteoSchweiz. Issues & pull requests at the source.
  • Jupyter Notebook 98.3%
  • Python 1.6%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2024-05-18 22:59:27 +02:00
example_plots slice zoom out 2022-10-31 11:12:10 +01:00
.gitignore added steffisburg 2022-11-04 10:55:02 +01:00
aster_vs_cosmo.py compare orography of aster vs cosmo-oro 2023-04-06 15:41:27 +02:00
commands.txt added ddz plot 2023-02-06 17:29:00 +01:00
compare_nominal_level_distributions.py add plot for dz 2023-02-23 18:30:47 +01:00
compare_orig_with_smoothed_topo.ipynb more iterations 2022-11-29 16:04:26 +01:00
construct_hhl.py Add LOSVEC ntesting otebook 2022-10-27 18:35:27 +02:00
cosmo_levels.py add cosmo level distribution and original script by olifu 2022-10-10 16:31:28 +02:00
environment.yml newer version of xarray 2022-12-16 16:15:18 +01:00
evaluate_hhl.py only load poi if empty 2023-02-16 08:46:54 +01:00
genlev.m add cosmo level distribution and original script by olifu 2022-10-10 16:31:28 +02:00
LICENSE Create LICENSE 2024-05-18 22:59:27 +02:00
LOSVEC.ipynb Add condition increasing dz for LOSVEC 2022-11-02 09:33:04 +01:00
losvec_slices.ipynb fix transect, plot hhl 2022-11-08 17:43:07 +01:00
plotting.py add marker do dz-profiles 2023-02-17 15:53:10 +01:00
printing.py only load poi if empty 2023-02-16 08:46:54 +01:00
README.rst fix large slice plot 2022-10-31 11:16:11 +01:00
smooth_topo.py Add smooth_topo.py 2022-10-17 16:54:32 +02:00
utils.py add monte rosa as poi 2023-04-13 14:11:55 +02:00
vct_b.ipynb increase accuracy of vct_b 2023-02-16 15:54:34 +01:00

==========
vert_coord
==========

This repo gathers a variety of python scripts to create and evaluate a vertical coordinate for ICON.

.. contents:: **Content**

------------
Installation
------------

This package does not yet comply with high-standard CICD.

Simply init the dedicated conda env with:

``conda env create -f environment.yml``

and later update with:

``conda env update --file environment.yml``

------------------------
Usage of evaluate_hhl.py
------------------------
- ``lev``: Indicate number of levels to be printed
- ``loc``: Locations
- ``grid_file``: ICON grid file
- ``file``: constants file containing HHL
- ``model``: model, either icon or cosmo

Print altitude of levels at specific locations
----------------------------------------------

``python evaluate_hhl.py --print_hhl --lev 35 --loc mtblanc --loc sav --loc zrh --loc ulr --grid_file /store/s83/swester/vert_coord_files/icon-1-alps/alps_DOM01.nc --file /store/s83/swester/vert_coord_files/icon-1-alps/const_sleve.nc``

Print maximum elevation difference between adjacent cells
---------------------------------------------------------
``python evaluate_hhl.py --print_max_dzdc --lev 1 --grid_file /store/s83/swester/vert_coord_files/icon-1-alps/alps_DOM01.nc --file /store/s83/swester/vert_coord_files/icon-1-alps/const_sleve.nc``

-------------------------
Usage of construct_hhl.py
-------------------------
Constructs HHL field from an indicated surface elevation field and other settings. Currently, the script only calculates vct_a and vct_b.

``python construct_hhl.py --file /store/s83/swester/vert_coord_files/icon-1-alps/external_parameter_icon_alps_R19B08_mch.nc --n_levels 81 --h_flat 16000 --top_height 22000 --stretch_fac 0.65 --type_vct_a 2nd_order --type_vct_b linear``


---------------------------------------------------------
plot vertical slices from A to B with losvec_slices.ipynb
---------------------------------------------------------
This is a notebook which was created to play around with slicing "as clean as possible" to be able to visualise a cross-section.

For further usage, it is recommended to use LOSVEC.ipynb.

The cross-section now goes along the following line:

.. image:: example_plots/slice_a_b_large.png
  :width: 400
  
.. image:: example_plots/slice_a_b.png
  :width: 400

---------------------
Usage of LOSVEC.ipynb
---------------------

This is a notebook used to produce a 3D field of LOSVEC coordinates and to visualize a slice of it
using code taken from losvec_slices.ipynb. It can be used by "running all" cells to simply check the
resulting coordinates from the default parameters. 

The main parameters that can be varied are:

1) The input grid file and a corresponding HSURF variable
2) The Gal-Chen vectors **a** and **b**
3) The number of smoothing iterations, the constant *c_smooth* determining the strengh of each 
smoothing iteration, the minimum resulting difference in height of two successive levels 
(default = 15 m), and the maximum change in *dz* (default = 1.5 times the initial one).


The functions that are present in this notebook are described as follows:
- *calc_vct_ab*: Create the Gal-Chen vectors from a desired number of levels, top height,
stretch factor and flat height (see documentation of construct_hhl.py)
- *fill_geofac_div_xr*: Create the divergence geometrical coefficients, used in the following function
- *fill_geofac_n2s_xr*: Create the nabla2_scalar geometrical coefficients, used for the smoothing
- *nabla2_scalar*: Use the geometrical coefficients to obtain the Laplacian of a field defined on the
cells of an ICON grid
- *c_smooth_topo*: Do one iteration of smoothing of a given topology
- *compute_LOSVEC_hhl*: Produce a 3D field of vertical coordinates from the Gal-Chen vectors and 
successive localized smoothings of a given topography.
- *ind_from_lat_lon*: Copied from losvec_slices.ipynb to visualize a slice of the produced field from 
the previous function.