1 | !> @file user_read_restart_data.f90 |
---|
2 | !------------------------------------------------------------------------------! |
---|
3 | ! This file is part of the PALM model system. |
---|
4 | ! |
---|
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. |
---|
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 | ! |
---|
17 | ! Copyright 1997-2018 Leibniz Universitaet Hannover |
---|
18 | !------------------------------------------------------------------------------! |
---|
19 | ! |
---|
20 | ! Current revisions: |
---|
21 | ! ----------------- |
---|
22 | ! |
---|
23 | ! |
---|
24 | ! Former revisions: |
---|
25 | ! ----------------- |
---|
26 | ! $Id: user_read_restart_data.f90 2718 2018-01-02 08:49:38Z thiele $ |
---|
27 | ! Corrected "Former revisions" section |
---|
28 | ! |
---|
29 | ! 2696 2017-12-14 17:12:51Z kanani |
---|
30 | ! Change in file header (GPL part) |
---|
31 | ! |
---|
32 | ! 2101 2017-01-05 16:42:31Z suehring |
---|
33 | ! |
---|
34 | ! 2000 2016-08-20 18:09:15Z knoop |
---|
35 | ! Forced header and separation lines into 80 columns |
---|
36 | ! |
---|
37 | ! 1682 2015-10-07 23:56:08Z knoop |
---|
38 | ! Code annotations made doxygen readable |
---|
39 | ! |
---|
40 | ! 1320 2014-03-20 08:40:49Z raasch |
---|
41 | ! kind-parameters added to all INTEGER and REAL declaration statements, |
---|
42 | ! kinds are defined in new module kinds, |
---|
43 | ! old module precision_kind is removed, |
---|
44 | ! revision history before 2012 removed, |
---|
45 | ! comment fields (!:) to be used for variable explanations added to |
---|
46 | ! all variable declaration statements |
---|
47 | ! |
---|
48 | ! 1036 2012-10-22 13:43:42Z raasch |
---|
49 | ! code put under GPL (PALM 3.9) |
---|
50 | ! |
---|
51 | ! 220 2008-12-18 07:00:36Z raasch |
---|
52 | ! reading mechanism revised (subdomain/total domain size can vary arbitrarily |
---|
53 | ! between current and previous run), |
---|
54 | ! former file user_interface.f90 split into one file per subroutine |
---|
55 | ! |
---|
56 | ! Description: |
---|
57 | ! ------------ |
---|
58 | !> Reading restart data from file(s) |
---|
59 | !> Subdomain index limits on file are given by nxl_on_file, etc. |
---|
60 | !> Indices nxlc, etc. indicate the range of gridpoints to be mapped from the |
---|
61 | !> subdomain on file (f) to the subdomain of the current PE (c). They have been |
---|
62 | !> calculated in routine read_3d_binary. |
---|
63 | !------------------------------------------------------------------------------! |
---|
64 | SUBROUTINE user_read_restart_data( i, nxlfa, nxl_on_file, nxrfa, nxr_on_file, & |
---|
65 | nynfa, nyn_on_file, nysfa, nys_on_file, & |
---|
66 | offset_xa, offset_ya, overlap_count, & |
---|
67 | tmp_2d, tmp_3d ) |
---|
68 | |
---|
69 | |
---|
70 | USE control_parameters |
---|
71 | |
---|
72 | USE indices |
---|
73 | |
---|
74 | USE kinds |
---|
75 | |
---|
76 | USE pegrid |
---|
77 | |
---|
78 | USE user |
---|
79 | |
---|
80 | IMPLICIT NONE |
---|
81 | |
---|
82 | CHARACTER (LEN=20) :: field_char !< |
---|
83 | |
---|
84 | INTEGER(iwp) :: i !< |
---|
85 | INTEGER(iwp) :: k !< |
---|
86 | INTEGER(iwp) :: nxlc !< |
---|
87 | INTEGER(iwp) :: nxlf !< |
---|
88 | INTEGER(iwp) :: nxl_on_file !< |
---|
89 | INTEGER(iwp) :: nxrc !< |
---|
90 | INTEGER(iwp) :: nxrf !< |
---|
91 | INTEGER(iwp) :: nxr_on_file !< |
---|
92 | INTEGER(iwp) :: nync !< |
---|
93 | INTEGER(iwp) :: nynf !< |
---|
94 | INTEGER(iwp) :: nyn_on_file !< |
---|
95 | INTEGER(iwp) :: nysc !< |
---|
96 | INTEGER(iwp) :: nysf !< |
---|
97 | INTEGER(iwp) :: nys_on_file !< |
---|
98 | INTEGER(iwp) :: overlap_count !< |
---|
99 | |
---|
100 | INTEGER(iwp), DIMENSION(numprocs_previous_run,1000) :: nxlfa !< |
---|
101 | INTEGER(iwp), DIMENSION(numprocs_previous_run,1000) :: nxrfa !< |
---|
102 | INTEGER(iwp), DIMENSION(numprocs_previous_run,1000) :: nynfa !< |
---|
103 | INTEGER(iwp), DIMENSION(numprocs_previous_run,1000) :: nysfa !< |
---|
104 | INTEGER(iwp), DIMENSION(numprocs_previous_run,1000) :: offset_xa !< |
---|
105 | INTEGER(iwp), DIMENSION(numprocs_previous_run,1000) :: offset_ya !< |
---|
106 | |
---|
107 | REAL(wp), & |
---|
108 | DIMENSION(nys_on_file-nbgp:nyn_on_file+nbgp,nxl_on_file-nbgp:nxr_on_file+nbgp) ::& |
---|
109 | tmp_2d !< |
---|
110 | |
---|
111 | REAL(wp), & |
---|
112 | DIMENSION(nzb:nzt+1,nys_on_file-nbgp:nyn_on_file+nbgp,nxl_on_file-nbgp:nxr_on_file+nbgp) ::& |
---|
113 | tmp_3d !< |
---|
114 | |
---|
115 | ! |
---|
116 | !-- Here the reading of user-defined restart data follows: |
---|
117 | !-- Sample for user-defined output |
---|
118 | ! |
---|
119 | ! IF ( initializing_actions == 'read_restart_data' ) THEN |
---|
120 | ! READ ( 13 ) field_char |
---|
121 | ! DO WHILE ( TRIM( field_char ) /= '*** end user ***' ) |
---|
122 | ! |
---|
123 | ! DO k = 1, overlap_count |
---|
124 | ! |
---|
125 | ! nxlf = nxlfa(i,k) |
---|
126 | ! nxlc = nxlfa(i,k) + offset_xa(i,k) |
---|
127 | ! nxrf = nxrfa(i,k) |
---|
128 | ! nxrc = nxrfa(i,k) + offset_xa(i,k) |
---|
129 | ! nysf = nysfa(i,k) |
---|
130 | ! nysc = nysfa(i,k) + offset_ya(i,k) |
---|
131 | ! nynf = nynfa(i,k) |
---|
132 | ! nync = nynfa(i,k) + offset_ya(i,k) |
---|
133 | ! |
---|
134 | ! |
---|
135 | ! SELECT CASE ( TRIM( field_char ) ) |
---|
136 | ! |
---|
137 | ! CASE ( 'u2_av' ) |
---|
138 | ! IF ( .NOT. ALLOCATED( u2_av ) ) THEN |
---|
139 | ! ALLOCATE( u2_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) |
---|
140 | ! ENDIF |
---|
141 | ! IF ( k == 1 ) READ ( 13 ) tmp_3d |
---|
142 | ! u2_av(:,nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & |
---|
143 | ! tmp_3d(:,nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) |
---|
144 | ! |
---|
145 | ! CASE DEFAULT |
---|
146 | ! WRITE( message_string, * ) 'unknown variable named "', & |
---|
147 | ! TRIM( field_char ), '" found in', & |
---|
148 | ! '&data from prior run on PE ', myid |
---|
149 | ! CALL message( 'user_read_restart_data', 'UI0012', 1, 2, 0, 6, 0 ) |
---|
150 | ! |
---|
151 | ! END SELECT |
---|
152 | ! |
---|
153 | ! ENDDO |
---|
154 | ! |
---|
155 | ! READ ( 13 ) field_char |
---|
156 | ! |
---|
157 | ! ENDDO |
---|
158 | ! ENDIF |
---|
159 | |
---|
160 | END SUBROUTINE user_read_restart_data |
---|
161 | |
---|