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

Quentin 04/07/2024: test cases fixes

parent d0058a7d
No related branches found
No related tags found
No related merge requests found
#!/bin/sh #!/bin/sh
# generate FuelMap.nc and FuelMap.des files # generate FuelMap.nc and FuelMap.des files
ln -sf ../../fuelmap.py .
python3 fuelmap.py python3 fuelmap.py
time MESONH${XYZ} time MESONH${XYZ}
......
#!/bin/sh #!/bin/sh
# generate FuelMap.nc and FuelMap.des files # generate FuelMap.nc and FuelMap.des files
ln -sf ../../fuelmap.py .
python3 fuelmap.py python3 fuelmap.py
time MESONH${XYZ} time MESONH${XYZ}
......
#!/bin/sh #!/bin/sh
# generate FuelMap.nc and FuelMap.des files # generate FuelMap.nc and FuelMap.des files
ln -sf ../../fuelmap.py .
python3 fuelmap.py python3 fuelmap.py
time MESONH${XYZ} time MESONH${XYZ}
......
"""fuelmap.py
MesoNH Blaze canonic test case
"""
from pyrolib.fuelmap import FuelDatabase, FuelMap
# create fuel db
my_db = FuelDatabase()
# load existing database
my_db.load_fuel_database("FireFluxI")
# create a FuelMap
my_fuelmap = FuelMap(fuel_db=my_db)
# add a fuel patch of the tall grass fuel from the FireFluxI database
## to show the available fuel keys of the database, use print(my_db)
my_fuelmap.add_fuel_rectangle_patch(pos1=[0, 2500], pos2=[0, 1250], fuel_key="FireFluxI_tall_grass")
# add a ignition patch
my_fuelmap.add_ignition_rectangle_patch(pos1=[1000, 1025], pos2=[625, 650], ignition_time=0)
# dump for mesonh
my_fuelmap.dump_mesonh()
my_fuelmap.dump()
\ No newline at end of file
#!/bin/sh #!/bin/sh
ln -sf ../003_prep_nest_pgd/PGD1*neste* . ln -sf ../003_prep_nest_pgd/PGD1*neste* .
ln -sf /cnrm/phynh/data1/rodierq/GRIB_KTEST/ecmwf.OD.20030810.00 . cp -f /cnrm/phynh/data1/rodierq/GRIB_KTEST/ecmwf.OD.20030810.00 .
if [ ! -f ecmwf.OD.20030810.00 ]; then if [ ! -d ecmwf.OD.20030810.00 ]; then
wget -c -nd http://mesonh.aero.obs-mip.fr/mesonh/dir_doc/dir_namelist_examples/GRIB_KTEST/ecmwf.OD.20030810.00 wget -c -nd http://mesonh.aero.obs-mip.fr/mesonh/dir_doc/dir_namelist_examples/GRIB_KTEST/ecmwf.OD.20030810.00
fi fi
......
...@@ -71,24 +71,6 @@ ...@@ -71,24 +71,6 @@
CCLOUD = "NONE", ! cloud (REVE,KESS,ICE3) CCLOUD = "NONE", ! cloud (REVE,KESS,ICE3)
CDCONV = "NONE" / ! deep convection CDCONV = "NONE" / ! deep convection
! !
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!
! options for the radiation in the model n
!
&NAM_PARAM_RADn / ! not used
!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!
! options for the convective scheme
!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!
! ground ?? - not in the standard version any more
!
!&NAM_PARAM_GROUNDn /
!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!
! boundary conditions for the model n ! boundary conditions for the model n
! !
&NAM_LBCn CLBCX = 2*"CYCL", ! boundary condition in x &NAM_LBCn CLBCX = 2*"CYCL", ! boundary condition in x
...@@ -96,39 +78,6 @@ ...@@ -96,39 +78,6 @@
XCPHASE = 20.0 / ! phase speed of outgoing XCPHASE = 20.0 / ! phase speed of outgoing
! gravity waves ! gravity waves
! !
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!
! options for turbulence
!
&NAM_TURBn XIMPL = 0., ! 1 default (not implicit)
! 0.5 Crank Nicholson scheme
! 0 puerly explicit scheme
CTURBLEN = "DELT", ! type of turb. mixing lenght
CTURBDIM = "3DIM", ! cubic root of the grid volume
LTURB_DIAG = .FALSE., ! store diagnostic quantities
LTURB_FLX = .FALSE., ! store all turbulent fluxes
/ ! not sure
!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!
! options for chemistry
!
&NAM_CH_MNHCn / ! not used
!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!
! temporal series in diagnostic file of model n
!
NAM_SERIESn / ! not used ?
!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!
! options for stiff solver in model n
!
&NAM_CH_SOLVERn / ! use defaults
!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!
! global configuration parameters ! global configuration parameters
! !
&NAM_CONF &NAM_CONF
...@@ -166,17 +115,11 @@ NAM_SERIESn / ! not used ? ...@@ -166,17 +115,11 @@ NAM_SERIESn / ! not used ?
! the sponge layer ! the sponge layer
! !
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!
! grid nesting configuration
!
&NAM_NESTING / ! not used
!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
! !
! output times ! output times
! !
! !
&NAM_BACKUP XBAK_TIME(1,1)=0., &NAM_BACKUP XBAK_TIME(1,1)=10.,
XBAK_TIME(1,2)=10., XBAK_TIME(1,2)=10.,
XBAK_TIME(1,3)=1500., XBAK_TIME(1,3)=1500.,
XBAK_TIME(1,4)=3000., XBAK_TIME(1,4)=3000.,
...@@ -188,61 +131,6 @@ NAM_SERIESn / ! not used ? ...@@ -188,61 +131,6 @@ NAM_SERIESn / ! not used ?
XBAK_TIME(1,10)=12000., XBAK_TIME(1,10)=12000.,
XBAK_TIME(1,11)=13500., XBAK_TIME(1,11)=13500.,
XBAK_TIME(1,12)=15000./ XBAK_TIME(1,12)=15000./
!&NAM_FMOUT XBAK_TIME(1,1)=0.,
! XBAK_TIME(1,2)=5.,
! XBAK_TIME(1,3)=10.,
! XBAK_TIME(1,4)=15.,
! XBAK_TIME(1,5)=20.,
! XBAK_TIME(1,6)=25.,
! XBAK_TIME(1,7)=30.,
! XBAK_TIME(1,8)=35.,
! XBAK_TIME(1,9)=40.,
! XBAK_TIME(1,10)=45.,
! XBAK_TIME(1,11)=50.,
! XBAK_TIME(1,12)=55./
!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!
! different budgets - not used
!
&NAM_BUDGET /
&NAM_BU_RU /
&NAM_BU_RV /
&NAM_BU_RW /
&NAM_BU_RTH /
&NAM_BU_RTKE /
&NAM_BU_RRV /
&NAM_BU_RRC /
&NAM_BU_RRR /
&NAM_BU_RRI /
&NAM_BU_RRS /
&NAM_BU_RRG /
&NAM_BU_RRH /
&NAM_BU_RSV /
!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
! averages used in LES mode
&NAM_LES / ! not used
!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!
! aditional user defined variables
!
&NAM_BLANK
! CDUMMY1='MOMENTUM_FLUX', ! caclulate momentum flux
CDUMMY2='test' ! file name for mom. flux
NDUMMY1=28, ! height of the useful domain
! including level 1
XDUMMY1=20., ! background wind speed
XDUMMY2=1., ! mountain height in m
XDUMMY3=1000., ! scaling factor
XDUMMY8=0.8 ,
LDUMMY8 = .F./
!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!
! forcing parameters
&NAM_FRC / ! not used
! !
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
! !
......
...@@ -15,9 +15,9 @@ os.system('rm -f tempgraph*') ...@@ -15,9 +15,9 @@ os.system('rm -f tempgraph*')
# #
path="" path=""
LnameFiles = ['HYDRO.1.CEN4T.00'+str(i)+'.nc' for i in range(1,10)] + ['HYDRO.1.CEN4T.01'+str(i)+'.nc' for i in range(3)] LnameFiles = ['HYDRO.1.CEN4T.00'+str(i)+'.nc' for i in range(1,10)] + ['HYDRO.1.CEN4T.01'+str(i)+'.nc' for i in range(2)]
Dvar_input = {"f"+str(i):['UT','WT','LSUM','ni_u','level', 'ni','level_w','time'] for i in range(1,13)} Dvar_input = {"f"+str(i):['UT','WT','LSUM','ni_u','level', 'ni','level_w','time'] for i in range(1,12)}
# Read the variables in the files # Read the variables in the files
Dvar = {} Dvar = {}
...@@ -28,9 +28,9 @@ Dvar = read_netcdf(LnameFiles, Dvar_input, path=path, removeHALO=True) ...@@ -28,9 +28,9 @@ Dvar = read_netcdf(LnameFiles, Dvar_input, path=path, removeHALO=True)
############################################################### ###############################################################
Panel1 = PanelPlot(6,2, [40,80],'Hydro : UT(time) - LSUM(0)', xlabelSize=25, ylabelSize=25, legendSize=25, timeSize=25, cbTicksLabelSize=25, cbTitleSize=25, xyTicksLabelSize=25, minmaxTextSize=25, titleSize=30, bigtitleSize=40) Panel1 = PanelPlot(6,2, [40,80],'Hydro : UT(time) - LSUM(0)', xlabelSize=25, ylabelSize=25, legendSize=25, timeSize=25, cbTicksLabelSize=25, cbTitleSize=25, xyTicksLabelSize=25, minmaxTextSize=25, titleSize=30, bigtitleSize=40)
Lplot = [Dvar['f'+str(i)]['UT'] - Dvar['f1']['LSUM'] for i in range(1,13)] Lplot = [Dvar['f'+str(i)]['UT'] - Dvar['f1']['LSUM'] for i in range(1,12)]
LaxeX = [Dvar['f'+str(i)]['ni_u'] for i in range(1,13)] LaxeX = [Dvar['f'+str(i)]['ni_u'] for i in range(1,12)]
LaxeY = [Dvar['f'+str(i)]['level'] for i in range(1,13)] LaxeY = [Dvar['f'+str(i)]['level'] for i in range(1,12)]
Ltitle = ['']*len(Lplot) Ltitle = ['']*len(Lplot)
Lcbarlabel = ['m/s']*len(Lplot) Lcbarlabel = ['m/s']*len(Lplot)
...@@ -40,7 +40,7 @@ Lminval = [-31.25]*len(Lplot) ...@@ -40,7 +40,7 @@ Lminval = [-31.25]*len(Lplot)
Lmaxval = [31.25]*len(Lplot) Lmaxval = [31.25]*len(Lplot)
Lstep = [2.5]*len(Lplot) Lstep = [2.5]*len(Lplot)
Lstepticks = Lstep Lstepticks = Lstep
Ltime = [Dvar['f'+str(i)]['time'] for i in range(1,13)] Ltime = [Dvar['f'+str(i)]['time'] for i in range(1,12)]
Lcolormap = ['seismic']*len(Lplot) Lcolormap = ['seismic']*len(Lplot)
Lfacconv = [1000]*len(Lplot) Lfacconv = [1000]*len(Lplot)
fig1 = Panel1.psectionV(Lxx=LaxeX, Lzz=LaxeY, Lvar=Lplot, Lxlab=Lxlab, Lylab=Lylab, Ltitle=Ltitle, Lminval=Lminval, Lmaxval=Lmaxval, fig1 = Panel1.psectionV(Lxx=LaxeX, Lzz=LaxeY, Lvar=Lplot, Lxlab=Lxlab, Lylab=Lylab, Ltitle=Ltitle, Lminval=Lminval, Lmaxval=Lmaxval,
...@@ -53,9 +53,9 @@ Panel1.save_graph(1,fig1) ...@@ -53,9 +53,9 @@ Panel1.save_graph(1,fig1)
############################################################### ###############################################################
Panel2 = PanelPlot(6,2, [40,80],'Hydro : Vertical velocity WT', xlabelSize=25, ylabelSize=25, legendSize=25, timeSize=25, cbTicksLabelSize=25, cbTitleSize=25, xyTicksLabelSize=25, minmaxTextSize=25, titleSize=30, bigtitleSize=40) Panel2 = PanelPlot(6,2, [40,80],'Hydro : Vertical velocity WT', xlabelSize=25, ylabelSize=25, legendSize=25, timeSize=25, cbTicksLabelSize=25, cbTitleSize=25, xyTicksLabelSize=25, minmaxTextSize=25, titleSize=30, bigtitleSize=40)
Lplot = [Dvar['f'+str(i)]['WT'] for i in range(1,13)] Lplot = [Dvar['f'+str(i)]['WT'] for i in range(1,12)]
LaxeX = [Dvar['f'+str(i)]['ni'] for i in range(1,13)] LaxeX = [Dvar['f'+str(i)]['ni'] for i in range(1,12)]
LaxeY = [Dvar['f'+str(i)]['level_w'] for i in range(1,13)] LaxeY = [Dvar['f'+str(i)]['level_w'] for i in range(1,12)]
Ltitle = ['']*len(Lplot) Ltitle = ['']*len(Lplot)
Lcbarlabel = ['m/s']*len(Lplot) Lcbarlabel = ['m/s']*len(Lplot)
...@@ -65,7 +65,7 @@ Lminval = [-4.75]*len(Lplot) ...@@ -65,7 +65,7 @@ Lminval = [-4.75]*len(Lplot)
Lmaxval = [4.75]*len(Lplot) Lmaxval = [4.75]*len(Lplot)
Lstep = [0.5]*len(Lplot) Lstep = [0.5]*len(Lplot)
Lstepticks = Lstep Lstepticks = Lstep
Ltime = [Dvar['f'+str(i)]['time'] for i in range(1,13)] Ltime = [Dvar['f'+str(i)]['time'] for i in range(1,12)]
Lcolormap = ['seismic']*len(Lplot) Lcolormap = ['seismic']*len(Lplot)
Lfacconv = [1000]*len(Lplot) Lfacconv = [1000]*len(Lplot)
fig2 = Panel2.psectionV(Lxx=LaxeX, Lzz=LaxeY, Lvar=Lplot, Lxlab=Lxlab, Lylab=Lylab, Ltitle=Ltitle, Lminval=Lminval, Lmaxval=Lmaxval, fig2 = Panel2.psectionV(Lxx=LaxeX, Lzz=LaxeY, Lvar=Lplot, Lxlab=Lxlab, Lylab=Lylab, Ltitle=Ltitle, Lminval=Lminval, Lmaxval=Lmaxval,
...@@ -78,9 +78,9 @@ Panel2.save_graph(2,fig2) ...@@ -78,9 +78,9 @@ Panel2.save_graph(2,fig2)
############################################################### ###############################################################
Panel3 = PanelPlot(6,2, [40,80],'Hydro : WT(time) - WT(0)', xlabelSize=25, ylabelSize=25, legendSize=25, timeSize=25, cbTicksLabelSize=25, cbTitleSize=25, xyTicksLabelSize=25, minmaxTextSize=25, titleSize=30, bigtitleSize=40) Panel3 = PanelPlot(6,2, [40,80],'Hydro : WT(time) - WT(0)', xlabelSize=25, ylabelSize=25, legendSize=25, timeSize=25, cbTicksLabelSize=25, cbTitleSize=25, xyTicksLabelSize=25, minmaxTextSize=25, titleSize=30, bigtitleSize=40)
Lplot = [Dvar['f'+str(i)]['WT'] - Dvar['f1']['WT'] for i in range(2,13)] Lplot = [Dvar['f'+str(i)]['WT'] - Dvar['f1']['WT'] for i in range(2,12)]
LaxeX = [Dvar['f'+str(i)]['ni'] for i in range(2,13)] LaxeX = [Dvar['f'+str(i)]['ni'] for i in range(2,12)]
LaxeY = [Dvar['f'+str(i)]['level_w'] for i in range(2,13)] LaxeY = [Dvar['f'+str(i)]['level_w'] for i in range(2,12)]
Ltitle = ['']*len(Lplot) Ltitle = ['']*len(Lplot)
Lcbarlabel = ['m/s']*len(Lplot) Lcbarlabel = ['m/s']*len(Lplot)
...@@ -90,10 +90,10 @@ Lminval = [-0.034] + [-4.25]*(len(Lplot)-1) ...@@ -90,10 +90,10 @@ Lminval = [-0.034] + [-4.25]*(len(Lplot)-1)
Lmaxval = [0.034] + [4.25]*(len(Lplot)-1) Lmaxval = [0.034] + [4.25]*(len(Lplot)-1)
Lstep = [0.004] + [0.5]*(len(Lplot)-1) Lstep = [0.004] + [0.5]*(len(Lplot)-1)
Lstepticks = Lstep Lstepticks = Lstep
Ltime = [Dvar['f'+str(i)]['time'] for i in range(2,13)] Ltime = [Dvar['f'+str(i)]['time'] for i in range(2,12)]
Lcolormap = ['seismic']*len(Lplot) Lcolormap = ['seismic']*len(Lplot)
Lfacconv = [1000]*len(Lplot) Lfacconv = [1000]*len(Lplot)
fig3 = Panel3.psectionV(Lxx=LaxeX, Lzz=LaxeY, Lvar=Lplot, Lxlab=Lxlab, Lylab=Lylab, Ltitle=Ltitle, Lminval=Lminval, Lmaxval=Lmaxval, fig3 = Panel3.psectionV(Lxx=LaxeX, Lzz=LaxeY, Lvar=Lplot, Lxlab=Lxlab, Lylab=Lylab, Ltitle=Ltitle, Lminval=Lminval, Lmaxval=Lmaxval,
Lstep=Lstep, Lstepticks=Lstepticks, Lcbarlabel=Lcbarlabel, Ltime=Ltime, Lcolormap=Lcolormap, Lfacconv=Lfacconv) Lstep=Lstep, Lstepticks=Lstepticks, Lcbarlabel=Lcbarlabel, Ltime=Ltime, Lcolormap=Lcolormap, Lfacconv=Lfacconv)
Panel3.save_graph(3,fig3) Panel3.save_graph(3,fig3)
\ No newline at end of file
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