Skip to content

Commit

Permalink
Converting reference from 'calc_rrho' to 'calc_ideal_gas_rrho' from l…
Browse files Browse the repository at this point in the history
…atest atmos_phys.
  • Loading branch information
mwaxmonsky committed Feb 24, 2025
1 parent e776da5 commit 29f7768
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
6 changes: 3 additions & 3 deletions src/physics/cam/clubb_intr.F90
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ module clubb_intr

use spmd_utils, only: masterproc
use constituents, only: pcnst, cnst_add
use atmos_phys_pbl_utils,only: calc_friction_velocity, calc_kinematic_heat_flux, calc_rrho, &
use atmos_phys_pbl_utils,only: calc_friction_velocity, calc_kinematic_heat_flux, calc_ideal_gas_rrho, &
calc_kinematic_water_vapor_flux, calc_kinematic_buoyancy_flux, calc_obukhov_length
use ref_pres, only: top_lev => trop_cloud_top_lev

Expand Down Expand Up @@ -3492,7 +3492,7 @@ subroutine clubb_tend_cam( state, ptend_all, pbuf, hdtime, &
ubar = sqrt(state1%u(i,pver)**2+state1%v(i,pver)**2)
if (ubar < 0.25_r8) ubar = 0.25_r8

rrho(i) = calc_rrho(rair, state1%t(i,pver), state1%pmid(i,pver))
rrho(i) = calc_ideal_gas_rrho(rair, state1%t(i,pver), state1%pmid(i,pver))
ustar = calc_friction_velocity(cam_in%wsx(i), cam_in%wsy(i), rrho(i))

upwp_sfc(i) = -state1%u(i,pver)*ustar**2/ubar
Expand Down Expand Up @@ -4707,7 +4707,7 @@ subroutine clubb_tend_cam( state, ptend_all, pbuf, hdtime, &
enddo

! diagnose surface friction and obukhov length (inputs to diagnose PBL depth)
rrho (1:ncol) = calc_rrho(rair, state1%t(1:ncol,pver), state1%pmid(1:ncol,pver))
rrho (1:ncol) = calc_ideal_gas_rrho(rair, state1%t(1:ncol,pver), state1%pmid(1:ncol,pver))
ustar2 (1:ncol) = calc_friction_velocity(cam_in%wsx(1:ncol), cam_in%wsy(1:ncol), rrho(1:ncol))
! use correct qflux from coupler
kinheat(1:ncol) = calc_kinematic_heat_flux(cam_in%shf(1:ncol), rrho(1:ncol), cpair)
Expand Down
4 changes: 2 additions & 2 deletions src/physics/cam/eddy_diff_cam.F90
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,7 @@ subroutine compute_eddy_diff( pbuf, lchnk ,
use cam_history, only: outfld
use phys_debug_util, only: phys_debug_col
use air_composition, only: cpairv
use atmos_phys_pbl_utils, only: calc_eddy_flux_coefficient, calc_rrho, calc_friction_velocity
use atmos_phys_pbl_utils, only: calc_eddy_flux_coefficient, calc_ideal_gas_rrho, calc_friction_velocity
use error_messages, only: handle_errmsg
use coords_1d, only: Coords1D
use wv_saturation, only: qsat
Expand Down Expand Up @@ -670,7 +670,7 @@ subroutine compute_eddy_diff( pbuf, lchnk ,
! I am using updated wind, here.

! Compute ustar
rrho(:ncol) = calc_rrho(rair, tfd(:ncol,pver), pmid(:ncol,pver))
rrho(:ncol) = calc_ideal_gas_rrho(rair, tfd(:ncol,pver), pmid(:ncol,pver))
ustar(:ncol) = calc_friction_velocity(taux(:ncol) - ksrftms(:ncol) * ufd(:ncol,pver), & ! Zonal wind stress
tauy(:ncol) - ksrftms(:ncol) * vfd(:ncol,pver), & ! Meridional wind stress
rrho(:ncol))
Expand Down
8 changes: 4 additions & 4 deletions src/physics/cam/hb_diff.F90
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ subroutine compute_hb_diff(ncol , &
!-----------------------------------------------------------------------

use atmos_phys_pbl_utils, only: calc_virtual_temperature, calc_friction_velocity, calc_obukhov_length, &
calc_eddy_flux_coefficient, calc_rrho, calc_kinematic_heat_flux, calc_kinematic_water_vapor_flux, &
calc_eddy_flux_coefficient, calc_ideal_gas_rrho, calc_kinematic_heat_flux, calc_kinematic_water_vapor_flux, &
calc_kinematic_buoyancy_flux
use physconst, only: zvir, rair, gravit, karman

Expand Down Expand Up @@ -214,7 +214,7 @@ subroutine compute_hb_diff(ncol , &
thv(:ncol,ntop_turb:) = calc_virtual_temperature(th(:ncol,ntop_turb:),q(:ncol,ntop_turb:), zvir)

! Compute ustar, Obukhov length, and kinematic surface fluxes.
rrho(:ncol) = calc_rrho(rair, t(:ncol,pver), pmid(:ncol,pver))
rrho(:ncol) = calc_ideal_gas_rrho(rair, t(:ncol,pver), pmid(:ncol,pver))
ustar(:ncol) = calc_friction_velocity(taux(:ncol),tauy(:ncol), rrho(:ncol))
khfs(:ncol) = calc_kinematic_heat_flux(shflx(:ncol), rrho(:ncol), cpair)
kqfs(:ncol) = calc_kinematic_water_vapor_flux(qflx(:ncol), rrho(:ncol))
Expand Down Expand Up @@ -272,7 +272,7 @@ subroutine compute_hb_free_atm_diff(ncol, &
!-----------------------------------------------------------------------

use atmos_phys_pbl_utils, only: calc_virtual_temperature, calc_friction_velocity, calc_obukhov_length, &
calc_free_atm_eddy_flux_coefficient, calc_rrho, calc_kinematic_heat_flux, calc_kinematic_water_vapor_flux, &
calc_free_atm_eddy_flux_coefficient, calc_ideal_gas_rrho, calc_kinematic_heat_flux, calc_kinematic_water_vapor_flux, &
calc_kinematic_buoyancy_flux
use physconst, only: zvir, rair, gravit, karman

Expand Down Expand Up @@ -321,7 +321,7 @@ subroutine compute_hb_free_atm_diff(ncol, &
thv(:ncol,ntop_turb:) = calc_virtual_temperature(th(:ncol,ntop_turb:),q(:ncol,ntop_turb:), zvir)

! Compute ustar, Obukhov length, and kinematic surface fluxes.
rrho(:ncol) = calc_rrho(rair, t(:ncol,pver), pmid(:ncol,pver))
rrho(:ncol) = calc_ideal_gas_rrho(rair, t(:ncol,pver), pmid(:ncol,pver))
ustar(:ncol) = calc_friction_velocity(taux(:ncol),tauy(:ncol), rrho(:ncol))
khfs(:ncol) = calc_kinematic_heat_flux(shflx(:ncol), rrho(:ncol), cpair)
kqfs(:ncol) = calc_kinematic_water_vapor_flux(qflx(:ncol), rrho(:ncol))
Expand Down
4 changes: 2 additions & 2 deletions src/physics/cam/vertical_diffusion.F90
Original file line number Diff line number Diff line change
Expand Up @@ -726,7 +726,7 @@ subroutine vertical_diffusion_tend( &
use constituents, only : cnst_get_type_byind, cnst_name, &
cnst_mw, cnst_fixed_ubc, cnst_fixed_ubflx
use physconst, only : pi
use atmos_phys_pbl_utils, only: calc_virtual_temperature, calc_rrho, calc_friction_velocity, &
use atmos_phys_pbl_utils, only: calc_virtual_temperature, calc_ideal_gas_rrho, calc_friction_velocity, &
calc_kinematic_heat_flux, calc_kinematic_water_vapor_flux, calc_kinematic_buoyancy_flux, &
calc_obukhov_length
use upper_bc, only : ubc_get_vals, ubc_fixed_temp
Expand Down Expand Up @@ -1080,7 +1080,7 @@ subroutine vertical_diffusion_tend( &
! and molecular diffusion.

thvs (:ncol) = calc_virtual_temperature(th(:ncol,pver), state%q(:ncol,pver,1), zvir)
rrho (:ncol) = calc_rrho(rair, state%t(:ncol,pver), state%pmid(:ncol,pver))
rrho (:ncol) = calc_ideal_gas_rrho(rair, state%t(:ncol,pver), state%pmid(:ncol,pver))
ustar (:ncol) = calc_friction_velocity(cam_in%wsx(:ncol), cam_in%wsy(:ncol), rrho(:ncol))
khfs (:ncol) = calc_kinematic_heat_flux(cam_in%shf(:ncol), rrho(:ncol), cpair)
kqfs (:ncol) = calc_kinematic_water_vapor_flux(cam_in%cflx(:ncol,1), rrho(:ncol))
Expand Down

0 comments on commit 29f7768

Please sign in to comment.