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

Last change on this file since 947 was 932, checked in by maronga, 12 years ago

last commit documented

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