Changeset 4648 for palm/trunk/SOURCE/init_vertical_profiles.f90
- Timestamp:
- Aug 25, 2020 7:52:08 AM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
palm/trunk/SOURCE/init_vertical_profiles.f90
r4481 r4648 1 1 !> @file ocean_mod.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 2017-2020 Leibniz Universitaet Hannover 18 !-------------------------------------------------------------------------------- !17 !--------------------------------------------------------------------------------------------------! 19 18 ! 20 19 ! Current revisions: 21 20 ! ----------------- 22 ! 23 ! 21 ! 22 ! 24 23 ! Former revisions: 25 24 ! ----------------- 26 25 ! $Id$ 27 ! split from check_parameters as separate file to avoid circular dependency 28 ! with ocean_mod 26 ! file re-formatted to follow the PALM coding standard 29 27 ! 30 ! 28 ! 4481 2020-03-31 18:55:54Z maronga 29 ! split from check_parameters as separate file to avoid circular dependency with ocean_mod 30 ! 31 ! 31 32 ! 32 33 ! … … 38 39 ! ------------ 39 40 !> Inititalizes the vertical profiles of scalar quantities. 40 !------------------------------------------------------------------------------ !41 SUBROUTINE init_vertical_profiles( vertical_gradient_level_ind, &42 vertical_gradient_level, &43 vertical_gradient, initial_profile, &41 !--------------------------------------------------------------------------------------------------! 42 SUBROUTINE init_vertical_profiles( vertical_gradient_level_ind, & 43 vertical_gradient_level, & 44 vertical_gradient, initial_profile, & 44 45 surface_value, bc_top_gradient ) 45 46 46 USE arrays_3d, &47 USE arrays_3d, & 47 48 ONLY: dzu, zu 48 49 49 USE control_parameters, &50 USE control_parameters, & 50 51 ONLY: ocean_mode 51 52 52 USE indices, &53 USE indices, & 53 54 ONLY: nz, nzt 54 55 … … 59 60 INTEGER(iwp) :: i !< loop counter 60 61 INTEGER(iwp) :: k !< loop counter 62 61 63 INTEGER(iwp), DIMENSION(1:10) :: vertical_gradient_level_ind !< vertical grid indices for gradient levels 62 64 … … 77 79 DO k = 1, nzt+1 78 80 IF ( i < 11 ) THEN 79 IF ( vertical_gradient_level(i) < zu(k) .AND. &81 IF ( vertical_gradient_level(i) < zu(k) .AND. & 80 82 vertical_gradient_level(i) >= 0.0_wp ) THEN 81 83 gradient = vertical_gradient(i) / 100.0_wp … … 103 105 104 106 ! 105 !-- In ocean mode, profiles are constructed starting from the ocean surface, 106 !-- which is at the topof the model domain107 !-- In ocean mode, profiles are constructed starting from the ocean surface, which is at the top 108 !-- of the model domain 107 109 vertical_gradient_level_ind(1) = nzt+1 108 110 DO k = nzt, 0, -1 109 111 IF ( i < 11 ) THEN 110 IF ( vertical_gradient_level(i) > zu(k) .AND. &112 IF ( vertical_gradient_level(i) > zu(k) .AND. & 111 113 vertical_gradient_level(i) <= 0.0_wp ) THEN 112 114 gradient = vertical_gradient(i) / 100.0_wp … … 119 121 initial_profile(k) = initial_profile(k+1) - dzu(k+1) * gradient 120 122 ELSE 121 initial_profile(k) = surface_value - 0.5_wp * dzu(k+1) * & 122 gradient 123 initial_profile(k+1) = surface_value + 0.5_wp * dzu(k+1) * & 124 gradient 123 initial_profile(k) = surface_value - 0.5_wp * dzu(k+1) * gradient 124 initial_profile(k+1) = surface_value + 0.5_wp * dzu(k+1) * gradient 125 125 ENDIF 126 126 ELSE … … 143 143 ! 144 144 !-- Store gradient at the top boundary for possible Neumann boundary condition 145 bc_top_gradient = ( initial_profile(nzt+1) - initial_profile(nzt) ) / & 146 dzu(nzt+1) 145 bc_top_gradient = ( initial_profile(nzt+1) - initial_profile(nzt) ) / dzu(nzt+1) 147 146 148 147 END SUBROUTINE init_vertical_profiles
Note: See TracChangeset
for help on using the changeset viewer.