SUBROUTINE user_init_plant_canopy !--------------------------------------------------------------------------------! ! This file is part of PALM. ! ! PALM is free software: you can redistribute it and/or modify it under the terms ! of the GNU General Public License as published by the Free Software Foundation, ! either version 3 of the License, or (at your option) any later version. ! ! PALM is distributed in the hope that it will be useful, but WITHOUT ANY ! WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR ! A PARTICULAR PURPOSE. See the GNU General Public License for more details. ! ! You should have received a copy of the GNU General Public License along with ! PALM. If not, see . ! ! Copyright 1997-2014 Leibniz Universitaet Hannover !--------------------------------------------------------------------------------! ! ! Current revisions: ! ----------------- ! ! ! Former revisions: ! ----------------- ! $Id: user_init_plant_canopy.f90 1354 2014-04-08 15:22:57Z witha $ ! ! 1353 2014-04-08 15:21:23Z heinze ! REAL constants provided with KIND-attribute ! ! 1320 2014-03-20 08:40:49Z raasch ! kind-parameters added to all INTEGER and REAL declaration statements, ! kinds are defined in new module kinds, ! old module precision_kind is removed, ! revision history before 2012 removed, ! comment fields (!:) to be used for variable explanations added to ! all variable declaration statements ! ! 1036 2012-10-22 13:43:42Z raasch ! code put under GPL (PALM 3.9) ! ! 211 2008-11-11 04:46:24Z raasch ! Former file user_interface.f90 split into one file per subroutine ! ! Description: ! ------------ ! Initialisation of the leaf area density array (for scalar grid points) and ! the array of the canopy drag coefficient, if the user has not chosen any ! of the default cases !------------------------------------------------------------------------------! USE arrays_3d USE control_parameters USE indices USE kinds USE user IMPLICIT NONE INTEGER(iwp) :: i !: INTEGER(iwp) :: j !: ! !-- Here the user-defined grid initializing actions follow: ! !-- Set the 3D-arrays lad_s and cdc for user defined canopies SELECT CASE ( TRIM( canopy_mode ) ) CASE ( 'block' ) ! !-- Not allowed here since this is the standard case used in init_3d_model. CASE ( 'user_defined_canopy_1' ) ! !-- Here the user can define his own topography. !-- The following lines contain an example in that the !-- plant canopy extends only over the second half of the !-- model domain along x ! DO i = nxlg, nxrg ! IF ( i >= INT(nx+1/2) ) THEN ! DO j = nysg, nyng ! lad_s(:,j,i) = lad(:) ! cdc(:,j,i) = drag_coefficient ! ENDDO ! ELSE ! lad_s(:,:,i) = 0.0_wp ! cdc(:,:,i) = 0.0_wp ! ENDIF ! ENDDO !-- After definition, please !-- remove the following three lines! message_string = 'canopy_mode "' // canopy_mode // & '" not available yet' CALL message( 'user_init_plant_canopy', 'UI0007', 0, 1, 0, 6, 0 ) CASE DEFAULT ! !-- The DEFAULT case is reached if the parameter canopy_mode contains a !-- wrong character string that is neither recognized in init_3d_model nor !-- here in user_init_plant_canopy. message_string = 'unknown canopy_mode "' // canopy_mode // '"' CALL message( 'user_init_plant_canopy', 'UI0008', 1, 2, 0, 6, 0 ) END SELECT END SUBROUTINE user_init_plant_canopy