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

Last change on this file since 1682 was 1682, checked in by knoop, 6 years ago

Code annotations made doxygen readable

  • Property svn:keywords set to Id
File size: 5.5 KB
RevLine 
[1682]1!> @file user_read_restart_data.f90
[1036]2!--------------------------------------------------------------------------------!
3! This file is part of PALM.
4!
5! PALM is free software: you can redistribute it and/or modify it under the terms
6! of the GNU General Public License as published by the Free Software Foundation,
7! either version 3 of the License, or (at your option) any later version.
8!
9! PALM is distributed in the hope that it will be useful, but WITHOUT ANY
10! WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
11! A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
12!
13! You should have received a copy of the GNU General Public License along with
14! PALM. If not, see <http://www.gnu.org/licenses/>.
15!
[1310]16! Copyright 1997-2014 Leibniz Universitaet Hannover
[1036]17!--------------------------------------------------------------------------------!
18!
[258]19! Current revisions:
[211]20! -----------------
[1682]21! Code annotations made doxygen readable
[1321]22!
23! Former revisions:
24! -----------------
25! $Id: user_read_restart_data.f90 1682 2015-10-07 23:56:08Z knoop $
26!
27! 1320 2014-03-20 08:40:49Z raasch
[1320]28! kind-parameters added to all INTEGER and REAL declaration statements,
29! kinds are defined in new module kinds,
30! old module precision_kind is removed,
31! revision history before 2012 removed,
32! comment fields (!:) to be used for variable explanations added to
33! all variable declaration statements
[211]34!
[1037]35! 1036 2012-10-22 13:43:42Z raasch
36! code put under GPL (PALM 3.9)
37!
[226]38! 220 2008-12-18 07:00:36Z raasch
39! reading mechanism revised (subdomain/total domain size can vary arbitrarily
40! between current and previous run),
41! former file user_interface.f90 split into one file per subroutine
42!
[211]43! Description:
44! ------------
[1682]45!> Reading restart data from file(s)
46!> Subdomain index limits on file are given by nxl_on_file, etc.
47!> Indices nxlc, etc. indicate the range of gridpoints to be mapped from the
48!> subdomain on file (f) to the subdomain of the current PE (c). They have been
49!> calculated in routine read_3d_binary.
[211]50!------------------------------------------------------------------------------!
[1682]51 SUBROUTINE user_read_restart_data( i, nxlfa, nxl_on_file, nxrfa, nxr_on_file, &
52                                    nynfa, nyn_on_file, nysfa, nys_on_file,    &
53                                    offset_xa, offset_ya, overlap_count,       &
54                                    tmp_2d, tmp_3d )
55 
[211]56
57    USE control_parameters
[1320]58       
[211]59    USE indices
[1320]60   
61    USE kinds
62   
[211]63    USE pegrid
[1320]64   
[211]65    USE user
66
67    IMPLICIT NONE
68
[1682]69    CHARACTER (LEN=20) :: field_char   !<
[211]70
[1682]71    INTEGER(iwp) ::  i               !<
72    INTEGER(iwp) ::  k               !<
73    INTEGER(iwp) ::  nxlc            !<
74    INTEGER(iwp) ::  nxlf            !<
75    INTEGER(iwp) ::  nxl_on_file     !<
76    INTEGER(iwp) ::  nxrc            !<
77    INTEGER(iwp) ::  nxrf            !<
78    INTEGER(iwp) ::  nxr_on_file     !<
79    INTEGER(iwp) ::  nync            !<
80    INTEGER(iwp) ::  nynf            !<
81    INTEGER(iwp) ::  nyn_on_file     !<
82    INTEGER(iwp) ::  nysc            !<
83    INTEGER(iwp) ::  nysf            !<
84    INTEGER(iwp) ::  nys_on_file     !<
85    INTEGER(iwp) ::  overlap_count   !<
[211]86
[1682]87    INTEGER(iwp), DIMENSION(numprocs_previous_run,1000) ::  nxlfa       !<
88    INTEGER(iwp), DIMENSION(numprocs_previous_run,1000) ::  nxrfa       !<
89    INTEGER(iwp), DIMENSION(numprocs_previous_run,1000) ::  nynfa       !<
90    INTEGER(iwp), DIMENSION(numprocs_previous_run,1000) ::  nysfa       !<
91    INTEGER(iwp), DIMENSION(numprocs_previous_run,1000) ::  offset_xa   !<
92    INTEGER(iwp), DIMENSION(numprocs_previous_run,1000) ::  offset_ya   !<
[216]93
[1320]94    REAL(wp),                                                                  &
95       DIMENSION(nys_on_file-nbgp:nyn_on_file+nbgp,nxl_on_file-nbgp:nxr_on_file+nbgp) ::&
[1682]96          tmp_2d   !<
[211]97
[1320]98    REAL(wp),                                                                  &
99       DIMENSION(nzb:nzt+1,nys_on_file-nbgp:nyn_on_file+nbgp,nxl_on_file-nbgp:nxr_on_file+nbgp) ::&
[1682]100          tmp_3d   !<
[211]101
102!
103!-- Here the reading of user-defined restart data follows:
104!-- Sample for user-defined output
105!
106!    IF ( initializing_actions == 'read_restart_data' )  THEN
107!       READ ( 13 )  field_char
108!       DO  WHILE ( TRIM( field_char ) /= '*** end user ***' )
109!
[216]110!          DO  k = 1, overlap_count
[211]111!
[216]112!             nxlf = nxlfa(i,k)
113!             nxlc = nxlfa(i,k) + offset_xa(i,k)
114!             nxrf = nxrfa(i,k)
115!             nxrc = nxrfa(i,k) + offset_xa(i,k)
116!             nysf = nysfa(i,k)
117!             nysc = nysfa(i,k) + offset_ya(i,k)
118!             nynf = nynfa(i,k)
119!             nync = nynfa(i,k) + offset_ya(i,k)
120!
121!
122!             SELECT CASE ( TRIM( field_char ) )
123!
124!                CASE ( 'u2_av' )
125!                   IF ( .NOT. ALLOCATED( u2_av ) ) THEN
[702]126!                      ALLOCATE( u2_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) )
[216]127!                   ENDIF
128!                   IF ( k == 1 )  READ ( 13 )  tmp_3d
[1320]129!                   u2_av(:,nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) =           &
[702]130!                                          tmp_3d(:,nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp)
[211]131!
[216]132!                CASE DEFAULT
[1320]133!                   WRITE( message_string, * ) 'unknown variable named "',       &
134!                                         TRIM( field_char ), '" found in',      &
[274]135!                                         '&data from prior run on PE ', myid
[583]136!                   CALL message( 'user_read_restart_data', 'UI0012', 1, 2, 0, 6, 0 )
[211]137!
[216]138!             END SELECT
[211]139!
[216]140!          ENDDO
141!
[211]142!          READ ( 13 )  field_char
143!
144!       ENDDO
145!    ENDIF
146
147 END SUBROUTINE user_read_restart_data
148
Note: See TracBrowser for help on using the repository browser.