Skip to content
Snippets Groups Projects
Commit 08e98165 authored by Gaelle Tanguy's avatar Gaelle Tanguy Committed by WAUTELET Philippe
Browse files

Gaelle 2/12/2015 : MAJ 001_2Drelief

parent 3071c35e
No related branches found
No related tags found
No related merge requests found
rm -f HYD2D.* OUTPUT_LISTING* pipe* *.tex
rm -f HYD2D.* OUTPUT_LISTING* pipe* *.tex file_for_xtransfer
&NAM_CONFIO LCDF4=T, LLFIOUT=T, LLFIREAD=F /
&NAM_LUNITn CINIFILE = "HYD2D" /
&NAM_CONFn LUSERV = T /
&NAM_DYNn XTSTEP = 30.0, LITRADJ = T,
......@@ -10,7 +11,9 @@
&NAM_TURBn XIMPL = 1., CTURBLEN = "DELT", CTURBDIM = "3DIM",
LTURB_DIAG = T, LTURB_FLX = T /
&NAM_CONF CCONF = "START", LFLAT = F, NMODEL = 1, NVERB = 5,
CEXP = "EXPER", CSEG = "HYD2D" /
CEXP = "EXPER", CSEG = "HYD2D"
!JPHEXT=3 NHALO=3
/
&NAM_DYN XSEGLEN =1080., XASSELIN = 0.2, LCORIO = F,
XALKTOP = 0.005, XALZBOT = 12570., LNUMDIFU =.T. /
&NAM_FMOUT XFMOUT(1,1) = 360., XFMOUT(1,2) = 720., XFMOUT(1,3) = 1080. /
&NAM_CONFIO LCDF4=T, LLFIOUT=T, LLFIREAD=F /
&NAM_LUNITn CINIFILE = "HYD2D" /
&NAM_CONFn LUSERV = T /
&NAM_DYNn XTSTEP = 120.0, LITRADJ = T,
LHORELAX_UVWTH = F, LHORELAX_RV = F, LVE_RELAX = F,
XT4DIFU = 1500. /
&NAM_ADVn CUVW_ADV_SCHEME='WENO_K', LCFL_WRIT=T /
&NAM_ADVn CUVW_ADV_SCHEME='WENO_K', LCFL_WRIT=T ,NWENO_ORDER=5,CTEMP_SCHEME='RK53'/
&NAM_PARAMn CTURB = "TKEL" /
&NAM_PARAM_GROUNDn /
&NAM_LBCn CLBCX = 2*"OPEN", CLBCY = 2*"CYCL", XCPHASE = 20. /
&NAM_TURBn XIMPL = 1., CTURBLEN = "DELT", CTURBDIM = "3DIM",
LTURB_DIAG = T, LTURB_FLX = T /
&NAM_CONF CCONF = "START", LFLAT = F, NMODEL = 1, NVERB = 5,
CEXP = "EXPER", CSEG = "HYD2D" /
CEXP = "EXPER", CSEG = "HYD2D"
!JPHEXT=3 NHALO=3
/
&NAM_DYN XSEGLEN =1080., XASSELIN = 0.2, LCORIO = F,
XALKTOP = 0.005, XALZBOT = 12570., LNUMDIFU =.F. /
&NAM_FMOUT XFMOUT(1,1) = 360., XFMOUT(1,2) = 720., XFMOUT(1,3) = 1080. /
rm -f HYD2D* pipe_name PRESSURE
rm -f HYD2D* pipe_name PRESSURE file_for_xtransfer
rm -f EXPER.1.HYD* OUT*
rm -f *.nc4 *.ps
;================================================;
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
; ================================================;
;================================================;
begin
;=================================================;
; open file and read in data
;=================================================;
fichier1 = addfile("EXPER.1.HYD2D.002.nc4", "r")
fichier2 = addfile("EXPER.1.HYD2D.003.nc4", "r")
;==================================================;
; Open the workstation
;==================================================;
type = "ps"
wks = gsn_open_wks(type,"visu_2Drelief")
;=================================================;
; lecture des différents champs
;=================================================;
zs = fichier1->ZS(0,:) ; ZS
zhat = fichier1->ZHAT(:) ; ZHAT
xhat = fichier1->XHAT(:) ; XHAT
lsum1_old = fichier1->LSUM(:,0,:) ; LSUM
lsthm1 = fichier1->LSTHM(:,0,:) ; LSTHM
lsthm1@long_name="LSTHM"
lsthm1@units="K"
wt1_old= fichier1->WT(:,0,:) ; WT
ut1_old= fichier1->UT(:,0,:) ; UT
tht1= fichier1->THT(:,0,:) ; THT
tht1@long_name="Potential Temperature"
tht1@units="K"
rvt1= fichier1->RVT(:,0,:) ; RVT
rvt1@long_name="Vapor mixing ratio"
rvt1@units="g/kg"
cflu1= fichier1->CFLU(:,0,:) ; CFLU
cflu1@long_name="CFLU"
cflu1@units="-"
cflw1= fichier1->CFLW(:,0,:) ; CFLW
cflw1@long_name="CFLW"
cflw1@units=" "
YYYYDDMM1= fichier1->DTCUR__TDATE
SS1=fichier1->DTCUR__TIME
YYYYDDMM2= fichier2->DTCUR__TDATE
SS2=fichier2->DTCUR__TIME
lsum2_old = fichier2->LSUM(:,0,:) ; LSUM
lsthm2 = fichier2->LSTHM(:,0,:) ; LSTHM
lsthm2@long_name="LSTHM"
lsthm2@units="K"
wt2_old= fichier2->WT(:,0,:) ; WT
ut2_old= fichier2->UT(:,0,:) ; UT
tht2= fichier2->THT(:,0,:) ; THT
tht2@long_name="Potential Temperature"
tht2@units="K"
rvt2= fichier2->RVT(:,0,:) ; RVT
rvt2@long_name="Vapor mixing ratio"
rvt2@units="g/kg"
cflu2= fichier2->CFLU(:,0,:) ; CFLU
cflu2@long_name="CFLU"
cflu2@units="-"
cflw2= fichier2->CFLW(:,0,:) ; CFLW
cflw2@long_name="CFLW"
cflw2@units=" "
;=================================================;
; Récupération des dimensions des tableaux
;=================================================;
mdims = dimsizes(tht1)
print (mdims)
nd=dimsizes(mdims)
imax=mdims(nd-1)
kmax=mdims(nd-2)
;=================================================;
; Récupération de la date
;=================================================;
year1=YYYYDDMM1(0)
day1=YYYYDDMM1(1)
min1=YYYYDDMM1(2)
time1=SS1
year2=YYYYDDMM2(0)
day2=YYYYDDMM2(1)
min2=YYYYDDMM2(2)
time2=SS2
;=================================================;
; On mets toutes les variables sur la grille 1
;=================================================;
lsum1 = wrf_user_unstagger(lsum1_old,"X")
lsum1@long_name="LSUM"
lsum1@units="m/s"
ut1 = wrf_user_unstagger(ut1_old,"X")
ut1@long_name="Zonal wind"
ut1@units="m/s"
printVarSummary(ut1_old)
printVarSummary(ut1)
lsum2 = wrf_user_unstagger(lsum1_old,"X")
lsum2@long_name="LSUM"
lsum2@units="m/s"
ut2 = wrf_user_unstagger(ut1_old,"X")
ut2@long_name="Zonal wind"
ut2@units="m/s"
; Unstagger wt (from grid 4 to 1)
wt1=new((/kmax,imax/),double)
wt2=new((/kmax,imax/),double)
do k=0,kmax-2
wt1(k,:)=(wt1_old(k,:)+wt1_old(k+1,:))/2.
wt2(k,:)=(wt2_old(k,:)+wt2_old(k+1,:))/2.
end do
wt1(kmax-1,:)=2*wt1_old(kmax-1,:)-wt1_old(kmax-2,:)
wt2(kmax-1,:)=2*wt2_old(kmax-1,:)-wt2_old(kmax-2,:)
wt1@long_name="Vertical wind"
wt1@units="m/s"
wt2@long_name="Vertical wind"
wt2@units="m/s"
;=================================================;
; Altitude des niveaux modèles
;=================================================;
; Unstagger zhat (from grid 4 to 1)
nzh=new(kmax,double)
do k=0,kmax-2
nzh(k)=(zhat(k)+zhat(k+1))/2.
end do
nzh(kmax-1)=2*zhat(kmax-1)-zhat(kmax-2)
; Create a (altitude des niveaux modèle)
z=new(dimsizes(tht1),double)
zcoef=new(imax,double)
zcoef=1.-zs/nzh(kmax-1)
do i=0,imax-1
z(:,i) = nzh*zcoef(i)+zs(i)
end do
printVarSummary(ut1)
printVarSummary(z)
printVarSummary(xhat)
xconf=conform(tht1,xhat,1)
printVarSummary(xconf)
;=================================================;
; Set some other basic resources
;=================================================;
resmap = True
resmap@gsnFrame = False
resmap@gsnDraw = False
resmap@gsnMaximize = True
resmap@gsnPaperOrientation = "portrait"
resmap@gsnSpreadColors = True ; use full range of colormap
resmap@tiYAxisString =" "
resmap@cnFillOn = True ; turn on color fill
resmap@cnLinesOn = False ; turn off contour lines
;pour prendre en compte l'orographie sur la coupe verticale.
resmap@sfYArray = z ; 2D
resmap@sfXArray = xconf ; 2D
resmap@trGridType = "TriangularMesh"
; resmap@cnInfoLabelOn = False ; turn off contour info label
resmap@tiXAxisPosition="Left"
resmap@tiXAxisFontHeightF=0.015
;=================================================;
; TRACE
;=================================================;
gsn_define_colormap(wks,"rainbow") ; Choose colormap
opts=resmap
opts@cnLevelSelectionMode = "ExplicitLevels"
cnLevels = (/4,4.5,5,5.5,6,6.5,7,7.5,8,8.5,9,9.5,10,10.5,11,11.5,12/)
opts@cnLevels = cnLevels
opts@tiXAxisString="time="+time1+"s"
plot_ut1 = gsn_csm_contour(wks,ut1,opts)
draw(plot_ut1)
frame(wks)
opts@tiXAxisString="time="+time2+"s"
plot_ut2 = gsn_csm_contour(wks,ut2,opts)
draw(plot_ut2)
frame(wks)
delete(opts)
delete(cnLevels)
opts=resmap
opts@cnLevelSelectionMode = "ManualLevels"
opts@cnLevelSpacingF = 2.5
opts@cnMinLevelValF = 285
opts@cnMaxLevelValF = 330
opts@tiXAxisString="time="+time1+"s"
plot_tht1 = gsn_csm_contour(wks,tht1,opts)
draw(plot_tht1)
frame(wks)
opts@tiXAxisString="time="+time2+"s"
plot_tht2 = gsn_csm_contour(wks,tht2,opts)
draw(plot_tht2)
frame(wks)
delete(opts)
opts=resmap
opts@cnLevelSelectionMode = "ManualLevels"
opts@cnLevelSpacingF = 0.04
opts@cnMinLevelValF = -0.4
opts@cnMaxLevelValF = 0.28
opts@tiXAxisString="time="+time1+"s"
plot_wt1 = gsn_csm_contour(wks,wt1,opts)
draw(plot_wt1)
frame(wks)
opts@tiXAxisString="time="+time2+"s"
plot_wt2 = gsn_csm_contour(wks,wt2,opts)
draw(plot_wt2)
frame(wks)
delete(opts)
opts=resmap
opts@cnLevelSelectionMode = "ManualLevels"
opts@cnLevelSpacingF = 0.0002
opts@cnMinLevelValF = 0.0002
opts@cnMaxLevelValF = 0.0038
opts@tiXAxisString="time="+time1+"s"
plot_rvt1 = gsn_csm_contour(wks,rvt1,opts)
draw(plot_rvt1)
frame(wks)
opts@tiXAxisString="time="+time2+"s"
plot_rvt2 = gsn_csm_contour(wks,rvt2,opts)
draw(plot_rvt2)
frame(wks)
delete(opts)
opts=resmap
opts@cnLevelSelectionMode = "ManualLevels"
opts@cnLevelSpacingF = 0.003
opts@cnMinLevelValF = 0.028
opts@cnMaxLevelValF = 0.078
opts@tiXAxisString="time="+time1+"s"
plot_cflu1 = gsn_csm_contour(wks,cflu1,opts)
draw(plot_cflu1)
frame(wks)
opts@tiXAxisString="time="+time2+"s"
plot_cflu2 = gsn_csm_contour(wks,cflu2,opts)
draw(plot_cflu2)
frame(wks)
delete(opts)
opts=resmap
opts@cnLevelSelectionMode = "ManualLevels"
opts@cnLevelSpacingF = 0.004
opts@cnMinLevelValF = 0.004
opts@cnMaxLevelValF = 0.072
opts@tiXAxisString="time="+time1+"s"
plot_cflw1 = gsn_csm_contour(wks,cflw1,opts)
draw(plot_cflw1)
frame(wks)
opts@tiXAxisString="time="+time2+"s"
plot_cflw2 = gsn_csm_contour(wks,cflw2,opts)
draw(plot_cflw2)
frame(wks)
delete(opts)
res=resmap
;===================================================
; profils verticaux
;===================================================
;====================================
resmap@pmLegendDisplayMode = "Always"
resmap@pmLegendWidthF = 0.05
resmap@pmLegendHeightF = 0.15
resmap@lgPerimOn = False
resmap@pmLegendSide = "Top"
resmap@pmLegendParallelPosF = .1
resmap@lgLabelFontHeightF = .01
resmap@pmLegendOrthogonalPosF = -0.3
res_w=resmap
res_t=resmap
res_w@gsnRightString="time="+time1+"s"
res_w@trXMinF=-0.3
res_w@trXMaxF=0.3
res_w@xyLineColors = (/"red","green"/) ; change line color
res_w@xyExplicitLegendLabels = (/"WT","THT-LSTHM"/)
res_w@tiXAxisString = "WT" ; title
res_w@tiXAxisFontHeightF = 0.015
res_t@pmLegendOrthogonalPosF = -0.4
res_t@pmLegendParallelPosF = .15
res_t@trXMinF=-0.8
res_t@trXMaxF=0.1
res_t@xyLineColors = (/"green"/) ; change line color
res_t@xyExplicitLegendLabels = (/"THT-LSTHM"/)
res_t@gsnLeftString = "THT-LSTHM" ; title
res_t@gsnLeftStringFontHeightF = 0.015
plot = gsn_csm_x2y (wks,wt1(:,128),tht1(:,128)-lsthm1(:,128),z(:,128),res_w,res_t)
draw(plot)
frame(wks)
res_t@trXMinF=-1
res_t@trXMaxF=0.2
res_w@gsnRightString="time="+time2+"s"
plot = gsn_csm_x2y (wks,wt2(:,128),tht2(:,128)-lsthm2(:,128),z(:,128),res_w,res_t)
draw(plot)
frame(wks)
res_u=resmap
res_lsu=resmap
res_w@xyExplicitLegendLabels = (/"WT","UT-LSUM"/)
res_lsu@pmLegendOrthogonalPosF = -0.4
res_lsu@pmLegendParallelPosF = .15
res_lsu@trXMinF=-0.2
res_lsu@trXMaxF=0.8
res_lsu@xyLineColors = (/"green"/) ; change line color
res_lsu@xyExplicitLegendLabels = (/"UT-LSUM"/)
res_lsu@gsnLeftString = "UT-LSUM" ; title
res_lsu@tiMainFontHeightF = 0.015
res_w@gsnRightString="time="+time1+"s"
plot = gsn_csm_x2y (wks,wt1(:,128),ut1(:,128)-lsum1(:,128),z(:,128),res_w,res_lsu)
draw(plot)
frame(wks)
res_lsu@trXMinF=-2
res_lsu@trXMaxF=2
res_w@gsnRightString="time="+time2+"s"
plot = gsn_csm_x2y (wks,wt2(:,128),ut2(:,128)-lsum2(:,128),z(:,128),res_w,res_lsu)
draw(plot)
frame(wks)
end
#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.002.nc4 .
ln -sf ../002_mesonh/EXPER.1.HYD2D.003.nc4 .
ncl plot_2Drelief.ncl
......@@ -3,9 +3,11 @@ all:
cd 002_mesonh && run_mesonh_xyz
cd 003_convdia && run_conv2dia
cd 004_diaprog && run_diaprog
cd 005_ncl && run_ncl
clean:
cd 001_prep_ideal_case && clean_prep_ideal_case_xyz
cd 002_mesonh && clean_mesonh_xyz
cd 003_convdia && clean_conv2dia
cd 004_diaprog && clean_diaprog
\ No newline at end of file
cd 004_diaprog && clean_diaprog
cd 005_ncl && clean_ncl
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