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

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