Changeset 3271 for palm/trunk
- Timestamp:
- Sep 24, 2018 8:20:34 AM (6 years ago)
- Location:
- palm/trunk/SOURCE
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
palm/trunk/SOURCE/land_surface_model_mod.f90
r3256 r3271 25 25 ! ----------------- 26 26 ! $Id$ 27 ! Several bugfixes: 28 ! - Initialization of pt_surface array with soil temperature in the uppermost 29 ! soil layer, else heat fluxes at the very first time step become quite large 30 ! - Default initialization of vertical surface elements in special case terrain 31 ! height changes are larger than adjacent building heights. 32 ! 33 ! 3256 2018-09-17 12:20:07Z suehring 27 34 ! Enable initialization of z0q for vegetation, pavement and water surfaces via 28 35 ! namelist input. … … 1809 1816 j_off = surf%joff 1810 1817 i_off = surf%ioff 1811 1818 1812 1819 ! 1813 1820 !-- Calculate the exner function for the current time step … … 2313 2320 !-- Calculate new roughness lengths (for water surfaces only) 2314 2321 IF ( horizontal .AND. .NOT. constant_roughness ) CALL calc_z0_water_surface 2315 2322 2316 2323 CONTAINS 2317 2324 !------------------------------------------------------------------------------! … … 2724 2731 i = surf_lsm_h%i(m) 2725 2732 j = surf_lsm_h%j(m) 2726 IF ( vegetation_type_f%var(j,i) /= vegetation_type_f%fill ) 2733 IF ( vegetation_type_f%var(j,i) /= vegetation_type_f%fill ) & 2727 2734 surf_lsm_h%vegetation_surface(m) = .TRUE. 2728 IF ( pavement_type_f%var(j,i) /= pavement_type_f%fill ) 2735 IF ( pavement_type_f%var(j,i) /= pavement_type_f%fill ) & 2729 2736 surf_lsm_h%pavement_surface(m) = .TRUE. 2730 IF ( water_type_f%var(j,i) /= water_type_f%fill ) 2737 IF ( water_type_f%var(j,i) /= water_type_f%fill ) & 2731 2738 surf_lsm_h%water_surface(m) = .TRUE. 2732 2739 ENDDO 2740 ! 2741 !-- For vertical surfaces some special checks and treatment are 2742 !-- required for correct initialization. 2733 2743 DO l = 0, 3 2734 2744 DO m = 1, surf_lsm_v(l)%ns 2735 2745 ! 2736 !-- Only for vertical surfaces. Check if natural walls at reference 2737 !-- grid point are covered by any building. This case, problems 2738 !-- with initialization will aris if index offsets are used. 2739 !-- In order to deal with this, set special flag. 2746 !-- Only for vertical surfaces. Check if at the grid point where 2747 !-- the wall is defined (i+ioff, j+joff) is any building. 2748 !-- This case, no natural surfaces properties will be defined at 2749 !-- at this grid point, leading to problems in the initialization. 2750 !-- To overcome this, define a special flag which 2751 !-- indicates that a building is defined at the wall grid point 2752 !-- and take the surface properties from the adjoining grid 2753 !-- point, i.e. without offset values. 2754 !-- Further, there can occur a special case where elevation 2755 !-- changes are larger than building heights. This case, (j,i) 2756 !-- and (j+joff,i+ioff) grid points may be both covered by 2757 !-- buildings, but vertical, but vertically natural walls may 2758 !-- be located between the buildings. This case, it is not 2759 !-- guaranteed that information about natural surface types is 2760 !-- given, neither at (j,i) nor at (j+joff,i+ioff), again leading 2761 !-- to non-initialized surface properties. 2740 2762 surf_lsm_v(l)%building_covered(m) = .FALSE. 2763 ! 2764 !-- Wall grid point is building-covered. This case, set 2765 !-- flag indicating that surface properties are initialized 2766 !-- from neighboring reference grid point, which is not 2767 !-- building_covered. 2741 2768 IF ( building_type_f%from_file ) THEN 2742 i = surf_lsm_v(l)%i(m) + surf_lsm_v(l)%ioff 2743 j = surf_lsm_v(l)%j(m) + surf_lsm_v(l)%joff 2744 IF ( building_type_f%var(j,i) /= 0 ) & 2769 i = surf_lsm_v(l)%i(m) 2770 j = surf_lsm_v(l)%j(m) 2771 IF ( building_type_f%var(j+surf_lsm_v(l)%joff, & 2772 i+surf_lsm_v(l)%ioff) /= & 2773 building_type_f%fill ) & 2745 2774 surf_lsm_v(l)%building_covered(m) = .TRUE. 2775 ! 2776 !-- Wall grid point as well as neighboring reference grid 2777 !-- point are both building-covered. This case, surface 2778 !-- properties are not necessarily defined (not covered by 2779 !-- checks for static input file) at this surface. Hence, 2780 !-- initialize surface properties by simply setting 2781 !-- vegetation_type_f to bare-soil bulk parametrization. 2782 !-- soil_type_f as well as surface_fractions_f will be set 2783 !-- also. 2784 IF ( building_type_f%var(j+surf_lsm_v(l)%joff, & 2785 i+surf_lsm_v(l)%ioff) /= & 2786 building_type_f%fill .AND. & 2787 building_type_f%var(j,i) /= building_type_f%fill ) & 2788 THEN 2789 vegetation_type_f%var(j,i) = 1 ! bare soil 2790 soil_type_f%var_2d(j,i) = 1 2791 surface_fraction_f%frac(ind_veg_wall,j,i) = 1 2792 surface_fraction_f%frac(ind_pav_green,j,i) = 0 2793 surface_fraction_f%frac(ind_wat_win,j,i) = 0 2794 ENDIF 2795 2746 2796 ENDIF 2747 2797 ! 2748 2798 !-- Normally proceed with setting surface types. 2749 i = surf_lsm_v(l)%i(m) + MERGE( 0, surf_lsm_v(l)%ioff, &2799 i = surf_lsm_v(l)%i(m) + MERGE( 0, surf_lsm_v(l)%ioff, & 2750 2800 surf_lsm_v(l)%building_covered(m) ) 2751 j = surf_lsm_v(l)%j(m) + MERGE( 0, surf_lsm_v(l)%joff, &2801 j = surf_lsm_v(l)%j(m) + MERGE( 0, surf_lsm_v(l)%joff, & 2752 2802 surf_lsm_v(l)%building_covered(m) ) 2753 2803 IF ( vegetation_type_f%var(j,i) /= vegetation_type_f%fill ) & … … 2757 2807 IF ( water_type_f%var(j,i) /= water_type_f%fill ) & 2758 2808 surf_lsm_v(l)%water_surface(m) = .TRUE. 2809 ! 2810 !-- Check if surface element has the flag %building_covered_all, 2811 !-- this case, set vegetation_type appropriate 2759 2812 ENDDO 2760 2813 ENDDO … … 3268 3321 DO l = 0, 3 3269 3322 DO m = 1, surf_lsm_v(l)%ns 3270 i = surf_lsm_v(l)%i(m) + MERGE( 0, surf_lsm_v(l)%ioff, &3323 i = surf_lsm_v(l)%i(m) + MERGE( 0, surf_lsm_v(l)%ioff, & 3271 3324 surf_lsm_v(l)%building_covered(m) ) 3272 3325 j = surf_lsm_v(l)%j(m) + MERGE( 0, surf_lsm_v(l)%joff, & 3273 3326 surf_lsm_v(l)%building_covered(m) ) 3274 3327 3275 3328 st = vegetation_type_f%var(j,i) … … 3488 3541 IF ( surf_lsm_h%water_surface(m) ) THEN 3489 3542 IF ( TRIM( initializing_actions ) /= 'read_restart_data' ) & 3490 t_soil_h%var_2d(:,m) 3543 t_soil_h%var_2d(:,m) = water_temperature 3491 3544 surf_lsm_h%z0(m) = z0_water 3492 3545 surf_lsm_h%z0h(m) = z0h_water … … 3642 3695 water_pars_f%fill ) & 3643 3696 surf_lsm_h%emissivity(ind_wat_win,m) = & 3644 water_pars_f%pars_xy(ind_w_emis,j,i)3697 water_pars_f%pars_xy(ind_w_emis,j,i) 3645 3698 ENDIF 3646 3699 ENDDO … … 4395 4448 k = surf_lsm_h%k(m) 4396 4449 ! 4397 !-- Calculate surface temperature. In case of bare soil, the surface 4398 !-- temperature must be reset to the soil temperature in the first soil 4399 !-- layer 4400 IF ( surf_lsm_h%lambda_surface_s(m) == 0.0_wp ) THEN 4401 t_surface_h%var_1d(m) = t_soil_h%var_2d(nzb_soil,m) 4402 surf_lsm_h%pt_surface(m) = t_soil_h%var_2d(nzb_soil,m) / exn 4403 ELSE 4404 t_surface_h%var_1d(m) = pt(k-1,j,i) * exn 4405 surf_lsm_h%pt_surface(m) = pt(k-1,j,i) 4406 ENDIF 4450 !-- Initialize surface temperature with soil temperature in the uppermost 4451 !-- uppermost layer 4452 t_surface_h%var_1d(m) = t_soil_h%var_2d(nzb_soil,m) 4453 surf_lsm_h%pt_surface(m) = t_soil_h%var_2d(nzb_soil,m) / exn 4407 4454 4408 4455 IF ( cloud_physics .OR. cloud_droplets ) THEN … … 4411 4458 surf_lsm_h%pt1(m) = pt(k,j,i) 4412 4459 ENDIF 4413 4414 4415 4460 ! 4416 4461 !-- Assure that r_a cannot be zero at model start … … 4432 4477 k = surf_lsm_v(l)%k(m) 4433 4478 ! 4434 !-- Calculate surface temperature. In case of bare soil, the surface 4435 !-- temperature must be reset to the soil temperature in the first soil 4436 !-- layer 4437 IF ( surf_lsm_v(l)%lambda_surface_s(m) == 0.0_wp ) THEN 4438 t_surface_v(l)%var_1d(m) = t_soil_v(l)%var_2d(nzb_soil,m) 4439 surf_lsm_v(l)%pt_surface(m) = t_soil_v(l)%var_2d(nzb_soil,m) / exn 4440 ELSE 4441 j_off = surf_lsm_v(l)%joff 4442 i_off = surf_lsm_v(l)%ioff 4443 4444 t_surface_v(l)%var_1d(m) = pt(k,j+j_off,i+i_off) * exn 4445 surf_lsm_v(l)%pt_surface(m) = pt(k,j+j_off,i+i_off) 4446 ENDIF 4447 4479 !-- Initialize surface temperature with soil temperature in the uppermost 4480 !-- uppermost layer 4481 t_surface_v(l)%var_1d(m) = t_soil_v(l)%var_2d(nzb_soil,m) 4482 surf_lsm_v(l)%pt_surface(m) = t_soil_v(l)%var_2d(nzb_soil,m) / exn 4448 4483 4449 4484 IF ( cloud_physics .OR. cloud_droplets ) THEN -
palm/trunk/SOURCE/surface_layer_fluxes_mod.f90
r3157 r3271 26 26 ! ----------------- 27 27 ! $Id$ 28 ! Comment revised 29 ! 30 ! 3157 2018-07-19 21:08:49Z maronga 28 31 ! Added local free convection velocity scale w_lfc in calculation of uvw_abs. 29 32 ! This can be switche on/off by the user via the flag namelist parameter … … 1580 1583 !-- Calculate potential temperature, specific humidity, and virtual potential 1581 1584 !-- temperature at first grid level 1582 !-- ( only for upward-facing surfs )1583 1585 SUBROUTINE calc_pt_q 1584 1586
Note: See TracChangeset
for help on using the changeset viewer.