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