Changeset 3700 for palm/trunk/SOURCE/user_module.f90
- Timestamp:
- Jan 26, 2019 5:03:42 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
palm/trunk/SOURCE/user_module.f90
r3687 r3700 86 86 USE statistics 87 87 88 USE statistics, &89 ONLY: statistic_regions, region90 91 88 USE surface_mod 92 89 … … 94 91 95 92 INTEGER(iwp) :: dots_num_palm !< 93 INTEGER(iwp) :: dots_num_user = 0 !< 96 94 INTEGER(iwp) :: user_idummy !< 97 95 … … 117 115 user_parin, & 118 116 user_check_parameters, & 117 user_check_data_output_ts, & 119 118 user_check_data_output_pr, & 120 119 user_check_data_output, & … … 143 142 MODULE PROCEDURE user_check_parameters 144 143 END INTERFACE user_check_parameters 144 145 INTERFACE user_check_data_output_ts 146 MODULE PROCEDURE user_check_data_output_ts 147 END INTERFACE user_check_data_output_ts 145 148 146 149 INTERFACE user_check_data_output_pr … … 322 325 ! Description: 323 326 ! ------------ 327 !> Set module-specific timeseries units and labels 328 !------------------------------------------------------------------------------! 329 SUBROUTINE user_check_data_output_ts( dots_max, dots_num, dots_label, dots_unit ) 330 331 332 INTEGER(iwp), INTENT(IN) :: dots_max 333 INTEGER(iwp), INTENT(INOUT) :: dots_num 334 CHARACTER (LEN=*), DIMENSION(dots_max), INTENT(INOUT) :: dots_label 335 CHARACTER (LEN=*), DIMENSION(dots_max), INTENT(INOUT) :: dots_unit 336 337 338 !-- Sample for user-defined time series 339 !-- For each time series quantity you have to give a label and a unit, 340 !-- which will be used for the NetCDF file. They must not contain more than 341 !-- seven characters. The value of dots_num has to be increased by the 342 !-- number of new time series quantities. Its old value has to be store in 343 !-- dots_num_palm. See routine user_statistics on how to output calculate 344 !-- and output these quantities. 345 346 ! dots_num_palm = dots_num 347 348 ! dots_num = dots_num + 1 349 ! dots_num_user = dots_num_user + 1 350 ! dots_label(dots_num) = 'abs_umx' 351 ! dots_unit(dots_num) = 'm/s' 352 353 ! dots_num = dots_num + 1 354 ! dots_num_user = dots_num_user + 1 355 ! dots_label(dots_num) = 'abs_vmx' 356 ! dots_unit(dots_num) = 'm/s' 357 358 359 END SUBROUTINE user_check_data_output_ts 360 361 362 !------------------------------------------------------------------------------! 363 ! Description: 364 ! ------------ 324 365 !> Set the unit of user defined profile output quantities. For those variables 325 366 !> not recognized by the user, the parameter unit is set to "illegal", which … … 327 368 !> to a program abort. 328 369 !------------------------------------------------------------------------------! 329 SUBROUTINE user_check_data_output_pr( variable, var_count, unit ) 330 331 332 USE netcdf_interface, & 333 ONLY: dopr_unit 370 SUBROUTINE user_check_data_output_pr( variable, var_count, unit, dopr_unit ) 371 334 372 335 373 USE profil_parameter … … 338 376 CHARACTER (LEN=*) :: unit !< 339 377 CHARACTER (LEN=*) :: variable !< 378 CHARACTER (LEN=*) :: dopr_unit !< local value of dopr_unit 340 379 341 380 INTEGER(iwp) :: user_pr_index !< … … 357 396 ! user_pr_index = pr_palm + 1 358 397 ! dopr_index(var_count) = user_pr_index ! quantities' user-profile-number 359 ! dopr_unit(var_count) = 'm2/s2' ! quantity unit 398 ! dopr_unit = 'm2/s2' ! quantity unit 399 ! unit = dopr_unit 360 400 ! hom(:,2,user_pr_index,:) = SPREAD( zu, 2, statistic_regions+1 ) 361 401 ! ! grid on which the quantity is … … 413 453 414 454 415 USE netcdf_interface, &416 ONLY: dots_label, dots_unit, dots_num417 418 419 455 CHARACTER (LEN=20) :: field_char !< 420 456 ! … … 424 460 ! ALLOCATE( ustvst(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ); ustvst = 0.0_wp 425 461 426 !-- Sample for user-defined time series427 !-- For each time series quantity you have to give a label and a unit,428 !-- which will be used for the NetCDF file. They must not contain more than429 !-- seven characters. The value of dots_num has to be increased by the430 !-- number of new time series quantities. Its old value has to be store in431 !-- dots_num_palm. See routine user_statistics on how to output calculate432 !-- and output these quantities.433 ! dots_label(dots_num+1) = 'abs_umx'434 ! dots_unit(dots_num+1) = 'm/s'435 ! dots_label(dots_num+2) = 'abs_vmx'436 ! dots_unit(dots_num+2) = 'm/s'437 !438 ! dots_num_palm = dots_num439 ! dots_num = dots_num + 2440 462 441 463 END SUBROUTINE user_init 464 465 466 !------------------------------------------------------------------------------! 467 ! Description: 468 ! ------------ 469 !> Set the grids on which user-defined output quantities are defined. 470 !> Allowed values for grid_x are "x" and "xu", for grid_y "y" and "yv", and 471 !> for grid_z "zu" and "zw". 472 !------------------------------------------------------------------------------! 473 SUBROUTINE user_define_netcdf_grid( variable, found, grid_x, grid_y, grid_z ) 474 475 476 CHARACTER (LEN=*) :: grid_x !< 477 CHARACTER (LEN=*) :: grid_y !< 478 CHARACTER (LEN=*) :: grid_z !< 479 CHARACTER (LEN=*) :: variable !< 480 481 LOGICAL :: found !< 482 483 484 SELECT CASE ( TRIM( variable ) ) 485 486 ! 487 !-- Uncomment and extend the following lines, if necessary 488 ! CASE ( 'u2', 'u2_xy', 'u2_xz', 'u2_yz' ) 489 ! found = .TRUE. 490 ! grid_x = 'xu' 491 ! grid_y = 'y' 492 ! grid_z = 'zu' 493 494 ! CASE ( 'u*v*', 'u*v*_xy', 'u*v*_xz', 'u*v*_yz' ) 495 ! found = .TRUE. 496 ! grid_x = 'x' 497 ! grid_y = 'y' 498 ! grid_z = 'zu' 499 500 CASE DEFAULT 501 found = .FALSE. 502 grid_x = 'none' 503 grid_y = 'none' 504 grid_z = 'none' 505 506 END SELECT 507 508 509 END SUBROUTINE user_define_netcdf_grid 510 511 442 512 443 513 … … 913 983 914 984 915 USE netcdf_interface, &916 ONLY: dots_max917 918 919 985 CHARACTER (LEN=*) :: mode !< 920 921 986 INTEGER(iwp) :: i !< 922 987 INTEGER(iwp) :: j !< … … 925 990 INTEGER(iwp) :: tn !< 926 991 927 REAL(wp), & 928 DIMENSION(dots_num_palm+1:dots_max) :: & 929 ts_value_l !< 930 992 REAL(wp), DIMENSION(:), ALLOCATABLE :: ts_value_l !< 931 993 932 994 IF ( mode == 'profiles' ) THEN … … 962 1024 ELSEIF ( mode == 'time_series' ) THEN 963 1025 1026 1027 ! ALLOCATE ( ts_value_l(dots_num_user) ) 964 1028 ! 965 1029 !-- Sample on how to add values for the user-defined time series quantities. … … 968 1032 !-- velocities u and v. 969 1033 ! ts_value_l = 0.0_wp 970 ! ts_value_l( dots_num_palm+1) = ABS( u_max )971 ! ts_value_l( dots_num_palm+2) = ABS( v_max )1034 ! ts_value_l(1) = ABS( u_max ) 1035 ! ts_value_l(2) = ABS( v_max ) 972 1036 ! 973 1037 !-- Collect / send values to PE0, because only PE0 outputs the time series. … … 981 1045 !#if defined( __parallel ) 982 1046 ! IF ( collective_wait ) CALL MPI_BARRIER( comm2d, ierr ) 983 ! CALL MPI_ALLREDUCE( ts_value_l( dots_num_palm+1), &1047 ! CALL MPI_ALLREDUCE( ts_value_l(1), & 984 1048 ! ts_value(dots_num_palm+1,sr), & 985 ! dots_ max-dots_num_palm, MPI_REAL, MPI_SUM, comm2d, &1049 ! dots_num_user, MPI_REAL, MPI_MAX, comm2d, & 986 1050 ! ierr ) 987 1051 !#else 988 ! ts_value(dots_num_palm+1: ,sr) = ts_value_l1052 ! ts_value(dots_num_palm+1:dots_num_palm+dots_num_user,sr) = ts_value_l 989 1053 !#endif 990 1054
Note: See TracChangeset
for help on using the changeset viewer.