[1682] | 1 | !> @file user_init_plant_canopy.f90 |
---|
[2000] | 2 | !------------------------------------------------------------------------------! |
---|
[2696] | 3 | ! This file is part of the PALM model system. |
---|
[1036] | 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 | ! |
---|
[4360] | 17 | ! Copyright 1997-2020 Leibniz Universitaet Hannover |
---|
[2000] | 18 | !------------------------------------------------------------------------------! |
---|
[1036] | 19 | ! |
---|
[258] | 20 | ! Current revisions: |
---|
[211] | 21 | ! ----------------- |
---|
[1485] | 22 | ! |
---|
[2001] | 23 | ! |
---|
[1485] | 24 | ! Former revisions: |
---|
| 25 | ! ----------------- |
---|
| 26 | ! $Id: user_init_plant_canopy.f90 4360 2020-01-07 11:25:50Z maronga $ |
---|
[4341] | 27 | ! Renamed canopy_mode 'block' to 'homogeneous' |
---|
| 28 | ! |
---|
| 29 | ! 4182 2019-08-22 15:20:23Z scharf |
---|
[4182] | 30 | ! Corrected "Former revisions" section |
---|
| 31 | ! |
---|
| 32 | ! 3768 2019-02-27 14:35:58Z raasch |
---|
[3768] | 33 | ! unused variables commented out to avoid compiler warnings |
---|
| 34 | ! |
---|
| 35 | ! 3655 2019-01-07 16:51:22Z knoop |
---|
[2716] | 36 | ! Corrected "Former revisions" section |
---|
[1485] | 37 | ! |
---|
[4182] | 38 | ! 211 2008-11-11 04:46:24Z raasch |
---|
| 39 | ! Former file user_interface.f90 split into one file per subroutine |
---|
| 40 | ! |
---|
[211] | 41 | ! Description: |
---|
| 42 | ! ------------ |
---|
[1682] | 43 | !> Initialisation of the leaf area density array (for scalar grid points) and |
---|
| 44 | !> the array of the canopy drag coefficient, if the user has not chosen any |
---|
| 45 | !> of the default cases |
---|
[211] | 46 | !------------------------------------------------------------------------------! |
---|
[1682] | 47 | SUBROUTINE user_init_plant_canopy |
---|
| 48 | |
---|
[211] | 49 | |
---|
| 50 | USE arrays_3d |
---|
[1320] | 51 | |
---|
[211] | 52 | USE control_parameters |
---|
[1320] | 53 | |
---|
[211] | 54 | USE indices |
---|
[1320] | 55 | |
---|
| 56 | USE kinds |
---|
[1484] | 57 | |
---|
| 58 | USE plant_canopy_model_mod |
---|
[1320] | 59 | |
---|
[211] | 60 | USE user |
---|
| 61 | |
---|
| 62 | IMPLICIT NONE |
---|
| 63 | |
---|
[3768] | 64 | ! INTEGER(iwp) :: i !< running index |
---|
| 65 | ! INTEGER(iwp) :: j !< running index |
---|
[211] | 66 | |
---|
| 67 | ! |
---|
| 68 | !-- Here the user-defined grid initializing actions follow: |
---|
| 69 | |
---|
| 70 | ! |
---|
[1484] | 71 | !-- Set the 3D-array lad_s for user defined canopies |
---|
[211] | 72 | SELECT CASE ( TRIM( canopy_mode ) ) |
---|
| 73 | |
---|
[4341] | 74 | CASE ( 'homogeneous' ) |
---|
[211] | 75 | ! |
---|
| 76 | !-- Not allowed here since this is the standard case used in init_3d_model. |
---|
| 77 | |
---|
| 78 | CASE ( 'user_defined_canopy_1' ) |
---|
| 79 | ! |
---|
[1484] | 80 | !-- Here the user can define his own forest topography. |
---|
| 81 | !-- The following lines contain an example, where the plant canopy extends |
---|
| 82 | !-- only over the second half of the model domain along x. |
---|
| 83 | !-- Attention: DO-loops have to include the ghost points (nxlg-nxrg, |
---|
| 84 | !-- nysg-nyng), because no exchange of ghost point information is intended, |
---|
[1951] | 85 | !-- in order to minimize communication between CPUs. |
---|
[667] | 86 | ! DO i = nxlg, nxrg |
---|
[1951] | 87 | ! IF ( i >= INT( ( nx+1 ) / 2 ) ) THEN |
---|
[667] | 88 | ! DO j = nysg, nyng |
---|
[211] | 89 | ! lad_s(:,j,i) = lad(:) |
---|
| 90 | ! ENDDO |
---|
| 91 | ! ELSE |
---|
[1353] | 92 | ! lad_s(:,:,i) = 0.0_wp |
---|
[211] | 93 | ! ENDIF |
---|
| 94 | ! ENDDO |
---|
[1484] | 95 | ! |
---|
[211] | 96 | !-- After definition, please |
---|
| 97 | !-- remove the following three lines! |
---|
[274] | 98 | message_string = 'canopy_mode "' // canopy_mode // & |
---|
| 99 | '" not available yet' |
---|
[258] | 100 | CALL message( 'user_init_plant_canopy', 'UI0007', 0, 1, 0, 6, 0 ) |
---|
| 101 | |
---|
[211] | 102 | CASE DEFAULT |
---|
| 103 | ! |
---|
| 104 | !-- The DEFAULT case is reached if the parameter canopy_mode contains a |
---|
[274] | 105 | !-- wrong character string that is neither recognized in init_3d_model nor |
---|
[211] | 106 | !-- here in user_init_plant_canopy. |
---|
[258] | 107 | message_string = 'unknown canopy_mode "' // canopy_mode // '"' |
---|
| 108 | CALL message( 'user_init_plant_canopy', 'UI0008', 1, 2, 0, 6, 0 ) |
---|
[211] | 109 | |
---|
| 110 | END SELECT |
---|
| 111 | |
---|
| 112 | |
---|
| 113 | END SUBROUTINE user_init_plant_canopy |
---|
| 114 | |
---|