Skip to content

Commit

Permalink
Address review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
jimmielin committed Dec 12, 2024
1 parent 7448d73 commit 4bbb920
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 11 deletions.
7 changes: 4 additions & 3 deletions src/data/air_composition.F90
Original file line number Diff line number Diff line change
Expand Up @@ -559,13 +559,13 @@ subroutine water_composition_update(mmr, ncol, energy_formula, cp_or_cv_dycore,
! FV: moist pressure vertical coordinate does not need update.
else if (energy_formula == ENERGY_FORMULA_DYCORE_SE) then
! SE
! Note: species index subset to 1: because SIMA currently uses index 0. See #334.
! Note: species index subset to 1: because SIMA currently uses index 0. See GitHub issue #334 in ESCOMP/CAM-SIMA.
call get_cp(mmr(:ncol,:,:), .false., cp_or_cv_dycore(:ncol,:), &
factor=to_dry_factor, active_species_idx_dycore=thermodynamic_active_species_idx(1:), &
cpdry=cpairv(:ncol,:))
else if (energy_formula == ENERGY_FORMULA_DYCORE_MPAS) then
! MPAS
! Note: species index subset to 1: because SIMA currently uses index 0. See #334.
! Note: species index subset to 1: because SIMA currently uses index 0. See GitHub issue #334 in ESCOMP/CAM-SIMA.
call get_R(mmr(:ncol,:,:), thermodynamic_active_species_idx(1:), &
cp_or_cv_dycore(:ncol,:), fact=to_dry_factor, Rdry=rairv(:ncol,:))

Expand Down Expand Up @@ -699,7 +699,8 @@ subroutine get_cp_1hd(tracer, inv_cp, cp, factor, active_species_idx_dycore, cpd
! inv_cp: output inverse cp instead of cp
logical, intent(in) :: inv_cp
real(kind_phys), intent(out) :: cp(:,:)
! if provided then tracer is not a mass mixing ratio
! factor: to convert tracer to dry mixing ratio
! if provided, then tracer is not a dry mass mixing ratio
real(kind_phys), optional, intent(in) :: factor(:,:)
! active_species_idx_dycore: array of indices for index of
! thermodynamic active species in dycore tracer array
Expand Down
8 changes: 4 additions & 4 deletions src/data/cam_thermo.F90
Original file line number Diff line number Diff line change
Expand Up @@ -241,10 +241,10 @@ subroutine cam_thermo_dry_air_update(mmr, T, ncol, pver, update_thermo_variables

if (present(to_dry_factor)) then
if (SIZE(to_dry_factor, 1) /= ncol) then
call endrun(subname//'DIM 1 of to_dry_factor is'//stringify((/SIZE(to_dry_factor,1)/))//'but should be'//stringify((/ncol/)))
call endrun(subname//'DIM 1 of to_dry_factor is '//stringify((/SIZE(to_dry_factor,1)/))//' but should be '//stringify((/ncol/)))
end if
if (SIZE(to_dry_factor, 2) /= pver) then
call endrun(subname//'DIM 2 of to_dry_factor is'//stringify((/SIZE(to_dry_factor,2)/))//'but should be'//stringify((/pver/)))
call endrun(subname//'DIM 2 of to_dry_factor is '//stringify((/SIZE(to_dry_factor,2)/))//' but should be '//stringify((/pver/)))
end if
end if

Expand Down Expand Up @@ -285,10 +285,10 @@ subroutine cam_thermo_water_update(mmr, ncol, pver, energy_formula, cp_or_cv_dyc

if (present(to_dry_factor)) then
if (SIZE(to_dry_factor, 1) /= ncol) then
call endrun(subname//'DIM 1 of to_dry_factor is'//stringify((/SIZE(to_dry_factor,1)/))//'but should be'//stringify((/ncol/)))
call endrun(subname//'DIM 1 of to_dry_factor is '//stringify((/SIZE(to_dry_factor,1)/))//' but should be '//stringify((/ncol/)))
end if
if (SIZE(to_dry_factor, 2) /= pver) then
call endrun(subname//'DIM 2 of to_dry_factor is'//stringify((/SIZE(to_dry_factor,2)/))//'but should be'//stringify((/pver/)))
call endrun(subname//'DIM 2 of to_dry_factor is '//stringify((/SIZE(to_dry_factor,2)/))//' but should be '//stringify((/pver/)))
end if
end if

Expand Down
5 changes: 5 additions & 0 deletions src/dynamics/none/dyn_grid.F90
Original file line number Diff line number Diff line change
Expand Up @@ -645,6 +645,11 @@ subroutine find_energy_formula(file, grid_is_latlon)

! Find which dynamical core is used in <file> and set the energy formulation
! (also called vc_dycore in CAM)
!
! This functionality is only used to recognize the originating dynamical core
! from the snapshot file in order to set the energy formulation when running
! with the null dycore. Other dynamical cores set energy_formula_dycore at their
! initialization.

type(file_desc_t), intent(inout) :: file
logical, intent(in) :: grid_is_latlon
Expand Down
4 changes: 0 additions & 4 deletions src/dynamics/se/dp_coupling.F90
Original file line number Diff line number Diff line change
Expand Up @@ -784,10 +784,6 @@ subroutine derived_phys_dry(cam_runtime_opts, phys_state, phys_tend)
! Compute molecular viscosity(kmvis) and conductivity(kmcnd).
! Update zvirv registry variable; calculated for WACCM-X.
!-----------------------------------------------------------------------------
! **TEMP** TODO CHECK hplin: CAM has this if-clause for dry_air_species_num > 0
! or otherwise uses zvirv = zvir. CAM-SIMA previously did not have this, and
! instead has a switch for update_thermodynamic_variables. Check if we still want
! this if-clause or change it to something else.
if (dry_air_species_num > 0) then
call cam_thermo_dry_air_update( &
mmr = const_data_ptr, & ! dry MMR
Expand Down

0 comments on commit 4bbb920

Please sign in to comment.