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

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

checking possible mismatch of current and required user interface revision

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