1 | !> @file user_parin.f90 |
---|
2 | !--------------------------------------------------------------------------------! |
---|
3 | ! This file is part of PALM. |
---|
4 | ! |
---|
5 | ! PALM is free software: you can redistribute it and/or modify it under the terms |
---|
6 | ! of the GNU General Public License as published by the Free Software Foundation, |
---|
7 | ! either version 3 of the License, or (at your option) any later version. |
---|
8 | ! |
---|
9 | ! PALM is distributed in the hope that it will be useful, but WITHOUT ANY |
---|
10 | ! WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR |
---|
11 | ! A PARTICULAR PURPOSE. See the GNU General Public License for more details. |
---|
12 | ! |
---|
13 | ! You should have received a copy of the GNU General Public License along with |
---|
14 | ! PALM. If not, see <http://www.gnu.org/licenses/>. |
---|
15 | ! |
---|
16 | ! Copyright 1997-2016 Leibniz Universitaet Hannover |
---|
17 | !--------------------------------------------------------------------------------! |
---|
18 | ! |
---|
19 | ! Current revisions: |
---|
20 | ! ----------------- |
---|
21 | ! |
---|
22 | ! |
---|
23 | ! Former revisions: |
---|
24 | ! ----------------- |
---|
25 | ! $Id: user_parin.f90 1834 2016-04-07 14:34:20Z hoffmann $ |
---|
26 | ! |
---|
27 | ! 1833 2016-04-07 14:23:03Z raasch |
---|
28 | ! required interface revision changed |
---|
29 | ! |
---|
30 | ! 1783 2016-03-06 18:36:17Z raasch |
---|
31 | ! required interface revision changed |
---|
32 | ! |
---|
33 | ! 1682 2015-10-07 23:56:08Z knoop |
---|
34 | ! Code annotations made doxygen readable |
---|
35 | ! |
---|
36 | ! 1668 2015-09-23 13:45:36Z raasch |
---|
37 | ! current interface revision number number set to r1663 |
---|
38 | ! |
---|
39 | ! 1666 2015-09-23 07:31:10Z raasch |
---|
40 | ! interface revision number is set to blank |
---|
41 | ! |
---|
42 | ! 1320 2014-03-20 08:40:49Z raasch |
---|
43 | ! kind-parameters added to all INTEGER and REAL declaration statements, |
---|
44 | ! kinds are defined in new module kinds, |
---|
45 | ! old module precision_kind is removed, |
---|
46 | ! revision history before 2012 removed, |
---|
47 | ! comment fields (!:) to be used for variable explanations added to |
---|
48 | ! all variable declaration statements |
---|
49 | ! |
---|
50 | ! 1036 2012-10-22 13:43:42Z raasch |
---|
51 | ! code put under GPL (PALM 3.9) |
---|
52 | ! |
---|
53 | ! 931 2012-06-08 15:09:28Z maronga |
---|
54 | ! Re-enabled check for max_pr_user |
---|
55 | ! |
---|
56 | ! 841 2012-02-28 12:29:49Z maronga |
---|
57 | ! Bugfix: disable max_pr_user check during prior namelist file check |
---|
58 | ! |
---|
59 | ! 217 2008-12-09 18:00:48Z letzel |
---|
60 | ! +topography_grid_convention |
---|
61 | ! Former file user_interface.f90 split into one file per subroutine |
---|
62 | ! |
---|
63 | ! Description: |
---|
64 | ! ------------ |
---|
65 | !> Interface to read user-defined namelist-parameters. |
---|
66 | !------------------------------------------------------------------------------! |
---|
67 | SUBROUTINE user_parin |
---|
68 | |
---|
69 | |
---|
70 | USE control_parameters |
---|
71 | |
---|
72 | USE kinds |
---|
73 | |
---|
74 | USE pegrid |
---|
75 | |
---|
76 | USE statistics |
---|
77 | |
---|
78 | USE user |
---|
79 | |
---|
80 | IMPLICIT NONE |
---|
81 | |
---|
82 | CHARACTER (LEN=80) :: zeile !< |
---|
83 | |
---|
84 | INTEGER(iwp) :: i !< |
---|
85 | INTEGER(iwp) :: j !< |
---|
86 | INTEGER(iwp) :: max_pr_user_tmp !< |
---|
87 | |
---|
88 | |
---|
89 | NAMELIST /userpar/ data_output_pr_user, data_output_user, region, & |
---|
90 | data_output_masks_user |
---|
91 | |
---|
92 | ! |
---|
93 | !-- Set revision number of this default interface version. It will be checked within |
---|
94 | !-- the main program (palm). Please change the revision number in case that the |
---|
95 | !-- current revision does not match with previous revisions (e.g. if routines |
---|
96 | !-- have been added/deleted or if parameter lists in subroutines have been changed). |
---|
97 | user_interface_current_revision = 'r1819' |
---|
98 | |
---|
99 | ! |
---|
100 | !-- Position the namelist-file at the beginning (it was already opened in |
---|
101 | !-- parin), search for user-defined namelist-group ("userpar", but any other |
---|
102 | !-- name can be choosed) and position the file at this line. |
---|
103 | REWIND ( 11 ) |
---|
104 | |
---|
105 | zeile = ' ' |
---|
106 | DO WHILE ( INDEX( zeile, '&userpar' ) == 0 ) |
---|
107 | READ ( 11, '(A)', END=100 ) zeile |
---|
108 | ENDDO |
---|
109 | BACKSPACE ( 11 ) |
---|
110 | |
---|
111 | ! |
---|
112 | !-- Read user-defined namelist |
---|
113 | READ ( 11, userpar ) |
---|
114 | user_defined_namelist_found = .TRUE. |
---|
115 | |
---|
116 | ! |
---|
117 | !-- Determine the number of user-defined profiles and append them to the |
---|
118 | !-- standard data output (data_output_pr) |
---|
119 | max_pr_user_tmp = 0 |
---|
120 | IF ( data_output_pr_user(1) /= ' ' ) THEN |
---|
121 | i = 1 |
---|
122 | DO WHILE ( data_output_pr(i) /= ' ' .AND. i <= 100 ) |
---|
123 | i = i + 1 |
---|
124 | ENDDO |
---|
125 | j = 1 |
---|
126 | DO WHILE ( data_output_pr_user(j) /= ' ' .AND. j <= 100 ) |
---|
127 | data_output_pr(i) = data_output_pr_user(j) |
---|
128 | max_pr_user_tmp = max_pr_user_tmp + 1 |
---|
129 | i = i + 1 |
---|
130 | j = j + 1 |
---|
131 | ENDDO |
---|
132 | ENDIF |
---|
133 | |
---|
134 | ! |
---|
135 | !-- In case of a restart run, the number of user-defined profiles on the |
---|
136 | !-- restart file (already stored in max_pr_user) has to match the one given |
---|
137 | !-- for the current run |
---|
138 | IF ( TRIM( initializing_actions ) == 'read_restart_data' ) THEN |
---|
139 | IF ( max_pr_user /= max_pr_user_tmp ) THEN |
---|
140 | WRITE( message_string, * ) 'the number of user-defined profiles ', & |
---|
141 | 'given in &data_output_pr (', max_pr_user_tmp, ') doe', & |
---|
142 | 'snot match the one ', & |
---|
143 | '&found in the restart file (', max_pr_user, & |
---|
144 | ')' |
---|
145 | CALL message( 'user_parin', 'UI0009', 1, 2, 0, 6, 0 ) |
---|
146 | ENDIF |
---|
147 | ELSE |
---|
148 | max_pr_user = max_pr_user_tmp |
---|
149 | ENDIF |
---|
150 | |
---|
151 | 100 RETURN |
---|
152 | |
---|
153 | END SUBROUTINE user_parin |
---|
154 | |
---|