source: palm/trunk/SOURCE/user_read_restart_data.f90 @ 2000

Last change on this file since 2000 was 2000, checked in by knoop, 5 years ago

Forced header and separation lines into 80 columns

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