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

Last change on this file since 284 was 274, checked in by heinze, 16 years ago

Indentation of the message calls corrected

  • Property svn:keywords set to Id
File size: 2.6 KB
Line 
1 SUBROUTINE user_parin
2
3!------------------------------------------------------------------------------!
4! Current revisions:
5! -----------------
6! Output of messages replaced by message handling routine.
7! topography_grid_convention moved to inipar
8!
9! Former revisions:
10! -----------------
11! $Id: user_parin.f90 274 2009-03-26 15:11:21Z raasch $
12!
13! 217 2008-12-09 18:00:48Z letzel
14! +topography_grid_convention
15! Former file user_interface.f90 split into one file per subroutine
16!
17! Description:
18! ------------
19! Interface to read user-defined namelist-parameters.
20!------------------------------------------------------------------------------!
21
22    USE control_parameters
23    USE pegrid
24    USE statistics
25    USE user
26
27    IMPLICIT NONE
28
29    CHARACTER (LEN=80) ::  zeile
30
31    INTEGER ::  i, j, max_pr_user_tmp
32
33
34    NAMELIST /userpar/  data_output_pr_user, data_output_user, region
35
36!
37!-- Position the namelist-file at the beginning (it was already opened in
38!-- parin), search for user-defined namelist-group ("userpar", but any other
39!-- name can be choosed) and position the file at this line.
40    REWIND ( 11 )
41
42    zeile = ' '
43    DO   WHILE ( INDEX( zeile, '&userpar' ) == 0 )
44       READ ( 11, '(A)', END=100 )  zeile
45    ENDDO
46    BACKSPACE ( 11 )
47
48!
49!-- Read user-defined namelist
50    READ ( 11, userpar )
51    user_defined_namelist_found = .TRUE.
52
53!
54!-- Determine the number of user-defined profiles and append them to the
55!-- standard data output (data_output_pr)
56    max_pr_user_tmp = 0
57    IF ( data_output_pr_user(1) /= ' ' )  THEN
58       i = 1
59       DO  WHILE ( data_output_pr(i) /= ' '  .AND.  i <= 100 )
60          i = i + 1
61       ENDDO
62       j = 1
63       DO  WHILE ( data_output_pr_user(j) /= ' '  .AND.  j <= 100 )
64          data_output_pr(i) = data_output_pr_user(j)
65          max_pr_user_tmp   = max_pr_user_tmp + 1
66          i = i + 1
67          j = j + 1
68       ENDDO
69    ENDIF
70
71!
72!-- In case of a restart run, the number of user-defined profiles on the
73!-- restart file (already stored in max_pr_user) has to match the one given
74!-- for the current run
75    IF ( TRIM( initializing_actions ) == 'read_restart_data' )  THEN
76       IF ( max_pr_user /= max_pr_user_tmp )  THEN
77          WRITE( message_string, * ) 'the number of user-defined profiles ', &
78                     'given in &data_output_pr (', max_pr_user_tmp, ') doe', &
79                     'snot match the one ',                                  &
80                     '&found in the restart file (', max_pr_user,            &
81                                     ')'
82          CALL message( 'user_parin', 'UI0009', 1, 2, 0, 6, 0 )
83       ENDIF
84    ELSE
85       max_pr_user = max_pr_user_tmp
86    ENDIF
87
88100 RETURN
89
90 END SUBROUTINE user_parin
91
Note: See TracBrowser for help on using the repository browser.