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

Last change on this file since 211 was 211, checked in by raasch, 13 years ago

user interface was split into one single file per subroutine

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