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

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

last commit documented

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