Changeset 4498 for palm/trunk/SOURCE/user_init_grid.f90
- Timestamp:
- Apr 15, 2020 2:26:31 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
palm/trunk/SOURCE/user_init_grid.f90
r4360 r4498 1 1 !> @file user_init_grid.f90 2 !------------------------------------------------------------------------------ !2 !--------------------------------------------------------------------------------------------------! 3 3 ! This file is part of the PALM model system. 4 4 ! 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. 5 ! PALM is free software: you can redistribute it and/or modify it under the terms of the GNU General 6 ! Public License as published by the Free Software Foundation, either version 3 of the License, or 7 ! (at your option) any later version. 9 8 ! 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 FOR12 ! A PARTICULAR PURPOSE. See the GNU GeneralPublic License for more details.9 ! PALM is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the 10 ! implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General 11 ! Public License for more details. 13 12 ! 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/>.13 ! You should have received a copy of the GNU General Public License along with PALM. If not, see 14 ! <http://www.gnu.org/licenses/>. 16 15 ! 17 16 ! Copyright 1997-2020 Leibniz Universitaet Hannover 18 !------------------------------------------------------------------------------! 17 !--------------------------------------------------------------------------------------------------! 18 ! 19 19 ! 20 20 ! Current revisions: … … 25 25 ! ----------------- 26 26 ! $Id$ 27 ! file re-formatted to follow the PALM coding standard 28 ! 29 ! 30 ! 4360 2020-01-07 11:25:50Z suehring 27 31 ! Corrected "Former revisions" section 28 ! 32 ! 29 33 ! 3768 2019-02-27 14:35:58Z raasch 30 34 ! variables commented + statement added to avoid compiler warnings about unused variables 31 ! 35 ! 32 36 ! 3655 2019-01-07 16:51:22Z knoop 33 37 ! dz was replaced by dz(1) … … 40 44 ! ------------ 41 45 !> Execution of user-defined grid initializing actions 42 !------------------------------------------------------------------------------ !46 !--------------------------------------------------------------------------------------------------! 43 47 SUBROUTINE user_init_grid( topo_3d ) 44 48 45 49 46 50 USE control_parameters 47 51 48 52 USE indices 49 53 50 54 USE kinds 51 55 52 56 USE user 53 57 54 58 IMPLICIT NONE 55 59 56 ! INTEGER(iwp) :: k_topo 57 INTEGER(iwp), DIMENSION(nzb:nzt+1,nysg:nyng,nxlg:nxrg) :: topo_3d 60 ! INTEGER(iwp) :: k_topo !< topography top index 61 INTEGER(iwp), DIMENSION(nzb:nzt+1,nysg:nyng,nxlg:nxrg) :: topo_3d !< 3D topography field 58 62 59 63 ! REAL(wp) :: h_topo !< user-defined topography height … … 78 82 CASE ( 'user_defined_topography_1' ) 79 83 ! 80 !-- Here the user can define hisown topography.84 !-- Here the user can define their own topography. 81 85 !-- After definition, please remove the following three lines! 82 86 message_string = 'topography "' // topography // '" not available yet' 83 87 CALL message( 'user_init_grid', 'UI0005', 1, 2, 0, 6, 0 ) 84 88 ! 85 !-- The user is allowed to set surface-mounted as well as non-surface 86 !-- mounted topography (e.g. overhanging structures). For both, use 87 !-- 3D array topo_3d and set bit 0. The convention is: bit is zero inside 88 !-- topography, bit is 1 for atmospheric grid point. 89 !-- The following example shows how to prescribe sine-like topography 90 !-- along x-direction with amplitude of 10 * dz(1) and wavelength 10 * dy. 89 !-- The user is allowed to set surface-mounted as well as non-surface mounted topography 90 !-- (e.g. overhanging structures). For both, use 3D array topo_3d and set bit 0. The 91 !-- convention is: bit is zero inside topography, bit is 1 for atmospheric grid point. 92 !-- The following example shows how to prescribe sine-like topography along x-direction with 93 !-- amplitude of 10 * dz(1) and wavelength 10 * dy. 91 94 ! DO i = nxlg, nxrg 92 ! h_topo = 10.0_wp * dz(1) * ( SIN(3.14_wp*0.5_wp)*i*dx / ( 5.0_wp * dy ) )**293 ! 95 ! h_topo = 10.0_wp * dz(1) * ( SIN( 3.14_wp * 0.5_wp) * i * dx / ( 5.0_wp * dy ) )**2 96 ! 94 97 ! k_topo = MINLOC( ABS( zw - h_topo ), 1 ) - 1 95 ! 96 ! topo_3d(k_topo+1:nzt+1,:,i) = & 97 ! IBSET( topo_3d(k_topo+1:nzt+1,:,i), 0 ) 98 ! ENDDO 99 ! 98 ! 99 ! topo_3d(k_topo+1:nzt+1,:,i) = IBSET( topo_3d(k_topo+1:nzt+1,:,i), 0 ) 100 ! ENDDO 101 ! 100 102 ! CALL exchange_horiz_int( topo_3d, nys, nyn, nxl, nxr, nzt, nbgp ) 101 103 102 104 CASE DEFAULT 103 105 ! 104 !-- The DEFAULT case is reached if the parameter topography contains a 105 !-- wrong character string that is neither recognized in init_grid nor 106 !-- here in user_init_grid. 106 !-- The DEFAULT case is reached if the parameter topography contains a wrong character string 107 !-- that is neither recognized in init_grid nor here in user_init_grid. 107 108 message_string = 'unknown topography "' // topography // '"' 108 109 CALL message( 'user_init_grid', 'UI0006', 1, 2, 0, 6, 0 ) … … 110 111 END SELECT 111 112 112 113 114 115 113 END SUBROUTINE user_init_grid 116 114
Note: See TracChangeset
for help on using the changeset viewer.