Skip to content

Commit

Permalink
set local vars that can go on device
Browse files Browse the repository at this point in the history
  • Loading branch information
hklion committed Dec 13, 2023
1 parent 2c827d8 commit 822d85b
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions Source/TimeIntegration/ROMSX_rho_eos.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,16 @@ ROMSX::rho_eos (const Box& bx,
// equation of state.
//-----------------------------------------------------------------------
//
Real R0 = solverChoice.R0;
Real S0 = solverChoice.S0;
Real T0 = solverChoice.T0;
Real Tcoef = solverChoice.Tcoef;
Real Scoef = solverChoice.Scoef;
amrex::ParallelFor(bx,
[=] AMREX_GPU_DEVICE (int i, int j, int k)
{
rho(i,j,k) = solverChoice.R0 - solverChoice.R0*solverChoice.Tcoef*(temp(i,j,k,nrhs)-solverChoice.T0);
rho(i,j,k) += solverChoice.R0*solverChoice.Scoef*(salt(i,j,k,nrhs)-solverChoice.S0) - 1000.0_rt;
rho(i,j,k) = R0 - R0*Tcoef*(temp(i,j,k,nrhs)-T0);
rho(i,j,k) += R0*Scoef*(salt(i,j,k,nrhs)-S0) - 1000.0_rt;
});

//
Expand Down

0 comments on commit 822d85b

Please sign in to comment.