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

Last change on this file since 3248 was 3248, checked in by sward, 6 years ago

Minor format changes

  • Property svn:keywords set to Id
File size: 6.1 KB
RevLine 
[1682]1!> @file user_parin.f90
[2000]2!------------------------------------------------------------------------------!
[2696]3! This file is part of the PALM model system.
[1036]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!
[2718]17! Copyright 1997-2018 Leibniz Universitaet Hannover
[2000]18!------------------------------------------------------------------------------!
[1036]19!
[258]20! Current revisions:
[211]21! -----------------
[1834]22!
[3049]23!
[1321]24! Former revisions:
25! -----------------
26! $Id: user_parin.f90 3248 2018-09-14 09:42:06Z sward $
[3248]27! Minor formating changes
28!
29! 3246 2018-09-13 15:14:50Z sward
[3246]30! Added error handling for input namelist via parin_fail_message
31!
32! 3240 2018-09-12 12:04:40Z Giersch
[3240]33! The check that controls the number of user-defined profiles on the restart file
34! with the one given for the current run has been removed.
35!
36! 3189 2018-08-06 13:18:55Z Giersch
[3189]37! Indent revised
38!
39! 3174 2018-07-26 13:46:50Z Giersch
[3174]40! userpar in READ statement has been changed to user_parameters
41!
42! 3049 2018-05-29 13:52:36Z Giersch
[3049]43! Error messages revised
44!
45! 3045 2018-05-28 07:55:41Z Giersch
[2932]46! renamed userpar to user_parameters
47!
48! 2718 2018-01-02 08:49:38Z maronga
[2716]49! Corrected "Former revisions" section
50!
51! 2696 2017-12-14 17:12:51Z kanani
52! Change in file header (GPL part)
53!
54! 2512 2017-10-04 08:26:59Z raasch
[2512]55! current interface revision number number set to r2512
56!
57! 2298 2017-06-29 09:28:18Z raasch
[2298]58! user interface current revision updated
59!
60! 2101 2017-01-05 16:42:31Z suehring
[1321]61!
[2001]62! 2000 2016-08-20 18:09:15Z knoop
63! Forced header and separation lines into 80 columns
64!
[1834]65! 1833 2016-04-07 14:23:03Z raasch
66! required interface revision changed
67!
[1784]68! 1783 2016-03-06 18:36:17Z raasch
69! required interface revision changed
70!
[1683]71! 1682 2015-10-07 23:56:08Z knoop
72! Code annotations made doxygen readable
73!
[1669]74! 1668 2015-09-23 13:45:36Z raasch
75! current interface revision number number set to r1663
76!
[1667]77! 1666 2015-09-23 07:31:10Z raasch
[1668]78! interface revision number is set to blank
[1667]79!
[1321]80! 1320 2014-03-20 08:40:49Z raasch
[1320]81! kind-parameters added to all INTEGER and REAL declaration statements,
82! kinds are defined in new module kinds,
83! old module precision_kind is removed,
84! revision history before 2012 removed,
85! comment fields (!:) to be used for variable explanations added to
86! all variable declaration statements
[211]87!
[1037]88! 1036 2012-10-22 13:43:42Z raasch
89! code put under GPL (PALM 3.9)
90!
[932]91! 931 2012-06-08 15:09:28Z maronga
92! Re-enabled check for max_pr_user
93!
[842]94! 841 2012-02-28 12:29:49Z maronga
95! Bugfix: disable max_pr_user check during prior namelist file check
96!
[226]97! 217 2008-12-09 18:00:48Z letzel
98! +topography_grid_convention
99! Former file user_interface.f90 split into one file per subroutine
100!
[211]101! Description:
102! ------------
[1682]103!> Interface to read user-defined namelist-parameters.
[211]104!------------------------------------------------------------------------------!
[1682]105 SUBROUTINE user_parin
106 
[211]107
108    USE control_parameters
[1320]109   
110    USE kinds
111   
[211]112    USE pegrid
[1320]113   
[211]114    USE statistics
[1320]115   
[211]116    USE user
117
118    IMPLICIT NONE
119
[2932]120    CHARACTER (LEN=80) ::  line   !<
[211]121
[1682]122    INTEGER(iwp) ::  i                 !<
123    INTEGER(iwp) ::  j                 !<
[211]124
125
[1320]126    NAMELIST /userpar/  data_output_pr_user, data_output_user, region,         &
[553]127                        data_output_masks_user
[2932]128                       
129                       
130    NAMELIST /user_parameters/  data_output_pr_user, data_output_user, region, &
131                        data_output_masks_user
[211]132
133!
[1666]134!-- Set revision number of this default interface version. It will be checked within
135!-- the main program (palm). Please change the revision number in case that the
136!-- current revision does not match with previous revisions (e.g. if routines
137!-- have been added/deleted or if parameter lists in subroutines have been changed).
[2512]138    user_interface_current_revision = 'r2512'
[1666]139
140!
[211]141!-- Position the namelist-file at the beginning (it was already opened in
142!-- parin), search for user-defined namelist-group ("userpar", but any other
143!-- name can be choosed) and position the file at this line.
144    REWIND ( 11 )
145
[2932]146    line = ' '
[3248]147    DO WHILE ( INDEX( line, '&user_parameters' ) == 0 )
[3246]148       READ ( 11, '(A)', END=12 )  line
[211]149    ENDDO
150    BACKSPACE ( 11 )
151
152!
153!-- Read user-defined namelist
[3246]154    READ ( 11, user_parameters, ERR = 10 )
[2932]155
[211]156    user_defined_namelist_found = .TRUE.
157
[3246]158    GOTO 14
[2932]159
[3246]16010  BACKSPACE( 11 )
[3248]161    READ( 11 , '(A)') line
162    CALL parin_fail_message( 'user_parameters', line )
[3246]163
16412  REWIND ( 11 )
165
[2932]166    line = ' ' 
[3248]167    DO WHILE ( INDEX( line, '&userpar' ) == 0 )
[3246]168       READ ( 11, '(A)', END=14 )  line
[2932]169    ENDDO
170    BACKSPACE ( 11 )
171
[211]172!
[2932]173!-- Read user-defined namelist
[3246]174    READ ( 11, userpar, ERR = 13, END = 14 )
175
[2932]176    message_string = 'namelist userpar is deprecated and will be ' //          &
[3046]177                     'removed in near future. &Please use namelist ' //        &
[2932]178                     'user_parameters instead' 
179    CALL message( 'user_parin', 'PA0487', 0, 1, 0, 6, 0 )
[3246]180
[2932]181    user_defined_namelist_found = .TRUE.
182
[3246]183    GOTO 14
184
18513  BACKSPACE( 11 )
[3248]186    READ( 11 , '(A)') line
187    CALL parin_fail_message( 'userpar', line )
[3246]188
[3248]18914  CONTINUE
[3246]190
[2932]191!
[211]192!-- Determine the number of user-defined profiles and append them to the
193!-- standard data output (data_output_pr)
[2932]194    IF ( user_defined_namelist_found )  THEN
195       IF ( data_output_pr_user(1) /= ' ' )  THEN
196          i = 1
[3248]197          DO WHILE ( data_output_pr(i) /= ' '  .AND.  i <= 100 )
[2932]198             i = i + 1
199          ENDDO
200          j = 1
[3248]201          DO WHILE ( data_output_pr_user(j) /= ' '  .AND.  j <= 100 )
[2932]202             data_output_pr(i) = data_output_pr_user(j)
203             max_pr_user_tmp   = max_pr_user_tmp + 1
204             i = i + 1
205             j = j + 1
206          ENDDO
[3189]207       ENDIF
[211]208    ENDIF
[2932]209 
210    RETURN
[211]211
212 END SUBROUTINE user_parin
213
Note: See TracBrowser for help on using the repository browser.