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

Last change on this file since 1669 was 1669, checked in by raasch, 9 years ago

last commit documented

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