!-------------------------------------------------------------------------------
!-- INITIALIZATION PARAMETER NAMELIST
!   Documentation: https://palm.muk.uni-hannover.de/trac/wiki/doc/app/inipar
!-------------------------------------------------------------------------------
 &initialization_parameters

!
!-- Grid
!------------------------------------------------------------------------------
    nx                   = 599,
    ny                   = 599,
    nz                   = 130,

    dx                   = 2.0,
    dy                   = 2.0,
    dz                   = 2.0,

    dz_stretch_level     = 100.0,
    dz_stretch_factor    = 1.01,
    dz_max               = 6.0,

!
!-- Numerics
!------------------------------------------------------------------------------
    fft_method           = 'fftw',
    psolver              = 'multigrid'
    cycle_mg             = 'w',
    mg_cycles            = 2,
    mg_switch_to_pe0_level = -1,
    bc_p_t               = 'neumann',

!
!-- Mode
!------------------------------------------------------------------------------
    humidity             = .T.,

!
!-- Initialization
!------------------------------------------------------------------------------
    initializing_actions = 'set_constant_profiles',   !'set_constant_profiles', or 'inifor',
                                                      ! or both (met. from inifor, chem constant profiles)

pt_surface                 = 285
pt_vertical_gradient       =    0.0,  0.1,   0.8,   0.5,    0.4
pt_vertical_gradient_level = 100., 300., 500., 800., 1050., 6000.

q_surface                 = 0.009
q_vertical_gradient       = -1.e-3
q_vertical_gradient_level = 0, 1000.

uv_heights                = 0.0, 100., 300., 500., 800., 1050., 6000.0
u_profile                 = 0.0,   2.,  3.5,   1.,   0.,    0.,   15.
v_profile                 = 0.0,   0.,  2.0,   5.,   5.,   10.,    0.

    ug_surface           = 0.0,
    vg_surface           = 0.0,

    origin_date_time     = '2019-06-01 06:00:00 +00'

!
!-- Topography
!------------------------------------------------------------------------------
    topography           = 'read_from_file',

!
!-- Physics
!------------------------------------------------------------------------------
  longitude = 13.255468
  latitude  = 52.44824

!
!-- boundary conditions
!-------------------------------------------------------------------------------
!    flux_input_mode            = 'dynamic' ! sensible and latent heat fluxes in W/m2
!    use_surface_fluxes         = .T.,
!    surface_heatflux           = 50.,  ! sensible heat flux at the bottom surface
!    surface_waterflux          = 800., ! latent heat flux
!    bc_pt_b                    = 'neumann', ! required with surface_heatflux
!    bc_q_b                     = 'neumann', ! required with surface_heatflux

 / ! end of inipar namelist


!-------------------------------------------------------------------------------
!-- RUNTIME PARAMETER NAMELIST
!   Documentation: https://palm.muk.uni-hannover.de/trac/wiki/doc/app/d3par
!-------------------------------------------------------------------------------
 &runtime_parameters

!
!-- Run steering
!------------------------------------------------------------------------------
    end_time              = 43200,
    dt_restart            = 3600,
    restart_time          = 3600,
    termination_time_needed = 900,
    
    create_disturbances   = .T.,
    dt_disturb            = 150.0,  ! interval for random perturbations
    disturbance_energy_limit = 0.01,   ! upper limit for perturbation energy
    npex                  = 8,
    npey                  = 8,
!    cpu_log_barrierwait   = .T.,

!-- Run-control/timeseries output settings
!------------------------------------------------------------------------------
    dt_run_control        =  0.0,
    dt_dots               =  300,

!
!-- Profile output settings
!------------------------------------------------------------------------------
    skip_time_dopr        =  0.0,
    dt_dopr               = 300,
    averaging_interval_pr = 300,
    dt_averaging_input_pr =  0.0,

!
!-- 2D/3D output settings
!------------------------------------------------------------------------------
    netcdf_data_format = 5,
    do3d_at_begin      = .T.,
    do2d_at_begin      = .T.,
    section_xy         = 0,2,4,6,8,10,12,14,16,18,20

    dt_data_output     = 300,
    dt_data_output_av  = 300,
    dt_dopr            = 300,

    data_output                = 'u','v','w', 'q', 'theta', 'rad_lw_hr', 'rad_lw_in', 'rad_lw_out', 'rad_sw_hr', 'rad_sw_in', 'rad_sw_out', 'hr', 'rh', 'ta_2m*_xy', 'theta_2m*_xy', 'wspeed_10m*_xy', 'tsurf*_xy'

    data_output_pr             = 'wtheta', 'w"theta"', 'w*theta*',
                                 'w*2', '#theta', 'theta*2',
                                 'rad_lw_hr', 'rad_sw_hr',
                                 'u','v', 'w', 'p', 'rho',
                                 'q', 'rh' !, 'qc'

!
!-- Debug
!---------------------------------------------------------------------------------
    !debug_output = .T.,
    !debug_output_timestep = .T.,

 / ! end of d3par namelist

!&bulk_cloud_parameters
!!
!!-- set microphyiscs scheme
!!-------------------------------------------------------------------------------
!    cloud_scheme              = 'morrison',       ! two-moment liquid water microphysics
!                                                  ! including autoconversion,
!                                                  ! accretion, sedimentation, precipitation
!!
!!-- steering of liquid phase
!!-------------------------------------------------------------------------------
!    collision_turbulence              = .TRUE.,   ! parametize turbulence effects for collision
!    cloud_water_sedimentation         = .TRUE.,   ! enable cloud water sedimentation
!!    nc_const                          = 100.0E6,  ! cloud droplet concentration
!    call_microphysics_at_all_substeps = .FALSE.,  ! microphysics every sub-timestep disabled
!
!!!
!!!-- steering of ice phase
!!!-------------------------------------------------------------------------------
!    microphysics_ice_phase    = .False.,           ! turn on ice microphysics
!!!    in_init                   = 4000.0,           ! set ice nucleii concentration
!!    ice_crystal_sedimentation = .TRUE.,           ! turn on ice sedimentation
!!    snow                      = .TRUE.,           ! turn on prog. quantities for snow
!!    graupel                   = .TRUE.,           ! turn on prog. quantities for graupel
!!    start_ice_microphysics    = 0.0,              ! start with ice microphysics at model start
!/ ! end of bulk cloud parameter namelist

!-------------------------------------------------------------------------------
!-- RADIATION MODEL PARAMETER NAMELIST
!   Documentation: https://palm.muk.uni-hannover.de/trac/wiki/doc/app/radpar
!-------------------------------------------------------------------------------
  &radiation_parameters
     radiation_scheme = 'rrtmg',
     !albedo_type      = 5,
     constant_albedo  = .T.,
     use_broadband_albedo = .T.,
     dt_radiation     = 30.0,
     !rad_angular_discretization = .F.,
     raytrace_mpi_rma = .F.,
     surface_reflections = .F.,
     !localized_raytracing = .T.,

/

!-------------------------------------------------------------------------------
!-- LAND SURFACE MODEL PARAMETER NAMELIST
!   Documentation: https://palm.muk.uni-hannover.de/trac/wiki/doc/app/lsmpar
!-------------------------------------------------------------------------------
 &land_surface_parameters

!    surface_type = 'vegetation',

    constant_roughness     = .T.,
    aero_resist_kray       = .T.,

    vegetation_type        = 2,
    soil_type              = 3,
    conserve_water_content = .T.,

    root_fraction          = 0.49, 0.26, 0.25, 0.0, 0.0, 0.0, 0.0, 0.0,
    soil_temperature       = 290.15, 290.0, 290.0, 290.0, 290.0, 290.0, 290.0, 290.0,
    soil_moisture          = 0.50,   0.50,  0.50,  0.50,  0.50, 0.50,  0.50,  0.50,
    deep_soil_temperature  = 277.0,
 / ! end of lsm_par namelist


!-------------------------------------------------------------------------------
!-- URBAN SURFACE MODEL PARAMETER NAMELIST
!   Documentation: https://palm.muk.uni-hannover.de/trac/wiki/doc/app/usmpar
!-------------------------------------------------------------------------------
 &urban_surface_parameters

    usm_wall_mod = .T.,

 / ! end of urban_surface_par namelist

&plant_canopy_parameters

   canopy_mode       = 'read_from_file',
   canopy_drag_coeff = 0.3,

/ ! end of canopy_par namelist


!-------------------------------------------------------------------------------
!   Documentation: https://palm.muk.uni-hannover.de/trac/wiki/doc/app/usmpar
!-------------------------------------------------------------------------------
 &surface_data_output_parameters

    data_output_surf = 'albedo',        'emissivity',
                       'rad_net',       'rad_net_av',
                       'shf',           'shf_av',
                       'qsws',          'qsws_av',
                       'q_surface',     'q_surface_av',
                       'theta_surface', 'theta_surface_av',
                       'ghf',           'ghf_av',
                       'rad_lw_dif',    'rad_lw_dif_av',
                       'rad_lw_in',     'rad_lw_in_av',
                       'rad_lw_out',    'rad_lw_out_av',
                       'rad_sw_dir',    'rad_sw_dir_av',
                       'rad_sw_dif',    'rad_sw_dif_av',
                       'rad_sw_in',     'rad_sw_in_av',
                       'rad_sw_out',    'rad_sw_out_av',
    dt_dosurf = 60,
    averaging_interval_surf = 60,
    dt_dosurf_av = 60,
    to_netcdf = .TRUE., to_vtk = .False.,
    skip_time_dosurf = 0.0,
/

