source: palm/trunk/SOURCE/user_parin.f90 @ 1320

Last change on this file since 1320 was 1320, checked in by raasch, 10 years ago

ONLY-attribute added to USE-statements,
kind-parameters added to all INTEGER and REAL declaration statements,
kinds are defined in new module kinds,
old module precision_kind is removed,
revision history before 2012 removed,
comment fields (!:) to be used for variable explanations added to all variable declaration statements

  • Property svn:keywords set to Id
File size: 4.0 KB
Line 
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-2014 Leibniz Universitaet Hannover
18!--------------------------------------------------------------------------------!
19!
20! Current revisions:
21! -----------------
22! kind-parameters added to all INTEGER and REAL declaration statements,
23! kinds are defined in new module kinds,
24! old module precision_kind is removed,
25! revision history before 2012 removed,
26! comment fields (!:) to be used for variable explanations added to
27! all variable declaration statements
28!
29!
30! Former revisions:
31! -----------------
32! $Id: user_parin.f90 1320 2014-03-20 08:40:49Z raasch $
33!
34! 1036 2012-10-22 13:43:42Z raasch
35! code put under GPL (PALM 3.9)
36!
37! 931 2012-06-08 15:09:28Z maronga
38! Re-enabled check for max_pr_user
39!
40! 841 2012-02-28 12:29:49Z maronga
41! Bugfix: disable max_pr_user check during prior namelist file check
42!
43! 217 2008-12-09 18:00:48Z letzel
44! +topography_grid_convention
45! Former file user_interface.f90 split into one file per subroutine
46!
47! Description:
48! ------------
49! Interface to read user-defined namelist-parameters.
50!------------------------------------------------------------------------------!
51
52    USE control_parameters
53   
54    USE kinds
55   
56    USE pegrid
57   
58    USE statistics
59   
60    USE user
61
62    IMPLICIT NONE
63
64    CHARACTER (LEN=80) ::  zeile   !:
65
66    INTEGER(iwp) ::  i                 !:
67    INTEGER(iwp) ::  j                 !:
68    INTEGER(iwp) ::  max_pr_user_tmp   !:
69
70
71    NAMELIST /userpar/  data_output_pr_user, data_output_user, region,         &
72                        data_output_masks_user
73
74!
75!-- Position the namelist-file at the beginning (it was already opened in
76!-- parin), search for user-defined namelist-group ("userpar", but any other
77!-- name can be choosed) and position the file at this line.
78    REWIND ( 11 )
79
80    zeile = ' '
81    DO   WHILE ( INDEX( zeile, '&userpar' ) == 0 )
82       READ ( 11, '(A)', END=100 )  zeile
83    ENDDO
84    BACKSPACE ( 11 )
85
86!
87!-- Read user-defined namelist
88    READ ( 11, userpar )
89    user_defined_namelist_found = .TRUE.
90
91!
92!-- Determine the number of user-defined profiles and append them to the
93!-- standard data output (data_output_pr)
94    max_pr_user_tmp = 0
95    IF ( data_output_pr_user(1) /= ' ' )  THEN
96       i = 1
97       DO  WHILE ( data_output_pr(i) /= ' '  .AND.  i <= 100 )
98          i = i + 1
99       ENDDO
100       j = 1
101       DO  WHILE ( data_output_pr_user(j) /= ' '  .AND.  j <= 100 )
102          data_output_pr(i) = data_output_pr_user(j)
103          max_pr_user_tmp   = max_pr_user_tmp + 1
104          i = i + 1
105          j = j + 1
106       ENDDO
107    ENDIF
108
109!
110!-- In case of a restart run, the number of user-defined profiles on the
111!-- restart file (already stored in max_pr_user) has to match the one given
112!-- for the current run
113    IF ( TRIM( initializing_actions ) == 'read_restart_data' )  THEN
114       IF ( max_pr_user /= max_pr_user_tmp )  THEN
115          WRITE( message_string, * ) 'the number of user-defined profiles ',   &
116                     'given in &data_output_pr (', max_pr_user_tmp, ') doe',   &
117                     'snot match the one ',                                    &
118                     '&found in the restart file (', max_pr_user,              &
119                                     ')'
120          CALL message( 'user_parin', 'UI0009', 1, 2, 0, 6, 0 )
121       ENDIF
122    ELSE
123       max_pr_user = max_pr_user_tmp
124    ENDIF
125
126100 RETURN
127
128 END SUBROUTINE user_parin
129
Note: See TracBrowser for help on using the repository browser.