1 | SUBROUTINE user_parin |
---|
2 | |
---|
3 | !--------------------------------------------------------------------------------! |
---|
4 | ! This file is part of PALM. |
---|
5 | ! |
---|
6 | ! PALM is free software: you can redistribute it and/or modify it under the terms |
---|
7 | ! of the GNU General Public License as published by the Free Software Foundation, |
---|
8 | ! either version 3 of the License, or (at your option) any later 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-2012 Leibniz University Hannover |
---|
18 | !--------------------------------------------------------------------------------! |
---|
19 | ! |
---|
20 | ! Current revisions: |
---|
21 | ! ----------------- |
---|
22 | ! |
---|
23 | ! |
---|
24 | ! Former revisions: |
---|
25 | ! ----------------- |
---|
26 | ! $Id: user_parin.f90 1037 2012-10-22 14:10:22Z suehring $ |
---|
27 | ! |
---|
28 | ! 1036 2012-10-22 13:43:42Z raasch |
---|
29 | ! code put under GPL (PALM 3.9) |
---|
30 | ! |
---|
31 | ! 931 2012-06-08 15:09:28Z maronga |
---|
32 | ! Re-enabled check for max_pr_user |
---|
33 | ! |
---|
34 | ! 841 2012-02-28 12:29:49Z maronga |
---|
35 | ! Bugfix: disable max_pr_user check during prior namelist file check |
---|
36 | ! |
---|
37 | ! 553 2010-09-01 14:09:06Z weinreis |
---|
38 | ! data_output_mask_user_* replaced by array data_output_masks_user |
---|
39 | ! |
---|
40 | ! 410 2009-12-04 17:05:40Z letzel |
---|
41 | ! masked data output |
---|
42 | ! |
---|
43 | ! 274 2009-03-26 15:11:21Z heinze |
---|
44 | ! Output of messages replaced by message handling routine. |
---|
45 | ! topography_grid_convention moved to inipar |
---|
46 | ! |
---|
47 | ! 217 2008-12-09 18:00:48Z letzel |
---|
48 | ! +topography_grid_convention |
---|
49 | ! Former file user_interface.f90 split into one file per subroutine |
---|
50 | ! |
---|
51 | ! Description: |
---|
52 | ! ------------ |
---|
53 | ! Interface to read user-defined namelist-parameters. |
---|
54 | !------------------------------------------------------------------------------! |
---|
55 | |
---|
56 | USE control_parameters |
---|
57 | USE pegrid |
---|
58 | USE statistics |
---|
59 | USE user |
---|
60 | |
---|
61 | IMPLICIT NONE |
---|
62 | |
---|
63 | CHARACTER (LEN=80) :: zeile |
---|
64 | |
---|
65 | INTEGER :: i, j, max_pr_user_tmp |
---|
66 | |
---|
67 | |
---|
68 | NAMELIST /userpar/ data_output_pr_user, data_output_user, region, & |
---|
69 | data_output_masks_user |
---|
70 | |
---|
71 | ! |
---|
72 | !-- Position the namelist-file at the beginning (it was already opened in |
---|
73 | !-- parin), search for user-defined namelist-group ("userpar", but any other |
---|
74 | !-- name can be choosed) and position the file at this line. |
---|
75 | REWIND ( 11 ) |
---|
76 | |
---|
77 | zeile = ' ' |
---|
78 | DO WHILE ( INDEX( zeile, '&userpar' ) == 0 ) |
---|
79 | READ ( 11, '(A)', END=100 ) zeile |
---|
80 | ENDDO |
---|
81 | BACKSPACE ( 11 ) |
---|
82 | |
---|
83 | ! |
---|
84 | !-- Read user-defined namelist |
---|
85 | READ ( 11, userpar ) |
---|
86 | user_defined_namelist_found = .TRUE. |
---|
87 | |
---|
88 | ! |
---|
89 | !-- Determine the number of user-defined profiles and append them to the |
---|
90 | !-- standard data output (data_output_pr) |
---|
91 | max_pr_user_tmp = 0 |
---|
92 | IF ( data_output_pr_user(1) /= ' ' ) THEN |
---|
93 | i = 1 |
---|
94 | DO WHILE ( data_output_pr(i) /= ' ' .AND. i <= 100 ) |
---|
95 | i = i + 1 |
---|
96 | ENDDO |
---|
97 | j = 1 |
---|
98 | DO WHILE ( data_output_pr_user(j) /= ' ' .AND. j <= 100 ) |
---|
99 | data_output_pr(i) = data_output_pr_user(j) |
---|
100 | max_pr_user_tmp = max_pr_user_tmp + 1 |
---|
101 | i = i + 1 |
---|
102 | j = j + 1 |
---|
103 | ENDDO |
---|
104 | ENDIF |
---|
105 | |
---|
106 | ! |
---|
107 | !-- In case of a restart run, the number of user-defined profiles on the |
---|
108 | !-- restart file (already stored in max_pr_user) has to match the one given |
---|
109 | !-- for the current run |
---|
110 | IF ( TRIM( initializing_actions ) == 'read_restart_data' ) THEN |
---|
111 | IF ( max_pr_user /= max_pr_user_tmp ) THEN |
---|
112 | WRITE( message_string, * ) 'the number of user-defined profiles ', & |
---|
113 | 'given in &data_output_pr (', max_pr_user_tmp, ') doe', & |
---|
114 | 'snot match the one ', & |
---|
115 | '&found in the restart file (', max_pr_user, & |
---|
116 | ')' |
---|
117 | CALL message( 'user_parin', 'UI0009', 1, 2, 0, 6, 0 ) |
---|
118 | ENDIF |
---|
119 | ELSE |
---|
120 | max_pr_user = max_pr_user_tmp |
---|
121 | ENDIF |
---|
122 | |
---|
123 | 100 RETURN |
---|
124 | |
---|
125 | END SUBROUTINE user_parin |
---|
126 | |
---|