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

Last change on this file since 1682 was 1682, checked in by knoop, 9 years ago

Code annotations made doxygen readable

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