From 5954bc8b4cb16e517b392aa9f0433df084778834 Mon Sep 17 00:00:00 2001 From: Thomas Jahns Date: Fri, 13 Dec 2024 23:25:32 +0100 Subject: [PATCH] Keep data in float format. * 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. --- rrtmgp-kernels/mo_gas_optics_rrtmgp_kernels.F90 | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/rrtmgp-kernels/mo_gas_optics_rrtmgp_kernels.F90 b/rrtmgp-kernels/mo_gas_optics_rrtmgp_kernels.F90 index ddd4e5806..f0d446e54 100644 --- a/rrtmgp-kernels/mo_gas_optics_rrtmgp_kernels.F90 +++ b/rrtmgp-kernels/mo_gas_optics_rrtmgp_kernels.F90 @@ -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_ @@ -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