Three dimensional (xyz) with ideal surface
3D Meso-NH simulations capture full spatial dynamics, including complex interactions between terrain, convection, and surface heterogeneity. They allow to study organized atmospheric structures that 1D or 2D models cannot represent. In this example you will use idealized initial and surface conditions.
To perform a 3D simulation with Meso-NH with idealized initial and surface condition you need to prepare the initial condition and run the model using the PREP_IDEAL_CASE and MESONH executables respectively. These two steps are described in the following sections:
Warning
This kind of simulation is parallelized and can be run with more than 1 core.
Note
You can find all the namelists presented in this section as well as the scripts here:
MNH-V6-0-0/examples/tutorials/ideal_cases/3D_ideal_surface/
001_prep_ideal_case : directory to prepare the initial condition
002_mesonh : directory to run the model
003_python : directory to plot the figure
The different steps must be performed in the order indicated by the directory numbers.
Prepare the initial condition (PREP_IDEAL_CASE)
To create the initial condition for a 3D Meso-NH simulation you have to use PREP_IDEAL_CASE program. This program reads a file called PRE_IDEA1.nam defining the characteristics of the simulation.
Tip
To see all the namelists you can use in the PREP_IDEAL_CASE program or to obtain information about namelists, please go here.
In the PRE_IDEA1.nam file, we recommend to have the following minimum informations and namelists:
The name of the NetCDF files you will create with the PREP_IDEAL_CASE program (without the extension) in NAM_LUNITn namelist:
&NAM_LUNITn CINIFILE = "INI", CINIFILEPGD = "PGD" /
Note
In this example, you will create the two NetCDF files
INI.ncandPGD.nccorresponding respectively to initial and surface boundary conditions files.The number of points along x (i) and y (j) direction in NAM_DIMn_PRE namelist:
&NAM_DIMn_PRE NIMAX = 50, NJMAX = 50 /
The type of initial profile and the shape of the orography you will impose in NAM_CONF_PRE :
&NAM_CONF_PRE CIDEAL = "RSOU", CZS = "BELL" /
Note
In this example, you will use initialization from radiosounding (
CIDEAL="RSOU") and bell-shape hill orography (CZS="BELL").Characteristic of radiosounding has to be defined in the freeformat part of the
PRE_IDEA1.namfile (cf below).Characteristic of the bell-shape hill orography has to be defined in NAM_GRIDH_PRE namelist.
The horizontal resolution along i and j direction and the orography charateristic in NAM_GRIDH_PRE namelist:
&NAM_GRIDH_PRE XDELTAX = 2000., XDELTAY = 2000., XHMAX = 100., XAX = 10000., XAY = 10000., NIZS = 25, NJZS = 25 /
Note
It is better to set XDELTAX and XDELTAY to a value that is consistent with the relevant resolution of the your case study.
XHMAX, XAX, XAY and NIZS, NJZS correspond to characteristic of the bell-shape hill you’ve chose in NAM_CONF_PRE namelist.
The vertical grid discretisation in NAM_VER_GRID namelist:
&NAM_VER_GRID NKMAX = 40, ZDZGRD = 750., ZDZTOP = 750. /
Note
In this example, you will use 40 vertical grid points with a vertical resolution of 750 m everywhere.
The kind of lateral boundary condition in NAM_LBCn_PRE namelist:
&NAM_LBCn_PRE CLBCX(1) = "CYCL", CLBCX(2) = "CYCL" /
Note
In this example, you will use cyclic lateral boundary condition in PREP_IDEAL_CASE to impose cyclic orography.
The surface representation in NAM_GRn_PRE and NAM_COVER namelists:
&NAM_GRn_PRE CSURF = "EXTE" / &NAM_COVER XUNIF_COVER(4) = 1.0 /
Note
In this example, you will use SURFEX (
CSURF = "EXTE") and a cover containing 100 % nature points (XUNIF_COVER(4) = 1.0).The characteristic of the vertical profile is given in the freeformat part of the
PRE_IDEA1.namfile:RSOU 2025 6 11 0. "ZUVTHVHU" 0. 100000. 288. 0. 2 0 10 0 30000 10 0 2 50.0 288.15 0.0 29900.0 390.68 0.0
Note
In this example you will impose an u-wind speed of 10 m/s, a relative humidty of 0 % (dry simulation) and a regular increase of the potential temperature from 288 K at 0 m to 390.68 K at 29900 m.
Tip
See the full PRE_IDEA1.nam file:
&NAM_LUNITn CINIFILE = "INI",
CINIFILEPGD = "PGD" /
&NAM_DIMn_PRE NIMAX = 50,
NJMAX = 50 /
&NAM_CONF_PRE CIDEAL = "RSOU",
CZS = "BELL" /
&NAM_GRIDH_PRE XDELTAX = 2000.,
XDELTAY = 2000.,
XHMAX = 100.,
XAX = 10000.,
XAY = 10000.,
NIZS = 25,
NJZS = 25 /
&NAM_VER_GRID NKMAX = 40,
ZDZGRD = 750.,
ZDZTOP = 750. /
&NAM_LBCn_PRE CLBCX(1) = "CYCL",
CLBCX(2) = "CYCL" /
&NAM_GRn_PRE CSURF = "EXTE" /
&NAM_COVER XUNIF_COVER(4) = 1.0 /
RSOU
2025 6 11 0.
"ZUVTHVHU"
0.
100000.
288.
0.
2
0 10 0
30000 10 0
2
50.0 288.15 0.0
29900.0 390.68 0.0
This file is located here :
MNH-V6-0-0/examples/tutorials/ideal_cases/3D_ideal_surface/001_prep_ideal_case/
You can launch PREP_IDEAL_CASE program using run_prep_ideal_case.sh script (execution takes less than 2 s):
cd MNH-V6-0-0/examples/tutorials/ideal_cases/3D_ideal_surface/001_prep_ideal_case/
./run_prep_ideal_case.sh
At the end of the PREP_IDEAL_CASE execution, you need to have following files:
your_run_directory/
PRE_IDEA1.nam : The file you’ve created from this example
INI.des : The descriptive part of the initial condition file
INI.nc : The NetCDF part of the initial condition file
PGD.nc : The NetCDF part of the physiographic data file
OUTPUT_LISTING1 : File containing debug informations
Tip
To verify that the program has been executed correctly, you should see the following lines at the end of the OUTPUT_LISTING1 file:
****************************************************
* PREP_IDEAL_CASE: PREP_IDEAL_CASE ENDS CORRECTLY. *
****************************************************
Launch the simulation (MESONH)
To launch the Meso-NH simulation you have to use MESONH program. This program reads a file called EXSEG1.nam defining the characteristics of the simulation.
Tip
To see all the namelists you can use in the MESONH program or to obtain information about namelists, please go here.
In the EXSEG1.nam file, we recommend to have the following minimum informations and namelists:
The name of the NetCDF files created by the PREP_IDEAL_CASE program in NAM_LUNITn namelist:
&NAM_LUNITn CINIFILE = "INI", CINIFILEPGD = "PGD" /
The simulated length (in s), the activation of Coriolis effect and the top absorbing layer coefficient in NAM_DYN namelist :
&NAM_DYN XSEGLEN = 36000., LCORIO = .FALSE., XALKTOP = 0.005, XALZBOT = 20000. /
Note
To activate the top absorbing layer you have to put
LVE_RELAX = .TRUE.in NAM_DYNn namelist.The backup output writing period in NAM_BACKUP namelist:
&NAM_BACKUP XBAK_TIME(1,1) = 36000.0 /
The time step, pressure solver option and the activation of the top absorbing layer in NAM_DYNn namelist:
&NAM_DYNn XTSTEP = 20., CPRESOPT = "CRESI", LVE_RELAX = .TRUE. /
The temporal and advection schemes in NAM_ADVn namelist:
&NAM_ADVn CTEMP_SCHEME = "RKC4", CUVW_ADV_SCHEME = "CEN4TH", CMET_ADV_SCHEME = "PPM_01" /
The physical parametrization options in NAM_PARAMn namelist:
&NAM_PARAMn CTURB = "NONE", CRAD = "NONE", CCLOUD = "NONE", CSCONV = "NONE", CDCONV = "NONE" /
Note
In this example, no physical parameters are activated.
The lateral boundary condition options NAM_LBCn namelist:
&NAM_LBCn CLBCX = 2*"OPEN" /
Note
In this example you will use open boundary condition in i direction, by default it’s cyclic along j direction.
Tip
See the full EXSEG1.nam file:
&NAM_LUNITn CINIFILE = "INI" ,
CINIFILEPGD = "PGD" /
&NAM_DYN XSEGLEN = 36000.,
LCORIO = .FALSE.,
XALKTOP = 0.005,
XALZBOT = 20000. /
&NAM_BACKUP XBAK_TIME(1,1) = 36000. /
&NAM_DYNn XTSTEP = 20.,
CPRESOPT = "CRESI",
LVE_RELAX = .TRUE. /
&NAM_ADVn CTEMP_SCHEME = "RKC4",
CUVW_ADV_SCHEME = "CEN4TH",
CMET_ADV_SCHEME = "PPM_01" /
&NAM_PARAMn CTURB = "NONE",
CRAD = "NONE",
CCLOUD = "NONE",
CSCONV = "NONE",
CDCONV = "NONE" /
&NAM_LBCn CLBCX = 2*"OPEN" /
This file is located here :
MNH-V6-0-0/examples/tutorials/ideal_cases/3D_ideal_surface/002_mesonh/
You can launch MESONH program using run_mesonh.sh script (execution takes less than 15 s):
cd MNH-V6-0-0/examples/tutorials/ideal_cases/3D_ideal_surface/002_mesonh/
./run_mesonh.sh
At the end of the MESONH execution, you need to have following files:
your_run_directory/
INI.des : The descriptive part of the initial condition file
INI.nc : The NetCDF part of the initial condition file
PGD.nc : The NetCDF part of the physiographic data file
EXSEG1.nam : The file you’ve created from this example
EXP01.1.SEG01.000.des : The descriptive part of the simulated output file
EXP01.1.SEG01.000.nc : The NetCDF part of the simulated output file
EXP01.1.SEG01.001.des : The descriptive part of the simulated output file
EXP01.1.SEG01.001.nc : The NetCDF part of the simulated output file
OUTPUT_LISTING0 : File containing debug informations
OUTPUT_LISTING1 : File containing debug informations
Tip
The *.001.nc file contains NAM_BACKUP output. This file can be used to restart the simulation. It contains one time variables.
To verify that the program has been executed correctly, you should see the following lines at the end of the
OUTPUT_LISTING1file:|----------------------------------------------------------------------------------------------------| | CPUTIME/ELAPSED || SUM(PROC) |MEAN(PROC)| MIN(PROC | MAX(PROC)| PERCENT %| |----------------------------------------------------------------------------------------------------| |++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++| |++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++| |++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++| | MODEL1 | CPUTIME || 798.785| 399.393| 399.351| 399.434| 100.000| | MODEL1 | ELAPSED || 798.907| 399.454| 399.438| 399.469| 100.000| |++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++| |++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++| |++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++| |====================================================================================================| | SECOND/STEP=1801 | CPUTIME || 0.444| 0.222| 0.222| 0.222| 0.056| | SECOND/STEP=1801 | ELAPSED || 0.444| 0.222| 0.222| 0.222| 0.056| |----------------------------------------------------------------------------------------------------| | MICROSEC/STP/PT=100000 | CPUTIME || 4.435| 2.218| 2.217| 2.218| 100.000| | MICROSEC/STP/PT=100000 | ELAPSED || 4.436| 2.218| 2.218| 2.218| 100.000| |====================================================================================================|
Plot results
You can plot the results using run_python.sh script (execution takes less than few seconds):
cd MNH-V6-0-0/examples/tutorials/ideal_cases/3D_ideal_surface/003_python/
./run_python.sh
The figure created visible below shows an example of a graph that you can plot from the 3D simulation you just performed. It shows the orographic wave generated by the 100 m bell shape hill through u-wind speed at k = 10 corresping to 7 125 m a.g.l. Black and yellow contours correspond to position of bell shape hill.
Example of 3D simulation output. U wind speed at k=10 (z = 7 125 m a.g.l.).
Tip
See the python script used to plot this figure:
#!/usr/bin/python
# -*- coding: utf-8 -*-
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
import numpy as np
import netCDF4
import matplotlib.pyplot as plt
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# #########################################################
# ### To be defined by user ###
# #########################################################
cfg_file_name = 'EXP01.1.SEG01.001.nc'
# #########################################################
# ------------------------------------------------------
# Read netcdf file and variables
# ------------------------------------------------------
file_MNH = netCDF4.Dataset(cfg_file_name)
xhat_MNH = file_MNH['XHAT'][1:-1]
yhat_MNH = file_MNH['YHAT'][1:-1]
x_MNH, y_MNH = np.meshgrid(xhat_MNH, yhat_MNH)
zs_MNH = file_MNH['ZS'][1:-1,1:-1]
uwnd_MNH = file_MNH['UT'][0,10,1:-1,1:-1]
# ------------------------------------------------------
# Quick plot
# ------------------------------------------------------
pmsh = plt.pcolormesh(x_MNH[:,:]/1000.0, y_MNH[:,:]/1000.0, uwnd_MNH[:,:], vmin=9.5, vmax=10.5, shading="auto", cmap="bwr")
ct = plt.contour(x_MNH[:,:]/1000.0, y_MNH[:,:]/1000.0, zs_MNH[:,:], levels=[50.0, 90.0])
# ------------------------------------------------------
# Some adjustments to the plot
# ------------------------------------------------------
plt.gca().set_aspect('equal', adjustable='box')
plt.grid(True, linestyle='--', linewidth=0.2)
cbar=plt.colorbar(pmsh)
cbar.set_label(r"U wind speed [m.s$^{-1}$]")
plt.clabel(ct, inline=True, fmt='%d m', fontsize=6) # labels inline
plt.xlabel("X (km)")
plt.ylabel("Y (km)")
plt.savefig('3D_orographic_wave.png', bbox_inches='tight', dpi=400)
This file is located here :
MNH-V6-0-0/examples/tutorials/ideal_cases/3D_ideal_surface/003_python/
Other examples
You can find other 3D ideal simulation examples in Namelist catalogue section.