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

Last change on this file since 1698 was 1683, checked in by knoop, 8 years ago

last commit documented

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