Changeset 3159 for palm/trunk
- Timestamp:
- Jul 20, 2018 11:20:01 AM (6 years ago)
- Location:
- palm/trunk
- Files:
-
- 21 added
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
palm/trunk/SCRIPTS/.palm.iofiles
r3025 r3159 6 6 PARIN in:tr d3r $base_data/$jobname/INPUT _p3dr* 7 7 PARIN in:tr pcr $base_data/$jobname/INPUT _pcr* 8 NAVIGATION_DATA inopt:tr d3#:d3r $base_data/$jobname/INPUT _nav* 8 9 TOPOGRAPHY_DATA inopt:tr d3#:d3r $base_data/$jobname/INPUT _topo* 9 10 PIDS_STATIC inopt:tr d3#:d3r $base_data/$jobname/INPUT _static* … … 62 63 DATA_MASK_NETCDF* out:tr * $base_data/$jobname/OUTPUT _masked nc 63 64 DATA_MASK_AV_NETCDF* out:tr * $base_data/$jobname/OUTPUT _av_masked nc 65 DATA_AGT_NETCDF out:tr * $base_data/$jobname/OUTPUT _agt nc 64 66 # 65 67 DATA_PRT_NETCDF* out:pe * $base_data/$jobname/OUTPUT _prt -
palm/trunk/SOURCE/Makefile
r3130 r3159 25 25 # ----------------- 26 26 # $Id$ 27 # Added multi agent system 28 # 29 # 3130 2018-07-16 11:08:55Z gronemeier 27 30 # add surface_layer_fluxes_mod to turbulence_closure_mod 28 31 # … … 537 540 mod_particle_attributes.f90 \ 538 541 modules.f90 \ 542 multi_agent_system_mod.f90 \ 539 543 netcdf_data_input_mod.f90 \ 540 544 netcdf_interface_mod.f90 \ … … 1177 1181 modules.o: \ 1178 1182 mod_kinds.o 1183 multi_agent_system_mod.o: \ 1184 chemistry_model_mod.o \ 1185 cpulog_mod.o \ 1186 mod_kinds.o \ 1187 modules.o \ 1188 netcdf_interface_mod.o \ 1189 surface_mod.o 1179 1190 mod_kinds.o: \ 1180 1191 -
palm/trunk/SOURCE/check_open.f90
r3045 r3159 25 25 ! ----------------- 26 26 ! $Id$ 27 ! Added multi agent system 28 ! 29 ! 3045 2018-05-28 07:55:41Z Giersch 27 30 ! Output case 108 disabled 28 31 ! … … 190 193 191 194 USE netcdf_interface, & 192 ONLY: id_set_fl, id_set_mask, id_set_pr, id_set_prt, id_set_pts, & 193 id_set_sp, id_set_ts, id_set_xy, id_set_xz, id_set_yz, & 194 id_set_3d, nc_stat, netcdf_create_file, netcdf_data_format, & 195 netcdf_define_header, netcdf_handle_error, netcdf_open_write_file 195 ONLY: id_set_agt, id_set_fl, id_set_mask, id_set_pr, id_set_prt, & 196 id_set_pts, id_set_sp, id_set_ts, id_set_xy, id_set_xz, & 197 id_set_yz, id_set_3d, nc_stat, netcdf_create_file, & 198 netcdf_data_format, netcdf_define_header, netcdf_handle_error, & 199 netcdf_open_write_file 196 200 197 201 USE particle_attributes, & … … 1077 1081 ENDIF 1078 1082 1083 CASE ( 118 ) 1084 1085 IF ( myid == 0 ) THEN 1086 filename = 'DATA_AGT_NETCDF' 1087 ! 1088 !-- Inquire, if there is a netCDF file from a previuos run. This should 1089 !-- be opened for extension, if its variables match the actual run. 1090 INQUIRE( FILE=filename, EXIST=netcdf_extend ) 1091 1092 ! 1093 !-- Create a new netCDF output file with requested netCDF format 1094 CALL netcdf_create_file( filename, id_set_agt, .FALSE., 43 ) 1095 1096 ! 1097 !-- Define the header 1098 CALL netcdf_define_header( 'ag', netcdf_extend, 0 ) 1099 ENDIF 1100 1101 ! IF ( netcdf_extend ) THEN 1102 ! ! 1103 ! !-- Open an existing netCDF file for output 1104 ! CALL netcdf_open_write_file( filename, id_set_agt, .FALSE., 41 ) 1105 ! ! 1106 ! !-- Read header information and set all ids. If there is a mismatch 1107 ! !-- between the previuos and the actual run, netcdf_extend is returned 1108 ! !-- as .FALSE. 1109 ! CALL netcdf_define_header( 'ag', netcdf_extend, 0 ) 1110 ! 1111 ! ! 1112 ! !-- Remove the local file, if it can not be extended 1113 ! IF ( .NOT. netcdf_extend ) THEN 1114 ! nc_stat = NF90_CLOSE( id_set_agt ) 1115 ! CALL netcdf_handle_error( 'check_open', 42 ) 1116 ! CALL local_system( 'rm ' // TRIM( filename ) ) 1117 ! ENDIF 1118 ! 1119 ! ENDIF 1120 1121 IF ( .NOT. netcdf_extend ) THEN 1122 1123 ! 1124 ! !-- For runs on multiple processors create the subdirectory 1125 ! IF ( myid_char /= '' ) THEN 1126 ! IF ( myid == 0 .AND. .NOT. openfile(file_id)%opened_before ) & 1127 ! THEN ! needs modification in case of non-extendable sets 1128 ! CALL local_system( 'mkdir DATA_PRT_NETCDF' // & 1129 ! TRIM( coupling_char ) // '/' ) 1130 ! ENDIF 1131 ! #if defined( __parallel ) 1132 ! ! 1133 ! !-- Set a barrier in order to allow that all other processors in the 1134 ! !-- directory created by PE0 can open their file 1135 ! CALL MPI_BARRIER( comm2d, ierr ) 1136 ! #endif 1137 ! ENDIF 1138 1139 ENDIF 1140 1079 1141 ! 1080 1142 !-- nc-file for virtual flight measurements -
palm/trunk/SOURCE/init_3d_model.f90
r3129 r3159 25 25 ! ----------------- 26 26 ! $Id$ 27 ! Added multi agent system 28 ! 29 ! 3129 2018-07-16 07:45:13Z gronemeier 27 30 ! Move initialization call for nudging and 1D/3D offline nesting. 28 31 ! Revise initialization with inifor data. … … 506 509 507 510 USE indices 511 512 USE kinds 513 514 USE land_surface_model_mod, & 515 ONLY: lsm_init, lsm_init_arrays 508 516 509 517 USE lpm_init_mod, & 510 518 ONLY: lpm_init 511 512 USE kinds513 514 USE land_surface_model_mod, &515 ONLY: lsm_init, lsm_init_arrays516 519 517 520 USE lsf_nudging_mod, & … … 524 527 ONLY: e1d, init_1d_model, kh1d, km1d, l1d, rif1d, u1d, us1d, usws1d, & 525 528 v1d, vsws1d 529 530 USE multi_agent_system_mod, & 531 ONLY: agents_active, mas_init 526 532 527 533 USE netcdf_interface, & … … 2367 2373 2368 2374 ! 2375 !-- If required, initialize particles 2376 IF ( agents_active ) CALL mas_init 2377 2378 ! 2369 2379 !-- If required, initialize quantities needed for the LSM 2370 2380 IF ( land_surface ) THEN -
palm/trunk/SOURCE/modules.f90
r3157 r3159 25 25 ! ----------------- 26 26 ! $Id$ 27 ! Added multi agent system 28 ! 29 ! 3157 2018-07-19 21:08:49Z maronga 27 30 ! added use_free_convection_scaling 28 31 ! … … 1149 1152 1150 1153 INTEGER(iwp) :: abort_mode = 1 !< abort condition (nested runs) 1154 INTEGER(iwp) :: agt_time_count = 0 !< number of output intervals for agent data output 1151 1155 INTEGER(iwp) :: average_count_pr = 0 !< number of samples in vertical-profile output 1152 1156 INTEGER(iwp) :: average_count_3d = 0 !< number of samples in 3d output … … 1262 1266 LOGICAL :: aerosol_c3h4o4 =.FALSE. !< malonic acid aerosol for bulk scheme 1263 1267 LOGICAL :: aerosol_nh4no3 =.FALSE. !< malonic acid aerosol for bulk scheme 1268 LOGICAL :: agent_time_unlimited = .FALSE. !< namelist parameter 1264 1269 LOGICAL :: air_chemistry = .FALSE. !< chemistry model switch 1265 1270 LOGICAL :: bc_lr_cyc =.TRUE. !< left-right boundary condition cyclic? … … 1299 1304 LOGICAL :: dt_3d_reached_l !< internal timestep for particle advection 1300 1305 LOGICAL :: first_call_lpm = .TRUE. !< call lpm only once per timestep? 1306 LOGICAL :: first_call_mas = .TRUE. !< call mas only once per timestep 1301 1307 LOGICAL :: force_print_header = .FALSE. !< namelist parameter 1302 1308 LOGICAL :: force_bound_l = .FALSE. !< flag indicating domain boundary on left side to set forcing boundary conditions … … 1436 1442 REAL(wp) :: dt_run_control = 60.0_wp !< namelist parameter 1437 1443 REAL(wp) :: dt_spinup = 60.0_wp !< namelist parameter 1444 REAL(wp) :: dt_write_agent_data = 9999999.9_wp !< namelist parameter 1438 1445 REAL(wp) :: dt_3d = 0.01_wp !< time step 1439 1446 REAL(wp) :: dz_max = 1000.0_wp !< namelist parameter -
palm/trunk/SOURCE/netcdf_interface_mod.f90
r3049 r3159 25 25 ! ----------------- 26 26 ! $Id$ 27 ! Added multi agent system 28 ! 29 ! 3049 2018-05-29 13:52:36Z Giersch 27 30 ! Error messages revised 28 31 ! … … 282 285 PRIVATE 283 286 287 CHARACTER (LEN=16), DIMENSION(13) :: agt_var_names = & 288 (/ 'ag_x ', 'ag_y ', 'ag_wind ', & 289 'ag_temp ', 'ag_group ', 'PM10 ', & 290 'PM25 ', 'ag_therm_comf ', 'ag_uv ', & 291 'not_used ', 'not_used ', 'not_used ', & 292 'not_used ' /) 293 294 CHARACTER (LEN=16), DIMENSION(13) :: agt_var_units = & 295 (/ 'meters ', 'meters ', 'm/s ', & 296 'K ', 'dim_less ', 'tbd ', & 297 'tbd ', 'tbd ', 'tbd ', & 298 'not_used ', 'not_used ', 'not_used ', & 299 'not_used ' /) 300 284 301 INTEGER(iwp), PARAMETER :: dopr_norm_num = 7, dopts_num = 29, dots_max = 100 285 302 … … 377 394 CHARACTER(LEN=40) :: netcdf_data_format_string 378 395 379 INTEGER(iwp) :: id_dim_prtnum, id_dim_time_fl, id_dim_time_pr, id_dim_time_prt, & 380 id_dim_time_pts, id_dim_time_sp, id_dim_time_ts, id_dim_x_sp, & 381 id_dim_y_sp, id_dim_zu_sp, id_dim_zw_sp, id_set_fl, id_set_pr, & 382 id_set_prt, id_set_pts, id_set_sp, id_set_ts, id_var_time_fl, & 383 id_var_prtnum, id_var_rnop_prt, id_var_time_pr, id_var_time_prt, & 384 id_var_time_pts, id_var_time_sp, id_var_time_ts, id_var_x_sp, & 385 id_var_y_sp, id_var_zu_sp, id_var_zw_sp, nc_stat 396 INTEGER(iwp) :: id_dim_agtnum, id_dim_prtnum, id_dim_time_agt, & 397 id_dim_time_fl, id_dim_time_pr, id_dim_time_prt, & 398 id_dim_time_pts, id_dim_time_sp, id_dim_time_ts, & 399 id_dim_x_sp, id_dim_y_sp, id_dim_zu_sp, id_dim_zw_sp, & 400 id_set_agt, id_set_fl, id_set_pr, id_set_prt, id_set_pts, & 401 id_set_sp, id_set_ts, id_var_agtnum, id_var_time_agt, & 402 id_var_time_fl, id_var_prtnum, id_var_rnoa_agt, & 403 id_var_rnop_prt, id_var_time_pr, id_var_time_prt, & 404 id_var_time_pts, id_var_time_sp, id_var_time_ts, & 405 id_var_x_sp, id_var_y_sp, id_var_zu_sp, id_var_zw_sp, & 406 nc_stat 386 407 387 408 … … 413 434 INTEGER(iwp) :: dofl_time_count 414 435 INTEGER(iwp), DIMENSION(10) :: id_var_dospx, id_var_dospy 436 INTEGER(iwp), DIMENSION(20) :: id_var_agt 415 437 INTEGER(iwp), DIMENSION(20) :: id_var_prt 416 438 INTEGER(iwp), DIMENSION(11) :: nc_precision … … 457 479 dofl_time_count, dofl_unit, domask_unit, dopr_unit, dopts_num, & 458 480 dots_label, dots_max, dots_num, dots_rad, dots_soil, dots_unit, & 459 do2d_unit, do3d_unit, fill_value, & 460 id_set_fl, id_set_mask, id_set_pr, & 461 id_set_prt, id_set_pts, id_set_sp, id_set_ts, id_set_xy, id_set_xz,& 462 id_set_yz, id_set_3d, id_var_domask, id_var_dofl, id_var_dopr, & 463 id_var_dopts, id_var_dospx, id_var_dospy, id_var_dots, id_var_do2d,& 464 id_var_do3d, id_var_norm_dopr, id_var_time_fl, id_var_time_mask, & 465 id_var_time_pr, id_var_time_pts, id_var_time_sp, id_var_time_ts, & 481 do2d_unit, do3d_unit, fill_value, id_set_agt, id_set_fl, & 482 id_set_mask, id_set_pr, id_set_prt, id_set_pts, id_set_sp, & 483 id_set_ts, id_set_xy, id_set_xz, id_set_yz, id_set_3d, id_var_agt, & 484 id_var_domask, id_var_dofl, id_var_dopr, id_var_dopts, & 485 id_var_dospx, id_var_dospy, id_var_dots, id_var_do2d, id_var_do3d, & 486 id_var_norm_dopr, id_var_time_agt, id_var_time_fl, & 487 id_var_time_mask, id_var_time_pr, id_var_rnoa_agt, id_var_time_pts,& 488 id_var_time_sp, id_var_time_ts, & 466 489 id_var_time_xy, id_var_time_xz, id_var_time_yz, id_var_time_3d, & 467 490 id_var_x_fl, id_var_y_fl, id_var_z_fl, nc_stat, & … … 515 538 516 539 USE control_parameters, & 517 ONLY: a ir_chemistry, averaging_interval, averaging_interval_pr,&518 data_output_pr, domask, dopr_n,&540 ONLY: agent_time_unlimited, air_chemistry, averaging_interval, & 541 averaging_interval_pr, data_output_pr, domask, dopr_n, & 519 542 dopr_time_count, dopts_time_count, dots_time_count, & 520 543 do2d, do2d_at_begin, do2d_xz_time_count, do3d, do3d_at_begin, & 521 544 do2d_yz_time_count, dt_data_output_av, dt_do2d_xy, dt_do2d_xz, & 522 dt_do2d_yz, dt_do3d, mask_size, do2d_xy_time_count, & 545 dt_do2d_yz, dt_do3d, dt_write_agent_data, mask_size, & 546 do2d_xy_time_count, & 523 547 do3d_time_count, domask_time_count, end_time, land_surface, & 524 548 mask_size_l, mask_i, mask_i_global, mask_j, mask_j_global, & … … 1922 1946 '&This file will be extended.' 1923 1947 CALL message( 'define_netcdf_header', 'PA0248', 0, 0, 0, 6, 0 ) 1948 1949 1950 CASE ( 'ag_new' ) 1951 1952 ! 1953 !-- Define some global attributes of the dataset 1954 nc_stat = NF90_PUT_ATT( id_set_agt, NF90_GLOBAL, 'title', & 1955 TRIM( run_description_header ) ) 1956 CALL netcdf_handle_error( 'netcdf_define_header', 330 ) 1957 ! 1958 !-- Switch for unlimited time dimension 1959 IF ( agent_time_unlimited ) THEN 1960 CALL netcdf_create_dim( id_set_agt, 'time', NF90_UNLIMITED, & 1961 id_dim_time_agt, 331 ) 1962 ELSE 1963 CALL netcdf_create_dim( id_set_agt, 'time', & 1964 INT(end_time/dt_write_agent_data*1.2), & 1965 id_dim_time_agt, 331 ) 1966 ENDIF 1967 1968 CALL netcdf_create_var( id_set_agt, (/ id_dim_time_agt /), 'time', & 1969 NF90_DOUBLE, id_var_time_agt, 'seconds', '', & 1970 332, 333, 000 ) 1971 ! 1972 !-- netCDF4 allows more than one unlimited dimension 1973 CALL netcdf_create_dim( id_set_agt, 'agent_number', & 1974 NF90_UNLIMITED, id_dim_agtnum, 334 ) 1975 1976 CALL netcdf_create_var( id_set_agt, (/ id_dim_agtnum /), & 1977 'agent_number', NF90_DOUBLE, & 1978 id_var_agtnum, 'agent number', '', 335, & 1979 336, 000 ) 1980 ! 1981 !-- Define variable which contains the real number of agents in use 1982 CALL netcdf_create_var( id_set_agt, (/ id_dim_time_agt /), & 1983 'real_num_of_agt', NF90_DOUBLE, & 1984 id_var_rnoa_agt, 'agent number', '', 337, & 1985 338, 000 ) 1986 ! 1987 !-- Define the variables 1988 DO i = 1, 5 1989 CALL netcdf_create_var( id_set_agt, (/ id_dim_agtnum, & 1990 id_dim_time_agt /), agt_var_names(i), & 1991 nc_precision(8), id_var_agt(i), & 1992 TRIM( agt_var_units(i) ), & 1993 TRIM( agt_var_names(i) ), 339, 340, 341 ) 1994 1995 ENDDO 1996 ! 1997 !-- Leave netCDF define mode 1998 nc_stat = NF90_ENDDEF( id_set_agt ) 1999 CALL netcdf_handle_error( 'netcdf_define_header', 342 ) 2000 2001 2002 ! CASE ( 'ag_ext' ) 2003 ! !+?agent extend output for restart runs has to be adapted 2004 ! 2005 ! ! 2006 ! !-- Get the id of the time coordinate (unlimited coordinate) and its 2007 ! !-- last index on the file. The next time level is prt..count+1. 2008 ! !-- The current time must be larger than the last output time 2009 ! !-- on the file. 2010 ! nc_stat = NF90_INQ_VARID( id_set_agt, 'time', id_var_time_agt ) 2011 ! CALL netcdf_handle_error( 'netcdf_define_header', 343 ) 2012 ! 2013 ! nc_stat = NF90_INQUIRE_VARIABLE( id_set_agt, id_var_time_agt, & 2014 ! dimids = id_dim_time_old ) 2015 ! CALL netcdf_handle_error( 'netcdf_define_header', 344 ) 2016 ! id_dim_time_agt = id_dim_time_old(1) 2017 ! 2018 ! nc_stat = NF90_INQUIRE_DIMENSION( id_set_agt, id_dim_time_agt, & 2019 ! len = agt_time_count ) 2020 ! CALL netcdf_handle_error( 'netcdf_define_header', 345 ) 2021 ! 2022 ! nc_stat = NF90_GET_VAR( id_set_agt, id_var_time_agt, & 2023 ! last_time_coordinate, & 2024 ! start = (/ agt_time_count /), & 2025 ! count = (/ 1 /) ) 2026 ! CALL netcdf_handle_error( 'netcdf_define_header', 346 ) 2027 ! 2028 ! IF ( last_time_coordinate(1) >= simulated_time ) THEN 2029 ! message_string = 'netCDF file for agents ' // & 2030 ! 'from previous run found,' // & 2031 ! '&but this file cannot be extended becaus' // & 2032 ! 'e the current output time' // & 2033 ! '&is less or equal than the last output t' // & 2034 ! 'ime on this file.' // & 2035 ! '&New file is created instead.' 2036 ! CALL message( 'define_netcdf_header', 'PA0265', 0, 1, 0, 6, 0 ) 2037 ! agt_time_count = 0 2038 ! extend = .FALSE. 2039 ! RETURN 2040 ! ENDIF 2041 ! 2042 ! ! 2043 ! !-- Dataset seems to be extendable. 2044 ! !-- Now get the variable ids. 2045 ! nc_stat = NF90_INQ_VARID( id_set_agt, 'real_num_of_agt', & 2046 ! id_var_rnoa_agt ) 2047 ! CALL netcdf_handle_error( 'netcdf_define_header', 347 ) 2048 ! 2049 ! DO i = 1, 17 2050 ! 2051 ! nc_stat = NF90_INQ_VARID( id_set_agt, agt_var_names(i), & 2052 ! id_var_prt(i) ) 2053 ! CALL netcdf_handle_error( 'netcdf_define_header', 348 ) 2054 ! 2055 ! ENDDO 2056 ! 2057 ! message_string = 'netCDF file for particles ' // & 2058 ! 'from previous run found.' // & 2059 ! '&This file will be extended.' 2060 ! CALL message( 'define_netcdf_header', 'PA0266', 0, 0, 0, 6, 0 ) 2061 1924 2062 1925 2063 CASE ( 'xy_new' ) -
palm/trunk/SOURCE/parin.f90
r3157 r3159 25 25 ! ----------------- 26 26 ! $Id$ 27 ! Added multi agent system 28 ! 29 ! 3157 2018-07-19 21:08:49Z maronga 27 30 ! added use_free_convection_scaling 28 31 ! … … 441 444 USE model_1d_mod, & 442 445 ONLY: damp_level_1d, dt_pr_1d, dt_run_control_1d, end_time_1d 446 447 USE multi_agent_system_mod, & 448 ONLY: mas_parin 443 449 444 450 USE netcdf_interface, & … … 843 849 !-- Check if gust module is used and read &gust_par if required 844 850 CALL gust_parin 845 846 851 852 ! 853 !-- Check if multi agent system is used and read &agents_par if required 854 CALL mas_parin 855 856 ! 847 857 !-- Check if plant canopy model is used and read &canopy_par if required 848 858 CALL pcm_parin 849 859 850 860 ! 851 861 !-- Read control parameters for optionally used model software packages -
palm/trunk/SOURCE/time_integration.f90
r3042 r3159 25 25 ! ----------------- 26 26 ! $Id$ 27 ! Added multi agent system 28 ! 29 ! 3042 2018-05-25 10:44:37Z schwenkel 27 30 ! Changed the name specific humidity to mixing ratio 28 31 ! … … 375 378 dt_do2d_xz, dt_do2d_yz, dt_do3d, dt_domask,dt_dopts, dt_dopr, & 376 379 dt_dopr_listing, dt_dots, dt_dvrp, dt_run_control, end_time, & 377 first_call_lpm, f orcing, galilei_transformation, humidity,&378 intermediate_timestep_count, intermediate_timestep_count_max,&379 land_surface, large_scale_forcing,&380 l oop_optimization, lsf_surf, lsf_vert, masks,&381 m icrophysics_morrison, microphysics_seifert, mid, nest_domain,&382 ne utral, nr_timesteps_this_run, nudging,&380 first_call_lpm, first_call_mas, forcing, galilei_transformation,& 381 humidity, intermediate_timestep_count, & 382 intermediate_timestep_count_max, land_surface, & 383 large_scale_forcing, loop_optimization, lsf_surf, lsf_vert, & 384 masks, microphysics_morrison, microphysics_seifert, mid, & 385 nest_domain, neutral, nr_timesteps_this_run, nudging, & 383 386 ocean, passive_scalar, prho_reference, pt_reference, & 384 387 pt_slope_offset, random_heatflux, rans_mode, & … … 431 434 ONLY: collision_turbulence 432 435 436 USE multi_agent_system_mod, & 437 ONLY: agents_active, multi_agent_system, multi_agent_system_start 438 433 439 USE particle_attributes, & 434 440 ONLY: particle_advection, particle_advection_start, & … … 706 712 707 713 ! 714 !-- Movement of agents in multi agent system 715 IF ( agents_active .AND. & 716 simulated_time >= multi_agent_system_start .AND. & 717 intermediate_timestep_count == 1 ) THEN 718 CALL multi_agent_system 719 first_call_mas = .FALSE. 720 ENDIF 721 722 ! 708 723 !-- Exchange of ghost points (lateral boundary conditions) 709 724 CALL cpu_log( log_point(26), 'exchange-horiz-progn', 'start' )
Note: See TracChangeset
for help on using the changeset viewer.