Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
[submodule "atmos_phys"]
path = src/atmos_phys
url = https://github.com/NorESMhub/atmospheric_physics
fxtag = atmos_phys0_18_002_noresm_v0
fxtag = atmos_phys0_18_002_noresm_v1
fxrequired = AlwaysRequired
fxDONOTUSEurl = https://github.com/NorESMhub/atmospheric_physics

Expand Down Expand Up @@ -85,7 +85,7 @@
[submodule "oslo_aero"]
path = src/chemistry/oslo_aero
url = https://github.com/NorESMhub/OSLO_AERO
fxtag = oslo_aero_3_0a010
fxtag = oslo_aero_3_0a011
fxrequired = AlwaysRequired
fxDONOTUSEurl = https://github.com/NorESMhub/OSLO_AERO.git

Expand Down
2 changes: 1 addition & 1 deletion src/atmos_phys
2 changes: 1 addition & 1 deletion src/chemistry/oslo_aero
Submodule oslo_aero updated 1 files
+8 −5 src_cam/physpkg.F90
19 changes: 11 additions & 8 deletions src/physics/cam/physpkg.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1434,6 +1434,7 @@ subroutine tphysac (ztodt, cam_in, &
real(r8) :: tmp_trac (pcols,pver,pcnst) ! tmp space
real(r8) :: tmp_pdel (pcols,pver) ! tmp space
real(r8) :: tmp_ps (pcols) ! tmp space
real(r8) :: tmp_cpcv (pcols,pver) ! tmp space
real(r8) :: scaling(pcols,pver)
logical :: moist_mixing_ratio_dycore

Expand Down Expand Up @@ -1895,11 +1896,6 @@ subroutine tphysac (ztodt, cam_in, &
! FV: convert dry-type mixing ratios to moist here because physics_dme_adjust
! assumes moist. This is done in p_d_coupling for other dynamics. Bundy, Feb 2004.
moist_mixing_ratio_dycore = dycore_is('LR').or. dycore_is('FV3')
!
! update cp/cv for energy computation based in updated water variables
!
call cam_thermo_water_update(state%q(:ncol,:,:), lchnk, ncol, vc_dycore,&
to_dry_factor=state%pdel(:ncol,:)/state%pdeldry(:ncol,:))

! for dry mixing ratio dycore, physics_dme_adjust is called for energy diagnostic purposes only.
! So, save off tracers
Expand All @@ -1913,21 +1909,28 @@ subroutine tphysac (ztodt, cam_in, &
tmp_trac(:ncol,:pver,:pcnst) = state%q(:ncol,:pver,:pcnst)
tmp_pdel(:ncol,:pver) = state%pdel(:ncol,:pver)
tmp_ps(:ncol) = state%ps(:ncol)
tmp_cpcv(:ncol,:pver) = cp_or_cv_dycore(:ncol,:pver,lchnk)
if (trim(cam_take_snapshot_before) == "physics_dme_adjust") then
call cam_snapshot_all_outfld_tphysac(cam_snapshot_before_num, state, tend, cam_in, cam_out, pbuf,&
fh2o, surfric, obklen, flx_heat)
fh2o, surfric, obklen, flx_heat)
end if
!
! update cp/cv for energy computation based in updated water variables
!
call cam_thermo_water_update(state%q(:ncol,:,:), lchnk, ncol, vc_dycore,&
to_dry_factor=state%pdel(:ncol,:)/state%pdeldry(:ncol,:))
call physics_dme_adjust(state, tend, qini, totliqini, toticeini, ztodt)
if (trim(cam_take_snapshot_after) == "physics_dme_adjust") then
call cam_snapshot_all_outfld_tphysac(cam_snapshot_after_num, state, tend, cam_in, cam_out, pbuf,&
fh2o, surfric, obklen, flx_heat)
call cam_snapshot_all_outfld_tphysac(cam_snapshot_after_num, state, tend, cam_in, cam_out, pbuf,&
fh2o, surfric, obklen, flx_heat)
end if
call tot_energy_phys(state, 'phAM')
call tot_energy_phys(state, 'dyAM', vc=vc_dycore)
! Restore pre-"physics_dme_adjust" tracers
state%q(:ncol,:pver,:pcnst) = tmp_trac(:ncol,:pver,:pcnst)
state%pdel(:ncol,:pver) = tmp_pdel(:ncol,:pver)
state%ps(:ncol) = tmp_ps(:ncol)
cp_or_cv_dycore(:ncol,:pver,lchnk) = tmp_cpcv(:ncol,:pver)
end if
else
!
Expand Down
13 changes: 8 additions & 5 deletions src/physics/cam7/physpkg.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1501,6 +1501,7 @@ subroutine tphysac (ztodt, cam_in, &
real(r8) :: tmp_trac (pcols,pver,pcnst) ! tmp space
real(r8) :: tmp_pdel (pcols,pver) ! tmp space
real(r8) :: tmp_ps (pcols) ! tmp space
real(r8) :: tmp_cpcv (pcols,pver) ! tmp space
real(r8) :: scaling(pcols,pver)
logical :: moist_mixing_ratio_dycore

Expand Down Expand Up @@ -2378,11 +2379,6 @@ subroutine tphysac (ztodt, cam_in, &
! FV: convert dry-type mixing ratios to moist here because physics_dme_adjust
! assumes moist. This is done in p_d_coupling for other dynamics. Bundy, Feb 2004.
moist_mixing_ratio_dycore = dycore_is('LR').or. dycore_is('FV3')
!
! update cp/cv for energy computation based in updated water variables
!
call cam_thermo_water_update(state%q(:ncol,:,:), lchnk, ncol, vc_dycore,&
to_dry_factor=state%pdel(:ncol,:)/state%pdeldry(:ncol,:))

! for dry mixing ratio dycore, physics_dme_adjust is called for energy diagnostic purposes only.
! So, save off tracers
Expand All @@ -2396,10 +2392,16 @@ subroutine tphysac (ztodt, cam_in, &
tmp_trac(:ncol,:pver,:pcnst) = state%q(:ncol,:pver,:pcnst)
tmp_pdel(:ncol,:pver) = state%pdel(:ncol,:pver)
tmp_ps(:ncol) = state%ps(:ncol)
tmp_cpcv(:ncol,:pver) = cp_or_cv_dycore(:ncol,:pver,lchnk)
if (trim(cam_take_snapshot_before) == "physics_dme_adjust") then
call cam_snapshot_all_outfld_tphysac(cam_snapshot_before_num, state, tend, cam_in, cam_out, pbuf,&
fh2o, surfric, obklen, flx_heat, cmfmc, dlf, det_s, det_ice, net_flx)
end if
!
! update cp/cv for energy computation based in updated water variables
!
call cam_thermo_water_update(state%q(:ncol,:,:), lchnk, ncol, vc_dycore,&
to_dry_factor=state%pdel(:ncol,:)/state%pdeldry(:ncol,:))
call physics_dme_adjust(state, tend, qini, totliqini, toticeini, ztodt)
if (trim(cam_take_snapshot_after) == "physics_dme_adjust") then
call cam_snapshot_all_outfld_tphysac(cam_snapshot_after_num, state, tend, cam_in, cam_out, pbuf,&
Expand All @@ -2411,6 +2413,7 @@ subroutine tphysac (ztodt, cam_in, &
state%q(:ncol,:pver,:pcnst) = tmp_trac(:ncol,:pver,:pcnst)
state%pdel(:ncol,:pver) = tmp_pdel(:ncol,:pver)
state%ps(:ncol) = tmp_ps(:ncol)
cp_or_cv_dycore(:ncol,:pver,lchnk) = tmp_cpcv(:ncol,:pver)
end if
else
!
Expand Down
13 changes: 8 additions & 5 deletions src/physics/simple/physpkg.F90
Original file line number Diff line number Diff line change
Expand Up @@ -543,6 +543,7 @@ subroutine tphysac (ztodt, cam_in, cam_out, state, tend, pbuf)
real(r8) :: tmp_trac (pcols,pver,pcnst) ! tmp space
real(r8) :: tmp_pdel (pcols,pver) ! tmp space
real(r8) :: tmp_ps (pcols) ! tmp space
real(r8) :: tmp_cpcv (pcols,pver) ! tmp space
real(r8) :: scaling(pcols,pver)
!--------------------------------------------------------------------------

Expand Down Expand Up @@ -609,11 +610,6 @@ subroutine tphysac (ztodt, cam_in, cam_out, state, tend, pbuf)
! other dynamics. Bundy, Feb 2004.
!
moist_mixing_ratio_dycore = dycore_is('LR').or. dycore_is('FV3')
!
! update cp/cv for energy computation based in updated water variables
!
call cam_thermo_water_update(state%q(:ncol,:,:), lchnk, ncol, vc_dycore,&
to_dry_factor=state%pdel(:ncol,:)/state%pdeldry(:ncol,:))

if (moist_physics) then
! Scale dry mass and energy
Expand Down Expand Up @@ -643,13 +639,20 @@ subroutine tphysac (ztodt, cam_in, cam_out, state, tend, pbuf)
tmp_trac(:ncol,:pver,:pcnst) = state%q(:ncol,:pver,:pcnst)
tmp_pdel(:ncol,:pver) = state%pdel(:ncol,:pver)
tmp_ps(:ncol) = state%ps(:ncol)
tmp_cpcv(:ncol,:pver) = cp_or_cv_dycore(:ncol,:pver,lchnk)
!
! update cp/cv for energy computation based in updated water variables
!
call cam_thermo_water_update(state%q(:ncol,:,:), lchnk, ncol, vc_dycore,&
to_dry_factor=state%pdel(:ncol,:)/state%pdeldry(:ncol,:))
call physics_dme_adjust(state, tend, qini, totliqini, toticeini, ztodt)
call tot_energy_phys(state, 'phAM')
call tot_energy_phys(state, 'dyAM', vc=vc_dycore)
! Restore pre-"physics_dme_adjust" tracers
state%q(:ncol,:pver,:pcnst) = tmp_trac(:ncol,:pver,:pcnst)
state%pdel(:ncol,:pver) = tmp_pdel(:ncol,:pver)
state%ps(:ncol) = tmp_ps(:ncol)
cp_or_cv_dycore(:ncol,:pver,lchnk) = tmp_cpcv(:ncol,:pver)
end if
else
!
Expand Down
2 changes: 1 addition & 1 deletion src/utils/air_composition.F90
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ module air_composition
real(r8), public, protected, allocatable :: mbarv(:,:,:)
! cp_or_cv_dycore: enthalpy or internal energy scaling factor for
! energy consistency
real(r8), public, protected, allocatable :: cp_or_cv_dycore(:,:,:)
real(r8), public, allocatable :: cp_or_cv_dycore(:,:,:)
!
! Interfaces for public routines
interface get_cp_dry
Expand Down
Loading