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

Last change on this file since 1036 was 1036, checked in by raasch, 11 years ago

code has been put under the GNU General Public License (v3)

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