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 ) !------------------------------------------------------------------------------! ! Current revisions: ! ----------------- ! ! ! Former revisions: ! ----------------- ! $Id: user_read_restart_data.f90 584 2010-10-11 09:30:42Z heinze $ ! ! 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-1:nyn_on_file+1,nxl_on_file-1:nxr_on_file+1) ::& tmp_2d REAL, DIMENSION(nzb:nzt+1,nys_on_file-1:nyn_on_file+1, & nxl_on_file-1:nxr_on_file+1) :: & 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,nys-1:nyn+1,nxl-1:nxr+1) ) ! ENDIF ! IF ( k == 1 ) READ ( 13 ) tmp_3d ! u2_av(:,nysc-1:nync+1,nxlc-1:nxrc+1) = & ! tmp_3d(:,nysf-1:nynf+1,nxlf-1:nxrf+1) ! ! 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