Changeset 3271


Ignore:
Timestamp:
Sep 24, 2018 8:20:34 AM (3 years ago)
Author:
suehring
Message:

Several critical bugfixes: initialization of surface temperature at water bodies; consider special case in initialization of vertical natural surface elements

Location:
palm/trunk/SOURCE
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • palm/trunk/SOURCE/land_surface_model_mod.f90

    r3256 r3271  
    2525! -----------------
    2626! $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
    2734! Enable initialization of z0q for vegetation, pavement and water surfaces via
    2835! namelist input.
     
    18091816    j_off = surf%joff
    18101817    i_off = surf%ioff
    1811 
     1818   
    18121819!
    18131820!-- Calculate the exner function for the current time step
     
    23132320!-- Calculate new roughness lengths (for water surfaces only)
    23142321    IF ( horizontal  .AND.  .NOT. constant_roughness )  CALL calc_z0_water_surface
    2315 
     2322   
    23162323    CONTAINS
    23172324!------------------------------------------------------------------------------!
     
    27242731                i = surf_lsm_h%i(m)
    27252732                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 )    &
    27272734                   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 )      &
    27292736                   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 )         &
    27312738                   surf_lsm_h%water_surface(m) = .TRUE.
    27322739             ENDDO
     2740!
     2741!--          For vertical surfaces some special checks and treatment are
     2742!--          required for correct initialization.
    27332743             DO  l = 0, 3
    27342744                DO  m = 1, surf_lsm_v(l)%ns
    27352745!
    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.
    27402762                   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.
    27412768                   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 )                              &
    27452774                         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                     
    27462796                   ENDIF
    27472797!
    27482798!--                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,      &
    27502800                                            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,      &
    27522802                                            surf_lsm_v(l)%building_covered(m) )
    27532803                   IF ( vegetation_type_f%var(j,i) /= vegetation_type_f%fill ) &
     
    27572807                   IF ( water_type_f%var(j,i)      /= water_type_f%fill )      &
    27582808                      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
    27592812                ENDDO
    27602813             ENDDO
     
    32683321          DO  l = 0, 3
    32693322             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,         &
    32713324                                                surf_lsm_v(l)%building_covered(m) )
    32723325                j = surf_lsm_v(l)%j(m) + MERGE( 0, surf_lsm_v(l)%joff,      &
    3273                                                    surf_lsm_v(l)%building_covered(m) )
     3326                                                surf_lsm_v(l)%building_covered(m) )
    32743327             
    32753328                st = vegetation_type_f%var(j,i)
     
    34883541          IF ( surf_lsm_h%water_surface(m) )  THEN
    34893542             IF ( TRIM( initializing_actions ) /= 'read_restart_data' )        &
    3490                 t_soil_h%var_2d(:,m)           = water_temperature
     3543                t_soil_h%var_2d(:,m)        = water_temperature
    34913544             surf_lsm_h%z0(m)               = z0_water
    34923545             surf_lsm_h%z0h(m)              = z0h_water
     
    36423695                     water_pars_f%fill )                                       &
    36433696                   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) 
    36453698             ENDIF
    36463699          ENDDO
     
    43954448             k   = surf_lsm_h%k(m)
    43964449!
    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
    44074454             
    44084455             IF ( cloud_physics  .OR. cloud_droplets ) THEN
     
    44114458                surf_lsm_h%pt1(m) = pt(k,j,i)
    44124459             ENDIF
    4413 
    4414 
    44154460!
    44164461!--          Assure that r_a cannot be zero at model start
     
    44324477                k   = surf_lsm_v(l)%k(m)         
    44334478!
    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
    44484483
    44494484                IF ( cloud_physics  .OR. cloud_droplets ) THEN
  • palm/trunk/SOURCE/surface_layer_fluxes_mod.f90

    r3157 r3271  
    2626! -----------------
    2727! $Id$
     28! Comment revised
     29!
     30! 3157 2018-07-19 21:08:49Z maronga
    2831! Added local free convection velocity scale w_lfc in calculation of uvw_abs.
    2932! This can be switche on/off by the user via the flag namelist parameter
     
    15801583!-- Calculate potential temperature, specific humidity, and virtual potential
    15811584!-- temperature at first grid level
    1582 !-- ( only for upward-facing surfs )
    15831585    SUBROUTINE calc_pt_q
    15841586
Note: See TracChangeset for help on using the changeset viewer.