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

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