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-2012 Leibniz University Hannover !--------------------------------------------------------------------------------! ! ! Current revisions: ! ----------------- ! ! Former revisions: ! ----------------- ! $Id: user_init_plant_canopy.f90 1037 2012-10-22 14:10:22Z witha $ ! ! 1036 2012-10-22 13:43:42Z raasch ! code put under GPL (PALM 3.9) ! ! 667 2010-12-23 12:06:00Z suehring/gryschka ! nxl-1, nxr+1, nys-1, nyn+1 replaced by nxlg, nxrg, nysg, nyng ! ! 274 2009-03-26 15:11:21Z heinze ! Output of messages replaced by message handling routine. ! ! 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 user IMPLICIT NONE INTEGER :: i, 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 ! cdc(:,:,i) = 0.0 ! 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