Changeset 2696 for palm/trunk/SOURCE/time_integration.f90
- Timestamp:
- Dec 14, 2017 5:12:51 PM (7 years ago)
- Location:
- palm/trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
palm/trunk
-
palm/trunk/SOURCE
-
palm/trunk/SOURCE/time_integration.f90
r2617 r2696 1 1 !> @file time_integration.f90 2 2 !------------------------------------------------------------------------------! 3 ! This file is part of PALM.3 ! This file is part of the PALM model system. 4 4 ! 5 5 ! PALM is free software: you can redistribute it and/or modify it under the … … 25 25 ! ----------------- 26 26 ! $Id$ 27 ! - Implementation of uv exposure model (FK) 28 ! - Moved vnest_boundary_conds_khkm from tcm_diffusivities to here (TG) 29 ! - renamed diffusivities to tcm_diffusivities (TG) 30 ! - implement prognostic equation for diss (TG) 31 ! - Moved/commented CALL to chem_emissions (FK) 32 ! - Added CALL to chem_emissions (FK) 33 ! - Implementation of chemistry module (FK) 34 ! - Calls for setting boundary conditions in USM and LSM (MS) 35 ! - Large-scale forcing with larger-scale models implemented (MS) 36 ! - Rename usm_radiation into radiation_interactions; merge with branch 37 ! radiation (MS) 38 ! - added call for usm_green_heat_model for green building surfaces (RvT) 39 ! - added call for usm_temperature_near_surface for use in indoor model (RvT) 40 ! 41 ! 2617 2017-11-16 12:47:24Z suehring 27 42 ! Bugfix, assure that the reference state does not become zero. 28 43 ! … … 287 302 288 303 USE arrays_3d, & 289 ONLY: diss, d zu, e, e_p, nc, nc_p, nr, nr_p, prho, pt, pt_p, pt_init, &304 ONLY: diss, diss_p, dzu, e, e_p, nc, nc_p, nr, nr_p, prho, pt, pt_p, pt_init, & 290 305 q_init, q, qc, qc_p, ql, ql_c, ql_v, ql_vp, qr, qr_p, q_p, & 291 306 ref_state, rho_ocean, s, s_p, sa_p, tend, u, u_p, v, vpt, & … … 295 310 ONLY: calc_mean_profile 296 311 312 #if defined( __chem ) 313 USE chemistry_model_mod, & 314 ONLY: chem_emissions, chem_species 315 316 USE chem_modules, & 317 ONLY: nspec 318 #endif 319 297 320 USE control_parameters, & 298 ONLY: advected_distance_x, advected_distance_y, a verage_count_3d,&299 averag ing_interval, averaging_interval_pr,&321 ONLY: advected_distance_x, advected_distance_y, air_chemistry, & 322 average_count_3d, averaging_interval, averaging_interval_pr, & 300 323 bc_lr_cyc, bc_ns_cyc, bc_pt_t_val, & 301 324 bc_q_t_val, call_psolver_at_all_substeps, cloud_droplets, & … … 307 330 dt_coupling, dt_data_output_av, dt_disturb, dt_do2d_xy, & 308 331 dt_do2d_xz, dt_do2d_yz, dt_do3d, dt_domask,dt_dopts, dt_dopr, & 309 dt_dopr_listing, dt_dots, dt_dvrp, dt_run_control, 310 end_time, first_call_lpm, galilei_transformation, humidity,&332 dt_dopr_listing, dt_dots, dt_dvrp, dt_run_control, end_time, & 333 first_call_lpm, forcing, galilei_transformation, humidity, & 311 334 intermediate_timestep_count, intermediate_timestep_count_max, & 312 335 land_surface, large_scale_forcing, & … … 316 339 ocean, passive_scalar, & 317 340 prho_reference, pt_reference, pt_slope_offset, random_heatflux, & 318 r un_coupled, simulated_time, simulated_time_chr,&341 rans_tke_e, run_coupled, simulated_time, simulated_time_chr, & 319 342 skip_time_do2d_xy, skip_time_do2d_xz, skip_time_do2d_yz, & 320 343 skip_time_do3d, skip_time_domask, skip_time_dopr, & … … 328 351 turbulent_inflow, turbulent_outflow, urban_surface, & 329 352 use_initial_profile_as_reference, & 330 use_single_reference_value, u _gtrans, v_gtrans, virtual_flight,&331 wind_turbine, ws_scheme_mom, ws_scheme_sca353 use_single_reference_value, uv_exposure, u_gtrans, v_gtrans, & 354 virtual_flight, wind_turbine, ws_scheme_mom, ws_scheme_sca 332 355 333 356 USE cpulog, & … … 349 372 350 373 USE land_surface_model_mod, & 351 ONLY: lsm_ energy_balance, lsm_soil_model,&374 ONLY: lsm_boundary_condition, lsm_energy_balance, lsm_soil_model, & 352 375 skip_time_do_lsm 353 376 354 377 USE lsf_nudging_mod, & 355 ONLY: calc_tnudge, ls_forcing_surf, ls_forcing_vert, nudge_ref 378 ONLY: calc_tnudge, ls_forcing_surf, ls_forcing_vert, nudge_ref, & 379 forcing_bc, forcing_bc_mass_conservation 380 381 USE netcdf_data_input_mod, & 382 ONLY: force, netcdf_data_input_lsf 356 383 357 384 USE microphysics_mod, & … … 368 395 pmci_ensure_nest_mass_conservation, pmci_synchronize 369 396 370 USE production_e_mod, &371 ONLY: production_e_init372 373 397 USE progress_bar, & 374 398 ONLY: finish_progress_bar, output_progress_bar … … 379 403 USE radiation_model_mod, & 380 404 ONLY: dt_radiation, force_radiation_call, radiation, radiation_control,& 405 radiation_interaction, radiation_interactions, & 381 406 skip_time_do_radiation, time_radiation 382 407 … … 395 420 ONLY: surf_def_h, surf_lsm_h, surf_usm_h 396 421 422 USE turbulence_closure_mod, & 423 ONLY: tcm_diffusivities, production_e_init 424 397 425 USE urban_surface_mod, & 398 ONLY: usm_material_heat_model, usm_material_model, & 399 usm_radiation, usm_surface_energy_balance 426 ONLY: usm_boundary_condition, usm_material_heat_model, & 427 usm_material_model, & 428 usm_surface_energy_balance, usm_green_heat_model, & 429 usm_temperature_near_surface 400 430 401 431 USE synthetic_turbulence_generator_mod, & … … 404 434 USE user_actions_mod, & 405 435 ONLY: user_actions 436 437 USE uv_exposure_model_mod, & 438 ONLY: uvem_calc_exposure 406 439 407 440 USE wind_turbine_model_mod, & … … 417 450 418 451 CHARACTER (LEN=9) :: time_to_string !< 452 INTEGER :: n 453 INTEGER :: lsp 419 454 420 455 REAL(wp) :: dt_3d_old !< temporary storage of timestep to be used for 421 456 !< steering of run control output interval 422 423 457 ! 424 458 !-- At beginning determine the first time step … … 501 535 bc_q_t_val = ( q_init(nzt+1) - q_init(nzt) ) / dzu(nzt+1) 502 536 ENDIF 537 ! 538 !-- If forcing by larger-scale models is applied, check if new data 539 !-- at domain boundaries need to be read. 540 IF ( forcing ) THEN 541 IF ( force%time(force%tind_p) <= simulated_time ) & 542 CALL netcdf_data_input_lsf 543 ENDIF 503 544 504 545 ! … … 617 658 CALL exchange_horiz( pt_p, nbgp ) 618 659 IF ( .NOT. constant_diffusion ) CALL exchange_horiz( e_p, nbgp ) 660 IF ( rans_tke_e .OR. wang_kernel .OR. collision_turbulence & 661 .OR. use_sgs_for_particles ) THEN 662 IF ( rans_tke_e ) THEN 663 CALL exchange_horiz( diss_p, nbgp ) 664 ELSE 665 CALL exchange_horiz( diss, nbgp ) 666 ENDIF 667 ENDIF 619 668 IF ( ocean ) THEN 620 669 CALL exchange_horiz( sa_p, nbgp ) … … 639 688 CALL exchange_horiz( ql_vp, nbgp ) 640 689 ENDIF 641 IF ( wang_kernel .OR. collision_turbulence .OR. &642 use_sgs_for_particles ) THEN643 CALL exchange_horiz( diss, nbgp )644 ENDIF645 690 IF ( passive_scalar ) CALL exchange_horiz( s_p, nbgp ) 646 691 #if defined( __chem ) 692 IF ( air_chemistry ) THEN 693 DO n = 1, nspec 694 CALL exchange_horiz( chem_species(n)%conc_p, nbgp ) 695 ENDDO 696 ENDIF 697 #endif 647 698 CALL cpu_log( log_point(26), 'exchange-horiz-progn', 'stop' ) 648 699 … … 756 807 CALL disturb_field( 'v', tend, v ) 757 808 ELSEIF ( ( .NOT. bc_lr_cyc .OR. .NOT. bc_ns_cyc ) & 758 .AND. .NOT. nest_domain ) THEN809 .AND. .NOT. nest_domain .AND. .NOT. forcing ) THEN 759 810 ! 760 811 !-- Runs with a non-cyclic lateral wall need perturbations … … 770 821 771 822 ! 823 !-- Map forcing data derived from larger scale model onto domain 824 !-- boundaries. 825 IF ( forcing .AND. intermediate_timestep_count == & 826 intermediate_timestep_count_max ) THEN 827 CALL forcing_bc 828 ENDIF 829 ! 830 !-- Moreover, ensure mass conservation at each RK substep. 831 IF ( forcing ) CALL forcing_bc_mass_conservation 832 833 ! 772 834 !-- Reduce the velocity divergence via the equation for perturbation 773 835 !-- pressure. … … 833 895 CALL cpu_log( log_point(19), 'surface_layer_fluxes', 'stop' ) 834 896 ENDIF 835 836 897 ! 837 898 !-- If required, solve the energy balance for the surface and run soil 838 899 !-- model. Call for horizontal as well as vertical surfaces 839 IF ( land_surface .AND. time_since_reference_point > skip_time_do_lsm) THEN900 IF ( land_surface .AND. time_since_reference_point >= skip_time_do_lsm) THEN 840 901 841 902 CALL cpu_log( log_point(54), 'land_surface', 'start' ) … … 860 921 CALL lsm_energy_balance( .FALSE., 3 ) 861 922 CALL lsm_soil_model( .FALSE., 3, .TRUE. ) 923 ! 924 !-- At the end, set boundary conditons for potential temperature 925 !-- and humidity after running the land-surface model. This 926 !-- might be important for the nesting, where arrays are transfered. 927 CALL lsm_boundary_condition 862 928 863 929 CALL cpu_log( log_point(54), 'land_surface', 'stop' ) 864 930 ENDIF 865 866 931 ! 867 932 !-- If required, solve the energy balance for urban surfaces and run … … 871 936 CALL usm_surface_energy_balance 872 937 IF ( usm_material_model ) THEN 938 CALL usm_green_heat_model 873 939 CALL usm_material_heat_model 874 940 ENDIF 941 942 CALL usm_temperature_near_surface 943 ! 944 !-- At the end, set boundary conditons for potential temperature 945 !-- and humidity after running the urban-surface model. This 946 !-- might be important for the nesting, where arrays are transfered. 947 CALL usm_boundary_condition 948 875 949 CALL cpu_log( log_point(74), 'urban_surface', 'stop' ) 876 950 ENDIF 877 878 951 ! 879 952 !-- Compute the diffusion coefficients … … 881 954 IF ( .NOT. humidity ) THEN 882 955 IF ( ocean ) THEN 883 CALL diffusivities( prho, prho_reference )956 CALL tcm_diffusivities( prho, prho_reference ) 884 957 ELSE 885 CALL diffusivities( pt, pt_reference )958 CALL tcm_diffusivities( pt, pt_reference ) 886 959 ENDIF 887 960 ELSE 888 CALL diffusivities( vpt, pt_reference ) 889 ENDIF 890 961 CALL tcm_diffusivities( vpt, pt_reference ) 962 ENDIF 891 963 CALL cpu_log( log_point(17), 'diffusivities', 'stop' ) 964 ! 965 !-- Vertical nesting: set fine grid eddy viscosity top boundary condition 966 IF ( vnest_init ) CALL vnest_boundary_conds_khkm 892 967 893 968 ENDIF … … 914 989 CALL cpu_log( log_point(50), 'radiation', 'stop' ) 915 990 916 IF (urban_surface) THEN 917 CALL cpu_log( log_point(75), 'usm_radiation', 'start' ) 918 CALL usm_radiation 919 CALL cpu_log( log_point(75), 'usm_radiation', 'stop' ) 991 IF ( urban_surface .OR. land_surface .AND. & 992 radiation_interactions ) THEN 993 CALL cpu_log( log_point(75), 'radiation_interaction', 'start' ) 994 CALL radiation_interaction 995 CALL cpu_log( log_point(75), 'radiation_interaction', 'stop' ) 920 996 ENDIF 921 997 … … 924 1000 925 1001 ENDDO ! Intermediate step loop 926 1002 ! 1003 !-- If required, consider chemical emissions 1004 !-- (todo (FK): Implement hourly call of emissions, using time_utc from 1005 !-- data_and_time_mod.f90; 1006 !-- move the CALL to appropriate location) 1007 ! #if defined( __chem ) 1008 ! IF ( air_chemistry ) THEN 1009 ! CALL chem_emissions 1010 ! ENDIF 1011 ! #endif 1012 ! 1013 !-- If required, do UV exposure calculations 1014 IF ( uv_exposure ) THEN 1015 CALL uvem_calc_exposure 1016 ENDIF 927 1017 ! 928 1018 !-- Increase simulation time and output times
Note: See TracChangeset
for help on using the changeset viewer.