[1682] | 1 | !> @file user_parin.f90 |
---|
[2000] | 2 | !------------------------------------------------------------------------------! |
---|
[1036] | 3 | ! This file is part of PALM. |
---|
| 4 | ! |
---|
[2000] | 5 | ! PALM is free software: you can redistribute it and/or modify it under the |
---|
| 6 | ! terms of the GNU General Public License as published by the Free Software |
---|
| 7 | ! Foundation, either version 3 of the License, or (at your option) any later |
---|
| 8 | ! version. |
---|
[1036] | 9 | ! |
---|
| 10 | ! PALM is distributed in the hope that it will be useful, but WITHOUT ANY |
---|
| 11 | ! WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR |
---|
| 12 | ! A PARTICULAR PURPOSE. See the GNU General Public License for more details. |
---|
| 13 | ! |
---|
| 14 | ! You should have received a copy of the GNU General Public License along with |
---|
| 15 | ! PALM. If not, see <http://www.gnu.org/licenses/>. |
---|
| 16 | ! |
---|
[2101] | 17 | ! Copyright 1997-2017 Leibniz Universitaet Hannover |
---|
[2000] | 18 | !------------------------------------------------------------------------------! |
---|
[1036] | 19 | ! |
---|
[258] | 20 | ! Current revisions: |
---|
[211] | 21 | ! ----------------- |
---|
[1834] | 22 | ! |
---|
[2001] | 23 | ! |
---|
[1321] | 24 | ! Former revisions: |
---|
| 25 | ! ----------------- |
---|
| 26 | ! $Id: user_parin.f90 2298 2017-06-29 09:28:18Z suehring $ |
---|
[2298] | 27 | ! user interface current revision updated |
---|
| 28 | ! |
---|
| 29 | ! 2101 2017-01-05 16:42:31Z suehring |
---|
[1321] | 30 | ! |
---|
[2001] | 31 | ! 2000 2016-08-20 18:09:15Z knoop |
---|
| 32 | ! Forced header and separation lines into 80 columns |
---|
| 33 | ! |
---|
[1834] | 34 | ! 1833 2016-04-07 14:23:03Z raasch |
---|
| 35 | ! required interface revision changed |
---|
| 36 | ! |
---|
[1784] | 37 | ! 1783 2016-03-06 18:36:17Z raasch |
---|
| 38 | ! required interface revision changed |
---|
| 39 | ! |
---|
[1683] | 40 | ! 1682 2015-10-07 23:56:08Z knoop |
---|
| 41 | ! Code annotations made doxygen readable |
---|
| 42 | ! |
---|
[1669] | 43 | ! 1668 2015-09-23 13:45:36Z raasch |
---|
| 44 | ! current interface revision number number set to r1663 |
---|
| 45 | ! |
---|
[1667] | 46 | ! 1666 2015-09-23 07:31:10Z raasch |
---|
[1668] | 47 | ! interface revision number is set to blank |
---|
[1667] | 48 | ! |
---|
[1321] | 49 | ! 1320 2014-03-20 08:40:49Z raasch |
---|
[1320] | 50 | ! kind-parameters added to all INTEGER and REAL declaration statements, |
---|
| 51 | ! kinds are defined in new module kinds, |
---|
| 52 | ! old module precision_kind is removed, |
---|
| 53 | ! revision history before 2012 removed, |
---|
| 54 | ! comment fields (!:) to be used for variable explanations added to |
---|
| 55 | ! all variable declaration statements |
---|
[211] | 56 | ! |
---|
[1037] | 57 | ! 1036 2012-10-22 13:43:42Z raasch |
---|
| 58 | ! code put under GPL (PALM 3.9) |
---|
| 59 | ! |
---|
[932] | 60 | ! 931 2012-06-08 15:09:28Z maronga |
---|
| 61 | ! Re-enabled check for max_pr_user |
---|
| 62 | ! |
---|
[842] | 63 | ! 841 2012-02-28 12:29:49Z maronga |
---|
| 64 | ! Bugfix: disable max_pr_user check during prior namelist file check |
---|
| 65 | ! |
---|
[226] | 66 | ! 217 2008-12-09 18:00:48Z letzel |
---|
| 67 | ! +topography_grid_convention |
---|
| 68 | ! Former file user_interface.f90 split into one file per subroutine |
---|
| 69 | ! |
---|
[211] | 70 | ! Description: |
---|
| 71 | ! ------------ |
---|
[1682] | 72 | !> Interface to read user-defined namelist-parameters. |
---|
[211] | 73 | !------------------------------------------------------------------------------! |
---|
[1682] | 74 | SUBROUTINE user_parin |
---|
| 75 | |
---|
[211] | 76 | |
---|
| 77 | USE control_parameters |
---|
[1320] | 78 | |
---|
| 79 | USE kinds |
---|
| 80 | |
---|
[211] | 81 | USE pegrid |
---|
[1320] | 82 | |
---|
[211] | 83 | USE statistics |
---|
[1320] | 84 | |
---|
[211] | 85 | USE user |
---|
| 86 | |
---|
| 87 | IMPLICIT NONE |
---|
| 88 | |
---|
[1682] | 89 | CHARACTER (LEN=80) :: zeile !< |
---|
[211] | 90 | |
---|
[1682] | 91 | INTEGER(iwp) :: i !< |
---|
| 92 | INTEGER(iwp) :: j !< |
---|
| 93 | INTEGER(iwp) :: max_pr_user_tmp !< |
---|
[211] | 94 | |
---|
| 95 | |
---|
[1320] | 96 | NAMELIST /userpar/ data_output_pr_user, data_output_user, region, & |
---|
[553] | 97 | data_output_masks_user |
---|
[211] | 98 | |
---|
| 99 | ! |
---|
[1666] | 100 | !-- Set revision number of this default interface version. It will be checked within |
---|
| 101 | !-- the main program (palm). Please change the revision number in case that the |
---|
| 102 | !-- current revision does not match with previous revisions (e.g. if routines |
---|
| 103 | !-- have been added/deleted or if parameter lists in subroutines have been changed). |
---|
[2298] | 104 | user_interface_current_revision = 'r2297' |
---|
[1666] | 105 | |
---|
| 106 | ! |
---|
[211] | 107 | !-- Position the namelist-file at the beginning (it was already opened in |
---|
| 108 | !-- parin), search for user-defined namelist-group ("userpar", but any other |
---|
| 109 | !-- name can be choosed) and position the file at this line. |
---|
| 110 | REWIND ( 11 ) |
---|
| 111 | |
---|
| 112 | zeile = ' ' |
---|
| 113 | DO WHILE ( INDEX( zeile, '&userpar' ) == 0 ) |
---|
| 114 | READ ( 11, '(A)', END=100 ) zeile |
---|
| 115 | ENDDO |
---|
| 116 | BACKSPACE ( 11 ) |
---|
| 117 | |
---|
| 118 | ! |
---|
| 119 | !-- Read user-defined namelist |
---|
| 120 | READ ( 11, userpar ) |
---|
| 121 | user_defined_namelist_found = .TRUE. |
---|
| 122 | |
---|
| 123 | ! |
---|
| 124 | !-- Determine the number of user-defined profiles and append them to the |
---|
| 125 | !-- standard data output (data_output_pr) |
---|
| 126 | max_pr_user_tmp = 0 |
---|
| 127 | IF ( data_output_pr_user(1) /= ' ' ) THEN |
---|
| 128 | i = 1 |
---|
| 129 | DO WHILE ( data_output_pr(i) /= ' ' .AND. i <= 100 ) |
---|
| 130 | i = i + 1 |
---|
| 131 | ENDDO |
---|
| 132 | j = 1 |
---|
| 133 | DO WHILE ( data_output_pr_user(j) /= ' ' .AND. j <= 100 ) |
---|
| 134 | data_output_pr(i) = data_output_pr_user(j) |
---|
| 135 | max_pr_user_tmp = max_pr_user_tmp + 1 |
---|
| 136 | i = i + 1 |
---|
| 137 | j = j + 1 |
---|
| 138 | ENDDO |
---|
| 139 | ENDIF |
---|
| 140 | |
---|
| 141 | ! |
---|
| 142 | !-- In case of a restart run, the number of user-defined profiles on the |
---|
| 143 | !-- restart file (already stored in max_pr_user) has to match the one given |
---|
| 144 | !-- for the current run |
---|
| 145 | IF ( TRIM( initializing_actions ) == 'read_restart_data' ) THEN |
---|
| 146 | IF ( max_pr_user /= max_pr_user_tmp ) THEN |
---|
[1320] | 147 | WRITE( message_string, * ) 'the number of user-defined profiles ', & |
---|
| 148 | 'given in &data_output_pr (', max_pr_user_tmp, ') doe', & |
---|
| 149 | 'snot match the one ', & |
---|
| 150 | '&found in the restart file (', max_pr_user, & |
---|
[258] | 151 | ')' |
---|
| 152 | CALL message( 'user_parin', 'UI0009', 1, 2, 0, 6, 0 ) |
---|
[211] | 153 | ENDIF |
---|
| 154 | ELSE |
---|
| 155 | max_pr_user = max_pr_user_tmp |
---|
| 156 | ENDIF |
---|
| 157 | |
---|
| 158 | 100 RETURN |
---|
| 159 | |
---|
| 160 | END SUBROUTINE user_parin |
---|
| 161 | |
---|