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

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