Changeset 1682 for palm/trunk/SOURCE/plant_canopy_model.f90
- Timestamp:
- Oct 7, 2015 11:56:08 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
palm/trunk/SOURCE/plant_canopy_model.f90
r1485 r1682 1 MODULE plant_canopy_model_mod 2 1 !> @file plant_canopy_model.f90 3 2 !--------------------------------------------------------------------------------! 4 3 ! This file is part of PALM. … … 20 19 ! Current revisions: 21 20 ! ----------------- 22 ! 21 ! Code annotations made doxygen readable 23 22 ! 24 23 ! Former revisions: … … 66 65 ! Description: 67 66 ! ------------ 68 ! 1) Initialization of the canopy model, e.g. construction of leaf area density69 ! profile (subroutine init_plant_canopy).70 ! 2) Calculation of sinks and sources of momentum, heat and scalar concentration71 ! due to canopy elements (subroutine plant_canopy_model).67 !> 1) Initialization of the canopy model, e.g. construction of leaf area density 68 !> profile (subroutine init_plant_canopy). 69 !> 2) Calculation of sinks and sources of momentum, heat and scalar concentration 70 !> due to canopy elements (subroutine plant_canopy_model). 72 71 !------------------------------------------------------------------------------! 72 MODULE plant_canopy_model_mod 73 73 74 USE arrays_3d, & 74 75 ONLY: dzu, dzw, e, q, shf, tend, u, v, w, zu, zw … … 84 85 85 86 86 CHARACTER (LEN=20) :: canopy_mode = 'block' ! :canopy coverage87 88 INTEGER(iwp) :: pch_index = 0 ! :plant canopy height/top index87 CHARACTER (LEN=20) :: canopy_mode = 'block' !< canopy coverage 88 89 INTEGER(iwp) :: pch_index = 0 !< plant canopy height/top index 89 90 INTEGER(iwp) :: & 90 lad_vertical_gradient_level_ind(10) = -9999 ! :lad-profile levels (index)91 92 LOGICAL :: calc_beta_lad_profile = .FALSE. ! :switch for calc. of lad from beta func.93 LOGICAL :: plant_canopy = .FALSE. ! :switch for use of canopy model94 95 REAL(wp) :: alpha_lad = 9999999.9_wp ! :coefficient for lad calculation96 REAL(wp) :: beta_lad = 9999999.9_wp ! :coefficient for lad calculation97 REAL(wp) :: canopy_drag_coeff = 0.0_wp ! :canopy drag coefficient (parameter)98 REAL(wp) :: cdc = 0.0_wp ! :canopy drag coeff. (abbreviation used in equations)99 REAL(wp) :: cthf = 0.0_wp ! :canopy top heat flux100 REAL(wp) :: dt_plant_canopy = 0.0_wp ! :timestep account. for canopy drag101 REAL(wp) :: lad_surface = 0.0_wp ! :lad surface value102 REAL(wp) :: lai_beta = 0.0_wp ! :leaf area index (lai) for lad calc.91 lad_vertical_gradient_level_ind(10) = -9999 !< lad-profile levels (index) 92 93 LOGICAL :: calc_beta_lad_profile = .FALSE. !< switch for calc. of lad from beta func. 94 LOGICAL :: plant_canopy = .FALSE. !< switch for use of canopy model 95 96 REAL(wp) :: alpha_lad = 9999999.9_wp !< coefficient for lad calculation 97 REAL(wp) :: beta_lad = 9999999.9_wp !< coefficient for lad calculation 98 REAL(wp) :: canopy_drag_coeff = 0.0_wp !< canopy drag coefficient (parameter) 99 REAL(wp) :: cdc = 0.0_wp !< canopy drag coeff. (abbreviation used in equations) 100 REAL(wp) :: cthf = 0.0_wp !< canopy top heat flux 101 REAL(wp) :: dt_plant_canopy = 0.0_wp !< timestep account. for canopy drag 102 REAL(wp) :: lad_surface = 0.0_wp !< lad surface value 103 REAL(wp) :: lai_beta = 0.0_wp !< leaf area index (lai) for lad calc. 103 104 REAL(wp) :: & 104 leaf_scalar_exch_coeff = 0.0_wp ! :canopy scalar exchange coeff.105 leaf_scalar_exch_coeff = 0.0_wp !< canopy scalar exchange coeff. 105 106 REAL(wp) :: & 106 leaf_surface_conc = 0.0_wp ! :leaf surface concentration107 REAL(wp) :: lsec = 0.0_wp ! :leaf scalar exchange coeff.108 REAL(wp) :: lsc = 0.0_wp ! :leaf surface concentration107 leaf_surface_conc = 0.0_wp !< leaf surface concentration 108 REAL(wp) :: lsec = 0.0_wp !< leaf scalar exchange coeff. 109 REAL(wp) :: lsc = 0.0_wp !< leaf surface concentration 109 110 110 111 REAL(wp) :: & 111 lad_vertical_gradient(10) = 0.0_wp ! :lad gradient112 lad_vertical_gradient(10) = 0.0_wp !< lad gradient 112 113 REAL(wp) :: & 113 lad_vertical_gradient_level(10) = -9999999.9_wp ! :lad-prof. levels (in m)114 115 REAL(wp), DIMENSION(:), ALLOCATABLE :: lad ! :leaf area density116 REAL(wp), DIMENSION(:), ALLOCATABLE :: pre_lad ! :preliminary lad114 lad_vertical_gradient_level(10) = -9999999.9_wp !< lad-prof. levels (in m) 115 116 REAL(wp), DIMENSION(:), ALLOCATABLE :: lad !< leaf area density 117 REAL(wp), DIMENSION(:), ALLOCATABLE :: pre_lad !< preliminary lad 117 118 118 119 REAL(wp), DIMENSION(:,:,:), ALLOCATABLE :: & 119 canopy_heat_flux ! :canopy heat flux120 REAL(wp), DIMENSION(:,:,:), ALLOCATABLE :: cum_lai_hf ! :cumulative lai for heatflux calc.121 REAL(wp), DIMENSION(:,:,:), ALLOCATABLE :: lad_s ! :lad on scalar-grid120 canopy_heat_flux !< canopy heat flux 121 REAL(wp), DIMENSION(:,:,:), ALLOCATABLE :: cum_lai_hf !< cumulative lai for heatflux calc. 122 REAL(wp), DIMENSION(:,:,:), ALLOCATABLE :: lad_s !< lad on scalar-grid 122 123 123 124 … … 152 153 ! Description: 153 154 ! ------------ 154 ! --Initialization of the plant canopy model155 !> Initialization of the plant canopy model 155 156 !------------------------------------------------------------------------------! 156 157 SUBROUTINE init_plant_canopy … … 163 164 IMPLICIT NONE 164 165 165 INTEGER(iwp) :: i ! :running index166 INTEGER(iwp) :: j ! :running index167 INTEGER(iwp) :: k ! :running index168 169 REAL(wp) :: int_bpdf ! :vertical integral for lad-profile construction170 REAL(wp) :: dzh ! :vertical grid spacing in units of canopy height171 REAL(wp) :: gradient ! :gradient for lad-profile construction172 REAL(wp) :: canopy_height ! :canopy height for lad-profile construction166 INTEGER(iwp) :: i !< running index 167 INTEGER(iwp) :: j !< running index 168 INTEGER(iwp) :: k !< running index 169 170 REAL(wp) :: int_bpdf !< vertical integral for lad-profile construction 171 REAL(wp) :: dzh !< vertical grid spacing in units of canopy height 172 REAL(wp) :: gradient !< gradient for lad-profile construction 173 REAL(wp) :: canopy_height !< canopy height for lad-profile construction 173 174 174 175 ! … … 368 369 ! Description: 369 370 ! ------------ 370 ! --Calculation of the tendency terms, accounting for the effect of the plant371 ! --canopy on momentum and scalar quantities.372 ! --373 ! --The canopy is located where the leaf area density lad_s(k,j,i) > 0.0374 ! --(defined on scalar grid), as initialized in subroutine init_plant_canopy.375 ! --The lad on the w-grid is vertically interpolated from the surrounding376 ! --lad_s. The upper boundary of the canopy is defined on the w-grid at377 ! --k = pch_index. Here, the lad is zero.378 ! --379 ! --The canopy drag must be limited (previously accounted for by calculation of380 ! --a limiting canopy timestep for the determination of the maximum LES timestep381 ! --in subroutine timestep), since it is physically impossible that the canopy382 ! --drag alone can locally change the sign of a velocity component. This383 ! --limitation is realized by calculating preliminary tendencies and velocities.384 ! --It is subsequently checked if the preliminary new velocity has a different385 ! --sign than the current velocity. If so, the tendency is limited in a way that386 ! --the velocity can at maximum be reduced to zero by the canopy drag.387 ! --388 ! --389 ! --Call for all grid points371 !> Calculation of the tendency terms, accounting for the effect of the plant 372 !> canopy on momentum and scalar quantities. 373 !> 374 !> The canopy is located where the leaf area density lad_s(k,j,i) > 0.0 375 !> (defined on scalar grid), as initialized in subroutine init_plant_canopy. 376 !> The lad on the w-grid is vertically interpolated from the surrounding 377 !> lad_s. The upper boundary of the canopy is defined on the w-grid at 378 !> k = pch_index. Here, the lad is zero. 379 !> 380 !> The canopy drag must be limited (previously accounted for by calculation of 381 !> a limiting canopy timestep for the determination of the maximum LES timestep 382 !> in subroutine timestep), since it is physically impossible that the canopy 383 !> drag alone can locally change the sign of a velocity component. This 384 !> limitation is realized by calculating preliminary tendencies and velocities. 385 !> It is subsequently checked if the preliminary new velocity has a different 386 !> sign than the current velocity. If so, the tendency is limited in a way that 387 !> the velocity can at maximum be reduced to zero by the canopy drag. 388 !> 389 !> 390 !> Call for all grid points 390 391 !------------------------------------------------------------------------------! 391 392 SUBROUTINE plant_canopy_model( component ) … … 399 400 IMPLICIT NONE 400 401 401 INTEGER(iwp) :: component ! :prognostic variable (u,v,w,pt,q,e)402 INTEGER(iwp) :: i ! :running index403 INTEGER(iwp) :: j ! :running index404 INTEGER(iwp) :: k ! :running index405 406 REAL(wp) :: ddt_3d ! :inverse of the LES timestep (dt_3d)407 REAL(wp) :: lad_local ! :local lad value408 REAL(wp) :: pre_tend ! :preliminary tendency409 REAL(wp) :: pre_u ! :preliminary u-value410 REAL(wp) :: pre_v ! :preliminary v-value411 REAL(wp) :: pre_w ! :preliminary w-value402 INTEGER(iwp) :: component !< prognostic variable (u,v,w,pt,q,e) 403 INTEGER(iwp) :: i !< running index 404 INTEGER(iwp) :: j !< running index 405 INTEGER(iwp) :: k !< running index 406 407 REAL(wp) :: ddt_3d !< inverse of the LES timestep (dt_3d) 408 REAL(wp) :: lad_local !< local lad value 409 REAL(wp) :: pre_tend !< preliminary tendency 410 REAL(wp) :: pre_u !< preliminary u-value 411 REAL(wp) :: pre_v !< preliminary v-value 412 REAL(wp) :: pre_w !< preliminary w-value 412 413 413 414 … … 659 660 ! Description: 660 661 ! ------------ 661 ! --Calculation of the tendency terms, accounting for the effect of the plant662 ! --canopy on momentum and scalar quantities.663 ! --664 ! --The canopy is located where the leaf area density lad_s(k,j,i) > 0.0665 ! --(defined on scalar grid), as initialized in subroutine init_plant_canopy.666 ! --The lad on the w-grid is vertically interpolated from the surrounding667 ! --lad_s. The upper boundary of the canopy is defined on the w-grid at668 ! --k = pch_index. Here, the lad is zero.669 ! --670 ! --The canopy drag must be limited (previously accounted for by calculation of671 ! --a limiting canopy timestep for the determination of the maximum LES timestep672 ! --in subroutine timestep), since it is physically impossible that the canopy673 ! --drag alone can locally change the sign of a velocity component. This674 ! --limitation is realized by calculating preliminary tendencies and velocities.675 ! --It is subsequently checked if the preliminary new velocity has a different676 ! --sign than the current velocity. If so, the tendency is limited in a way that677 ! --the velocity can at maximum be reduced to zero by the canopy drag.678 ! --679 ! --680 ! --Call for grid point i,j662 !> Calculation of the tendency terms, accounting for the effect of the plant 663 !> canopy on momentum and scalar quantities. 664 !> 665 !> The canopy is located where the leaf area density lad_s(k,j,i) > 0.0 666 !> (defined on scalar grid), as initialized in subroutine init_plant_canopy. 667 !> The lad on the w-grid is vertically interpolated from the surrounding 668 !> lad_s. The upper boundary of the canopy is defined on the w-grid at 669 !> k = pch_index. Here, the lad is zero. 670 !> 671 !> The canopy drag must be limited (previously accounted for by calculation of 672 !> a limiting canopy timestep for the determination of the maximum LES timestep 673 !> in subroutine timestep), since it is physically impossible that the canopy 674 !> drag alone can locally change the sign of a velocity component. This 675 !> limitation is realized by calculating preliminary tendencies and velocities. 676 !> It is subsequently checked if the preliminary new velocity has a different 677 !> sign than the current velocity. If so, the tendency is limited in a way that 678 !> the velocity can at maximum be reduced to zero by the canopy drag. 679 !> 680 !> 681 !> Call for grid point i,j 681 682 !------------------------------------------------------------------------------! 682 683 SUBROUTINE plant_canopy_model_ij( i, j, component ) … … 690 691 IMPLICIT NONE 691 692 692 INTEGER(iwp) :: component ! :prognostic variable (u,v,w,pt,q,e)693 INTEGER(iwp) :: i ! :running index694 INTEGER(iwp) :: j ! :running index695 INTEGER(iwp) :: k ! :running index696 697 REAL(wp) :: ddt_3d ! :inverse of the LES timestep (dt_3d)698 REAL(wp) :: lad_local ! :local lad value699 REAL(wp) :: pre_tend ! :preliminary tendency700 REAL(wp) :: pre_u ! :preliminary u-value701 REAL(wp) :: pre_v ! :preliminary v-value702 REAL(wp) :: pre_w ! :preliminary w-value693 INTEGER(iwp) :: component !< prognostic variable (u,v,w,pt,q,e) 694 INTEGER(iwp) :: i !< running index 695 INTEGER(iwp) :: j !< running index 696 INTEGER(iwp) :: k !< running index 697 698 REAL(wp) :: ddt_3d !< inverse of the LES timestep (dt_3d) 699 REAL(wp) :: lad_local !< local lad value 700 REAL(wp) :: pre_tend !< preliminary tendency 701 REAL(wp) :: pre_u !< preliminary u-value 702 REAL(wp) :: pre_v !< preliminary v-value 703 REAL(wp) :: pre_w !< preliminary w-value 703 704 704 705
Note: See TracChangeset
for help on using the changeset viewer.