Skip to content
Snippets Groups Projects
Commit a88e8518 authored by RODIER Quentin's avatar RODIER Quentin
Browse files

Quentin 26/03/2021: Major update of KTEST : add python for all KTEST based on...

Quentin 26/03/2021: Major update of KTEST : add python for all KTEST based on src/LIB/Python scripts + remove diaprog and conv2dia steps +
add DIAG steps for needed Python plots variables (ISOAL variables)
+ update existing ncl script to re-arrange dimensions of backup files
+ remove ncl script of time series KTEST (ncl not supported soon)
+ adapt Makefiles
parent 9a48a2d1
No related branches found
No related tags found
No related merge requests found
Showing
with 399 additions and 148 deletions
#!/bin/bash
rm -f dirconv.elim FICJD LISTING_DIA OUT_DIA pipe_name
rm -f EXPER.1.HYD2D*
2
EXPER.1.HYD2D.002
EXPER.1.HYD2D.003
EXPER.1.HYD2D.002-3d
n
0
#!/bin/bash
#MNH_LIC Copyright 1994-2014 CNRS, Meteo-France and Universite Paul Sabatier
#MNH_LIC This is part of the Meso-NH software governed by the CeCILL-C licence
#MNH_LIC version 1. See LICENSE, CeCILL-C_V1-en.txt and CeCILL-C_V1-fr.txt
#MNH_LIC for details. version 1.
set -x
set -e
ln -sf ../002_mesonh/EXPER.1.HYD2D.00?.{des,lfi,nc} .
rm -f EXPER.1.HYD2D.002-3d.{des,lfi,nc}
time ${POSTRUN} conv2dia < dir_conv2dia
#!/bin/bash
rm -f *.png *.pdf *.nc
rm -Rf __pycache__
find . -type l -delete
#!/usr/bin/env python3
"""
@author: Quentin Rodier
Creation : 07/01/2021
Last modifications
"""
import matplotlib as mpl
mpl.use('Agg')
from read_MNHfile import read_netcdf
from Panel_Plot import PanelPlot
from misc_functions import comp_altitude1DVar
import os
import copy
os.system('rm -f tempgraph*')
#
# User's parameter / Namelist
#
output_name = '001_2DRelief.pdf' #Name of the output PDF file
path=""
LnameFiles = ['EXPER.1.HYD2D.002.nc', 'EXPER.1.HYD2D.003.nc']
Dvar_input = {
'f1':['ZS', 'UT', 'WT', 'THT', 'RVT','LSUM','LSTHM','CFLU','CFLW','ni_u','level','ZTOP', 'ni','level_w','time'],
'f2':['ZS', 'UT', 'WT', 'THT', 'RVT','LSUM','LSTHM','CFLU','CFLW','ni_u','level','ZTOP', 'ni', 'level_w', 'time']
}
# Read the variables in the files
Dvar = {}
Dvar = read_netcdf(LnameFiles, Dvar_input, path=path, removeHALO=True)
# Compute altitude variable in 2D with a 1D topography
Dvar['f1']['altitude'], Dvar['f1']['ni_u_2D'] = comp_altitude1DVar(Dvar['f1']['UT'], Dvar['f1']['ZS'],Dvar['f1']['ZTOP'], Dvar['f1']['level'],Dvar['f1']['ni_u'])
Dvar['f1']['altitude_w'], Dvar['f1']['ni_2D'] = comp_altitude1DVar(Dvar['f1']['WT'], Dvar['f1']['ZS'],Dvar['f1']['ZTOP'], Dvar['f1']['level_w'],Dvar['f1']['ni'])
orog = Dvar['f1']['ZS'][101:158]
################################################################
######### PANEL 1 & 2
###############################################################
Panel1 = PanelPlot(2,2, [20,20],'001_2DRelief zoomed plots')
Lplot = [ Dvar['f1']['UT'][:,101:158], Dvar['f2']['UT'][:,101:158], Dvar['f1']['THT'][:,101:158], Dvar['f2']['THT'][:,101:158] ,
Dvar['f1']['WT'][:,101:158], Dvar['f2']['WT'][:,101:158], Dvar['f1']['RVT'][:,101:158], Dvar['f2']['RVT'][:,101:158] ]
LaxeX = [Dvar['f1']['ni_u_2D'][:,101:158]]*2
LaxeX.extend([Dvar['f1']['ni_2D'][:,101:158] for i in range(6)]) #ni for all except UT
LaxeZ = [Dvar['f1']['altitude'][:,101:158]]*4
LaxeZ.extend([Dvar['f1']['altitude_w'][:,101:158] for i in range(2)]) #altitude_w only for WT
LaxeZ.extend([Dvar['f1']['altitude'][:,101:158] for i in range(2)])
Ltitle = ['u-wind UT', 'u-wind UT', 'Potential temperature THT', 'Potential temperature THT',
'Vertical velocity WT','Vertical velocity WT','Water vapor mixing ratio RVT', 'Water vapor mixing ratio RVT']
Lcbarlabel = ['m/s', 'm/s', 'K', 'K', 'm/s','m/s','g/kg','g/kg']
Lxlab = ['x (m)']*len(Lplot)
Lylab = ['altitude (m)']*len(Lplot)
Lylim = [(0,8000.1)]*len(Lplot)
Lminval = [5.2, 5.2, 285, 285, -0.4, -0.4, 0.2, 0.2]
Lmaxval = [12.4, 12.4, 330, 330, 0.28, 0.28, 4.0, 4.0]
Lstep = [0.4, 0.4, 2.5, 2.5, 0.04, 0.04, 0.2, 0.2]
Lstepticks = Lstep
Lfacconv = [1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1000.0, 1000.0]
Ltime = [Dvar['f1']['time'], Dvar['f2']['time']]*4
LcolorLine = ['gist_rainbow_r']*len(Lplot)
Lpltype = ['c']*len(Lplot)
fig1 = Panel1.psectionV(Lxx=LaxeX[0:4], Lzz=LaxeZ[0:4], Lvar=Lplot[0:4], Lxlab=Lxlab[0:4], Lylab=Lylab[0:4], Ltitle=Ltitle[0:4],Lpltype=Lpltype,
Lminval=Lminval[0:4], Lmaxval=Lmaxval[0:4], Lstep=Lstep[0:4], Lstepticks=Lstepticks[0:4], LcolorLine=LcolorLine[0:4],
Lcbarlabel=Lcbarlabel[0:4], Lfacconv=Lfacconv[0:4], orog=orog, Lylim=Lylim[0:4], colorbar=False, Ltime=Ltime[0:4])
Panel1.save_graph(1,fig1)
Panel2 = PanelPlot(2,2, [20,20],'001_2DRelief zoomed plots')
Lcolormap = ['gist_rainbow_r']*len(Lplot)
fig2 = Panel2.psectionV(Lxx=LaxeX[:4], Lzz=LaxeZ[:4], Lvar=Lplot[:4], Lxlab=Lxlab[:4], Lylab=Lylab[:4], Ltitle=Ltitle[:4],
Lminval=Lminval[:4], Lmaxval=Lmaxval[:4], Lstep=Lstep[:4], Lstepticks=Lstepticks[:4], Lcolormap=Lcolormap[:4],
Lcbarlabel=Lcbarlabel[:4], Lfacconv=Lfacconv[:4], orog=orog, Lylim=Lylim[:4], colorbar=True, Ltime=Ltime[:4])
Panel2.save_graph(2,fig2)
################################################################
######### PANEL 3 & 4
###############################################################
Panel3 = PanelPlot(2,2, [20,20],'001_2DRelief full domain')
Lplot = [ Dvar['f1']['UT'][:,:], Dvar['f2']['UT'][:,:], Dvar['f1']['THT'][:,:], Dvar['f2']['THT'][:,:] ,
Dvar['f1']['WT'][:,:], Dvar['f2']['WT'][:,:], Dvar['f1']['RVT'][:,:], Dvar['f2']['RVT'][:,:] ]
orog = Dvar['f1']['ZS'][:]
Lylim = [(0,15000.1)]*len(Lplot)
LaxeX = [Dvar['f1']['ni_u_2D'][:,:]]*2
LaxeX.extend([Dvar['f1']['ni_2D'][:,:] for i in range(6)]) #ni for all except UT
LaxeZ = [Dvar['f1']['altitude'][:,:]]*4
LaxeZ.extend([Dvar['f1']['altitude_w'][:,:] for i in range(2)]) #altitude_w only for WT
LaxeZ.extend([Dvar['f1']['altitude'][:,:] for i in range(2)])
Lpltype = ['c']*len(Lplot)
fig3 = Panel3.psectionV(Lxx=LaxeX[0:4], Lzz=LaxeZ[0:4], Lvar=Lplot[0:4], Lxlab=Lxlab[0:4], Lylab=Lylab[0:4], Ltitle=Ltitle[0:4], Lpltype=Lpltype,
Lminval=Lminval[0:4], Lmaxval=Lmaxval[0:4], Lstep=Lstep[0:4], Lstepticks=Lstepticks[0:4], LcolorLine=LcolorLine[0:4],
Lcbarlabel=Lcbarlabel[0:4], Lfacconv=Lfacconv[0:4], orog=orog, Lylim=Lylim[0:4], colorbar=False, Ltime=Ltime[0:4])
Panel3.save_graph(3,fig3)
Panel4 = PanelPlot(2,2, [20,20],'001_2DRelief full domain')
fig4 = Panel4.psectionV(Lxx=LaxeX[:4], Lzz=LaxeZ[:4], Lvar=Lplot[:4], Lxlab=Lxlab[:4], Lylab=Lylab[:4], Ltitle=Ltitle[:4],
Lminval=Lminval[:4], Lmaxval=Lmaxval[:4], Lstep=Lstep[:4], Lstepticks=Lstepticks[:4], Lcolormap=Lcolormap[:4],
Lcbarlabel=Lcbarlabel[:4], Lfacconv=Lfacconv[:4], orog=orog, Lylim=Lylim[:4], colorbar=True, Ltime=Ltime[:4])
Panel4.save_graph(4,fig4)
################################################################
######### PANEL 5
###############################################################
Panel5 = PanelPlot(2,2, [20,20],'001_2DRelief')
Lplot = [ Dvar['f1']['CFLU'][:,:], Dvar['f2']['CFLU'][:,:], Dvar['f1']['CFLW'][:,:], Dvar['f2']['CFLW'][:,:]]
LaxeX = [Dvar['f1']['ni_2D'][:,:]]*4
LaxeZ = [Dvar['f1']['altitude'][:,:]]*4
Ltitle = ['CFLU','CFLU','CFLW','CFLW']
Lcbarlabel = ['-']*len(Lplot)
Lxlab = ['x (m)']*len(Lplot)
Lylab = ['altitude (m)']*len(Lplot)
Lylim = [(0,15000.1)]*len(Lplot)
Lminval = [0.03,0.03,0.004,0.004]
Lmaxval = [0.078,0.078,0.072,0.072]
Lstep = [0.003, 0.003, 0.004,0.004]
Lstepticks = Lstep
Lcolormap = ['gist_rainbow_r']*len(Lplot)
Ltime = [Dvar['f1']['time'], Dvar['f2']['time']]*2
fig5 = Panel5.psectionV(Lxx=LaxeX, Lzz=LaxeZ, Lvar=Lplot, Lxlab=Lxlab, Lylab=Lylab, Ltitle=Ltitle, Lminval=Lminval, Lmaxval=Lmaxval,
Lstep=Lstep, Lstepticks=Lstepticks, Lcolormap=Lcolormap, Lcbarlabel=Lcbarlabel,
orog=orog, Lylim=Lylim, colorbar=True, Ltime=Ltime)
Panel5.save_graph(5,fig5)
################################################################
######### PANEL 6
###############################################################
Dvar['f1']['altitude'], Dvar['f1']['ni_u_2D'] = comp_altitude1DVar(Dvar['f1']['UT'], Dvar['f1']['ZS'],Dvar['f1']['ZTOP'], Dvar['f1']['level'],Dvar['f1']['ni_u'])
Dvar['f1']['THT-LSTHM'] = copy.deepcopy(Dvar['f1']['THT'])
Dvar['f1']['THT-LSTHM'] = Dvar['f1']['THT'] - Dvar['f1']['LSTHM']
Dvar['f2']['altitude'], Dvar['f2']['ni_u_2D'] = comp_altitude1DVar(Dvar['f2']['UT'], Dvar['f2']['ZS'],Dvar['f2']['ZTOP'], Dvar['f2']['level'],Dvar['f2']['ni_u'])
Dvar['f2']['THT-LSTHM'] = copy.deepcopy(Dvar['f2']['THT'])
Dvar['f2']['THT-LSTHM'] = Dvar['f2']['THT'] - Dvar['f2']['LSTHM']
Dvar['f1']['UT-LSUM'] = copy.deepcopy(Dvar['f1']['UT'])
Dvar['f1']['UT-LSUM'] = Dvar['f1']['UT'] - Dvar['f1']['LSUM']
Dvar['f2']['UT-LSUM'] = copy.deepcopy(Dvar['f2']['UT'])
Dvar['f2']['UT-LSUM'] = Dvar['f2']['UT'] - Dvar['f2']['LSUM']
Panel6 = PanelPlot(2,2, [20,20],'Profiles at the center (top of the topography)')
Lplot = [ Dvar['f1']['WT'][:,127]]
LaxeZ = [Dvar['f1']['altitude'][:,127]]*len(Lplot)
Ltitle = ['WT and THT-LSTHM']*len(Lplot)
Llinelabel = ['WT']
Lxlab = ['velocity (m/s)']*len(Lplot)
Lylab = ['altitude (m)']*len(Lplot)
Lylim = [(0,15000.1)]*len(Lplot)
Lxlim = [(-0.3,0.3)]
Llinecolor = ['r']
LaxisColor = Llinecolor
Llvl = [0]*len(Lplot)
Ltime = [Dvar['f1']['time']]
fig6 = Panel6.pXY_lines(Lzz=LaxeZ, Lvar=Lplot, Lxlab=Lxlab, Lylab=Lylab, Ltitle=Ltitle, Lylim=Lylim, Lxlim=Lxlim, Llinelabel=Llinelabel,
Llinecolor=Llinecolor, LaxisColor=LaxisColor, Ltime=Ltime)
Lplot = [ Dvar['f1']['THT-LSTHM'][:,127]]
Ltitle = []
Llinelabel = ['THT - LSTHM ']
Lxlab = ['theta perturb (K)']*len(Lplot)
Lylab = ['altitude (m)']*len(Lplot)
Lylim = [(0,15000.1)]*len(Lplot)
Lxlim = [(-0.8,0.1)]
Llinecolor = ['g']
LaxisColor = Llinecolor
Llvl = [0]*len(Lplot)
fig7 = Panel6.pXY_lines(Lzz=LaxeZ, Lvar=Lplot, Lxlab=Lxlab, Lylab=Lylab, Ltitle=Ltitle,ax=fig6.axes, id_overlap=1,
Lylim=Lylim, Lxlim=Lxlim, Llinelabel=Llinelabel, Llinecolor=Llinecolor,LaxisColor=LaxisColor, Ltime=Ltime)
Lplot = [ Dvar['f2']['WT'][:,127]]
LaxeZ = [Dvar['f2']['altitude'][:,127]]*len(Lplot)
Ltitle = ['WT and THT-LSTHM']*len(Lplot)
Llinelabel = ['WT']
Lxlab = ['velocity (m/s)']*len(Lplot)
Lylab = ['altitude (m)']*len(Lplot)
Lylim = [(0,15000.1)]*len(Lplot)
Lxlim = [(-0.3,0.3)]
Llinecolor = ['r']
LaxisColor = Llinecolor
Llvl = [0]*len(Lplot)
Ltime = [Dvar['f2']['time']]
fig8 = Panel6.pXY_lines(Lzz=LaxeZ, Lvar=Lplot, Lxlab=Lxlab, Lylab=Lylab, Ltitle=Ltitle, Lylim=Lylim, Lxlim=Lxlim, Llinelabel=Llinelabel,
Llinecolor=Llinecolor, LaxisColor=LaxisColor, Ltime=Ltime, ax=fig7.axes)
Lplot = [ Dvar['f2']['THT-LSTHM'][:,127]]
Ltitle = []
Llinelabel = ['THT - LSTHM ']
Lxlab = ['theta perturb (K)']*len(Lplot)
Lylab = ['altitude (m)']*len(Lplot)
Lylim = [(0,15000.1)]*len(Lplot)
Lxlim = [(-0.1,0.2)]
Llinecolor = ['g']
LaxisColor = Llinecolor
Llvl = [0]*len(Lplot)
fig9 = Panel6.pXY_lines(Lzz=LaxeZ, Lvar=Lplot, Lxlab=Lxlab, Lylab=Lylab, Ltitle=Ltitle, ax=fig8.axes, id_overlap=1,
Lylim=Lylim, Lxlim=Lxlim, Llinelabel=Llinelabel, Llinecolor=Llinecolor, LaxisColor=LaxisColor, Ltime=Ltime)
# WT and UT-LSUM
Lplot = [ Dvar['f1']['WT'][:,127]]
LaxeZ = [Dvar['f1']['altitude'][:,127]]*len(Lplot)
Ltitle = ['WT and UT-LSUM']*len(Lplot)
Llinelabel = ['WT']
Lxlab = ['velocity (m/s)']*len(Lplot)
Lylab = ['altitude (m)']*len(Lplot)
Lylim = [(0,15000.1)]*len(Lplot)
Lxlim = [(-0.3,0.3)]
Llinecolor = ['r']
LaxisColor = Llinecolor
Llvl = [0]*len(Lplot)
Ltime = [Dvar['f1']['time']]
fig10 = Panel6.pXY_lines(Lzz=LaxeZ, Lvar=Lplot, Lxlab=Lxlab, Lylab=Lylab, Ltitle=Ltitle, Lylim=Lylim, Lxlim=Lxlim, Llinelabel=Llinelabel,
Llinecolor=Llinecolor, LaxisColor=LaxisColor, Ltime=Ltime, ax=fig9.axes)
Lplot = [ Dvar['f1']['UT-LSUM'][:,127]]
Ltitle = []
Llinelabel = ['UT - LSUM ']
Lxlab = ['u perturb (K)']*len(Lplot)
Lylab = ['altitude (m)']*len(Lplot)
Lylim = [(0,15000.1)]*len(Lplot)
Lxlim = [(-0.2,0.8)]
Llinecolor = ['g']
LaxisColor = Llinecolor
Llvl = [0]*len(Lplot)
fig11 = Panel6.pXY_lines(Lzz=LaxeZ, Lvar=Lplot, Lxlab=Lxlab, Lylab=Lylab, Ltitle=Ltitle, ax=fig10.axes, id_overlap=1,
Lylim=Lylim, Lxlim=Lxlim, Llinelabel=Llinelabel, Llinecolor=Llinecolor,LaxisColor=LaxisColor, Ltime=Ltime)
Lplot = [ Dvar['f2']['WT'][:,127]]
LaxeZ = [Dvar['f2']['altitude'][:,127]]*len(Lplot)
Ltitle = ['WT and UT-LSUM']*len(Lplot)
Llinelabel = ['WT']
Lxlab = ['velocity (m/s)']*len(Lplot)
Lylab = ['altitude (m)']*len(Lplot)
Lylim = [(0,15000.1)]*len(Lplot)
Lxlim = [(-0.3,0.3)]
Llinecolor = ['r']
LaxisColor = Llinecolor
Llvl = [0]*len(Lplot)
Ltime = [Dvar['f2']['time']]
fig12 = Panel6.pXY_lines(Lzz=LaxeZ, Lvar=Lplot, Lxlab=Lxlab, Lylab=Lylab, Ltitle=Ltitle, Lylim=Lylim, Lxlim=Lxlim, Llinelabel=Llinelabel,
Llinecolor=Llinecolor, LaxisColor=LaxisColor, Ltime=Ltime, ax=fig11.axes)
Lplot = [ Dvar['f2']['UT-LSUM'][:,127]]
Ltitle = []
Llinelabel = ['UT - LSUM ']
Lxlab = ['u perturb (K)']*len(Lplot)
Lylab = ['altitude (m)']*len(Lplot)
Lylim = [(0,15000.1)]*len(Lplot)
Lxlim = [(-2.0,2.0)]
Llinecolor = ['g']
LaxisColor = Llinecolor
Llvl = [0]*len(Lplot)
fig13 = Panel6.pXY_lines(Lzz=LaxeZ, Lvar=Lplot, Lxlab=Lxlab, Lylab=Lylab, Ltitle=Ltitle,ax=fig12.axes, id_overlap=1,
Lylim=Lylim, Lxlim=Lxlim, Llinelabel=Llinelabel, Llinecolor=Llinecolor, LaxisColor=LaxisColor, Ltime=Ltime)
Panel6.save_graph(6,fig13)
#!/bin/bash
#MNH_LIC Copyright 1994-2014 CNRS, Meteo-France and Universite Paul Sabatier
#MNH_LIC This is part of the Meso-NH software governed by the CeCILL-C licence
#MNH_LIC version 1. See LICENSE, CeCILL-C_V1-en.txt and CeCILL-C_V1-fr.txt
#MNH_LIC for details. version 1.
set -x
set -e
ln -sf ${SRC_MESONH}/src/LIB/Python/* .
ln -sf ../002_mesonh/EXPER.1.HYD2D.002.nc .
ln -sf ../002_mesonh/EXPER.1.HYD2D.003.nc .
python3 plot_001_2DRelief.py
${POSTRUN} convert *.png 001_2DRelief.pdf
${POSTRUN} evince 001_2DRelief.pdf
#!/bin/bash
rm -f EXPER.1.HYD2D*
rm -f gmeta OUT*
rm -f rm dir.*:*
visu
! directives generales
LINVWB=T
! plages de couleur
LCOLAREA=T LISO=F
XLWCONT=2
LMINMAX=T
! label de toutes les iso
NULBLL=0
! pour obtenir des labels d isolignes
XSIZEL=0.012
! localisation du minmax dans le print minmax
LMNMXLOC=T
! High&Low
NHI=0
! label des axes en indices plutot que km en CH
LINDAX=T
NIGRNC=10
! vecteur
XVRL=0.15
NISKIP=4
! pas de dilatation de la composante W
LDILW=F
! min max vecteur
LVECTMNMX=T
! min max du zoom si NIMNMX<=0
LCVZOOM=T
! normaliser la longueur des vecteurs a 20m/s et tracer tous les vecteurs
XVHC=-20
LVSUPSCA=T
! pour agrandir la legende a droite
LVPTUSER=T
XVPTL=0.1 XVPTR=0.9 !XVPTT=0.8
!LVPTVUSER=T
!XVPTVL=0.08 XVPTVR=0.78 XVPTVT=0.8
!LVPTPVUSER=T
!XVPTPVL=0.08 XVPTPVR=0.78 XVPTPVT=0.8
!LVPTXYUSER=T
!XVPTXYL=0.08 XVPTXYR=0.78 XVPTXYT=0.8
_file_'EXPER.1.HYD2D.002-3d'
LCOLINE=T LCOLAREA=F
! coupe verticale
nidebcou=2 njdebcou=1 nlangle=0 xhmin=0 xhmax=15000 nlmax=256 lpointg=.T.
UT_CV_
THT_CV_
WT_CV_
RVT_CV_
CFLU_CV_
CFLV_CV_
CFLW_CV_
!profile
PROFILE=128
WT_T_time1_PV__ON_THT_T_time1_PV__MINUS_LSTHM_T_time1_PV_
WT_T_time2_PV__ON_THT_T_time1_PV__MINUS_LSTHM_T_time2_PV_
WT_T_time1_PV__ON_UT_T_time2_PV__MINUS_LSUM_T_time1_PV_
WT_T_time2_PV__ON_UT_T_time2_PV__MINUS_LSUM_T_time2_PV_
!
! a vous d indiquer vos directives
quit
#!/bin/bash
#MNH_LIC Copyright 1994-2014 CNRS, Meteo-France and Universite Paul Sabatier
#MNH_LIC This is part of the Meso-NH software governed by the CeCILL-C licence
#MNH_LIC version 1. See LICENSE, CeCILL-C_V1-en.txt and CeCILL-C_V1-fr.txt
#MNH_LIC for details. version 1.
set -x
set -e
ln -sf ../003_convdia/EXPER.1.HYD2D.002-3d.{des,lfi} .
rm -f dir.0*
${POSTRUN} diaprog < dir.2Drelief
...@@ -23,35 +23,33 @@ begin ...@@ -23,35 +23,33 @@ begin
mdims = getfilevardimsizes(fichier1,"UT") mdims = getfilevardimsizes(fichier1,"UT")
nd = dimsizes(mdims) nd = dimsizes(mdims)
imax=mdims(nd-1)-2*jphext imax=mdims(nd-1)-2*jphext
jmax=mdims(nd-2)-2*jphext kmax=mdims(nd-2)-2
kmax=mdims(nd-3)-2
zs = fichier1->ZS(jphext:imax+jphext-1) ; ZS
zs = fichier1->ZS(0,jphext:imax+jphext-1) ; ZS
zhat = fichier1->ZHAT(1:kmax+1) ; ZHAT zhat = fichier1->ZHAT(1:kmax+1) ; ZHAT
xhat = fichier1->XHAT(jphext:imax+jphext-1+1) ; XHAT xhat = fichier1->XHAT(jphext:imax+jphext-1+1) ; XHAT
lsthm1 = fichier1->LSTHM(0,1:kmax,0,jphext:imax+jphext-1) ; LSTHM lsthm1 = fichier1->LSTHM(0,1:kmax,jphext:imax+jphext-1) ; LSTHM
lsthm1@long_name="LSTHM" lsthm1@long_name="LSTHM"
lsthm1@units="K" lsthm1@units="K"
lsum1_old = fichier1->LSUM(0,1:kmax,0,jphext:imax+jphext-1+1) ; LSUM lsum1_old = fichier1->LSUM(0,1:kmax,jphext:imax+jphext-1+1) ; LSUM
wt1_old= fichier1->WT(0,1:kmax+1,0,jphext:imax+jphext-1) ; WT wt1_old= fichier1->WT(0,1:kmax+1,jphext:imax+jphext-1) ; WT
ut1_old= fichier1->UT(0,1:kmax,0,jphext:imax+jphext-1+1) ; UT ut1_old= fichier1->UT(0,1:kmax,jphext:imax+jphext-1+1) ; UT
tht1= fichier1->THT(0,1:kmax,0,jphext:imax+jphext-1) ; THT tht1= fichier1->THT(0,1:kmax,jphext:imax+jphext-1) ; THT
tht1@long_name="Potential Temperature" tht1@long_name="Potential Temperature"
tht1@units="K" tht1@units="K"
rvt1= fichier1->RVT(0,1:kmax,0,jphext:imax+jphext-1) ; RVT rvt1= fichier1->RVT(0,1:kmax,jphext:imax+jphext-1) ; RVT
rvt1@long_name="Vapor mixing ratio" rvt1@long_name="Vapor mixing ratio"
rvt1@units="g/kg" rvt1@units="g/kg"
cflu1= fichier1->CFLU(0,1:kmax,0,jphext:imax+jphext-1) ; CFLU cflu1= fichier1->CFLU(0,1:kmax,jphext:imax+jphext-1) ; CFLU
cflu1@long_name="CFLU" cflu1@long_name="CFLU"
cflu1@units="-" cflu1@units="-"
cflw1= fichier1->CFLW(0,1:kmax,0,jphext:imax+jphext-1) ; CFLW cflw1= fichier1->CFLW(0,1:kmax,jphext:imax+jphext-1) ; CFLW
cflw1@long_name="CFLW" cflw1@long_name="CFLW"
cflw1@units=" " cflw1@units=" "
...@@ -60,27 +58,27 @@ SS1=fichier1->DTCUR ...@@ -60,27 +58,27 @@ SS1=fichier1->DTCUR
;YYYYDDMM2= fichier2->DTCUR__TDATE ;YYYYDDMM2= fichier2->DTCUR__TDATE
SS2=fichier2->DTCUR SS2=fichier2->DTCUR
lsthm2 = fichier2->LSTHM(0,1:kmax,0,jphext:imax+jphext-1) ; LSTHM lsthm2 = fichier2->LSTHM(0,1:kmax,jphext:imax+jphext-1) ; LSTHM
lsthm2@long_name="LSTHM" lsthm2@long_name="LSTHM"
lsthm2@units="K" lsthm2@units="K"
lsum2_old = fichier2->LSUM(0,1:kmax,0,jphext:imax+jphext-1+1) ; LSUM lsum2_old = fichier2->LSUM(0,1:kmax,jphext:imax+jphext-1+1) ; LSUM
wt2_old= fichier2->WT(0,1:kmax+1,0,jphext:imax+jphext-1) ; WT wt2_old= fichier2->WT(0,1:kmax+1,jphext:imax+jphext-1) ; WT
ut2_old= fichier2->UT(0,1:kmax,0,jphext:imax+jphext-1+1) ; UT ut2_old= fichier2->UT(0,1:kmax,jphext:imax+jphext-1+1) ; UT
tht2= fichier2->THT(0,1:kmax,0,jphext:imax+jphext-1) ; THT tht2= fichier2->THT(0,1:kmax,jphext:imax+jphext-1) ; THT
tht2@long_name="Potential Temperature" tht2@long_name="Potential Temperature"
tht2@units="K" tht2@units="K"
rvt2= fichier2->RVT(0,1:kmax,0,jphext:imax+jphext-1) ; RVT rvt2= fichier2->RVT(0,1:kmax,jphext:imax+jphext-1) ; RVT
rvt2@long_name="Vapor mixing ratio" rvt2@long_name="Vapor mixing ratio"
rvt2@units="g/kg" rvt2@units="g/kg"
cflu2= fichier2->CFLU(0,1:kmax,0,jphext:imax+jphext-1) ; CFLU cflu2= fichier2->CFLU(0,1:kmax,jphext:imax+jphext-1) ; CFLU
cflu2@long_name="CFLU" cflu2@long_name="CFLU"
cflu2@units="-" cflu2@units="-"
cflw2= fichier2->CFLW(0,1:kmax,0,jphext:imax+jphext-1) ; CFLW cflw2= fichier2->CFLW(0,1:kmax,jphext:imax+jphext-1) ; CFLW
cflw2@long_name="CFLW" cflw2@long_name="CFLW"
cflw2@units=" " cflw2@units=" "
......
all: all:
cd 001_prep_ideal_case && run_prep_ideal_case_xyz cd 001_prep_ideal_case && run_prep_ideal_case_xyz
cd 002_mesonh && run_mesonh_xyz cd 002_mesonh && run_mesonh_xyz
cd 003_convdia && run_conv2dia cd 003_python && run_python
cd 004_diaprog && run_diaprog cd 004_ncl && run_ncl
cd 005_ncl && run_ncl
clean: clean:
cd 001_prep_ideal_case && clean_prep_ideal_case_xyz cd 001_prep_ideal_case && clean_prep_ideal_case_xyz
cd 002_mesonh && clean_mesonh_xyz cd 002_mesonh && clean_mesonh_xyz
cd 003_convdia && clean_conv2dia cd 003_python && clean_python
cd 004_diaprog && clean_diaprog cd 004_ncl && clean_ncl
cd 005_ncl && clean_ncl
#!/bin/bash
set -x
rm -f REL3D.1.EXP01.002.{des,lfi,nc}
rm -f REL3D.1.EXP01.002dg.{des,lfi,nc}
rm -f dirconv FICJD LISTING_DIA OUT_DIA pipe_name
1
REL3D.1.EXP01.002
REL3D.1.EXP01.002dg
n
n
0
#!/bin/bash
rm -f *.png *.pdf *.nc
rm -Rf __pycache__
find . -type l -delete
#!/usr/bin/env python3
"""
@author: Quentin Rodier
Creation : 07/01/2021
Last modifications
"""
import matplotlib as mpl
mpl.use('Agg')
from read_MNHfile import read_netcdf
from Panel_Plot import PanelPlot
from misc_functions import comp_altitude2DVar
import cartopy.crs as ccrs
import os
os.system('rm -f tempgraph*')
#
# User's parameter / Namelist
#
output_name = '002_3DRelief.pdf' #Name of the output PDF file
path=""
LnameFiles = ['REL3D.1.EXP01.002.nc']
Dvar_input = {
'f1':['ZS', 'UT', 'WT','ni_u','nj_u','level','ZTOP', 'ni','nj','level_w','time']}
# Read the variables in the files
Dvar = {}
Dvar = read_netcdf(LnameFiles, Dvar_input, path=path, removeHALO=True)
# Compute altitude variable in 3D with a 2D topography
Dvar['f1']['altitude'], Dvar['f1']['ni_u_3D'], Dvar['f1']['nj_u_3D'] = comp_altitude2DVar(Dvar['f1']['UT'], Dvar['f1']['ZS'],Dvar['f1']['ZTOP'], Dvar['f1']['level'], Dvar['f1']['ni_u'], Dvar['f1']['nj_u'])
Dvar['f1']['altitude_w'], Dvar['f1']['ni_3D'], Dvar['f1']['nj_3D'] = comp_altitude2DVar(Dvar['f1']['WT'], Dvar['f1']['ZS'],Dvar['f1']['ZTOP'], Dvar['f1']['level_w'],Dvar['f1']['ni'], Dvar['f1']['nj'])
orog = Dvar['f1']['ZS'][15,:]
################################################################
######### PANEL 1
###############################################################
Panel1 = PanelPlot(2,2, [20,20],'003_2DRelief vertical and horizontal sections')
Lplot = [ Dvar['f1']['UT'][:,15,:], Dvar['f1']['WT'][:,15,:]]
LaxeX = [Dvar['f1']['ni_u_3D'][:,15,:], Dvar['f1']['ni_3D'][:,15,:]]
LaxeZ = [Dvar['f1']['altitude'][:,15,:], Dvar['f1']['altitude_w'][:,15,:]]
Ltitle = ['u-wind UT', 'Vertical velocity WT',]
Lcbarlabel = ['m/s']*len(Lplot)
Lxlab = ['x (m)']*len(Lplot)
Lylab = ['altitude (m)']*len(Lplot)
Lylim = [(0,10000.1)]*len(Lplot)
Lminval = [8, -1.2]
Lmaxval = [14, 0.9]
Lstep = [0.25, 0.1]
Lstepticks = Lstep
Lcolormap = ['gist_rainbow_r']*len(Lplot)
Ltime = [Dvar['f1']['time']]*len(Lplot)
Lprojection = [ccrs.PlateCarree()]*len(Lplot)
fig1 = Panel1.psectionV(Lxx=LaxeX, Lzz=LaxeZ, Lvar=Lplot, Lxlab=Lxlab, Lylab=Lylab, Ltitle=Ltitle, Lminval=Lminval, Lmaxval=Lmaxval,
Lstep=Lstep, Lstepticks=Lstepticks, Lcolormap=Lcolormap, Lcbarlabel=Lcbarlabel,
orog=orog, Lylim=Lylim, colorbar=True, Ltime=Ltime)
# Horizontal cross-section
Lplot = [ Dvar['f1']['UT'], Dvar['f1']['WT']]
Ltitle = ['u-wind UT at K=2', 'Vertical velocity WT at K=2',]
LaxeX = [Dvar['f1']['ni_u'], Dvar['f1']['ni']]
LaxeY = [Dvar['f1']['nj_u'], Dvar['f1']['nj']]
Llvl = [0]*len(Lplot)
fig2 = Panel1.psectionH(lon=LaxeX, lat=LaxeY, Lvar=Lplot, Llevel=Llvl, Lxlab=Lxlab, Lylab=Lylab, Ltitle=Ltitle, Lminval=Lminval, Lmaxval=Lmaxval,
Lstep=Lstep, Lstepticks=Lstepticks, Lcolormap=Lcolormap, Lcbarlabel=Lcbarlabel,
colorbar=True, Ltime=Ltime, ax=fig1.axes)
Panel1.save_graph(1,fig2)
#!/bin/bash
#MNH_LIC Copyright 1994-2014 CNRS, Meteo-France and Universite Paul Sabatier
#MNH_LIC This is part of the Meso-NH software governed by the CeCILL-C licence
#MNH_LIC version 1. See LICENSE, CeCILL-C_V1-en.txt and CeCILL-C_V1-fr.txt
#MNH_LIC for details. version 1.
set -x
set -e
ln -sf ${SRC_MESONH}/src/LIB/Python/* .
ln -sf ../002_mesonh/REL3D.1.EXP01.002.nc .
python3 plot_002_3DRelief.py
${POSTRUN} convert *.png 002_3DRelief.pdf
${POSTRUN} evince 002_3DRelief.pdf
#!/bin/bash
set -x
rm -f dir.* gmeta REL3D* OUT_DIA
visu
_file1_'REL3D.1.EXP01.002dg'
print groups
UT_k_2_file1_
liso=f
lcolarea=t
UT_k_2_file1_
quit
_file2_'REL3D_autre_run'
UT_k_2_file2_
UT_k_2_file1__minus_UT_k_2_file2_
quit
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment