diff --git a/cases/gabls1/README b/cases/gabls1/README deleted file mode 100644 index 9dbcd3ac..00000000 --- a/cases/gabls1/README +++ /dev/null @@ -1,15 +0,0 @@ -What: Dales v3.2 configuration files for GABLS1 intercomparison case -Date: December 8, 2010 -Author: Arnold Moene (arnold.moene@wur.nl) WUR-MAQ - -The detailed description of the intercomparison case can be found in: - -Beare, R.J.; MacVean, M.K.; Holtslag, A.A.M.; Cuxart, J.; Esau, I.; Golaz, J.C.; Jimenez, M.A.; Khairoutdinov, M.; Kosovic, B.; Lewellen, D.; Lund, T.S.; Lundquist, J.K.; McCabe, A.; Moene, A.F.; Noh, Y.; Raasch, S.; Sullivan, P. (2006) -An Intercomparison of Large-Eddy Simulations of the Stable Boundary Layer -Boundary-Layer Meteorology 118 (2). - p. 247 - 272. - -Notes: -* the relatively small dtmax is needed to correct the adaptive time step which allows too large time steps in the initial part of the simulation -* the ls_flux.inp.001 file contains on set of extern forcings for t=-1 second, because the model skips (or at leasst skipped in my 3.2 beta version) the first set of forcings. Thus only the prescribed forcings for t=0 seconds and t=36000 seconds are read and used -* The model crashes for advection scheme 6. In the past it has been performed with 5th and 2nd order advecion scheme. For this standard case, scheme 52 is chosen: 5th order in the horizontal direction (for stability) and 2nd order in the vertical (to make statistics comparable with model calculations). -* In the namoptions, CF is set to 2.0 in order to prevent too much subgrid dissipation diff --git a/cases/gabls1/_README.001 b/cases/gabls1/_README.001 new file mode 100644 index 00000000..4b7d5fc4 --- /dev/null +++ b/cases/gabls1/_README.001 @@ -0,0 +1,26 @@ +Last updated: 21 November 2024 + +## CASE DESCRIPTION: GABLS1 +A weakly stable boundary layer is created by a slow constant cooling of the surface temperature. The GABLS1 case is extensively described and documented in: +Beare, R.J. et al. An Intercomparison of Large-Eddy Simulations of the Stable Boundary Layer. Boundary-Layer Meteorol 118, 247–272 (2006). https://doi.org/10.1007/s10546-004-2820-6 + +This folder contains all necessary input files to run the GABLS1 case, namely + namoptions.001 + prof.inp.001 + lscale.inp.001 + ls_flux.inp.001 + +Further, it contains the following + dales_gabls1.py : script to generate new input files (e.g., after changing vertical levels) + plot_profiles.py : a simple template script to plot time-averaged profiles from output and time series + _wind_temperature_gabls1.png : example averaged profiles of wind and temperature, with both deardorff tke subgrid scheme and smagorinsky subgrid scheme + _flux_momheat_gabls1.png : example average profiles of momentum flux and heat flux, with both deardorff tke subgrid scheme and smagorinsky subgrid scheme + namoptions_SMAGORINSKY.001 : namoptions file for the use of the Smagorinsky subgrid scheme, the default one uses the Deardorff subgrid scheme. To use, replace the default one with this one. + +Default settings in namoptions.001 use: + kmax = 128 vertical levels + itot = jtot = 128 gridpoints in the horizontal + nx = ny = 4 processes in each direction (these can be freely changes as long as they are powers of 2 AND itot and jtot are divisible by them + +When changing the amount of vertical levels, new input files must be created using the python script: + python3 dales_gabls1.py -iexpr 001 diff --git a/cases/gabls1/_flux_momheat_gabls1.png b/cases/gabls1/_flux_momheat_gabls1.png new file mode 100644 index 00000000..2311fa31 Binary files /dev/null and b/cases/gabls1/_flux_momheat_gabls1.png differ diff --git a/cases/gabls1/_wind_temperature_gabls1.png b/cases/gabls1/_wind_temperature_gabls1.png new file mode 100644 index 00000000..2c43acde Binary files /dev/null and b/cases/gabls1/_wind_temperature_gabls1.png differ diff --git a/cases/gabls1/dales_gabls1.py b/cases/gabls1/dales_gabls1.py new file mode 100644 index 00000000..e5da9f2b --- /dev/null +++ b/cases/gabls1/dales_gabls1.py @@ -0,0 +1,142 @@ +# +# Purpose : this script generates all necessary input files (.inp.) for the GABLS1 case +# +# The GABLS1 case is described in: +# Beare, R.J. et al. An Intercomparison of Large-Eddy Simulations of the Stable Boundary Layer. Boundary-Layer Meteorol 118, 247–272 (2006). https://doi.org/10.1007/s10546-004-2820-6 +# +# Author : Steven van der Linden, Delft University of Technology (TUD) +# Contact : s.j.a.vanderlinden@tudelft.nl +# Date : 21 November 2024 +# +# This file is part of DALES. + +import numpy as np +import argparse + +float_type = np.float64 + +#### Define the parser #### +parser = argparse.ArgumentParser(description='Give experiment number via -iexpr=XX') +parser.add_argument('-iexpr', action="store", dest='iexpr', type=int, default=001) +parser.add_argument('-expname', action="store", dest='expname', default='gabls1') + +args = parser.parse_args() + +# Get required parameters from namoptions.iexpr +with open('namoptions.'+str(args.iexpr)) as f: + for line in f: + if(str.rstrip(line.split('=')[0]) == 'kmax'): + kmax = int(line.split('=')[1]) + +f.close() + +print("The number of vertical levels given in namoptions.{} is equal to kmax={}".format(args.iexpr,kmax)) + +#### Create vertical grid #### +zsize = 400 # << Specified domain height in GABLS1 +dz = zsize / kmax +z = np.linspace(0.5 * dz, zsize - 0.5 * dz, kmax) + +print("An equidistant vertical grid has been constructed with vertical resolution dz={}".format(dz)) + +#### Initialise arrays for initial profiles #### +th = np.empty(z.shape) +u = np.empty(z.shape) +ug = np.empty(z.shape) +v = np.empty(z.shape) +vg = np.empty(z.shape) +qt = np.empty(z.shape) +tke = np.empty(z.shape) + +wls = np.zeros(z.shape) # large scale subsidence velocity +emp = np.zeros(z.shape) +dthldt = np.zeros(z.shape) +dqtldt = np.zeros(z.shape) + +#### Write prescribed values of GABLS1 case to these arrays #### +u[:] = 8. +ug[:] = 8. +v[:] = 0. +vg[:] = 0. +qt[:] = 0. + +dthetadz = 0.01 + +for k in range(kmax): + if(z[k] <= 100.): + th[k] = 265. + if(z[k] > 100.): + th[k] = 265. + dthetadz*(z[k]-100.) + +for k in range(kmax): + if(z[k] <= 250.): + tke[k] = ( 0.4 * (1 - z[k]/250)**3 ) + if(z[k] > 250.): + tke[k] = 0. + +## Note: new str formatting in python +# In most of the cases the syntax is similar to the old %-formatting, +# with the addition of the {} and with : used instead of %. For example, '%03.2f' can be translated to '{:03.2f}'. +# additional: > forces right alignment within availabe space + +#### Create initialisation files for DALES #### +# prof.inp.iexpr is minimally needed and should contain the variables listed below. +# the first two lines are skipped during read phase. + +f = open('prof.inp.'+str(args.iexpr),'w') +f.write('# EXPERIMENT: '+args.expname+'\n') +f.write(' height(m) thl(K) qt(kg/kg) u(m/s) v(m/s) tke(m2/s2)\n') + +for k in range(kmax): + line = '{:>13.5f}{:>13.3f}{:>13.8f}{:>13.5f}{:>13.5f}{:>13.5f}\n'.format(z[k], th[k], qt[k], u[k], v[k], tke[k]) + f.write(line) + +f.close() + +# lscale.inp.iexpr provides large scale forcings (if left uninitialised, variables are set to zero by default) + +f = open('lscale.inp.'+str(args.iexpr),'w') + +f.write('# EXPERIMENT: '+args.expname+'\n') +f.write(' height(m) ugeo(m/s) vgeo(m/s) wfls(m/s) not_used not_used dqtdtls(kg/kg/s) dthldt(K/s)\n') + +for k in range(kmax): + line = '{:>10.5f}{:>8.3f}{:>8.3f}{:>10.6f}{:>6.1f}{:>6.1f}{:>6.1f}{:>6.1f}\n'.format(z[k], ug[k], vg[k], wls[k], emp[k], emp[k], dqtldt[k], dthldt[k]) + f.write(line) + +f.close() + +# ls_flux.inp.iexpr contains time dependent change of surface properties and/or profiles +# << GABLS1 uses a prescribed surface temperature over 9 simulation hours (isurf=2 in NAMOPTIONS) + +f = open('ls_flux.inp.'+str(args.iexpr),'w') + +f.write('EXPERIMENT: '+args.expname+'\n') # line not allowed to have '#' +f.write(' time wtsurf wqsurf thls qts psurf\n') # in total have three lines.. +f.write(' [s] [K m/s] [kg m/s] [K] [kg/kg] [Pa]\n') # +line = '{:>8.3f}{:>8.3f}{:>8.3f}{:>8.3f}{:>8.3f}{:>8.3f}\n'.format(0.000, -9.000, -9.000, 265, -9.000, 100000.00) # Ts taken from ERA5, pressure taken from ERA5 but kept constant.. +f.write(line) +line = '{:>8.3f}{:>8.3f}{:>8.3f}{:>8.3f}{:>8.3f}{:>8.3f}\n'.format(32400.000, -9.000, -9.000, 262.75, -9.000, 100000.00) +f.write(line) +f.write('\n') +f.write('\n') +f.write('\n') +f.write('\n') +f.write('%Large scale forcings\n') +f.write('% z [m] ug [m/s] vg [m/s] wmn [m/s] dqtdx dqtdy dqtdtls dthlrad\n') +f.write('# 0.00000\n') +for k in range(kmax): + line = '{:>13.5f}{:>8.3f}{:>8.3f}{:>10.6f}{:>5.1f}{:>5.1f}{:>5.1f}{:>5.1f}\n'.format(z[k], ug[k], vg[k], wls[k], emp[k], emp[k], emp[k], emp[k]) + f.write(line) +f.write('\n') +f.write('\n') +f.write('\n') +f.write('\n') +f.write('%Large scale forcings\n') +f.write('% z [m] ug [m/s] vg [m/s] wmn [m/s] dqtdx dqtdy dqtdtls dthlrad\n') +f.write('# 32400.000\n') +for k in range(kmax): + line = '{:>13.5f}{:>8.3f}{:>8.3f}{:>10.6f}{:>5.1f}{:>5.1f}{:>5.1f}{:>5.1f}\n'.format(z[k], ug[k], vg[k], wls[k], emp[k], emp[k], emp[k], emp[k]) + f.write(line) + +f.close() diff --git a/cases/gabls1/namoptions.001 b/cases/gabls1/namoptions.001 index 8cde12a4..17fe6f8d 100644 --- a/cases/gabls1/namoptions.001 +++ b/cases/gabls1/namoptions.001 @@ -3,12 +3,14 @@ iexpnr = 001 lwarmstart = .false. startfile = 'initd001h00mx000y000.001' runtime = 32400 -trestart = 3600 +trestart = 32400 irandom = 43 randthl = 0.1 randqt = 0 nsv = 0 ladaptive = .true. +nprocx = 4 +nprocy = 4 / &DOMAIN @@ -26,6 +28,9 @@ xtime = 0. / &PHYSICS +z0 = 0.1 +ps = 100000.00 +thls = 263.5 ltimedep = .true. lmoist = .false. iradiation = 0 @@ -33,55 +38,74 @@ lcoriol = .true. / &NAMSURFACE +lmostlocal = .true. z0 = 0.1 ps = 100000.00 isurf = 2 -thls = 265 ! time-dependent, needed here for base profile setup / &DYNAMICS llsadv = .false. lqlnr = .false. -cu = 4. +cu = 0. cv = 0. -iadv_mom = 52 -iadv_tke = 52 -iadv_thl = 52 -iadv_qt = 52 -iadv_sv = 52 +iadv_mom = 2 +iadv_tke = 2 +iadv_thl = 2 +iadv_qt = 2 +iadv_sv = 2 / &NAMSUBGRID - lmason = .true. - ldelta = .true. ! lmason requires ldelta - cf = 2.0 +lmason = .false. +lsmagorinsky = .false. +/ + +&NAMBUDGET +lbudget = .true. +dtav = 60. +timeav = 300 +/ + +&NAMCHECKSIM +tcheck = 6 / &NAMSAMPLING -lsampup = .false. dtav = 60 -timeav = 120 +timeav = 300 +lsampcl = .false. +lsampco = .false. +lsampup = .false. +lsampbuup = .false. +lsampcldup = .false. / + &NAMTIMESTAT ltimestat = .true. -dtav = 3600 +dtav = 60 / + &NAMCROSSSECTION lcross = .false. dtav = 60 / + &NAMGENSTAT lstat = .true. -dtav = 5 -timeav = 60 +dtav = 60 +timeav = 300 / + &NAMFIELDDUMP lfielddump = .false. dtav = 60 ldiracc = .true. / + &NAMSTATTEND -dtav = 3600 -ltend = .false. +dtav = 60 +ltend = .true. +timeav = 300 / diff --git a/cases/gabls1/namoptions_SMAGORINKSY.001 b/cases/gabls1/namoptions_SMAGORINKSY.001 new file mode 100644 index 00000000..4678bbdb --- /dev/null +++ b/cases/gabls1/namoptions_SMAGORINKSY.001 @@ -0,0 +1,110 @@ +&RUN +iexpnr = 001 +lwarmstart = .false. +startfile = 'initd001h00mx000y000.001' +runtime = 32400 +trestart = 32400 +irandom = 43 +randthl = 0.1 +randqt = 0 +nsv = 0 +ladaptive = .true. +nprocx = 4 +nprocy = 4 +/ + +&DOMAIN +itot = 128 +jtot = 128 +kmax = 128 + +xsize = 400. +ysize = 400. + +xlat = 73 +xlon = 0. +xday = 0. +xtime = 0. +/ + +&PHYSICS +z0 = 0.1 +ps = 100000.00 +thls = 263.5 +ltimedep = .true. +lmoist = .false. +iradiation = 0 +lcoriol = .true. +/ + +&NAMSURFACE +z0 = 0.1 +ps = 100000.00 +isurf = 2 +/ + +&DYNAMICS +llsadv = .false. +lqlnr = .false. +cu = 0. +cv = 0. + +iadv_mom = 2 +iadv_tke = 2 +iadv_thl = 2 +iadv_qt = 2 +iadv_sv = 2 +/ + +&NAMSUBGRID +lmason = .true. +lsmagorinsky = .true. +/ + +&NAMBUDGET +lbudget = .true. +dtav = 60. +timeav = 300 +/ + +&NAMCHECKSIM +tcheck = 6 +/ + +&NAMSAMPLING +dtav = 60 +timeav = 300 +lsampcl = .false. +lsampco = .false. +lsampup = .false. +lsampbuup = .false. +lsampcldup = .false. +/ + +&NAMTIMESTAT +ltimestat = .true. +dtav = 60 +/ + +&NAMCROSSSECTION +lcross = .false. +dtav = 60 +/ + +&NAMGENSTAT +lstat = .true. +dtav = 60 +timeav = 300 +/ + +&NAMFIELDDUMP +lfielddump = .false. +dtav = 60 +ldiracc = .true. +/ + +&NAMSTATTEND +dtav = 60 +ltend = .true. +timeav = 300 +/ diff --git a/cases/gabls1/plot_profiles.py b/cases/gabls1/plot_profiles.py new file mode 100644 index 00000000..f9483472 --- /dev/null +++ b/cases/gabls1/plot_profiles.py @@ -0,0 +1,117 @@ +# +# Purpose : this script plots very basic profiles from output in profiles.iexpr.nc and tmser.iexpr.nc +# (typically averaged over the final hour) +# +# required python dependencies are numpy, netCDF4 and matplotlib +# +# Author : Steven van der Linden, Delft University of Technology (TUD) +# Contact : s.j.a.vanderlinden@tudelft.nl +# Date : 21 November 2024 +# +# This file is part of DALES. + +import numpy as np +import netCDF4 as nc +import matplotlib as mpl +import matplotlib.pyplot as plt + + +#### Set timeframe over which to average #### +# average over final hour of simulation (9-10); specify time interval +time_begin = 32400 - 1*3600 +time_end = 32400 + 0.0001 # << the adding of small value is required + +########## +# General Figure settings +########## + +mpl.rcParams['axes.linewidth'] = 2 +mpl.rcParams['xtick.major.width'] = 2 +mpl.rcParams['ytick.major.width'] = 2 +mpl.rcParams['xtick.minor.width'] = 1 +mpl.rcParams['ytick.minor.width'] = 1 +mpl.rcParams['grid.linewidth'] = 1 +# mpl.rcParams['axes.grid'] = True +mpl.rcParams['ytick.labelsize'] = 15 +mpl.rcParams['xtick.labelsize'] = 15 +mpl.rcParams['legend.fontsize'] = 15 + +########## +# Plot figures +########## + +#### Initialise the figures #### +fig1=plt.figure(figsize=(20,10)) +ax11=fig1.add_axes([0.10,0.1,0.38,0.8]) +ax12=fig1.add_axes([0.52,0.1,0.38,0.8]) + +fig2=plt.figure(figsize=(20,10)) +ax21=fig2.add_axes([0.10,0.1,0.38,0.8]) +ax22=fig2.add_axes([0.52,0.1,0.38,0.8]) + +fig3=plt.figure(figsize=(20,10)) +ax31=fig3.add_axes([0.10,0.52,0.8,0.38]) +ax32=fig3.add_axes([0.10,0.1,0.8,0.38]) + +#### Open files and start plotting #### +filename = 'profiles.001.nc' +data = nc.Dataset(filename,'r') + +f2 = 'tmser.001.nc' +data2= nc.Dataset(f2,'r') + +# Find correct indices corresponding to averaging times +# Convert to array of indices instead of array of True, False. +indices_logic = np.logical_and(data['time'][:]>=time_begin, data['time'][:]<=time_end) +indices_numeric = np.where(indices_logic)[0] + +# Figure 1: wind, temperature +ax11.plot(((data['v'][indices_numeric]**2 + data['u'][indices_numeric]**2)**0.5).mean(axis=0),data['zt'][:],linestyle='solid', linewidth=2) + +ax12.plot(data['thv'][indices_numeric].mean(axis=0),data['zt'][:],linestyle='solid', linewidth=2, label='virtual pot. temp.') +ax12.plot(data['thl'][indices_numeric].mean(axis=0),data['zt'][:],linestyle='dotted', linewidth=2, label='liquid water pot. temp.') + +# Figure 2: momentum and temperature fluxes +ax21.plot(data['uwt'][indices_numeric].mean(axis=0),data['zm'][:],linestyle='solid', linewidth=2, label='total') +ax21.plot(data['uwr'][indices_numeric].mean(axis=0),data['zm'][:],linestyle='dashed', linewidth=2, label='resolved') + +ax22.plot(data['wthlt'][indices_numeric].mean(axis=0),data['zm'][:],linestyle='solid', linewidth=2) +ax22.plot(data['wthlr'][indices_numeric].mean(axis=0),data['zm'][:],linestyle='dashed', linewidth=2) + +ax31.plot(data2['time'][:],data2['ustar'][:],linestyle='solid', linewidth=2) +ax32.plot(data2['time'][:],data2['obukh'][:],linestyle='solid', linewidth=2) + + +#### Set axes, labels, etc. #### +ax11.grid() +ax12.grid() +ax11.set_ylabel(r'$z\,\mathrm{[m]}$',size=15) +ax11.set_xlabel(r'$U\,\mathrm{[m\,s^{-1}]}$',size=15) +ax12.set_xlabel(r'$\theta\,\mathrm{[K]}$',size=15) +ax11.set_ylim(0,250) +ax12.set_ylim(0,250) +lg11=ax11.legend(loc='best') + +ax21.grid() +ax22.grid() +ax21.set_ylabel(r'$z\,\mathrm{[m]}$',size=15) +ax21.set_xlabel(r'$F_u\,\mathrm{[m^2\,s^{-2}]}$',size=15) +ax22.set_xlabel(r'$F_\theta\,\mathrm{[K\,m\,s^{-1}]}$',size=15) +ax21.set_ylim(0,250) +ax22.set_ylim(0,250) +lg21=ax21.legend(loc='best') + +ax31.grid() +ax32.grid() +ax31.set_ylabel(r'$u_*\,\mathrm{[m\,s^{-1}]}$',size=15) +ax31.set_xticklabels([]) +ax32.set_ylabel(r'$L_O\,\mathrm{[m]}$',size=15) +ax32.set_xlabel(r'$t\,\mathrm{[s]}$',size=15) +lg31=ax31.legend(loc='best') + +#### Save and show #### +fig1.savefig('Wind_Temperature.png',format='png') +fig2.savefig('Fluxes_dearsmag.png',format='png') +fig3.savefig('FrictionVel_Obukhovlength.png',format='png') + +plt.show() diff --git a/cases/gabls1/results/Some example hourly averaged profiles.tar b/cases/gabls1/results/Some example hourly averaged profiles.tar deleted file mode 100644 index 1ab37f91..00000000 Binary files a/cases/gabls1/results/Some example hourly averaged profiles.tar and /dev/null differ diff --git a/cases/gabls1/results_3.2.0/profiles.001.nc b/cases/gabls1/results_3.2.0/profiles.001.nc deleted file mode 100644 index 33307ce6..00000000 Binary files a/cases/gabls1/results_3.2.0/profiles.001.nc and /dev/null differ diff --git a/cases/gabls1/results_3.2.0/tmser.001.nc b/cases/gabls1/results_3.2.0/tmser.001.nc deleted file mode 100644 index c2dbaec1..00000000 Binary files a/cases/gabls1/results_3.2.0/tmser.001.nc and /dev/null differ diff --git a/cases/gabls1/scalar.inp.001 b/cases/gabls1/scalar.inp.001 deleted file mode 100644 index eec9ca4a..00000000 --- a/cases/gabls1/scalar.inp.001 +++ /dev/null @@ -1,130 +0,0 @@ -# scalar -# zf sv1 sv2 sv3 sv4 -1.5625000000e+00 0.0 0.0 0.0 0.0 0.0 -4.6875000000e+00 0.0 0.0 0.0 0.0 0.0 -7.8125000000e+00 0.0 0.0 0.0 0.0 0.0 -1.0937500000e+01 0.0 0.0 0.0 0.0 0.0 -1.4062500000e+01 0.0 0.0 0.0 0.0 0.0 -1.7187500000e+01 0.0 0.0 0.0 0.0 0.0 -2.0312500000e+01 0.0 0.0 0.0 0.0 0.0 -2.3437500000e+01 0.0 0.0 0.0 0.0 0.0 -2.6562500000e+01 0.0 0.0 0.0 0.0 0.0 -2.9687500000e+01 0.0 0.0 0.0 0.0 0.0 -3.2812500000e+01 0.0 0.0 0.0 0.0 0.0 -3.5937500000e+01 0.0 0.0 0.0 0.0 0.0 -3.9062500000e+01 0.0 0.0 0.0 0.0 0.0 -4.2187500000e+01 0.0 0.0 0.0 0.0 0.0 -4.5312500000e+01 0.0 0.0 0.0 0.0 0.0 -4.8437500000e+01 0.0 0.0 0.0 0.0 0.0 -5.1562500000e+01 0.0 0.0 0.0 0.0 0.0 -5.4687500000e+01 0.0 0.0 0.0 0.0 0.0 -5.7812500000e+01 0.0 0.0 0.0 0.0 0.0 -6.0937500000e+01 0.0 0.0 0.0 0.0 0.0 -6.4062500000e+01 0.0 0.0 0.0 0.0 0.0 -6.7187500000e+01 0.0 0.0 0.0 0.0 0.0 -7.0312500000e+01 0.0 0.0 0.0 0.0 0.0 -7.3437500000e+01 0.0 0.0 0.0 0.0 0.0 -7.6562500000e+01 0.0 0.0 0.0 0.0 0.0 -7.9687500000e+01 0.0 0.0 0.0 0.0 0.0 -8.2812500000e+01 0.0 0.0 0.0 0.0 0.0 -8.5937500000e+01 0.0 0.0 0.0 0.0 0.0 -8.9062500000e+01 0.0 0.0 0.0 0.0 0.0 -9.2187500000e+01 0.0 0.0 0.0 0.0 0.0 -9.5312500000e+01 0.0 0.0 0.0 0.0 0.0 -9.8437500000e+01 0.0 0.0 0.0 0.0 0.0 -1.0156250000e+02 0.0 0.0 0.0 0.0 0.0 -1.0468750000e+02 0.0 0.0 0.0 0.0 0.0 -1.0781250000e+02 0.0 0.0 0.0 0.0 0.0 -1.1093750000e+02 0.0 0.0 0.0 0.0 0.0 -1.1406250000e+02 0.0 0.0 0.0 0.0 0.0 -1.1718750000e+02 0.0 0.0 0.0 0.0 0.0 -1.2031250000e+02 0.0 0.0 0.0 0.0 0.0 -1.2343750000e+02 0.0 0.0 0.0 0.0 0.0 -1.2656250000e+02 0.0 0.0 0.0 0.0 0.0 -1.2968750000e+02 0.0 0.0 0.0 0.0 0.0 -1.3281250000e+02 0.0 0.0 0.0 0.0 0.0 -1.3593750000e+02 0.0 0.0 0.0 0.0 0.0 -1.3906250000e+02 0.0 0.0 0.0 0.0 0.0 -1.4218750000e+02 0.0 0.0 0.0 0.0 0.0 -1.4531250000e+02 0.0 0.0 0.0 0.0 0.0 -1.4843750000e+02 0.0 0.0 0.0 0.0 0.0 -1.5156250000e+02 0.0 0.0 0.0 0.0 0.0 -1.5468750000e+02 0.0 0.0 0.0 0.0 0.0 -1.5781250000e+02 0.0 0.0 0.0 0.0 0.0 -1.6093750000e+02 0.0 0.0 0.0 0.0 0.0 -1.6406250000e+02 0.0 0.0 0.0 0.0 0.0 -1.6718750000e+02 0.0 0.0 0.0 0.0 0.0 -1.7031250000e+02 0.0 0.0 0.0 0.0 0.0 -1.7343750000e+02 0.0 0.0 0.0 0.0 0.0 -1.7656250000e+02 0.0 0.0 0.0 0.0 0.0 -1.7968750000e+02 0.0 0.0 0.0 0.0 0.0 -1.8281250000e+02 0.0 0.0 0.0 0.0 0.0 -1.8593750000e+02 0.0 0.0 0.0 0.0 0.0 -1.8906250000e+02 0.0 0.0 0.0 0.0 0.0 -1.9218750000e+02 0.0 0.0 0.0 0.0 0.0 -1.9531250000e+02 0.0 0.0 0.0 0.0 0.0 -1.9843750000e+02 0.0 0.0 0.0 0.0 0.0 -2.0156250000e+02 0.0 0.0 0.0 0.0 0.0 -2.0468750000e+02 0.0 0.0 0.0 0.0 0.0 -2.0781250000e+02 0.0 0.0 0.0 0.0 0.0 -2.1093750000e+02 0.0 0.0 0.0 0.0 0.0 -2.1406250000e+02 0.0 0.0 0.0 0.0 0.0 -2.1718750000e+02 0.0 0.0 0.0 0.0 0.0 -2.2031250000e+02 0.0 0.0 0.0 0.0 0.0 -2.2343750000e+02 0.0 0.0 0.0 0.0 0.0 -2.2656250000e+02 0.0 0.0 0.0 0.0 0.0 -2.2968750000e+02 0.0 0.0 0.0 0.0 0.0 -2.3281250000e+02 0.0 0.0 0.0 0.0 0.0 -2.3593750000e+02 0.0 0.0 0.0 0.0 0.0 -2.3906250000e+02 0.0 0.0 0.0 0.0 0.0 -2.4218750000e+02 0.0 0.0 0.0 0.0 0.0 -2.4531250000e+02 0.0 0.0 0.0 0.0 0.0 -2.4843750000e+02 0.0 0.0 0.0 0.0 0.0 -2.5156250000e+02 0.0 0.0 0.0 0.0 0.0 -2.5468750000e+02 0.0 0.0 0.0 0.0 0.0 -2.5781250000e+02 0.0 0.0 0.0 0.0 0.0 -2.6093750000e+02 0.0 0.0 0.0 0.0 0.0 -2.6406250000e+02 0.0 0.0 0.0 0.0 0.0 -2.6718750000e+02 0.0 0.0 0.0 0.0 0.0 -2.7031250000e+02 0.0 0.0 0.0 0.0 0.0 -2.7343750000e+02 0.0 0.0 0.0 0.0 0.0 -2.7656250000e+02 0.0 0.0 0.0 0.0 0.0 -2.7968750000e+02 0.0 0.0 0.0 0.0 0.0 -2.8281250000e+02 0.0 0.0 0.0 0.0 0.0 -2.8593750000e+02 0.0 0.0 0.0 0.0 0.0 -2.8906250000e+02 0.0 0.0 0.0 0.0 0.0 -2.9218750000e+02 0.0 0.0 0.0 0.0 0.0 -2.9531250000e+02 0.0 0.0 0.0 0.0 0.0 -2.9843750000e+02 0.0 0.0 0.0 0.0 0.0 -3.0156250000e+02 0.0 0.0 0.0 0.0 0.0 -3.0468750000e+02 0.0 0.0 0.0 0.0 0.0 -3.0781250000e+02 0.0 0.0 0.0 0.0 0.0 -3.1093750000e+02 0.0 0.0 0.0 0.0 0.0 -3.1406250000e+02 0.0 0.0 0.0 0.0 0.0 -3.1718750000e+02 0.0 0.0 0.0 0.0 0.0 -3.2031250000e+02 0.0 0.0 0.0 0.0 0.0 -3.2343750000e+02 0.0 0.0 0.0 0.0 0.0 -3.2656250000e+02 0.0 0.0 0.0 0.0 0.0 -3.2968750000e+02 0.0 0.0 0.0 0.0 0.0 -3.3281250000e+02 0.0 0.0 0.0 0.0 0.0 -3.3593750000e+02 0.0 0.0 0.0 0.0 0.0 -3.3906250000e+02 0.0 0.0 0.0 0.0 0.0 -3.4218750000e+02 0.0 0.0 0.0 0.0 0.0 -3.4531250000e+02 0.0 0.0 0.0 0.0 0.0 -3.4843750000e+02 0.0 0.0 0.0 0.0 0.0 -3.5156250000e+02 0.0 0.0 0.0 0.0 0.0 -3.5468750000e+02 0.0 0.0 0.0 0.0 0.0 -3.5781250000e+02 0.0 0.0 0.0 0.0 0.0 -3.6093750000e+02 0.0 0.0 0.0 0.0 0.0 -3.6406250000e+02 0.0 0.0 0.0 0.0 0.0 -3.6718750000e+02 0.0 0.0 0.0 0.0 0.0 -3.7031250000e+02 0.0 0.0 0.0 0.0 0.0 -3.7343750000e+02 0.0 0.0 0.0 0.0 0.0 -3.7656250000e+02 0.0 0.0 0.0 0.0 0.0 -3.7968750000e+02 0.0 0.0 0.0 0.0 0.0 -3.8281250000e+02 0.0 0.0 0.0 0.0 0.0 -3.8593750000e+02 0.0 0.0 0.0 0.0 0.0 -3.8906250000e+02 0.0 0.0 0.0 0.0 0.0 -3.9218750000e+02 0.0 0.0 0.0 0.0 0.0 -3.9531250000e+02 0.0 0.0 0.0 0.0 0.0 -3.9843750000e+02 0.0 0.0 0.0 0.0 0.0 diff --git a/cases/sullivan2011/_README.001 b/cases/sullivan2011/_README.001 new file mode 100644 index 00000000..22838c24 --- /dev/null +++ b/cases/sullivan2011/_README.001 @@ -0,0 +1,25 @@ +Last updated: 21 November 2024 + +## CASE DESCRIPTION: SULLIVAN2011 +Convective boundary layer with a surface flux of 0.24 K m/s growing into a well mixed layer with a jump and stratification above. The Sullivan2011 case is described and documented in: +Sullivan, P. P., and E. G. Patton, 2011: The Effect of Mesh Resolution on Convective Boundary Layer Statistics and Structures Generated by Large-Eddy Simulation. J. Atmos. Sci., 68, 2395–2415, https://doi.org/10.1175/JAS-D-10-05010.1. + +This folder contains all necessary input files to run the Sullivan2011 case, namely + namoptions.001 + prof.inp.001 + lscale.inp.001 + +Further, it contains the following + dales_sullivan2011.py : script to generate new input files (e.g., after changing vertical levels) + plot_profiles.py : a simple template script to plot time-averaged profiles from output and time series + _temperature_heatflux_sullivan2011.png : example averaged profiles of temperature and the heat flux, with both deardorff tke subgrid scheme and smagorinsky subgrid scheme + _frictionvelocity_obukhov_sullivan2011.png : example time series of friction velocity and Obukhov length, with both deardorff tke subgrid scheme and smagorinsky subgrid scheme + namoptions_SMAGORINSKY.001 : namoptions file for the use of the Smagorinsky subgrid scheme, the default one uses the Deardorff subgrid scheme. To use, replace the default one with this one. + +Default settings in namoptions.001 use: + kmax = 128 vertical levels + itot = jtot = 128 gridpoints in the horizontal + nx = ny = 4 processes in each direction (these can be freely changes as long as they are powers of 2 AND itot and jtot are divisible by them + +When changing the amount of vertical levels, new input files must be created using the python script: + python3 dales_sullivan2011.py -iexpr 001 diff --git a/cases/sullivan2011/_frictionvelocity_obukhov_sullivan2011.png b/cases/sullivan2011/_frictionvelocity_obukhov_sullivan2011.png new file mode 100644 index 00000000..a7041dd6 Binary files /dev/null and b/cases/sullivan2011/_frictionvelocity_obukhov_sullivan2011.png differ diff --git a/cases/sullivan2011/_temperature_heatlfux_sullivan2011.png b/cases/sullivan2011/_temperature_heatlfux_sullivan2011.png new file mode 100644 index 00000000..4fa46c28 Binary files /dev/null and b/cases/sullivan2011/_temperature_heatlfux_sullivan2011.png differ diff --git a/cases/sullivan2011/dales_sullivan2011.py b/cases/sullivan2011/dales_sullivan2011.py new file mode 100644 index 00000000..f7f0637e --- /dev/null +++ b/cases/sullivan2011/dales_sullivan2011.py @@ -0,0 +1,103 @@ +# +# Purpose : this script generates all necessary input files (.inp.) for the GABLS1 case +# +# The GABLS1 case is described in: +# Beare, R.J. et al. An Intercomparison of Large-Eddy Simulations of the Stable Boundary Layer. Boundary-Layer Meteorol 118, 247–272 (2006). https://doi.org/10.1007/s10546-004-2820-6 +# +# Author : Steven van der Linden, Delft University of Technology (TUD) +# Contact : s.j.a.vanderlinden@tudelft.nl +# Date : 21 November 2024 +# +# This file is part of DALES. + +import numpy as np +import argparse + +float_type = np.float64 + +#### Define the parser #### +parser = argparse.ArgumentParser(description='Give experiment number via -iexpr=XX') +parser.add_argument('-iexpr', action="store", dest='iexpr', type=int, default=001) +parser.add_argument('-expname', action="store", dest='expname', default='gabls1') + +args = parser.parse_args() + +# Get required parameters from namoptions.iexpr +with open('namoptions.'+str(args.iexpr)) as f: + for line in f: + if(str.rstrip(line.split('=')[0]) == 'kmax'): + kmax = int(line.split('=')[1]) + +f.close() + +print("The number of vertical levels given in namoptions.{} is equal to kmax={}".format(args.iexpr,kmax)) + +#### Create vertical grid #### +zsize = 2048 # << Specified domain height in Sullivan2011 +dz = zsize / kmax +z = np.linspace(0.5 * dz, zsize - 0.5 * dz, kmax) + +print("An equidistant vertical grid has been constructed with vertical resolution dz={}".format(dz)) + +#### Initialise arrays for initial profiles #### +th = np.empty(z.shape) +u = np.empty(z.shape) +ug = np.empty(z.shape) +v = np.empty(z.shape) +vg = np.empty(z.shape) +qt = np.empty(z.shape) +tke = np.empty(z.shape) + +wls = np.zeros(z.shape) # large scale subsidence velocity +emp = np.zeros(z.shape) +dthldt = np.zeros(z.shape) +dqtldt = np.zeros(z.shape) + +#### Write prescribed values of Sullivan2011 case to these arrays #### +for k in range(kmax): + # temperature + if(z[k] <= 974.): + th[k] = 300. + elif(z[k] <= 1074): + th[k] = 300. + (z[k] - 974.) * 0.08 + else: + th[k] = 308. + (z[k] - 1074.) * 0.003 + +u[:] = 1. +ug[:] = 1. +v[:] = 0. +vg[:] = 0. +qt[:] = 0. +tke[:] = 0. # Will be set to minimum value by DALES itself (when required) + +## Note: new str formatting in python +# In most of the cases the syntax is similar to the old %-formatting, +# with the addition of the {} and with : used instead of %. For example, '%03.2f' can be translated to '{:03.2f}'. +# additional: > forces right alignment within availabe space + +#### Create initialisation files for DALES #### +# prof.inp.iexpr is minimally needed and should contain the variables listed below. +# the first two lines are skipped during read phase. + +f = open('prof.inp.'+str(args.iexpr),'w') +f.write('# EXPERIMENT: '+args.expname+'\n') +f.write(' height(m) thl(K) qt(kg/kg) u(m/s) v(m/s) tke(m2/s2)\n') + +for k in range(kmax): + line = '{:>13.5f}{:>13.3f}{:>13.8f}{:>13.5f}{:>13.5f}{:>13.5f}\n'.format(z[k], th[k], qt[k], u[k], v[k], tke[k]) + f.write(line) + +f.close() + +# lscale.inp.iexpr provides large scale forcings (if left uninitialised, variables are set to zero by default) + +f = open('lscale.inp.'+str(args.iexpr),'w') + +f.write('# EXPERIMENT: '+args.expname+'\n') +f.write(' height(m) ugeo(m/s) vgeo(m/s) wfls(m/s) not_used not_used dqtdtls(kg/kg/s) dthldt(K/s)\n') + +for k in range(kmax): + line = '{:>10.5f}{:>8.3f}{:>8.3f}{:>10.6f}{:>6.1f}{:>6.1f}{:>6.1f}{:>6.1f}\n'.format(z[k], ug[k], vg[k], wls[k], emp[k], emp[k], dqtldt[k], dthldt[k]) + f.write(line) + +f.close() diff --git a/cases/sullivan2011/lscale.inp.001 b/cases/sullivan2011/lscale.inp.001 new file mode 100644 index 00000000..219a60a3 --- /dev/null +++ b/cases/sullivan2011/lscale.inp.001 @@ -0,0 +1,130 @@ +# EXPERIMENT: sullivan2011 + height(m) ugeo(m/s) vgeo(m/s) wfls(m/s) not_used not_used dqtdtls(kg/kg/s) dthldt(K/s) + 8.00000 1.000 0.000 0.000000 0.0 0.0 0.0 0.0 + 24.00000 1.000 0.000 0.000000 0.0 0.0 0.0 0.0 + 40.00000 1.000 0.000 0.000000 0.0 0.0 0.0 0.0 + 56.00000 1.000 0.000 0.000000 0.0 0.0 0.0 0.0 + 72.00000 1.000 0.000 0.000000 0.0 0.0 0.0 0.0 + 88.00000 1.000 0.000 0.000000 0.0 0.0 0.0 0.0 + 104.00000 1.000 0.000 0.000000 0.0 0.0 0.0 0.0 + 120.00000 1.000 0.000 0.000000 0.0 0.0 0.0 0.0 + 136.00000 1.000 0.000 0.000000 0.0 0.0 0.0 0.0 + 152.00000 1.000 0.000 0.000000 0.0 0.0 0.0 0.0 + 168.00000 1.000 0.000 0.000000 0.0 0.0 0.0 0.0 + 184.00000 1.000 0.000 0.000000 0.0 0.0 0.0 0.0 + 200.00000 1.000 0.000 0.000000 0.0 0.0 0.0 0.0 + 216.00000 1.000 0.000 0.000000 0.0 0.0 0.0 0.0 + 232.00000 1.000 0.000 0.000000 0.0 0.0 0.0 0.0 + 248.00000 1.000 0.000 0.000000 0.0 0.0 0.0 0.0 + 264.00000 1.000 0.000 0.000000 0.0 0.0 0.0 0.0 + 280.00000 1.000 0.000 0.000000 0.0 0.0 0.0 0.0 + 296.00000 1.000 0.000 0.000000 0.0 0.0 0.0 0.0 + 312.00000 1.000 0.000 0.000000 0.0 0.0 0.0 0.0 + 328.00000 1.000 0.000 0.000000 0.0 0.0 0.0 0.0 + 344.00000 1.000 0.000 0.000000 0.0 0.0 0.0 0.0 + 360.00000 1.000 0.000 0.000000 0.0 0.0 0.0 0.0 + 376.00000 1.000 0.000 0.000000 0.0 0.0 0.0 0.0 + 392.00000 1.000 0.000 0.000000 0.0 0.0 0.0 0.0 + 408.00000 1.000 0.000 0.000000 0.0 0.0 0.0 0.0 + 424.00000 1.000 0.000 0.000000 0.0 0.0 0.0 0.0 + 440.00000 1.000 0.000 0.000000 0.0 0.0 0.0 0.0 + 456.00000 1.000 0.000 0.000000 0.0 0.0 0.0 0.0 + 472.00000 1.000 0.000 0.000000 0.0 0.0 0.0 0.0 + 488.00000 1.000 0.000 0.000000 0.0 0.0 0.0 0.0 + 504.00000 1.000 0.000 0.000000 0.0 0.0 0.0 0.0 + 520.00000 1.000 0.000 0.000000 0.0 0.0 0.0 0.0 + 536.00000 1.000 0.000 0.000000 0.0 0.0 0.0 0.0 + 552.00000 1.000 0.000 0.000000 0.0 0.0 0.0 0.0 + 568.00000 1.000 0.000 0.000000 0.0 0.0 0.0 0.0 + 584.00000 1.000 0.000 0.000000 0.0 0.0 0.0 0.0 + 600.00000 1.000 0.000 0.000000 0.0 0.0 0.0 0.0 + 616.00000 1.000 0.000 0.000000 0.0 0.0 0.0 0.0 + 632.00000 1.000 0.000 0.000000 0.0 0.0 0.0 0.0 + 648.00000 1.000 0.000 0.000000 0.0 0.0 0.0 0.0 + 664.00000 1.000 0.000 0.000000 0.0 0.0 0.0 0.0 + 680.00000 1.000 0.000 0.000000 0.0 0.0 0.0 0.0 + 696.00000 1.000 0.000 0.000000 0.0 0.0 0.0 0.0 + 712.00000 1.000 0.000 0.000000 0.0 0.0 0.0 0.0 + 728.00000 1.000 0.000 0.000000 0.0 0.0 0.0 0.0 + 744.00000 1.000 0.000 0.000000 0.0 0.0 0.0 0.0 + 760.00000 1.000 0.000 0.000000 0.0 0.0 0.0 0.0 + 776.00000 1.000 0.000 0.000000 0.0 0.0 0.0 0.0 + 792.00000 1.000 0.000 0.000000 0.0 0.0 0.0 0.0 + 808.00000 1.000 0.000 0.000000 0.0 0.0 0.0 0.0 + 824.00000 1.000 0.000 0.000000 0.0 0.0 0.0 0.0 + 840.00000 1.000 0.000 0.000000 0.0 0.0 0.0 0.0 + 856.00000 1.000 0.000 0.000000 0.0 0.0 0.0 0.0 + 872.00000 1.000 0.000 0.000000 0.0 0.0 0.0 0.0 + 888.00000 1.000 0.000 0.000000 0.0 0.0 0.0 0.0 + 904.00000 1.000 0.000 0.000000 0.0 0.0 0.0 0.0 + 920.00000 1.000 0.000 0.000000 0.0 0.0 0.0 0.0 + 936.00000 1.000 0.000 0.000000 0.0 0.0 0.0 0.0 + 952.00000 1.000 0.000 0.000000 0.0 0.0 0.0 0.0 + 968.00000 1.000 0.000 0.000000 0.0 0.0 0.0 0.0 + 984.00000 1.000 0.000 0.000000 0.0 0.0 0.0 0.0 +1000.00000 1.000 0.000 0.000000 0.0 0.0 0.0 0.0 +1016.00000 1.000 0.000 0.000000 0.0 0.0 0.0 0.0 +1032.00000 1.000 0.000 0.000000 0.0 0.0 0.0 0.0 +1048.00000 1.000 0.000 0.000000 0.0 0.0 0.0 0.0 +1064.00000 1.000 0.000 0.000000 0.0 0.0 0.0 0.0 +1080.00000 1.000 0.000 0.000000 0.0 0.0 0.0 0.0 +1096.00000 1.000 0.000 0.000000 0.0 0.0 0.0 0.0 +1112.00000 1.000 0.000 0.000000 0.0 0.0 0.0 0.0 +1128.00000 1.000 0.000 0.000000 0.0 0.0 0.0 0.0 +1144.00000 1.000 0.000 0.000000 0.0 0.0 0.0 0.0 +1160.00000 1.000 0.000 0.000000 0.0 0.0 0.0 0.0 +1176.00000 1.000 0.000 0.000000 0.0 0.0 0.0 0.0 +1192.00000 1.000 0.000 0.000000 0.0 0.0 0.0 0.0 +1208.00000 1.000 0.000 0.000000 0.0 0.0 0.0 0.0 +1224.00000 1.000 0.000 0.000000 0.0 0.0 0.0 0.0 +1240.00000 1.000 0.000 0.000000 0.0 0.0 0.0 0.0 +1256.00000 1.000 0.000 0.000000 0.0 0.0 0.0 0.0 +1272.00000 1.000 0.000 0.000000 0.0 0.0 0.0 0.0 +1288.00000 1.000 0.000 0.000000 0.0 0.0 0.0 0.0 +1304.00000 1.000 0.000 0.000000 0.0 0.0 0.0 0.0 +1320.00000 1.000 0.000 0.000000 0.0 0.0 0.0 0.0 +1336.00000 1.000 0.000 0.000000 0.0 0.0 0.0 0.0 +1352.00000 1.000 0.000 0.000000 0.0 0.0 0.0 0.0 +1368.00000 1.000 0.000 0.000000 0.0 0.0 0.0 0.0 +1384.00000 1.000 0.000 0.000000 0.0 0.0 0.0 0.0 +1400.00000 1.000 0.000 0.000000 0.0 0.0 0.0 0.0 +1416.00000 1.000 0.000 0.000000 0.0 0.0 0.0 0.0 +1432.00000 1.000 0.000 0.000000 0.0 0.0 0.0 0.0 +1448.00000 1.000 0.000 0.000000 0.0 0.0 0.0 0.0 +1464.00000 1.000 0.000 0.000000 0.0 0.0 0.0 0.0 +1480.00000 1.000 0.000 0.000000 0.0 0.0 0.0 0.0 +1496.00000 1.000 0.000 0.000000 0.0 0.0 0.0 0.0 +1512.00000 1.000 0.000 0.000000 0.0 0.0 0.0 0.0 +1528.00000 1.000 0.000 0.000000 0.0 0.0 0.0 0.0 +1544.00000 1.000 0.000 0.000000 0.0 0.0 0.0 0.0 +1560.00000 1.000 0.000 0.000000 0.0 0.0 0.0 0.0 +1576.00000 1.000 0.000 0.000000 0.0 0.0 0.0 0.0 +1592.00000 1.000 0.000 0.000000 0.0 0.0 0.0 0.0 +1608.00000 1.000 0.000 0.000000 0.0 0.0 0.0 0.0 +1624.00000 1.000 0.000 0.000000 0.0 0.0 0.0 0.0 +1640.00000 1.000 0.000 0.000000 0.0 0.0 0.0 0.0 +1656.00000 1.000 0.000 0.000000 0.0 0.0 0.0 0.0 +1672.00000 1.000 0.000 0.000000 0.0 0.0 0.0 0.0 +1688.00000 1.000 0.000 0.000000 0.0 0.0 0.0 0.0 +1704.00000 1.000 0.000 0.000000 0.0 0.0 0.0 0.0 +1720.00000 1.000 0.000 0.000000 0.0 0.0 0.0 0.0 +1736.00000 1.000 0.000 0.000000 0.0 0.0 0.0 0.0 +1752.00000 1.000 0.000 0.000000 0.0 0.0 0.0 0.0 +1768.00000 1.000 0.000 0.000000 0.0 0.0 0.0 0.0 +1784.00000 1.000 0.000 0.000000 0.0 0.0 0.0 0.0 +1800.00000 1.000 0.000 0.000000 0.0 0.0 0.0 0.0 +1816.00000 1.000 0.000 0.000000 0.0 0.0 0.0 0.0 +1832.00000 1.000 0.000 0.000000 0.0 0.0 0.0 0.0 +1848.00000 1.000 0.000 0.000000 0.0 0.0 0.0 0.0 +1864.00000 1.000 0.000 0.000000 0.0 0.0 0.0 0.0 +1880.00000 1.000 0.000 0.000000 0.0 0.0 0.0 0.0 +1896.00000 1.000 0.000 0.000000 0.0 0.0 0.0 0.0 +1912.00000 1.000 0.000 0.000000 0.0 0.0 0.0 0.0 +1928.00000 1.000 0.000 0.000000 0.0 0.0 0.0 0.0 +1944.00000 1.000 0.000 0.000000 0.0 0.0 0.0 0.0 +1960.00000 1.000 0.000 0.000000 0.0 0.0 0.0 0.0 +1976.00000 1.000 0.000 0.000000 0.0 0.0 0.0 0.0 +1992.00000 1.000 0.000 0.000000 0.0 0.0 0.0 0.0 +2008.00000 1.000 0.000 0.000000 0.0 0.0 0.0 0.0 +2024.00000 1.000 0.000 0.000000 0.0 0.0 0.0 0.0 +2040.00000 1.000 0.000 0.000000 0.0 0.0 0.0 0.0 diff --git a/cases/sullivan2011/namoptions.001 b/cases/sullivan2011/namoptions.001 new file mode 100644 index 00000000..1ff8f8f5 --- /dev/null +++ b/cases/sullivan2011/namoptions.001 @@ -0,0 +1,110 @@ +&RUN +iexpnr = 001 +lwarmstart = .false. +startfile = 'initstart' +runtime = 14400 +trestart = 3600 +dtmax = 1 +ladaptive = .true. +irandom = 43 +randthl = 0.2 +randqt = 0. +nsv = 0 +nprocy = 4 +nprocx = 4 +/ + +&DOMAIN +itot = 128 +jtot = 128 +kmax = 128 +xsize = 5120. +ysize = 5120. +xlat = 43.45 +xlon = 0. +/ + +&PHYSICS +ltimedep = .false. +isurf = 4 +ps = 100000.00 +thls = 300. +lmoist = .false. +lcoriol = .true. +iradiation = 0 +z0 = 0.1 +/ + +&NAMSURFACE +isurf = 4 +ps = 100000.0 +z0mav = 0.1 +z0hav = 0.1 +wtsurf = 0.24 +wqsurf = 0.0 +wsvsurf = 0.0 +lmostlocal = .true. +/ + +&DYNAMICS +lqlnr = .false. +cu = 0 +cv = 0. +iadv_mom = 2 +iadv_tke = 2 +iadv_thl = 2 +iadv_qt = 2 +iadv_sv = 2 +ibas_prf = 2 +/ + +&NAMSUBGRID +ldelta = .false. +lmason = .false. +lsmagorinsky = .false. +/ + +&NAMCHECKSIM +tcheck = 60 +/ + +&NAMTIMESTAT +ltimestat = .true. +dtav = 30 +/ + +&NAMGENSTAT +lstat = .true. +dtav = 30 +timeav = 300 +/ + +&NAMBUDGET +lbudget = .true. +dtav = 30 +timeav = 300 +/ + +&NAMSAMPLING +dtav = 30 +timeav = 300 +/ + +&NAMSTATTEND +dtav = 30 +timeav = 300 +ltend = .false. +/ + +&NAMFIELDDUMP +dtav = 10 +lfielddump = .false. +lbinary = .false. +/ + +&NAMCROSSSECTION +lcross = .false. +dtav = 1800 +crossheight = 10 +lbinary = .true. +/ diff --git a/cases/sullivan2011/namoptions_SMAGORINSKY.001 b/cases/sullivan2011/namoptions_SMAGORINSKY.001 new file mode 100644 index 00000000..2b3e4a58 --- /dev/null +++ b/cases/sullivan2011/namoptions_SMAGORINSKY.001 @@ -0,0 +1,110 @@ +&RUN +iexpnr = 001 +lwarmstart = .false. +startfile = 'initstart' +runtime = 14400 +trestart = 3600 +dtmax = 1 +ladaptive = .true. +irandom = 43 +randthl = 0.2 +randqt = 0. +nsv = 0 +nprocy = 4 +nprocx = 4 +/ + +&DOMAIN +itot = 128 +jtot = 128 +kmax = 128 +xsize = 5120. +ysize = 5120. +xlat = 43.45 +xlon = 0. +/ + +&PHYSICS +ltimedep = .false. +isurf = 4 +ps = 100000.00 +thls = 300. +lmoist = .false. +lcoriol = .true. +iradiation = 0 +z0 = 0.1 +/ + +&NAMSURFACE +isurf = 4 +ps = 100000.0 +z0mav = 0.1 +z0hav = 0.1 +wtsurf = 0.24 +wqsurf = 0.0 +wsvsurf = 0.0 +lmostlocal = .true. +/ + +&DYNAMICS +lqlnr = .false. +cu = 0 +cv = 0. +iadv_mom = 2 +iadv_tke = 2 +iadv_thl = 2 +iadv_qt = 2 +iadv_sv = 2 +ibas_prf = 2 +/ + +&NAMSUBGRID +ldelta = .false. +lmason = .false. +lsmagorinsky = .true. +/ + +&NAMCHECKSIM +tcheck = 60 +/ + +&NAMTIMESTAT +ltimestat = .true. +dtav = 30 +/ + +&NAMGENSTAT +lstat = .true. +dtav = 30 +timeav = 300 +/ + +&NAMBUDGET +lbudget = .true. +dtav = 30 +timeav = 300 +/ + +&NAMSAMPLING +dtav = 30 +timeav = 300 +/ + +&NAMSTATTEND +dtav = 30 +timeav = 300 +ltend = .false. +/ + +&NAMFIELDDUMP +dtav = 10 +lfielddump = .false. +lbinary = .false. +/ + +&NAMCROSSSECTION +lcross = .false. +dtav = 1800 +crossheight = 10 +lbinary = .true. +/ diff --git a/cases/sullivan2011/plot_profiles.py b/cases/sullivan2011/plot_profiles.py new file mode 100644 index 00000000..3dbf01ad --- /dev/null +++ b/cases/sullivan2011/plot_profiles.py @@ -0,0 +1,117 @@ +# +# Purpose : this script plots very basic profiles from output in profiles.iexpr.nc and tmser.iexpr.nc +# (typically averaged over the final hour) +# +# required python dependencies are numpy, netCDF4 and matplotlib +# +# Author : Steven van der Linden, Delft University of Technology (TUD) +# Contact : s.j.a.vanderlinden@tudelft.nl +# Date : 21 November 2024 +# +# This file is part of DALES. + +import numpy as np +import netCDF4 as nc +import matplotlib as mpl +import matplotlib.pyplot as plt + + +#### Set timeframe over which to average #### +# average over final hour of simulation (9-10); specify time interval +time_begin = 14400 - 1*3600 +time_end = 14400 + 0.0001 # << the adding of small value is required + +########## +# General Figure settings +########## + +mpl.rcParams['axes.linewidth'] = 2 +mpl.rcParams['xtick.major.width'] = 2 +mpl.rcParams['ytick.major.width'] = 2 +mpl.rcParams['xtick.minor.width'] = 1 +mpl.rcParams['ytick.minor.width'] = 1 +mpl.rcParams['grid.linewidth'] = 1 +# mpl.rcParams['axes.grid'] = True +mpl.rcParams['ytick.labelsize'] = 15 +mpl.rcParams['xtick.labelsize'] = 15 +mpl.rcParams['legend.fontsize'] = 15 + +########## +# Plot figures +########## + +#### Initialise the figures #### +fig1=plt.figure(figsize=(20,10)) +ax11=fig1.add_axes([0.10,0.1,0.38,0.8]) +ax12=fig1.add_axes([0.52,0.1,0.38,0.8]) + +fig2=plt.figure(figsize=(20,10)) +ax21=fig2.add_axes([0.10,0.1,0.38,0.8]) +ax22=fig2.add_axes([0.52,0.1,0.38,0.8]) + +fig3=plt.figure(figsize=(20,10)) +ax31=fig3.add_axes([0.10,0.52,0.8,0.38]) +ax32=fig3.add_axes([0.10,0.1,0.8,0.38]) + +#### Open files and start plotting #### +filename = 'profiles.001.nc' +data = nc.Dataset(filename,'r') + +f2 = 'tmser.001.nc' +data2= nc.Dataset(f2,'r') + +# Find correct indices corresponding to averaging times +# Convert to array of indices instead of array of True, False. +indices_logic = np.logical_and(data['time'][:]>=time_begin, data['time'][:]<=time_end) +indices_numeric = np.where(indices_logic)[0] + +# Figure 1: wind, temperature +ax11.plot(((data['v'][indices_numeric]**2 + data['u'][indices_numeric]**2)**0.5).mean(axis=0),data['zt'][:],linestyle='solid', linewidth=2) + +ax12.plot(data['thv'][indices_numeric].mean(axis=0),data['zt'][:],linestyle='solid', linewidth=2, label='virtual pot. temp.') +ax12.plot(data['thl'][indices_numeric].mean(axis=0),data['zt'][:],linestyle='dotted', linewidth=2, label='liquid water pot. temp.') + +# Figure 2: momentum and temperature fluxes +ax21.plot(data['uwt'][indices_numeric].mean(axis=0),data['zm'][:],linestyle='solid', linewidth=2, label='total') +ax21.plot(data['uwr'][indices_numeric].mean(axis=0),data['zm'][:],linestyle='dashed', linewidth=2, label='resolved') + +ax22.plot(data['wthlt'][indices_numeric].mean(axis=0),data['zm'][:],linestyle='solid', linewidth=2) +ax22.plot(data['wthlr'][indices_numeric].mean(axis=0),data['zm'][:],linestyle='dashed', linewidth=2) + +ax31.plot(data2['time'][:],data2['ustar'][:],linestyle='solid', linewidth=2) +ax32.plot(data2['time'][:],data2['obukh'][:],linestyle='solid', linewidth=2) + + +#### Set axes, labels, etc. #### +ax11.grid() +ax12.grid() +ax11.set_ylabel(r'$z\,\mathrm{[m]}$',size=15) +ax11.set_xlabel(r'$U\,\mathrm{[m\,s^{-1}]}$',size=15) +ax12.set_xlabel(r'$\theta\,\mathrm{[K]}$',size=15) +ax11.set_ylim(0,250) +ax12.set_ylim(0,250) +lg11=ax11.legend(loc='best') + +ax21.grid() +ax22.grid() +ax21.set_ylabel(r'$z\,\mathrm{[m]}$',size=15) +ax21.set_xlabel(r'$F_u\,\mathrm{[m^2\,s^{-2}]}$',size=15) +ax22.set_xlabel(r'$F_\theta\,\mathrm{[K\,m\,s^{-1}]}$',size=15) +ax21.set_ylim(0,250) +ax22.set_ylim(0,250) +lg21=ax21.legend(loc='best') + +ax31.grid() +ax32.grid() +ax31.set_ylabel(r'$u_*\,\mathrm{[m\,s^{-1}]}$',size=15) +ax31.set_xticklabels([]) +ax32.set_ylabel(r'$L_O\,\mathrm{[m]}$',size=15) +ax32.set_xlabel(r'$t\,\mathrm{[s]}$',size=15) +lg31=ax31.legend(loc='best') + +#### Save and show #### +fig1.savefig('Wind_Temperature.png',format='png') +fig2.savefig('Fluxes_dearsmag.png',format='png') +fig3.savefig('FrictionVel_Obukhovlength.png',format='png') + +plt.show() diff --git a/cases/sullivan2011/prof.inp.001 b/cases/sullivan2011/prof.inp.001 new file mode 100644 index 00000000..66ccddf5 --- /dev/null +++ b/cases/sullivan2011/prof.inp.001 @@ -0,0 +1,130 @@ +# EXPERIMENT: sullivan2011 + height(m) thl(K) qt(kg/kg) u(m/s) v(m/s) tke(m2/s2) + 8.00000 300.000 0.00000000 1.00000 0.00000 0.00000 + 24.00000 300.000 0.00000000 1.00000 0.00000 0.00000 + 40.00000 300.000 0.00000000 1.00000 0.00000 0.00000 + 56.00000 300.000 0.00000000 1.00000 0.00000 0.00000 + 72.00000 300.000 0.00000000 1.00000 0.00000 0.00000 + 88.00000 300.000 0.00000000 1.00000 0.00000 0.00000 + 104.00000 300.000 0.00000000 1.00000 0.00000 0.00000 + 120.00000 300.000 0.00000000 1.00000 0.00000 0.00000 + 136.00000 300.000 0.00000000 1.00000 0.00000 0.00000 + 152.00000 300.000 0.00000000 1.00000 0.00000 0.00000 + 168.00000 300.000 0.00000000 1.00000 0.00000 0.00000 + 184.00000 300.000 0.00000000 1.00000 0.00000 0.00000 + 200.00000 300.000 0.00000000 1.00000 0.00000 0.00000 + 216.00000 300.000 0.00000000 1.00000 0.00000 0.00000 + 232.00000 300.000 0.00000000 1.00000 0.00000 0.00000 + 248.00000 300.000 0.00000000 1.00000 0.00000 0.00000 + 264.00000 300.000 0.00000000 1.00000 0.00000 0.00000 + 280.00000 300.000 0.00000000 1.00000 0.00000 0.00000 + 296.00000 300.000 0.00000000 1.00000 0.00000 0.00000 + 312.00000 300.000 0.00000000 1.00000 0.00000 0.00000 + 328.00000 300.000 0.00000000 1.00000 0.00000 0.00000 + 344.00000 300.000 0.00000000 1.00000 0.00000 0.00000 + 360.00000 300.000 0.00000000 1.00000 0.00000 0.00000 + 376.00000 300.000 0.00000000 1.00000 0.00000 0.00000 + 392.00000 300.000 0.00000000 1.00000 0.00000 0.00000 + 408.00000 300.000 0.00000000 1.00000 0.00000 0.00000 + 424.00000 300.000 0.00000000 1.00000 0.00000 0.00000 + 440.00000 300.000 0.00000000 1.00000 0.00000 0.00000 + 456.00000 300.000 0.00000000 1.00000 0.00000 0.00000 + 472.00000 300.000 0.00000000 1.00000 0.00000 0.00000 + 488.00000 300.000 0.00000000 1.00000 0.00000 0.00000 + 504.00000 300.000 0.00000000 1.00000 0.00000 0.00000 + 520.00000 300.000 0.00000000 1.00000 0.00000 0.00000 + 536.00000 300.000 0.00000000 1.00000 0.00000 0.00000 + 552.00000 300.000 0.00000000 1.00000 0.00000 0.00000 + 568.00000 300.000 0.00000000 1.00000 0.00000 0.00000 + 584.00000 300.000 0.00000000 1.00000 0.00000 0.00000 + 600.00000 300.000 0.00000000 1.00000 0.00000 0.00000 + 616.00000 300.000 0.00000000 1.00000 0.00000 0.00000 + 632.00000 300.000 0.00000000 1.00000 0.00000 0.00000 + 648.00000 300.000 0.00000000 1.00000 0.00000 0.00000 + 664.00000 300.000 0.00000000 1.00000 0.00000 0.00000 + 680.00000 300.000 0.00000000 1.00000 0.00000 0.00000 + 696.00000 300.000 0.00000000 1.00000 0.00000 0.00000 + 712.00000 300.000 0.00000000 1.00000 0.00000 0.00000 + 728.00000 300.000 0.00000000 1.00000 0.00000 0.00000 + 744.00000 300.000 0.00000000 1.00000 0.00000 0.00000 + 760.00000 300.000 0.00000000 1.00000 0.00000 0.00000 + 776.00000 300.000 0.00000000 1.00000 0.00000 0.00000 + 792.00000 300.000 0.00000000 1.00000 0.00000 0.00000 + 808.00000 300.000 0.00000000 1.00000 0.00000 0.00000 + 824.00000 300.000 0.00000000 1.00000 0.00000 0.00000 + 840.00000 300.000 0.00000000 1.00000 0.00000 0.00000 + 856.00000 300.000 0.00000000 1.00000 0.00000 0.00000 + 872.00000 300.000 0.00000000 1.00000 0.00000 0.00000 + 888.00000 300.000 0.00000000 1.00000 0.00000 0.00000 + 904.00000 300.000 0.00000000 1.00000 0.00000 0.00000 + 920.00000 300.000 0.00000000 1.00000 0.00000 0.00000 + 936.00000 300.000 0.00000000 1.00000 0.00000 0.00000 + 952.00000 300.000 0.00000000 1.00000 0.00000 0.00000 + 968.00000 300.000 0.00000000 1.00000 0.00000 0.00000 + 984.00000 300.800 0.00000000 1.00000 0.00000 0.00000 + 1000.00000 302.080 0.00000000 1.00000 0.00000 0.00000 + 1016.00000 303.360 0.00000000 1.00000 0.00000 0.00000 + 1032.00000 304.640 0.00000000 1.00000 0.00000 0.00000 + 1048.00000 305.920 0.00000000 1.00000 0.00000 0.00000 + 1064.00000 307.200 0.00000000 1.00000 0.00000 0.00000 + 1080.00000 308.018 0.00000000 1.00000 0.00000 0.00000 + 1096.00000 308.066 0.00000000 1.00000 0.00000 0.00000 + 1112.00000 308.114 0.00000000 1.00000 0.00000 0.00000 + 1128.00000 308.162 0.00000000 1.00000 0.00000 0.00000 + 1144.00000 308.210 0.00000000 1.00000 0.00000 0.00000 + 1160.00000 308.258 0.00000000 1.00000 0.00000 0.00000 + 1176.00000 308.306 0.00000000 1.00000 0.00000 0.00000 + 1192.00000 308.354 0.00000000 1.00000 0.00000 0.00000 + 1208.00000 308.402 0.00000000 1.00000 0.00000 0.00000 + 1224.00000 308.450 0.00000000 1.00000 0.00000 0.00000 + 1240.00000 308.498 0.00000000 1.00000 0.00000 0.00000 + 1256.00000 308.546 0.00000000 1.00000 0.00000 0.00000 + 1272.00000 308.594 0.00000000 1.00000 0.00000 0.00000 + 1288.00000 308.642 0.00000000 1.00000 0.00000 0.00000 + 1304.00000 308.690 0.00000000 1.00000 0.00000 0.00000 + 1320.00000 308.738 0.00000000 1.00000 0.00000 0.00000 + 1336.00000 308.786 0.00000000 1.00000 0.00000 0.00000 + 1352.00000 308.834 0.00000000 1.00000 0.00000 0.00000 + 1368.00000 308.882 0.00000000 1.00000 0.00000 0.00000 + 1384.00000 308.930 0.00000000 1.00000 0.00000 0.00000 + 1400.00000 308.978 0.00000000 1.00000 0.00000 0.00000 + 1416.00000 309.026 0.00000000 1.00000 0.00000 0.00000 + 1432.00000 309.074 0.00000000 1.00000 0.00000 0.00000 + 1448.00000 309.122 0.00000000 1.00000 0.00000 0.00000 + 1464.00000 309.170 0.00000000 1.00000 0.00000 0.00000 + 1480.00000 309.218 0.00000000 1.00000 0.00000 0.00000 + 1496.00000 309.266 0.00000000 1.00000 0.00000 0.00000 + 1512.00000 309.314 0.00000000 1.00000 0.00000 0.00000 + 1528.00000 309.362 0.00000000 1.00000 0.00000 0.00000 + 1544.00000 309.410 0.00000000 1.00000 0.00000 0.00000 + 1560.00000 309.458 0.00000000 1.00000 0.00000 0.00000 + 1576.00000 309.506 0.00000000 1.00000 0.00000 0.00000 + 1592.00000 309.554 0.00000000 1.00000 0.00000 0.00000 + 1608.00000 309.602 0.00000000 1.00000 0.00000 0.00000 + 1624.00000 309.650 0.00000000 1.00000 0.00000 0.00000 + 1640.00000 309.698 0.00000000 1.00000 0.00000 0.00000 + 1656.00000 309.746 0.00000000 1.00000 0.00000 0.00000 + 1672.00000 309.794 0.00000000 1.00000 0.00000 0.00000 + 1688.00000 309.842 0.00000000 1.00000 0.00000 0.00000 + 1704.00000 309.890 0.00000000 1.00000 0.00000 0.00000 + 1720.00000 309.938 0.00000000 1.00000 0.00000 0.00000 + 1736.00000 309.986 0.00000000 1.00000 0.00000 0.00000 + 1752.00000 310.034 0.00000000 1.00000 0.00000 0.00000 + 1768.00000 310.082 0.00000000 1.00000 0.00000 0.00000 + 1784.00000 310.130 0.00000000 1.00000 0.00000 0.00000 + 1800.00000 310.178 0.00000000 1.00000 0.00000 0.00000 + 1816.00000 310.226 0.00000000 1.00000 0.00000 0.00000 + 1832.00000 310.274 0.00000000 1.00000 0.00000 0.00000 + 1848.00000 310.322 0.00000000 1.00000 0.00000 0.00000 + 1864.00000 310.370 0.00000000 1.00000 0.00000 0.00000 + 1880.00000 310.418 0.00000000 1.00000 0.00000 0.00000 + 1896.00000 310.466 0.00000000 1.00000 0.00000 0.00000 + 1912.00000 310.514 0.00000000 1.00000 0.00000 0.00000 + 1928.00000 310.562 0.00000000 1.00000 0.00000 0.00000 + 1944.00000 310.610 0.00000000 1.00000 0.00000 0.00000 + 1960.00000 310.658 0.00000000 1.00000 0.00000 0.00000 + 1976.00000 310.706 0.00000000 1.00000 0.00000 0.00000 + 1992.00000 310.754 0.00000000 1.00000 0.00000 0.00000 + 2008.00000 310.802 0.00000000 1.00000 0.00000 0.00000 + 2024.00000 310.850 0.00000000 1.00000 0.00000 0.00000 + 2040.00000 310.898 0.00000000 1.00000 0.00000 0.00000