Changeset 3685 for palm/trunk/SOURCE/init_3d_model.f90
- Timestamp:
- Jan 21, 2019 1:02:11 AM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
palm/trunk/SOURCE/init_3d_model.f90
r3648 r3685 25 25 ! ----------------- 26 26 ! $Id$ 27 ! Some interface calls moved to module_interface + cleanup 28 ! 29 ! 3648 2019-01-02 16:35:46Z suehring 27 30 ! Rename subroutines for surface-data output 28 31 ! … … 583 586 ideal_gas_law_rho, ideal_gas_law_rho_pt, barometric_formula 584 587 585 USE biometeorology_mod, &586 ONLY: bio_init587 588 588 USE bulk_cloud_model_mod, & 589 ONLY: bulk_cloud_model, bcm_init, bcm_init_arrays 590 591 USE chem_emissions_mod, & 592 ONLY: chem_emissions_init 589 ONLY: bulk_cloud_model 593 590 594 591 USE chem_modules, & 595 ONLY: do_emis, max_pr_cs, nspec_out592 ONLY: max_pr_cs ! ToDo: this dependency needs to be removed cause it is ugly #new_dom 596 593 597 594 USE control_parameters 598 599 USE flight_mod, &600 ONLY: flight_init601 595 602 596 USE grid_variables, & 603 597 ONLY: dx, dy, ddx2_mg, ddy2_mg 604 598 605 USE gust_mod, &606 ONLY: gust_init, gust_init_arrays, gust_module_enabled607 608 599 USE indices 609 600 610 USE indoor_model_mod, &611 ONLY: im_init612 613 601 USE kinds 614 615 USE land_surface_model_mod, &616 ONLY: lsm_init, lsm_init_arrays617 602 618 603 USE lpm_init_mod, & … … 620 605 621 606 USE lsf_nudging_mod, & 622 ONLY: ls f_init, ls_forcing_surf, nudge_init607 ONLY: ls_forcing_surf 623 608 624 609 USE model_1d_mod, & 625 610 ONLY: init_1d_model, l1d, u1d, v1d 611 612 USE module_interface, & 613 ONLY: module_interface_init_arrays, module_interface_init 626 614 627 615 USE multi_agent_system_mod, & … … 638 626 ONLY: nesting_offl_init 639 627 640 USE ocean_mod, &641 ONLY: ocean_init, ocean_init_arrays642 643 628 USE particle_attributes, & 644 629 ONLY: particle_advection 645 630 646 631 USE pegrid 647 648 USE plant_canopy_model_mod, &649 ONLY: pcm_init650 632 651 633 #if defined( __parallel ) … … 655 637 656 638 USE radiation_model_mod, & 657 ONLY: average_radiation, & 658 radiation_init, radiation, radiation_scheme, & 659 radiation_calc_svf, radiation_write_svf, & 660 radiation_interaction, radiation_interactions, & 661 radiation_interaction_init, radiation_read_svf, & 662 radiation_presimulate_solar_pos, radiation_interactions_on 663 639 ONLY: radiation, radiation_scheme 640 664 641 USE random_function_mod 665 642 666 643 USE random_generator_parallel, & 667 644 ONLY: init_parallel_random_generator 668 645 669 646 USE read_restart_data_mod, & 670 ONLY: rrd_read_parts_of_global, rrd_local 671 672 USE salsa_mod, & 673 ONLY: salsa_init, salsa_init_arrays 674 647 ONLY: rrd_read_parts_of_global, rrd_local 648 675 649 USE statistics, & 676 650 ONLY: hom, hom_sum, mean_surface_level_height, pr_palm, rmask, & … … 682 656 ONLY: parametrize_inflow_turbulence, stg_adjust, stg_init, & 683 657 use_syn_turb_gen 684 658 685 659 USE surface_layer_fluxes_mod, & 686 660 ONLY: init_surface_layer_fluxes … … 689 663 ONLY : init_surface_arrays, init_surfaces, surf_def_h, surf_lsm_h, & 690 664 surf_usm_h, get_topography_top_index_ji, vertical_surfaces_exist 691 665 692 666 USE surface_data_output_mod, & 693 667 ONLY: surface_data_output_init 694 668 695 669 USE transpose_indices 696 670 697 671 USE turbulence_closure_mod, & 698 672 ONLY: tcm_init_arrays, tcm_init 699 700 USE urban_surface_mod, &701 ONLY: usm_init_urban_surface, usm_allocate_surface702 703 USE virtual_measurement_mod, &704 ONLY: vm_init705 706 USE wind_turbine_model_mod, &707 ONLY: wtm_init, wtm_init_arrays708 673 709 674 IMPLICIT NONE … … 1076 1041 ! 1077 1042 !-- Allocate arrays for other modules 1078 IF ( bulk_cloud_model ) CALL bcm_init_arrays 1079 IF ( gust_module_enabled ) CALL gust_init_arrays 1080 IF ( land_surface ) CALL lsm_init_arrays 1081 IF ( ocean_mode ) CALL ocean_init_arrays 1082 IF ( salsa ) CALL salsa_init_arrays 1083 IF ( wind_turbine ) CALL wtm_init_arrays 1084 1085 ! 1086 !-- Initialize virtual flight measurements 1087 IF ( virtual_flight ) THEN 1088 CALL flight_init 1089 ENDIF 1043 CALL module_interface_init_arrays 1090 1044 1091 1045 … … 2098 2052 ENDIF 2099 2053 ENDIF 2100 !2101 !-- User-defined initializing actions2102 CALL user_init2103 2054 ! 2104 2055 !-- To do: New concept for these non-topography grid points! … … 2205 2156 DEALLOCATE( mean_surface_level_height_l, ngp_2dh_l, ngp_2dh_outer_l, & 2206 2157 ngp_3d_inner_l, ngp_3d_inner_tmp ) 2207 2208 !2209 !-- Initialize nudging if required2210 IF ( nudging ) CALL nudge_init2211 !2212 !-- Initialize 1D large-scale forcing and nudging and read data from external2213 !-- ASCII file2214 IF ( large_scale_forcing ) CALL lsf_init2215 2158 ! 2216 2159 !-- Initialize surface forcing corresponding to large-scale forcing. Therein, … … 2250 2193 2251 2194 ! 2252 !-- If required, initialize quantities needed for the plant canopy model2253 IF ( plant_canopy ) THEN2254 CALL location_message( 'initializing plant canopy model', .FALSE. )2255 CALL pcm_init2256 CALL location_message( 'finished', .TRUE. )2257 ENDIF2258 2259 !2260 2195 !-- If required, initialize dvrp-software 2261 2196 IF ( dt_dvrp /= 9999999.9_wp ) CALL init_dvrp 2262 2263 !2264 !-- Initialize quantities needed for the ocean model2265 IF ( ocean_mode ) CALL ocean_init2266 2197 2267 2198 ! … … 2281 2212 WRITE( message_string, * ) 'absolute temperature < 0.0 at zu(', k, & 2282 2213 ') = ', zu(k) 2283 CALL message( 'init_ bulk_cloud_model', 'PA0142', 1, 2, 0, 6, 0 )2214 CALL message( 'init_3d_model', 'PA0142', 1, 2, 0, 6, 0 ) 2284 2215 ENDIF 2285 2216 ENDDO … … 2296 2227 2297 2228 ENDIF 2298 !2299 !-- If required, initialize quantities needed for the microphysics module2300 IF ( bulk_cloud_model ) THEN2301 CALL bcm_init2302 ENDIF2303 2229 2304 2230 ! 2305 2231 !-- If required, initialize particles 2306 2232 IF ( particle_advection ) CALL lpm_init 2307 2308 2233 ! 2309 2234 !-- If required, initialize particles 2310 2235 IF ( agents_active ) CALL mas_init 2311 2312 !2313 !-- If required, initialize quantities needed for the LSM2314 IF ( land_surface ) THEN2315 CALL location_message( 'initializing land surface model', .FALSE. )2316 CALL lsm_init2317 CALL location_message( 'finished', .TRUE. )2318 ENDIF2319 2320 !2321 !-- If required, allocate USM and LSM surfaces2322 IF ( urban_surface ) THEN2323 CALL location_message( 'initializing and allocating urban surfaces', .FALSE. )2324 CALL usm_allocate_surface2325 CALL location_message( 'finished', .TRUE. )2326 ENDIF2327 !2328 !-- If required, initialize urban surface model2329 IF ( urban_surface ) THEN2330 CALL location_message( 'initializing urban surface model', .FALSE. )2331 CALL usm_init_urban_surface2332 CALL location_message( 'finished', .TRUE. )2333 ENDIF2334 2335 !2336 !-- Initialize surface layer (done after LSM as roughness length are required2337 !-- for initialization2338 IF ( constant_flux_layer ) THEN2339 CALL location_message( 'initializing surface layer', .FALSE. )2340 CALL init_surface_layer_fluxes2341 CALL location_message( 'finished', .TRUE. )2342 ENDIF2343 2236 ! 2344 2237 !-- In case the synthetic turbulence generator does not have any information … … 2347 2240 !-- Please note, within pre-determined time intervals these turbulence 2348 2241 !-- information can be updated if desired. 2349 IF ( use_syn_turb_gen .AND. parametrize_inflow_turbulence ) &2242 IF ( use_syn_turb_gen .AND. parametrize_inflow_turbulence ) THEN 2350 2243 CALL stg_adjust 2351 ! 2352 !-- If required, set chemical emissions 2353 !-- Initialize values of cssws according to chemistry emission values 2354 IF ( air_chemistry .AND. do_emis ) THEN 2355 CALL chem_emissions_init( chem_emis_att, chem_emis, nspec_out ) 2356 ENDIF 2357 ! 2358 !-- Initialize radiation processes 2359 IF ( radiation ) THEN 2360 ! 2361 !-- Activate radiation_interactions according to the existence of vertical surfaces and/or trees. 2362 !-- The namelist parameter radiation_interactions_on can override this behavior. 2363 !-- (This check cannot be performed in check_parameters, because vertical_surfaces_exist is first set in 2364 !-- init_surface_arrays.) 2365 IF ( radiation_interactions_on ) THEN 2366 IF ( vertical_surfaces_exist .OR. plant_canopy ) THEN 2367 radiation_interactions = .TRUE. 2368 average_radiation = .TRUE. 2369 ELSE 2370 radiation_interactions_on = .FALSE. !< reset namelist parameter: no interactions 2371 !< calculations necessary in case of flat surface 2372 ENDIF 2373 ELSEIF ( vertical_surfaces_exist .OR. plant_canopy ) THEN 2374 message_string = 'radiation_interactions_on is set to .FALSE. although ' // & 2375 'vertical surfaces and/or trees exist. The model will run ' // & 2376 'without RTM (no shadows, no radiation reflections)' 2377 CALL message( 'init_3d_model', 'PA0348', 0, 1, 0, 6, 0 ) 2378 ENDIF 2379 ! 2380 !-- If required, initialize radiation interactions between surfaces 2381 !-- via sky-view factors. This must be done before radiation is initialized. 2382 IF ( radiation_interactions ) CALL radiation_interaction_init 2383 2384 ! 2385 !-- Initialize radiation model 2386 CALL location_message( 'initializing radiation model', .FALSE. ) 2387 CALL radiation_init 2388 CALL location_message( 'finished', .TRUE. ) 2389 2390 ! 2391 !-- Find all discretized apparent solar positions for radiation interaction. 2392 !-- This must be done after radiation_init. 2393 IF ( radiation_interactions ) CALL radiation_presimulate_solar_pos 2394 2395 ! 2396 !-- If required, read or calculate and write out the SVF 2397 IF ( radiation_interactions .AND. read_svf) THEN 2398 ! 2399 !-- Read sky-view factors and further required data from file 2400 CALL location_message( ' Start reading SVF from file', .FALSE. ) 2401 CALL radiation_read_svf() 2402 CALL location_message( ' Reading SVF from file has finished', .TRUE. ) 2403 2404 ELSEIF ( radiation_interactions .AND. .NOT. read_svf) THEN 2405 ! 2406 !-- calculate SFV and CSF 2407 CALL location_message( ' Start calculation of SVF', .FALSE. ) 2408 CALL radiation_calc_svf() 2409 CALL location_message( ' Calculation of SVF has finished', .TRUE. ) 2410 ENDIF 2411 2412 IF ( radiation_interactions .AND. write_svf) THEN 2413 ! 2414 !-- Write svf, csf svfsurf and csfsurf data to file 2415 CALL location_message( ' Start writing SVF in file', .FALSE. ) 2416 CALL radiation_write_svf() 2417 CALL location_message( ' Writing SVF in file has finished', .TRUE. ) 2418 ENDIF 2419 2420 ! 2421 !-- Adjust radiative fluxes. In case of urban and land surfaces, also 2422 !-- call an initial interaction. 2423 IF ( radiation_interactions ) THEN 2424 CALL radiation_interaction 2425 ENDIF 2426 ENDIF 2427 2428 ! 2429 !-- If required, initialize quantities needed for the wind turbine model 2430 IF ( wind_turbine ) THEN 2431 CALL location_message( 'initializing wind turbine model', .FALSE. ) 2432 CALL wtm_init 2433 CALL location_message( 'finished', .TRUE. ) 2434 ENDIF 2435 2436 ! 2437 !-- If required, initialize quantities needed in SALSA 2438 IF ( salsa ) THEN 2439 CALL location_message( 'initializing SALSA model', .TRUE. ) 2440 CALL salsa_init 2441 CALL location_message( 'finished', .TRUE. ) 2442 ENDIF 2443 2444 ! 2445 !-- If required, initialize quantities needed for the gust module 2446 IF ( gust_module_enabled ) THEN 2447 CALL gust_init( dots_label, dots_unit, dots_num, dots_max ) 2448 ENDIF 2244 ENDIF 2245 ! 2246 !-- Initializing actions for all other modules 2247 CALL module_interface_init 2248 ! 2249 !-- Initialize surface layer (done after LSM as roughness length are required 2250 !-- for initialization 2251 IF ( constant_flux_layer ) CALL init_surface_layer_fluxes 2449 2252 ! 2450 2253 !-- Initialize surface data output 2451 IF ( surface_output ) THEN 2452 CALL surface_data_output_init 2453 ENDIF 2454 ! 2455 !-- If virtual measurements should be taken, initialize all relevant 2456 !-- arrays and quantities. 2457 IF ( virtual_measurement ) CALL vm_init 2458 2459 ! 2460 !-- If required initialize biometeorology module 2461 IF ( biometeorology ) THEN 2462 CALL location_message( 'initializing biometeorology module', .FALSE. ) 2463 CALL bio_init 2464 CALL location_message( 'finished', .TRUE. ) 2465 ENDIF 2466 2467 ! 2468 !-- If required, initialize indoor model 2469 IF ( indoor_model ) THEN 2470 CALL location_message( 'initializing indoor model', .FALSE. ) 2471 CALL im_init 2472 CALL location_message( 'finished', .TRUE. ) 2473 ENDIF 2474 2254 IF ( surface_output ) CALL surface_data_output_init 2475 2255 ! 2476 2256 !-- Initialize the ws-scheme.
Note: See TracChangeset
for help on using the changeset viewer.