SUBROUTINE user_read_restart_data( i, nxlfa, nxl_on_file, nxrfa, nxr_on_file, & nynfa, nyn_on_file, nysfa, nys_on_file, & offset_xa, offset_ya, overlap_count, & tmp_2d, tmp_3d ) !--------------------------------------------------------------------------------! ! This file is part of PALM. ! ! PALM is free software: you can redistribute it and/or modify it under the terms ! of the GNU General Public License as published by the Free Software Foundation, ! either version 3 of the License, or (at your option) any later version. ! ! PALM is distributed in the hope that it will be useful, but WITHOUT ANY ! WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR ! A PARTICULAR PURPOSE. See the GNU General Public License for more details. ! ! You should have received a copy of the GNU General Public License along with ! PALM. If not, see . ! ! Copyright 1997-2012 Leibniz University Hannover !--------------------------------------------------------------------------------! ! ! Current revisions: ! ----------------- ! ! Former revisions: ! ----------------- ! $Id: user_read_restart_data.f90 1037 2012-10-22 14:10:22Z fricke $ ! ! 1036 2012-10-22 13:43:42Z raasch ! code put under GPL (PALM 3.9) ! ! 702 2011-03-24 19:33:15Z suehring ! nys-1, nyn+1, nxl-1, nxr+1 changed to nysg, nyng, nxlg, nxrg. ! ! 667 2010-12-23 12:06:00Z suehring/gryschka ! Allocation with nbgp ! ! 583 2010-10-11 09:28:42Z heinze ! Bugfix: replace 'user_spectra' with 'user_read_restart_data' in call of ! message ! ! 274 2009-03-26 15:11:21Z heinze ! Output of messages replaced by message handling routine. ! ! 220 2008-12-18 07:00:36Z raasch ! reading mechanism revised (subdomain/total domain size can vary arbitrarily ! between current and previous run), ! former file user_interface.f90 split into one file per subroutine ! ! Description: ! ------------ ! Reading restart data from file(s) ! Subdomain index limits on file are given by nxl_on_file, etc. ! Indices nxlc, etc. indicate the range of gridpoints to be mapped from the ! subdomain on file (f) to the subdomain of the current PE (c). They have been ! calculated in routine read_3d_binary. !------------------------------------------------------------------------------! USE control_parameters USE indices USE pegrid USE user IMPLICIT NONE CHARACTER (LEN=20) :: field_char INTEGER :: i, k, nxlc, nxlf, nxl_on_file, nxrc, nxrf, nxr_on_file, nync, & nynf, nyn_on_file, nysc, nysf, nys_on_file, overlap_count INTEGER, DIMENSION(numprocs_previous_run,1000) :: nxlfa, nxrfa, nynfa, & nysfa, offset_xa, & offset_ya REAL, DIMENSION(nys_on_file-nbgp:nyn_on_file+nbgp,nxl_on_file-nbgp:nxr_on_file+nbgp) :: & tmp_2d REAL, DIMENSION(nzb:nzt+1,nys_on_file-nbgp:nyn_on_file+nbgp,nxl_on_file-nbgp:nxr_on_file+nbgp) :: & tmp_3d ! !-- Here the reading of user-defined restart data follows: !-- Sample for user-defined output ! ! IF ( initializing_actions == 'read_restart_data' ) THEN ! READ ( 13 ) field_char ! DO WHILE ( TRIM( field_char ) /= '*** end user ***' ) ! ! DO k = 1, overlap_count ! ! nxlf = nxlfa(i,k) ! nxlc = nxlfa(i,k) + offset_xa(i,k) ! nxrf = nxrfa(i,k) ! nxrc = nxrfa(i,k) + offset_xa(i,k) ! nysf = nysfa(i,k) ! nysc = nysfa(i,k) + offset_ya(i,k) ! nynf = nynfa(i,k) ! nync = nynfa(i,k) + offset_ya(i,k) ! ! ! SELECT CASE ( TRIM( field_char ) ) ! ! CASE ( 'u2_av' ) ! IF ( .NOT. ALLOCATED( u2_av ) ) THEN ! ALLOCATE( u2_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) ! ENDIF ! IF ( k == 1 ) READ ( 13 ) tmp_3d ! u2_av(:,nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & ! tmp_3d(:,nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) ! ! CASE DEFAULT ! WRITE( message_string, * ) 'unknown variable named "', & ! TRIM( field_char ), '" found in', & ! '&data from prior run on PE ', myid ! CALL message( 'user_read_restart_data', 'UI0012', 1, 2, 0, 6, 0 ) ! ! END SELECT ! ! ENDDO ! ! READ ( 13 ) field_char ! ! ENDDO ! ENDIF END SUBROUTINE user_read_restart_data