subroutine in(j_dim,l_dim,td_dim, & j_max,l_max,c_x,c_y,x_max,y_max,courmx,no_out,t_out1) c Reads the data in input file adiprcon.in. c Writes to Fortran unit 1. Uses Fortran unit 2 internally. c Avoid typos: implicit none c Input variables: c Dimensioned mesh sizes in the x- and y-directions: integer j_dim,l_dim c Maximum tridiagonal system size: integer td_dim c Output variables: c Actual mesh sizes in the x- and y-directions: integer j_max,l_max c Components of the convection velocity in the x and y directions: double precision c_x,c_y c Domain size in the x- and y-directions: double precision x_max,y_max c The largest of the two Courant numbers c_x dt / dx and c_y dt / dy: double precision courmx c Number of nonzero output times: integer no_out c First nonzero output time: double precision t_out1 c Local variables: c Constants, defined to simplify changing precision: double precision zero parameter (zero=0.d0) c Executable statements: c Open the file: open(2,file='adiprcon.in',status='old') c Read the convection velocity in the x-direction: read(2,*)c_x write(1,110)c_x 110 format('Convection velocity in the x-direction:',g15.7) if(c_x.le.zero)then print*,'*** adiprc: '// & 'The x-convection velocity must be positive, not',c_x stop endif c Read the convection velocity in the y-direction: read(2,*)c_y write(1,120)c_y 120 format('Convection velocity in the y-direction:',g15.7) if(c_y.le.zero)then print*,'*** adiprc: '// & 'The y-convection velocity must be positive, not',c_y stop endif c Read the size of the domain in the x-direction: read(2,*)x_max write(1,130)x_max 130 format('Size of the domain in the x-direction:',g15.7) if(x_max.le.zero)then print*,'*** adiprc: '// & 'The x-size must be positive but is',x_max stop endif c Read the size of the domain in the y-direction: read(2,*)y_max write(1,140)y_max 140 format('Size of the domain in the y-direction:',g15.7) if(y_max.le.zero)then print*,'*** adiprc: '// & 'The y-size must be positive but is',y_max stop endif c Read the maximum Courant number: read(2,*)courmx write(1,150)courmx 150 format('The maximum Courant number:',g15.7) if(courmx.le.zero)then print*,'*** adiprc: '// & 'The Courant number must be positive, not',courmx stop endif c Read the number of mesh segments to use in the x-direction: read(2,*)j_max write(1,160)j_max 160 format('Number of mesh segments in the x-direction:',i4) if(j_max.lt.2)then print*,'*** adiprc: '// & 'The number of x-segments must be at least two but is',j_max stop endif if(j_max.gt.j_dim)then print*,'*** adiprc: '// & 'The requested number of x-segments,',j_max print*,' '// & 'exceeds the maximum dimensioned limit',j_dim stop endif c Read the number of mesh points to use in the y-direction: read(2,*)l_max write(1,170)l_max 170 format('Number of mesh segments in the y-direction:',i4) if(l_max.lt.2)then print*,'*** adiprc: '// & 'The number of y-segments must be at least two but is',l_max stop endif if(l_max.gt.l_dim)then print*,'*** adiprc: '// & 'The requested number of y-segments,',l_max print*,' '// & 'exceeds the maximum dimensioned limit',l_dim stop endif c Check the tridiagonal system size: if(max(j_max,l_max).gt.td_dim)then print*,'*** adiprc: '// & 'The requested mesh dimensions,',j_max,l_max print*,' '// & 'exceed the matrix storage limit',td_dim stop endif c Read the number of output times: read(2,*)no_out write(1,190)no_out 190 format('Number of output times:',i4) if(no_out.le.0)then print*,'*** adiprc: '// & 'The number of output times must be positive, not',no_out stop endif c Read the first nonzero output time: read(2,*)t_out1 write(1,200)t_out1 200 format('First nonzero output time:',g15.7) if(no_out.lt.0.)then print*,'*** adiprc: '// & 'The first nonzero output time must be positive, not:',no_out stop endif c Close the input file: close(2) return end