[211] | 1 | SUBROUTINE user_parin |
---|
| 2 | |
---|
| 3 | !------------------------------------------------------------------------------! |
---|
[258] | 4 | ! Current revisions: |
---|
[211] | 5 | ! ----------------- |
---|
[392] | 6 | ! |
---|
[211] | 7 | ! |
---|
| 8 | ! Former revisions: |
---|
| 9 | ! ----------------- |
---|
| 10 | ! $Id: user_parin.f90 449 2010-02-02 11:23:59Z raasch $ |
---|
| 11 | ! |
---|
[449] | 12 | ! 410 2009-12-04 17:05:40Z letzel |
---|
| 13 | ! masked data output |
---|
| 14 | ! |
---|
[392] | 15 | ! 274 2009-03-26 15:11:21Z heinze |
---|
| 16 | ! Output of messages replaced by message handling routine. |
---|
| 17 | ! topography_grid_convention moved to inipar |
---|
| 18 | ! |
---|
[226] | 19 | ! 217 2008-12-09 18:00:48Z letzel |
---|
| 20 | ! +topography_grid_convention |
---|
| 21 | ! Former file user_interface.f90 split into one file per subroutine |
---|
| 22 | ! |
---|
[211] | 23 | ! Description: |
---|
| 24 | ! ------------ |
---|
| 25 | ! Interface to read user-defined namelist-parameters. |
---|
| 26 | !------------------------------------------------------------------------------! |
---|
| 27 | |
---|
| 28 | USE control_parameters |
---|
| 29 | USE pegrid |
---|
| 30 | USE statistics |
---|
| 31 | USE user |
---|
| 32 | |
---|
| 33 | IMPLICIT NONE |
---|
| 34 | |
---|
| 35 | CHARACTER (LEN=80) :: zeile |
---|
| 36 | |
---|
| 37 | INTEGER :: i, j, max_pr_user_tmp |
---|
| 38 | |
---|
| 39 | |
---|
[410] | 40 | NAMELIST /userpar/ data_output_pr_user, data_output_user, region, & |
---|
| 41 | data_output_mask_user_01, data_output_mask_user_02, & |
---|
| 42 | data_output_mask_user_03, data_output_mask_user_04, & |
---|
| 43 | data_output_mask_user_05, data_output_mask_user_06, & |
---|
| 44 | data_output_mask_user_07, data_output_mask_user_08, & |
---|
| 45 | data_output_mask_user_09, data_output_mask_user_10, & |
---|
| 46 | data_output_mask_user_11, data_output_mask_user_12, & |
---|
| 47 | data_output_mask_user_13, data_output_mask_user_14, & |
---|
| 48 | data_output_mask_user_15, data_output_mask_user_16, & |
---|
| 49 | data_output_mask_user_17, data_output_mask_user_18, & |
---|
| 50 | data_output_mask_user_19, data_output_mask_user_20 |
---|
[211] | 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 |
---|
[274] | 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, & |
---|
[258] | 97 | ')' |
---|
| 98 | CALL message( 'user_parin', 'UI0009', 1, 2, 0, 6, 0 ) |
---|
[211] | 99 | ENDIF |
---|
| 100 | ELSE |
---|
| 101 | max_pr_user = max_pr_user_tmp |
---|
| 102 | ENDIF |
---|
| 103 | |
---|
| 104 | 100 RETURN |
---|
| 105 | |
---|
| 106 | END SUBROUTINE user_parin |
---|
| 107 | |
---|