diff --git a/.gitmodules b/.gitmodules index 2fb876753f..57bb536db5 100644 --- a/.gitmodules +++ b/.gitmodules @@ -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 @@ -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 diff --git a/src/atmos_phys b/src/atmos_phys index 8834a0700d..080ef7a83d 160000 --- a/src/atmos_phys +++ b/src/atmos_phys @@ -1 +1 @@ -Subproject commit 8834a0700defd0e8f27e7779d2d1fdf93bb52f98 +Subproject commit 080ef7a83dfb7de7de83d331d77377e1ff0b742f diff --git a/src/chemistry/oslo_aero b/src/chemistry/oslo_aero index d8839c22dd..ecad2be821 160000 --- a/src/chemistry/oslo_aero +++ b/src/chemistry/oslo_aero @@ -1 +1 @@ -Subproject commit d8839c22ddf63328a0cc74e7ce468d522865c2a0 +Subproject commit ecad2be8210705ad617466c0bd4d6a77b03dad75 diff --git a/src/physics/cam/physpkg.F90 b/src/physics/cam/physpkg.F90 index ebba317d15..768b06c7e4 100644 --- a/src/physics/cam/physpkg.F90 +++ b/src/physics/cam/physpkg.F90 @@ -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 @@ -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 @@ -1913,14 +1909,20 @@ 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) @@ -1928,6 +1930,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 ! diff --git a/src/physics/cam7/physpkg.F90 b/src/physics/cam7/physpkg.F90 index c585160963..5eed211965 100644 --- a/src/physics/cam7/physpkg.F90 +++ b/src/physics/cam7/physpkg.F90 @@ -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 @@ -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 @@ -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,& @@ -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 ! diff --git a/src/physics/simple/physpkg.F90 b/src/physics/simple/physpkg.F90 index 0bbb63dd7e..9da0dd26e7 100644 --- a/src/physics/simple/physpkg.F90 +++ b/src/physics/simple/physpkg.F90 @@ -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) !-------------------------------------------------------------------------- @@ -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 @@ -643,6 +639,12 @@ 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) @@ -650,6 +652,7 @@ subroutine tphysac (ztodt, cam_in, cam_out, state, tend, pbuf) 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 ! diff --git a/src/utils/air_composition.F90 b/src/utils/air_composition.F90 index ac4f7559e5..e4dabab4fe 100644 --- a/src/utils/air_composition.F90 +++ b/src/utils/air_composition.F90 @@ -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