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

Last change on this file since 2000 was 2000, checked in by knoop, 8 years ago

Forced header and separation lines into 80 columns

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