Changeset 3744 for palm/trunk/SOURCE/urban_surface_mod.f90
- Timestamp:
- Feb 15, 2019 6:38:58 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
palm/trunk/SOURCE/urban_surface_mod.f90
r3743 r3744 23 23 ! Current revisions: 24 24 ! ------------------ 25 ! 25 ! - Remove internal flag indoor_model (is a global control parameter) 26 ! - add waste heat from buildings to the kinmatic heat flux 27 ! - consider waste heat in restart data 28 ! - remove unused USE statements 26 29 ! 27 30 ! Former revisions: … … 401 404 !> @todo Output of _av variables in case of restarts 402 405 !> @todo Revise flux conversion in energy-balance solver 403 !> @todo Bugfixing in nopointer branch404 406 !> @todo Check optimizations for RMA operations 405 407 !> @todo Alternatives for MPI_WIN_ALLOCATE? (causes problems with openmpi) 406 408 !> @todo Check for load imbalances in CPU measures, e.g. for exchange_horiz_prog 407 409 !> factor 3 between min and max time 408 !> @todo Move setting of flag indoor_model to indoor_model_mod once available409 410 !> @todo Check divisions in wtend (etc.) calculations for possible division 410 411 !> by zero, e.g. in case fraq(0,m) + fraq(1,m) = 0?! … … 424 425 425 426 USE control_parameters, & 426 ONLY: coupling_start_time, topography, dt_3d, humidity, 427 ONLY: coupling_start_time, topography, dt_3d, humidity, indoor_model, & 427 428 intermediate_timestep_count, initializing_actions, & 428 429 intermediate_timestep_count_max, simulated_time, end_time, & … … 431 432 pt_surface, large_scale_forcing, lsf_surf, spinup, & 432 433 spinup_pt_mean, spinup_time, time_do3d, dt_do3d, & 433 average_count_3d, varnamelength, urban_surface, & 434 plant_canopy, dz 434 average_count_3d, varnamelength, urban_surface, dz 435 435 436 436 USE bulk_cloud_model_mod, & … … 455 455 456 456 USE pegrid 457 458 USE plant_canopy_model_mod, & 459 ONLY: pc_heating_rate, pc_transpiration_rate, pc_latent_rate 460 457 461 458 USE radiation_model_mod, & 462 459 ONLY: albedo_type, radiation_interaction, calc_zenith, zenith, & … … 535 532 !< (e.g.transportation) are used 536 533 LOGICAL :: force_radiation_call_l = .FALSE. !< flag parameter for unscheduled radiation model calls 537 LOGICAL :: indoor_model = .FALSE. !< whether to use the indoor model538 534 LOGICAL :: read_wall_temp_3d = .FALSE. 539 535 LOGICAL :: usm_wall_mod = .FALSE. !< reduces conductivity of the first 2 wall layers by factor 0.1 … … 1257 1253 ALLOCATE ( surf_usm_v(l)%target_temp_summer(1:surf_usm_v(l)%ns) ) 1258 1254 ALLOCATE ( surf_usm_v(l)%target_temp_winter(1:surf_usm_v(l)%ns) ) 1259 ENDDO 1255 ENDDO 1256 ! 1257 !-- In case the indoor model is applied, allocate memory for waste heat 1258 !-- and indoor temperature. 1259 IF ( indoor_model ) THEN 1260 ALLOCATE ( surf_usm_h%waste_heat(1:surf_usm_h%ns) ) 1261 surf_usm_h%waste_heat = 0.0_wp 1262 DO l = 0, 3 1263 ALLOCATE ( surf_usm_v(l)%waste_heat(1:surf_usm_v(l)%ns) ) 1264 surf_usm_v(l)%waste_heat = 0.0_wp 1265 ENDDO 1266 ENDIF 1260 1267 ! 1261 1268 !-- Allocate flag indicating ground floor level surface elements … … 6054 6061 usm_material_model, & 6055 6062 wall_category, & 6056 indoor_model, &6057 6063 wall_inner_temperature, & 6058 6064 roof_inner_temperature, & … … 6073 6079 usm_material_model, & 6074 6080 wall_category, & 6075 indoor_model, &6076 6081 wall_inner_temperature, & 6077 6082 roof_inner_temperature, & … … 6264 6269 6265 6270 LOGICAL, INTENT(OUT) :: found 6271 !!! suehring: Why the SAVE attribute? 6272 REAL(wp), DIMENSION(:), ALLOCATABLE, SAVE :: tmp_surf_wall_h 6273 REAL(wp), DIMENSION(:), ALLOCATABLE, SAVE :: tmp_surf_window_h 6274 REAL(wp), DIMENSION(:), ALLOCATABLE, SAVE :: tmp_surf_green_h 6275 REAL(wp), DIMENSION(:), ALLOCATABLE, SAVE :: tmp_surf_waste_h 6266 6276 6267 REAL(wp), DIMENSION(:), ALLOCATABLE, SAVE :: tmp_surf_wall_h, tmp_surf_window_h, tmp_surf_green_h 6268 REAL(wp), DIMENSION(:,:), ALLOCATABLE, SAVE :: tmp_wall_h, tmp_window_h, tmp_green_h 6277 REAL(wp), DIMENSION(:,:), ALLOCATABLE, SAVE :: tmp_wall_h 6278 REAL(wp), DIMENSION(:,:), ALLOCATABLE, SAVE :: tmp_window_h 6279 REAL(wp), DIMENSION(:,:), ALLOCATABLE, SAVE :: tmp_green_h 6269 6280 6270 TYPE( t_surf_vertical ), DIMENSION(0:3), SAVE :: tmp_surf_wall_v, tmp_surf_window_v, tmp_surf_green_v 6271 TYPE( t_wall_vertical ), DIMENSION(0:3), SAVE :: tmp_wall_v, tmp_window_v, tmp_green_v 6281 TYPE( t_surf_vertical ), DIMENSION(0:3), SAVE :: tmp_surf_wall_v 6282 TYPE( t_surf_vertical ), DIMENSION(0:3), SAVE :: tmp_surf_window_v 6283 TYPE( t_surf_vertical ), DIMENSION(0:3), SAVE :: tmp_surf_green_v 6284 TYPE( t_surf_vertical ), DIMENSION(0:3), SAVE :: tmp_surf_waste_v 6285 6286 TYPE( t_wall_vertical ), DIMENSION(0:3), SAVE :: tmp_wall_v 6287 TYPE( t_wall_vertical ), DIMENSION(0:3), SAVE :: tmp_window_v 6288 TYPE( t_wall_vertical ), DIMENSION(0:3), SAVE :: tmp_green_v 6272 6289 6273 6290 … … 6289 6306 DEALLOCATE( tmp_surf_green_h ) 6290 6307 IF ( ALLOCATED( tmp_green_h) ) DEALLOCATE( tmp_green_h ) 6308 IF ( ALLOCATED( tmp_surf_waste_h) ) & 6309 DEALLOCATE( tmp_surf_waste_h ) 6291 6310 6292 6311 ! … … 6305 6324 ALLOCATE( tmp_green_h(nzb_wall:nzt_wall+1, & 6306 6325 1:ns_h_on_file_usm) ) 6326 ALLOCATE( tmp_surf_waste_h(1:ns_h_on_file_usm) ) 6307 6327 6308 6328 ENDIF … … 6325 6345 IF ( ALLOCATED( tmp_green_v(l)%t ) ) & 6326 6346 DEALLOCATE( tmp_green_v(l)%t ) 6347 IF ( ALLOCATED( tmp_surf_waste_v(l)%t ) ) & 6348 DEALLOCATE( tmp_surf_waste_v(l)%t ) 6327 6349 ENDDO 6328 6350 … … 6343 6365 ALLOCATE( tmp_green_v(l)%t(nzb_wall:nzt_wall+1, & 6344 6366 1:ns_v_on_file_usm(l) ) ) 6367 ALLOCATE( tmp_surf_waste_v(l)%t(1:ns_v_on_file_usm(l)) ) 6345 6368 ENDDO 6346 6369 … … 6614 6637 t_surf_window_v_1(3)%t, & 6615 6638 tmp_surf_window_v(3)%t, & 6639 surf_usm_v(3)%start_index, & 6640 start_index_on_file, & 6641 end_index_on_file, & 6642 nxlc, nysc, & 6643 nxlf, nxrf, nysf, nynf, & 6644 nys_on_file, nyn_on_file, & 6645 nxl_on_file,nxr_on_file ) 6646 6647 CASE ( 'waste_heat_h' ) 6648 IF ( k == 1 ) THEN 6649 IF ( .NOT. ALLOCATED( surf_usm_h%waste_heat ) ) & 6650 ALLOCATE( surf_usm_h%waste_heat(1:surf_usm_h%ns) ) 6651 READ ( 13 ) tmp_surf_waste_h 6652 ENDIF 6653 CALL surface_restore_elements( & 6654 surf_usm_h%waste_heat, & 6655 tmp_surf_waste_h, & 6656 surf_usm_h%start_index, & 6657 start_index_on_file, & 6658 end_index_on_file, & 6659 nxlc, nysc, & 6660 nxlf, nxrf, nysf, nynf, & 6661 nys_on_file, nyn_on_file, & 6662 nxl_on_file,nxr_on_file ) 6663 6664 CASE ( 'waste_heat_v(0)' ) 6665 IF ( k == 1 ) THEN 6666 IF ( .NOT. ALLOCATED( surf_usm_v(0)%waste_heat ) ) & 6667 ALLOCATE( surf_usm_v(0)%waste_heat(1:surf_usm_v(0)%ns) ) 6668 READ ( 13 ) tmp_surf_waste_v(0)%t 6669 ENDIF 6670 CALL surface_restore_elements( & 6671 surf_usm_v(0)%waste_heat, & 6672 tmp_surf_waste_v(0)%t, & 6673 surf_usm_v(0)%start_index, & 6674 start_index_on_file, & 6675 end_index_on_file, & 6676 nxlc, nysc, & 6677 nxlf, nxrf, nysf, nynf, & 6678 nys_on_file, nyn_on_file, & 6679 nxl_on_file,nxr_on_file ) 6680 6681 CASE ( 'waste_heat_v(1)' ) 6682 IF ( k == 1 ) THEN 6683 IF ( .NOT. ALLOCATED( surf_usm_v(1)%waste_heat ) ) & 6684 ALLOCATE( surf_usm_v(1)%waste_heat(1:surf_usm_v(1)%ns) ) 6685 READ ( 13 ) tmp_surf_waste_v(1)%t 6686 ENDIF 6687 CALL surface_restore_elements( & 6688 surf_usm_v(1)%waste_heat, & 6689 tmp_surf_waste_v(1)%t, & 6690 surf_usm_v(1)%start_index, & 6691 start_index_on_file, & 6692 end_index_on_file, & 6693 nxlc, nysc, & 6694 nxlf, nxrf, nysf, nynf, & 6695 nys_on_file, nyn_on_file, & 6696 nxl_on_file,nxr_on_file ) 6697 6698 CASE ( 'waste_heat_v(2)' ) 6699 IF ( k == 1 ) THEN 6700 IF ( .NOT. ALLOCATED( surf_usm_v(2)%waste_heat ) ) & 6701 ALLOCATE( surf_usm_v(2)%waste_heat(1:surf_usm_v(2)%ns) ) 6702 READ ( 13 ) tmp_surf_waste_v(2)%t 6703 ENDIF 6704 CALL surface_restore_elements( & 6705 surf_usm_v(2)%waste_heat, & 6706 tmp_surf_waste_v(2)%t, & 6707 surf_usm_v(2)%start_index, & 6708 start_index_on_file, & 6709 end_index_on_file, & 6710 nxlc, nysc, & 6711 nxlf, nxrf, nysf, nynf, & 6712 nys_on_file, nyn_on_file, & 6713 nxl_on_file,nxr_on_file ) 6714 6715 CASE ( 'waste_heat_v(3)' ) 6716 IF ( k == 1 ) THEN 6717 IF ( .NOT. ALLOCATED( surf_usm_v(3)%waste_heat ) ) & 6718 ALLOCATE( surf_usm_v(3)%waste_heat(1:surf_usm_v(3)%ns) ) 6719 READ ( 13 ) tmp_surf_waste_v(3)%t 6720 ENDIF 6721 CALL surface_restore_elements( & 6722 surf_usm_v(3)%waste_heat, & 6723 tmp_surf_waste_v(3)%t, & 6616 6724 surf_usm_v(3)%start_index, & 6617 6725 start_index_on_file, & … … 7627 7735 j_off = surf_usm_h%joff 7628 7736 i_off = surf_usm_h%ioff 7629 7737 7630 7738 ! 7631 7739 !-- First, treat horizontal surface elements … … 7957 8065 !-- diffusion_s, surface_layer_fluxes,... 7958 8066 surf_usm_h%shf(m) = surf_usm_h%wshf_eb(m) / c_p 8067 ! 8068 !-- If the indoor model is applied, further add waste heat from buildings to the 8069 !-- kinematic flux. 8070 IF ( indoor_model ) THEN 8071 surf_usm_h%shf(m) = surf_usm_h%shf(m) + surf_usm_h%waste_heat(m) / rho_cp 8072 ENDIF 7959 8073 7960 8074 … … 8382 8496 !-- diffusion_s, surface_layer_fluxes,... 8383 8497 surf_usm_v(l)%shf(m) = surf_usm_v(l)%wshf_eb(m) / c_p 8498 ! 8499 !-- If the indoor model is applied, further add waste heat from buildings to the 8500 !-- kinematic flux. 8501 IF ( indoor_model ) THEN 8502 surf_usm_v(l)%shf(m) = surf_usm_v(l)%shf(m) + & 8503 surf_usm_v(l)%waste_heat(m) / rho_cp 8504 ENDIF 8384 8505 8385 8506 IF ( surf_usm_v(l)%frac(ind_pav_green,m) > 0.0_wp ) THEN … … 8685 8806 CALL wrd_write_string( 't_surf_green_h' ) 8686 8807 WRITE ( 14 ) t_surf_green_h 8687 8808 ! 8809 !-- Write restart data which is especially needed for the urban-surface 8810 !-- model. In order to do not fill up the restart routines in 8811 !-- surface_mod. 8812 !-- Output of waste heat from indoor model. Restart data is required in 8813 !-- this special case, because the indoor model where waste heat is 8814 !-- computed is call each hour (current default), so that waste heat would 8815 !-- have zero value until next call of indoor model. 8816 IF ( indoor_model ) THEN 8817 CALL wrd_write_string( 'waste_heat_h' ) 8818 WRITE ( 14 ) surf_usm_h%waste_heat 8819 ENDIF 8820 8688 8821 DO l = 0, 3 8689 8822 … … 8703 8836 8704 8837 CALL wrd_write_string( 't_surf_green_v(' // dum // ')' ) 8705 WRITE ( 14 ) t_surf_green_v(l)%t 8838 WRITE ( 14 ) t_surf_green_v(l)%t 8839 8840 IF ( indoor_model ) THEN 8841 CALL wrd_write_string( 'waste_heat_v(' // dum // ')' ) 8842 WRITE ( 14 ) surf_usm_v(l)%waste_heat 8843 ENDIF 8706 8844 8707 8845 ENDDO … … 8742 8880 8743 8881 ENDDO 8744 8745 8882 8746 8883 END SUBROUTINE usm_wrd_local
Note: See TracChangeset
for help on using the changeset viewer.