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

&initialization_parameters
    nx = 499,
    ny = 499,
    nz = 140,
    dx = 2.0,
    dy = 2.0,
    dz = 2.0,

    ! >>>>>>>  Tony, 1/02/2015 <<<<<<<<<<
    !dz = 50.0, 100.0, !200.0,
    !dz_stretch_level_start =  2000.0,! 1500.0,
    !dz_stretch_level_end   =  4000.0,! 3000.0,
    !ngsrb = 4 ! default is 2
!-- Wall/soil spinup
! >>> preso da https://palm.muk.uni-hannover.de/trac/wiki/doc/tec/biomet/examples
    !spinup_time         = 86400.0,
    !spinup_time         = 3600.0,
    !spinup_pt_mean      = 293.15,
    !spinup_pt_amplitude = 15.0,
! The soil/wall spinup may become unstable when the 
! timestep is chosen too large. Values of 
! dt_spinup <= 10.0 are recommended.

    data_output_during_spinup = .T.

    fft_method = 'fftw',
    psolver = 'multigrid',
    monotonic_limiter_z = .T.,
    humidity = .T.,
    initializing_actions = 'read_restart_data',
    constant_flux_layer        = .T.,
    check_realistic_q = .FALSE.,
    allow_roughness_limitation = .TRUE.,
    !origin_date_time = '2023-08-15 04:00:00 +01',
    !origin_date_time = '2023-08-17 04:00:00 +01',
    !origin_date_time = '2023-08-23 03:00:00 +01',
    origin_date_time = '2023-08-24 00:00:00 +01',
    topography = 'read_from_file',
    longitude = 11.3467247450045,
    latitude = 44.5120835669301,
/
&runtime_parameters
    end_time = 172800.0,
    create_disturbances = .T.,
    dt_run_control = 0.0,
    dt_dots = 0.0,
    skip_time_dopr = 0.0,
    dt_dopr = 1800.0,
    !dt_dopr = 300.0,
    averaging_interval = 1800.0,
    averaging_interval_pr = 1800.0,
    !averaging_interval = 300.0,
    !averaging_interval_pr = 300.0,

    data_output_pr = 'u', 'v', 'w',
                     'e', 'e*',
                     'l',
                     'rad_lw_in', 'rad_lw_out',
                     'rad_sw_in', 'rad_sw_out',
                     'rho', 'rh', 'qv', 'theta', 'thetav',

!data_output_pr = '#u', 'w"u"', 'w*u*', 'wu', 'u*2',
!                     '#v', 'w"v"', 'w*v*', 'wv', 'v*2',
!                     'w', 'w*2','rho', 'hyp', 'p',
!                     'e', 'e*','l','#theta', 'w"theta"',
!                     'w*theta*','wtheta', 'theta*2',
!                     '#q', 'w"q"', 'w*q*','wq', 'q*2',
!                     'rh','#t_soil', '#m_soil',
!                     'rad_lw_in', 'rad_lw_out',
!                     'rad_sw_in', 'rad_sw_out',

    netcdf_data_format = 5,
    do3d_at_begin = .T.,
    do2d_at_begin = .T.,
    dt_data_output = 1800.0,
    !dt_data_output = 300.0,
    dt_do2d_xy = 1800.0,
    dt_do2d_xz = 1800.0,
    dt_do2d_yz = 1800.0,
    dt_domask = 1800.0,
    !dt_do2d_xy = 300.0,
    !dt_do2d_xz = 300.0,
    !dt_do2d_yz = 300.0,
    !dt_domask = 300.0,
    dt_averaging_input = 0.0,
    section_xy = 10,
    section_xz = 50,
    section_yz = 50, 
    data_output = 'u_av',
                  'v_av',
                  'w_av',
                  'u',
		  'v',
		  'w',
                  'theta_av',
                  'ta_av',
                  'e_av',
                  'm_soil_av',
                  't_soil_av',
                  'tsurf*_xy_av',
                  'bio_utci*_xy_av',
                  'bio_perct*_xy_av',
                  'bio_pet*_xy_av',
                  'q_av',
                  'shf*_xy_av',
                  'ghf*_xy_av',
                  'rad_net*_xy', 'rad_lw_in*_xy', 
                  'rad_lw_out*_xy', 'rad_sw_in*_xy', 
                  'rad_sw_out*_xy',
                  'uu_product_av','vv_product_av','ww_product_av',
                  'uw_product_av','vw_product_av',
                  'wu_product_av','wv_product_av',
                  'wtheta_product','wq_product',
                  'wtheta_product_av','wq_product_av',
		  'wspeed_10m*_xy_av',
		  'us*_xy_av', 
		  'ta_xy_av',
                  'pcm_lad',
                  'pcm_heatrate_av',
                  'pcm_latentrate_av',
		  !'wspeed_10m*_xy_av',
		  !'u*2',
                  !'kc_PM10', 'kc_PM25',
                  !'ti_av',
                  !'p_av',
                  !'pcm_transpirationrate_av',
                  !'rh_av',
                  !'u_xz_av',
                  !'v_xz_av',
                  !'w_xz_av',
                  !'theta_xz_av',
                  !'ta_xz_av',
                  !'q_xz_av',
                  !'ti_xz_av',
                  !'u_yz_av',
                  !'v_yz_av',
                  !'w_yz_av',
                  !'theta_yz_av',
                  !'ta_yz_av',
                  !'q_yz_av',
                  !'qv_yz_av',
                  !'ti_yz_av',
                  !'us*_xy','z0*_xy',
                  !'t*_xy','ol*_xy',
                  !'m_liq*_xy', 'theta_xy',
                  !'r_s*_xy','r_a*_xy',
                  !'qsws*_xy', 'qsws*_xy_av',
                  !'pcm_heatrate', 'pcm_transpirationrate',
                  !'pcm_transpirationrate',
                     
/ !end runtime
&radiation_parameters
! Tony    radiation_scheme = 'clear-sky',!'rrtmg',
! Tony     constant_albedo = .F.,
! Tony     dt_radiation = 60.0,
! Tony     surface_reflections = .T.,
    
    radiation_scheme = 'rrtmg',      !Luca
    radiation_interactions_on = .T., !Luca
    constant_albedo = .F.,           !Luca
    dt_radiation = 60.0,             !Luca
    surface_reflections = .T.,       !Luca
/
&land_surface_parameters
    surface_type      = 'read_from_file', 
    constant_roughness = .T.,
    aero_resist_kray = .T.,
    conserve_water_content = .T.,
/
&urban_surface_parameters
!    usm_wall_mod = .T.,
/

! >>>>> Tony, 2 febbraio 2025
!-------------------------------------------------------------------------------
!-- CHEMISTRY MODEL PARAMETER NAMELIST
!   Documentation: https://palm.muk.uni-hannover.de/trac/wiki/doc/app/chempar
!-------------------------------------------------------------------------------
! &chemistry_parameters
!
!    chem_gasphase_on           = .F.,
!    chem_mechanism             = 'phstatp',
!
!    surface_csflux_name        = 'PM10','PM25',
!    surface_csflux             = 0.75, 0.375,
!    cs_name                    = 'PM10','PM25',
!    cs_surface                 = 2.0, 1.0,
!    bc_cs_b= 'neumann',
!    bc_cs_l= 'cyclic',
!    bc_cs_n= 'cyclic',
!    bc_cs_t= 'cyclic',
!    bc_cs_r= 'neumann',
!    bc_cs_s= 'neumann',
!    emiss_factor_main = 1.667,
!    emiss_factor_side = 0.334,
!
!    main_street_id = 12,
!    side_street_id =  8,
!    max_street_id = 19,
!
! / ! end of chemistry_par namelist

!---------------------------------------------------------------------------------------
!-- SYNTHETIC TURBULENCE GENERATOR PARAMETER NAMELIST
!   Documentation: https://palm.muk.uni-hannover.de/trac/wiki/doc/app/stg_par
!---------------------------------------------------------------------------------------
! &stg_par
!    dt_stg_adjust    = 300.0,
!    dt_stg_call      = 0.0,
! / ! end of stg_par namelist

&plant_canopy_parameters
    canopy_mode                = 'read_from_file',
    canopy_drag_coeff          = 0.15,
    cthf                       = 0,
    plant_canopy_transpiration = .T.,
    leaf_scalar_exch_coeff     = 0.5,
    leaf_surface_conc          = 0.003,
/

&biometeorology_parameters
    thermal_comfort = .T.,
!    uv_exposure = .F.,   !< .T.=expo model on, .F.=expo model off
!    clothing = 1,
/
!-------------------------------------------------------------------------------
!-- VIRTUAL MEASUREMENTS PARAMETER NAMELIST
!   Documentation: https://palm.muk.uni-hannover.de/trac/wiki/doc/app/virtual_measurement_parameters 
!-------------------------------------------------------------------------------
&virtual_measurement_parameters
     switch_off_module = .F.,
     vm_time_start = 169200.0, 
     dt_virtual_measurement = .05,
/ ! end of virtual measurements namelist     
