Skip to content

Commit

Permalink
Keep data in float format.
Browse files Browse the repository at this point in the history
* In some cases these conversions are carried out via memory such that
  reading data just written to memory back into a register stalls the
  FPU.
  • Loading branch information
tjahns committed Dec 14, 2024
1 parent be0801c commit 5954bc8
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions rrtmgp-kernels/mo_gas_optics_rrtmgp_kernels.F90
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ subroutine interpolation( &
real(wp) :: temp_ref_delta_inv
real(wp) :: press_ref_log_1
real(wp) :: press_ref_log_delta_inv
real(wp) :: jpress_aint
! -----------------
! local indexes
integer :: icol, ilay, iflav, igases_1, igases_2, itropo, itemp, jtemp_
Expand All @@ -108,8 +109,9 @@ subroutine interpolation( &

! index and factor for pressure interpolation
locpress = 1._wp + (log(play(icol,ilay)) - press_ref_log_1) * press_ref_log_delta_inv
jpress(icol,ilay) = min(npres-1, max(1, int(locpress)))
fpress(icol,ilay) = locpress - float(jpress(icol,ilay))
jpress_aint = min(real(npres-1, wp), max(1.0_wp, aint(locpress)))
jpress(icol,ilay) = int(jpress_aint)
fpress(icol,ilay) = locpress - jpress_aint

! determine if in lower or upper part of atmosphere
tropo(icol,ilay) = play(icol,ilay) > press_ref_trop
Expand Down

0 comments on commit 5954bc8

Please sign in to comment.