!------------------------------------------------------------------------------
!-- NESTING PARAMETER NAMELIST
!-- Documentation: https://palm.muk.uni-hannover.de/trac/wiki/doc/app/nestpar
!------------------------------------------------------------------------------
&nesting_parameters
! FUNZIONA SU LEONARDO con N02 ridotto MA TROPPO LENTO: 2% di 9h in 1h 
!   domain_layouts             = 'parent',  1,  -1,  50,    0.0,    0.0  ,0.0,
!                                'N02'   ,  2,   1, 100,  3250.0,  3250.0,0.0,
!                                'N03'   ,  3,   2, 250,  4500.0,  4500.0,0.0,

! HA FUNZIONATO SU LEONARDO con N02FULL MA TROPPO LENTO:  9h in circa 6h 
!   domain_layouts             = 'parent',  1,  -1,  200,    0.0,    0.0  ,0.0,
!                                'N02'   ,  2,   1, 1225,  3250.0,  3250.0,0.0,
!                                'N03'   ,  3,   2,  625,  4500.0,  4500.0,0.0,

   domain_layouts             = 'parent',  1,  -1,  100,    0.0,    0.0  ,0.0,
                                'N02'   ,  2,   1,  400,  3250.0,  3250.0,0.0,
                                'N03'   ,  3,   2,  250,  4500.0,  4500.0,0.0,

   nesting_mode               = 'two-way',
   nesting_datatransfer_mode  = 'mixed',

/! end of nesting_parameters namelist


&nesting_offl_parameters
    switch_off_module = .FALSE.,
/

&initialization_parameters
    nx = 199,
    ny = 199,
    nz = 60,
    dx = 50.0,
    dy = 50.0,
    dz = 50.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, ! che in questo dominio (N01) corrisponde ad un quarto dei 200 punti presenti lungo y
    section_yz = 50, ! che in questo dominio (N01) corrisponde ad un quarto dei 200 punti presenti lungo x
    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',
    !'u*2',
                  !'kc_PM10', 'kc_PM25',
                  !'ti_av',
                  !'p_av',
                  !'pcm_transpirationrate_av',
                  !'pcm_heatrate_av',
                  !'pcm_latentrate_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',
                  !'pcm_heatrate_av', 'pcm_transpirationrate_av', 'pcm_latentrate_av',
                  !'pcm_lad',
                     
/ !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',  ! must match with third line of chem_gasphase_mod.f90
!
!    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= '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    = 1800.0,
    dt_stg_call      = 0.0,
    switch_off_module=.F.,
    compute_velocity_seeds_local=.F.,
/ ! end of stg_par namelist

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

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