[211] | 1 | SUBROUTINE user_init_plant_canopy |
---|
| 2 | |
---|
[1036] | 3 | !--------------------------------------------------------------------------------! |
---|
| 4 | ! This file is part of PALM. |
---|
| 5 | ! |
---|
| 6 | ! PALM is free software: you can redistribute it and/or modify it under the terms |
---|
| 7 | ! of the GNU General Public License as published by the Free Software Foundation, |
---|
| 8 | ! either version 3 of the License, or (at your option) any later version. |
---|
| 9 | ! |
---|
| 10 | ! PALM is distributed in the hope that it will be useful, but WITHOUT ANY |
---|
| 11 | ! WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR |
---|
| 12 | ! A PARTICULAR PURPOSE. See the GNU General Public License for more details. |
---|
| 13 | ! |
---|
| 14 | ! You should have received a copy of the GNU General Public License along with |
---|
| 15 | ! PALM. If not, see <http://www.gnu.org/licenses/>. |
---|
| 16 | ! |
---|
[1310] | 17 | ! Copyright 1997-2014 Leibniz Universitaet Hannover |
---|
[1036] | 18 | !--------------------------------------------------------------------------------! |
---|
| 19 | ! |
---|
[258] | 20 | ! Current revisions: |
---|
[211] | 21 | ! ----------------- |
---|
[1485] | 22 | ! |
---|
| 23 | ! |
---|
| 24 | ! Former revisions: |
---|
| 25 | ! ----------------- |
---|
| 26 | ! $Id: user_init_plant_canopy.f90 1485 2014-10-21 11:09:54Z heinze $ |
---|
| 27 | ! |
---|
| 28 | ! 1484 2014-10-21 10:53:05Z kanani |
---|
[1484] | 29 | ! Changes in the course of the canopy-model modularization: |
---|
| 30 | ! module plant_canopy_model_mod added, |
---|
| 31 | ! definition of array cdc (canopy drag coefficient) removed, since it is now |
---|
| 32 | ! defined purely as a single constant value (see module plant_canopy_model) |
---|
[1354] | 33 | ! |
---|
| 34 | ! 1353 2014-04-08 15:21:23Z heinze |
---|
| 35 | ! REAL constants provided with KIND-attribute |
---|
| 36 | ! |
---|
[1321] | 37 | ! 1320 2014-03-20 08:40:49Z raasch |
---|
[1320] | 38 | ! kind-parameters added to all INTEGER and REAL declaration statements, |
---|
| 39 | ! kinds are defined in new module kinds, |
---|
| 40 | ! old module precision_kind is removed, |
---|
| 41 | ! revision history before 2012 removed, |
---|
| 42 | ! comment fields (!:) to be used for variable explanations added to |
---|
| 43 | ! all variable declaration statements |
---|
[211] | 44 | ! |
---|
[1037] | 45 | ! 1036 2012-10-22 13:43:42Z raasch |
---|
| 46 | ! code put under GPL (PALM 3.9) |
---|
| 47 | ! |
---|
[226] | 48 | ! 211 2008-11-11 04:46:24Z raasch |
---|
| 49 | ! Former file user_interface.f90 split into one file per subroutine |
---|
| 50 | ! |
---|
[211] | 51 | ! Description: |
---|
| 52 | ! ------------ |
---|
| 53 | ! Initialisation of the leaf area density array (for scalar grid points) and |
---|
| 54 | ! the array of the canopy drag coefficient, if the user has not chosen any |
---|
| 55 | ! of the default cases |
---|
| 56 | !------------------------------------------------------------------------------! |
---|
| 57 | |
---|
| 58 | USE arrays_3d |
---|
[1320] | 59 | |
---|
[211] | 60 | USE control_parameters |
---|
[1320] | 61 | |
---|
[211] | 62 | USE indices |
---|
[1320] | 63 | |
---|
| 64 | USE kinds |
---|
[1484] | 65 | |
---|
| 66 | USE plant_canopy_model_mod |
---|
[1320] | 67 | |
---|
[211] | 68 | USE user |
---|
| 69 | |
---|
| 70 | IMPLICIT NONE |
---|
| 71 | |
---|
[1484] | 72 | INTEGER(iwp) :: i !: running index |
---|
| 73 | INTEGER(iwp) :: j !: running index |
---|
[211] | 74 | |
---|
| 75 | ! |
---|
| 76 | !-- Here the user-defined grid initializing actions follow: |
---|
| 77 | |
---|
| 78 | ! |
---|
[1484] | 79 | !-- Set the 3D-array lad_s for user defined canopies |
---|
[211] | 80 | SELECT CASE ( TRIM( canopy_mode ) ) |
---|
| 81 | |
---|
| 82 | CASE ( 'block' ) |
---|
| 83 | ! |
---|
| 84 | !-- Not allowed here since this is the standard case used in init_3d_model. |
---|
| 85 | |
---|
| 86 | CASE ( 'user_defined_canopy_1' ) |
---|
| 87 | ! |
---|
[1484] | 88 | !-- Here the user can define his own forest topography. |
---|
| 89 | !-- The following lines contain an example, where the plant canopy extends |
---|
| 90 | !-- only over the second half of the model domain along x. |
---|
| 91 | !-- Attention: DO-loops have to include the ghost points (nxlg-nxrg, |
---|
| 92 | !-- nysg-nyng), because no exchange of ghost point information is intended, |
---|
| 93 | !-- in order to minimize communication between CPUs |
---|
[667] | 94 | ! DO i = nxlg, nxrg |
---|
[211] | 95 | ! IF ( i >= INT(nx+1/2) ) THEN |
---|
[667] | 96 | ! DO j = nysg, nyng |
---|
[211] | 97 | ! lad_s(:,j,i) = lad(:) |
---|
| 98 | ! ENDDO |
---|
| 99 | ! ELSE |
---|
[1353] | 100 | ! lad_s(:,:,i) = 0.0_wp |
---|
[211] | 101 | ! ENDIF |
---|
| 102 | ! ENDDO |
---|
[1484] | 103 | ! |
---|
[211] | 104 | !-- After definition, please |
---|
| 105 | !-- remove the following three lines! |
---|
[274] | 106 | message_string = 'canopy_mode "' // canopy_mode // & |
---|
| 107 | '" not available yet' |
---|
[258] | 108 | CALL message( 'user_init_plant_canopy', 'UI0007', 0, 1, 0, 6, 0 ) |
---|
| 109 | |
---|
[211] | 110 | CASE DEFAULT |
---|
| 111 | ! |
---|
| 112 | !-- The DEFAULT case is reached if the parameter canopy_mode contains a |
---|
[274] | 113 | !-- wrong character string that is neither recognized in init_3d_model nor |
---|
[211] | 114 | !-- here in user_init_plant_canopy. |
---|
[258] | 115 | message_string = 'unknown canopy_mode "' // canopy_mode // '"' |
---|
| 116 | CALL message( 'user_init_plant_canopy', 'UI0008', 1, 2, 0, 6, 0 ) |
---|
[211] | 117 | |
---|
| 118 | END SELECT |
---|
| 119 | |
---|
| 120 | |
---|
| 121 | END SUBROUTINE user_init_plant_canopy |
---|
| 122 | |
---|