c------------------------------------------------------------ c Initialization code that is interfaced to the RNPL- c generated initialization routine, via the c INITIALIZE statement in burgers_rnpl (note that RNPL c supplies the routine header, declaration of routine c arguments, as well as the RETURN and END statements). c------------------------------------------------------------ character*6 cdnm parameter ( cdnm = 'init_q' ) logical ltrace parameter ( ltrace = .true. ) real*8 cpi parameter ( cpi = 3.141 5926 5358 9793 d0 ) integer Nx integer j, jmid c============================================================ c============================================================ c----------------------------------------------------------------------- c Use a more convenient variable for the number of spatial c grid points. c----------------------------------------------------------------------- Nx = g1_nx if ( ltrace ) then write(0,*) cdnm,': Nx =', Nx write(0,*) cdnm,': ini_type =', ini_type write(0,*) cdnm,': q_xc =', q_xc write(0,*) cdnm,': q_R =', q_R write(0,*) cdnm,': q_L =', q_L write(0,*) cdnm,': q_0 =', q_0 write(0,*) cdnm,': q_amp =', q_amp write(0,*) cdnm,': q_delta =', q_delta endif if ( ini_type .eq. 1 ) then j = 1 do while ( x(j) .lt. q_xc ) q_n(j) = q_L j = j + 1 enddo jmid = j do j = jmid, Nx q_n(j) = q_R enddo elseif ( ini_type .eq. 2 ) then do j = 1, Nx q_n(j) = q_amp * exp(-(x(j)-q_0)**2/ q_delta**2 ) enddo endif