@@ -3301,15 +3301,14 @@ contains
33013301 type(riemann_states) :: c, c_fast, pres_mag
33023302
33033303 ! HLLD speeds and intermediate state variables:
3304- type(riemann_states) :: s, pTot
3305- real (wp) :: p_star, s_M, s_starL, s_starR, denom_ds, sign_Bx
3306- type(riemann_states) :: rho_star, E_star, v_star, w_star, sqrt_rho_star, E_double_lr
3307- type(riemann_states_arr7) :: U, U_star, U_double, F, F_star
3308- real (wp), dimension (7 ) :: F_hlld
3304+ type(riemann_states) :: s, pTot
3305+ real (wp) :: p_star, s_M, s_starL, s_starR, denom_ds, sign_Bx
3306+ type(riemann_states) :: rho_star, E_star, v_star, w_star, sqrt_rho_star, E_double_lr
3307+ real (wp), dimension ( 7 ) :: U_L, U_R, U_starL, U_starR, U_doubleL, U_doubleR
3308+ real (wp), dimension (7 ) :: F_L, F_R, F_starL, F_starR, F_hlld
33093309
3310- ! Indices for U and F: (rho, rho* vel(1 ), rho* vel(2 ), rho* vel(3 ), By, Bz, E) Note: vel and B are permutated, so vel(1 ) is the
3311- ! normal velocity, and x is the normal direction Note: Bx is omitted as the magnetic flux is always zero in the normal
3312- ! direction
3310+ ! Indices for U and F: (rho, rho* vel(1 ), rho* vel(2 ), rho* vel(3 ), By, Bz, E). vel and B are permuted by dir_idx so vel(1 ) is
3311+ ! always the normal velocity. Bx is omitted as the normal magnetic flux is always zero.
33133312
33143313 real (wp) :: v_double, w_double, By_double, Bz_double, E_double
33153314 integer :: i, j, k, l
@@ -3327,10 +3326,10 @@ contains
33273326 #:set SF = lambda offs: COORDS.format (STENCIL_IDX = SV + offs)
33283327 if (norm_dir == ${NORM_DIR}$) then
33293328 $:GPU_PARALLEL_LOOP(collapse= 3 , private= ' [alpha_rho_L, alpha_rho_R, vel, alpha_L, alpha_R, rho, pres, E, &
3330- & H_no_mag, gamma, pi_inf, qv, vel_rms, B, c, c_fast, pres_mag, U, U_star, U_double, F , &
3331- & F_star, F_hlld, s, s_M, s_starL, s_starR, pTot, p_star, rho_star, E_star, sqrt_rho_star , &
3332- & denom_ds, sign_Bx, v_star, w_star, v_double, w_double, By_double, Bz_double, E_double_lr , &
3333- & E_double]' , copyin= ' [norm_dir]' )
3329+ & H_no_mag, gamma, pi_inf, qv, vel_rms, B, c, c_fast, pres_mag, U_L, U_R, U_starL, U_starR , &
3330+ & U_doubleL, U_doubleR, F_L, F_R, F_starL, F_starR, F_hlld, s, s_M, s_starL, s_starR, pTot , &
3331+ & p_star, rho_star, E_star, sqrt_rho_star, denom_ds, sign_Bx, v_star, w_star, v_double , &
3332+ & w_double, By_double, Bz_double, E_double_lr, E_double]' , copyin= ' [norm_dir]' )
33343333 do l = ${Z_BND}$%beg, ${Z_BND}$%end
33353334 do k = ${Y_BND}$%beg, ${Y_BND}$%end
33363335 do j = ${X_BND}$%beg, ${X_BND}$%end
@@ -3424,26 +3423,26 @@ contains
34243423 E_star%R = ((s%R - vel%R(1 ))* E%R - pTot%R* vel%R(1 ) + p_star* s_M)/ (s%R - s_M)
34253424
34263425 ! (5 ) Compute left/ right state vectors and fluxes
3427- U%L = [rho%L, rho%L* vel%L(1 :3 ), B%L(2 :3 ), E%L]
3428- U_star%L = [rho_star%L, rho_star%L* s_M, rho_star%L* vel%L(2 :3 ), B%L(2 :3 ), E_star%L]
3429- U%R = [rho%R, rho%R* vel%R(1 :3 ), B%R(2 :3 ), E%R]
3430- U_star%R = [rho_star%R, rho_star%R* s_M, rho_star%R* vel%R(2 :3 ), B%R(2 :3 ), E_star%R]
3426+ U_L = [rho%L, rho%L* vel%L(1 :3 ), B%L(2 :3 ), E%L]
3427+ U_starL = [rho_star%L, rho_star%L* s_M, rho_star%L* vel%L(2 :3 ), B%L(2 :3 ), E_star%L]
3428+ U_R = [rho%R, rho%R* vel%R(1 :3 ), B%R(2 :3 ), E%R]
3429+ U_starR = [rho_star%R, rho_star%R* s_M, rho_star%R* vel%R(2 :3 ), B%R(2 :3 ), E_star%R]
34313430
34323431 ! Compute the left/ right fluxes
3433- F%L (1 ) = U%L (2 )
3434- F%L (2 ) = U%L (2 )* vel%L(1 ) - B%L(1 )* B%L(1 ) + pTot%L
3435- F%L (3 :4 ) = U%L (2 )* vel%L(2 :3 ) - B%L(1 )* B%L(2 :3 )
3436- F%L (5 :6 ) = vel%L(1 )* B%L(2 :3 ) - vel%L(2 :3 )* B%L(1 )
3437- F%L (7 ) = (E%L + pTot%L)* vel%L(1 ) - B%L(1 )* (vel%L(1 )* B%L(1 ) + vel%L(2 )* B%L(2 ) + vel%L(3 )* B%L(3 ))
3438-
3439- F%R (1 ) = U%R (2 )
3440- F%R (2 ) = U%R (2 )* vel%R(1 ) - B%R(1 )* B%R(1 ) + pTot%R
3441- F%R (3 :4 ) = U%R (2 )* vel%R(2 :3 ) - B%R(1 )* B%R(2 :3 )
3442- F%R (5 :6 ) = vel%R(1 )* B%R(2 :3 ) - vel%R(2 :3 )* B%R(1 )
3443- F%R (7 ) = (E%R + pTot%R)* vel%R(1 ) - B%R(1 )* (vel%R(1 )* B%R(1 ) + vel%R(2 )* B%R(2 ) + vel%R(3 )* B%R(3 ))
3432+ F_L (1 ) = U_L (2 )
3433+ F_L (2 ) = U_L (2 )* vel%L(1 ) - B%L(1 )* B%L(1 ) + pTot%L
3434+ F_L (3 :4 ) = U_L (2 )* vel%L(2 :3 ) - B%L(1 )* B%L(2 :3 )
3435+ F_L (5 :6 ) = vel%L(1 )* B%L(2 :3 ) - vel%L(2 :3 )* B%L(1 )
3436+ F_L (7 ) = (E%L + pTot%L)* vel%L(1 ) - B%L(1 )* (vel%L(1 )* B%L(1 ) + vel%L(2 )* B%L(2 ) + vel%L(3 )* B%L(3 ))
3437+
3438+ F_R (1 ) = U_R (2 )
3439+ F_R (2 ) = U_R (2 )* vel%R(1 ) - B%R(1 )* B%R(1 ) + pTot%R
3440+ F_R (3 :4 ) = U_R (2 )* vel%R(2 :3 ) - B%R(1 )* B%R(2 :3 )
3441+ F_R (5 :6 ) = vel%R(1 )* B%R(2 :3 ) - vel%R(2 :3 )* B%R(1 )
3442+ F_R (7 ) = (E%R + pTot%R)* vel%R(1 ) - B%R(1 )* (vel%R(1 )* B%R(1 ) + vel%R(2 )* B%R(2 ) + vel%R(3 )* B%R(3 ))
34443443 ! HLLD star- state fluxes via HLL jump relation
3445- F_star%L = F%L + s%L* (U_star%L - U%L )
3446- F_star%R = F%R + s%R* (U_star%R - U%R )
3444+ F_starL = F_L + s%L* (U_starL - U_L )
3445+ F_starR = F_R + s%R* (U_starR - U_R )
34473446 ! Alfven wave speeds bounding the rotational discontinuities
34483447 s_starL = s_M - abs (B%L(1 ))/ sqrt (rho_star%L)
34493448 s_starR = s_M + abs (B%L(1 ))/ sqrt (rho_star%R)
@@ -3468,24 +3467,24 @@ contains
34683467 & + w_double* Bz_double))* sign_Bx
34693468 E_double = 0.5_wp * (E_double_lr%L + E_double_lr%R)
34703469
3471- U_double%L = [rho_star%L, rho_star%L* s_M, rho_star%L* v_double, rho_star%L* w_double, By_double, &
3470+ U_doubleL = [rho_star%L, rho_star%L* s_M, rho_star%L* v_double, rho_star%L* w_double, By_double, &
34723471 & Bz_double, E_double]
3473- U_double%R = [rho_star%R, rho_star%R* s_M, rho_star%R* v_double, rho_star%R* w_double, By_double, &
3472+ U_doubleR = [rho_star%R, rho_star%R* s_M, rho_star%R* v_double, rho_star%R* w_double, By_double, &
34743473 & Bz_double, E_double]
34753474
34763475 ! Select HLLD flux region
34773476 if (0.0_wp <= s%L) then
3478- F_hlld = F%L
3477+ F_hlld = F_L
34793478 else if (0.0_wp <= s_starL) then
3480- F_hlld = F%L + s%L* (U_star%L - U%L )
3479+ F_hlld = F_L + s%L* (U_starL - U_L )
34813480 else if (0.0_wp <= s_M) then
3482- F_hlld = F_star%L + s_starL* (U_double%L - U_star%L )
3481+ F_hlld = F_starL + s_starL* (U_doubleL - U_starL )
34833482 else if (0.0_wp <= s_starR) then
3484- F_hlld = F_star%R + s_starR* (U_double%R - U_star%R )
3483+ F_hlld = F_starR + s_starR* (U_doubleR - U_starR )
34853484 else if (0.0_wp <= s%R) then
3486- F_hlld = F%R + s%R* (U_star%R - U%R )
3485+ F_hlld = F_R + s%R* (U_starR - U_R )
34873486 else
3488- F_hlld = F%R
3487+ F_hlld = F_R
34893488 end if
34903489
34913490 ! (12 ) Write HLLD flux to output arrays
0 commit comments