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