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 1485 2014-10-21 11:09:54Z witha $ ! ! 1484 2014-10-21 10:53:05Z kanani ! Changes in the course of the canopy-model modularization: ! module plant_canopy_model_mod added, ! definition of array cdc (canopy drag coefficient) removed, since it is now ! defined purely as a single constant value (see module plant_canopy_model) ! ! 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 plant_canopy_model_mod USE user IMPLICIT NONE INTEGER(iwp) :: i !: running index INTEGER(iwp) :: j !: running index ! !-- Here the user-defined grid initializing actions follow: ! !-- Set the 3D-array lad_s 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 forest topography. !-- The following lines contain an example, where the plant canopy extends !-- only over the second half of the model domain along x. !-- Attention: DO-loops have to include the ghost points (nxlg-nxrg, !-- nysg-nyng), because no exchange of ghost point information is intended, !-- in order to minimize communication between CPUs ! DO i = nxlg, nxrg ! IF ( i >= INT(nx+1/2) ) THEN ! DO j = nysg, nyng ! lad_s(:,j,i) = lad(:) ! ENDDO ! ELSE ! lad_s(:,:,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