1 | !> @file user_parin.f90 |
---|
2 | !------------------------------------------------------------------------------! |
---|
3 | ! This file is part of the PALM model system. |
---|
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. |
---|
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 | ! |
---|
17 | ! Copyright 1997-2018 Leibniz Universitaet Hannover |
---|
18 | !------------------------------------------------------------------------------! |
---|
19 | ! |
---|
20 | ! Current revisions: |
---|
21 | ! ----------------- |
---|
22 | ! |
---|
23 | ! |
---|
24 | ! Former revisions: |
---|
25 | ! ----------------- |
---|
26 | ! $Id: user_parin.f90 3240 2018-09-12 12:04:40Z Giersch $ |
---|
27 | ! The check that controls the number of user-defined profiles on the restart file |
---|
28 | ! with the one given for the current run has been removed. |
---|
29 | ! |
---|
30 | ! 3189 2018-08-06 13:18:55Z Giersch |
---|
31 | ! Indent revised |
---|
32 | ! |
---|
33 | ! 3174 2018-07-26 13:46:50Z Giersch |
---|
34 | ! userpar in READ statement has been changed to user_parameters |
---|
35 | ! |
---|
36 | ! 3049 2018-05-29 13:52:36Z Giersch |
---|
37 | ! Error messages revised |
---|
38 | ! |
---|
39 | ! 3045 2018-05-28 07:55:41Z Giersch |
---|
40 | ! renamed userpar to user_parameters |
---|
41 | ! |
---|
42 | ! 2718 2018-01-02 08:49:38Z maronga |
---|
43 | ! Corrected "Former revisions" section |
---|
44 | ! |
---|
45 | ! 2696 2017-12-14 17:12:51Z kanani |
---|
46 | ! Change in file header (GPL part) |
---|
47 | ! |
---|
48 | ! 2512 2017-10-04 08:26:59Z raasch |
---|
49 | ! current interface revision number number set to r2512 |
---|
50 | ! |
---|
51 | ! 2298 2017-06-29 09:28:18Z raasch |
---|
52 | ! user interface current revision updated |
---|
53 | ! |
---|
54 | ! 2101 2017-01-05 16:42:31Z suehring |
---|
55 | ! |
---|
56 | ! 2000 2016-08-20 18:09:15Z knoop |
---|
57 | ! Forced header and separation lines into 80 columns |
---|
58 | ! |
---|
59 | ! 1833 2016-04-07 14:23:03Z raasch |
---|
60 | ! required interface revision changed |
---|
61 | ! |
---|
62 | ! 1783 2016-03-06 18:36:17Z raasch |
---|
63 | ! required interface revision changed |
---|
64 | ! |
---|
65 | ! 1682 2015-10-07 23:56:08Z knoop |
---|
66 | ! Code annotations made doxygen readable |
---|
67 | ! |
---|
68 | ! 1668 2015-09-23 13:45:36Z raasch |
---|
69 | ! current interface revision number number set to r1663 |
---|
70 | ! |
---|
71 | ! 1666 2015-09-23 07:31:10Z raasch |
---|
72 | ! interface revision number is set to blank |
---|
73 | ! |
---|
74 | ! 1320 2014-03-20 08:40:49Z raasch |
---|
75 | ! kind-parameters added to all INTEGER and REAL declaration statements, |
---|
76 | ! kinds are defined in new module kinds, |
---|
77 | ! old module precision_kind is removed, |
---|
78 | ! revision history before 2012 removed, |
---|
79 | ! comment fields (!:) to be used for variable explanations added to |
---|
80 | ! all variable declaration statements |
---|
81 | ! |
---|
82 | ! 1036 2012-10-22 13:43:42Z raasch |
---|
83 | ! code put under GPL (PALM 3.9) |
---|
84 | ! |
---|
85 | ! 931 2012-06-08 15:09:28Z maronga |
---|
86 | ! Re-enabled check for max_pr_user |
---|
87 | ! |
---|
88 | ! 841 2012-02-28 12:29:49Z maronga |
---|
89 | ! Bugfix: disable max_pr_user check during prior namelist file check |
---|
90 | ! |
---|
91 | ! 217 2008-12-09 18:00:48Z letzel |
---|
92 | ! +topography_grid_convention |
---|
93 | ! Former file user_interface.f90 split into one file per subroutine |
---|
94 | ! |
---|
95 | ! Description: |
---|
96 | ! ------------ |
---|
97 | !> Interface to read user-defined namelist-parameters. |
---|
98 | !------------------------------------------------------------------------------! |
---|
99 | SUBROUTINE user_parin |
---|
100 | |
---|
101 | |
---|
102 | USE control_parameters |
---|
103 | |
---|
104 | USE kinds |
---|
105 | |
---|
106 | USE pegrid |
---|
107 | |
---|
108 | USE statistics |
---|
109 | |
---|
110 | USE user |
---|
111 | |
---|
112 | IMPLICIT NONE |
---|
113 | |
---|
114 | CHARACTER (LEN=80) :: line !< |
---|
115 | |
---|
116 | INTEGER(iwp) :: i !< |
---|
117 | INTEGER(iwp) :: j !< |
---|
118 | |
---|
119 | |
---|
120 | NAMELIST /userpar/ data_output_pr_user, data_output_user, region, & |
---|
121 | data_output_masks_user |
---|
122 | |
---|
123 | |
---|
124 | NAMELIST /user_parameters/ data_output_pr_user, data_output_user, region, & |
---|
125 | data_output_masks_user |
---|
126 | |
---|
127 | ! |
---|
128 | !-- Set revision number of this default interface version. It will be checked within |
---|
129 | !-- the main program (palm). Please change the revision number in case that the |
---|
130 | !-- current revision does not match with previous revisions (e.g. if routines |
---|
131 | !-- have been added/deleted or if parameter lists in subroutines have been changed). |
---|
132 | user_interface_current_revision = 'r2512' |
---|
133 | |
---|
134 | ! |
---|
135 | !-- Position the namelist-file at the beginning (it was already opened in |
---|
136 | !-- parin), search for user-defined namelist-group ("userpar", but any other |
---|
137 | !-- name can be choosed) and position the file at this line. |
---|
138 | REWIND ( 11 ) |
---|
139 | |
---|
140 | line = ' ' |
---|
141 | DO WHILE ( INDEX( line, '&user_parameters' ) == 0 ) |
---|
142 | READ ( 11, '(A)', END=10 ) line |
---|
143 | ENDDO |
---|
144 | BACKSPACE ( 11 ) |
---|
145 | |
---|
146 | ! |
---|
147 | !-- Read user-defined namelist |
---|
148 | READ ( 11, user_parameters ) |
---|
149 | |
---|
150 | user_defined_namelist_found = .TRUE. |
---|
151 | |
---|
152 | GOTO 12 |
---|
153 | |
---|
154 | |
---|
155 | 10 REWIND ( 11 ) |
---|
156 | |
---|
157 | line = ' ' |
---|
158 | DO WHILE ( INDEX( line, '&userpar' ) == 0 ) |
---|
159 | READ ( 11, '(A)', END=12 ) line |
---|
160 | ENDDO |
---|
161 | BACKSPACE ( 11 ) |
---|
162 | |
---|
163 | ! |
---|
164 | !-- Read user-defined namelist |
---|
165 | READ ( 11, userpar ) |
---|
166 | |
---|
167 | |
---|
168 | message_string = 'namelist userpar is deprecated and will be ' // & |
---|
169 | 'removed in near future. &Please use namelist ' // & |
---|
170 | 'user_parameters instead' |
---|
171 | CALL message( 'user_parin', 'PA0487', 0, 1, 0, 6, 0 ) |
---|
172 | |
---|
173 | user_defined_namelist_found = .TRUE. |
---|
174 | |
---|
175 | |
---|
176 | 12 CONTINUE |
---|
177 | |
---|
178 | ! |
---|
179 | !-- Determine the number of user-defined profiles and append them to the |
---|
180 | !-- standard data output (data_output_pr) |
---|
181 | IF ( user_defined_namelist_found ) THEN |
---|
182 | IF ( data_output_pr_user(1) /= ' ' ) THEN |
---|
183 | i = 1 |
---|
184 | DO WHILE ( data_output_pr(i) /= ' ' .AND. i <= 100 ) |
---|
185 | i = i + 1 |
---|
186 | ENDDO |
---|
187 | j = 1 |
---|
188 | DO WHILE ( data_output_pr_user(j) /= ' ' .AND. j <= 100 ) |
---|
189 | data_output_pr(i) = data_output_pr_user(j) |
---|
190 | max_pr_user_tmp = max_pr_user_tmp + 1 |
---|
191 | i = i + 1 |
---|
192 | j = j + 1 |
---|
193 | ENDDO |
---|
194 | ENDIF |
---|
195 | ENDIF |
---|
196 | |
---|
197 | RETURN |
---|
198 | |
---|
199 | END SUBROUTINE user_parin |
---|
200 | |
---|