Skip to content

Commit

Permalink
Merge pull request ESCOMP#887 from jtruesdal/waccmxfv_thermo_fix
Browse files Browse the repository at this point in the history
WACCMX-FV bug fix:convert wet species to dry before calling cam_thermo_dry_air_update
This PR corrects a bug introduced in cam6_3_109. Physics requires constituents mixing ratios to be dry but was using constituent thermodynamic properties based on the wet mixing ratio returned by dynamics. To fix this bug, the routine called to convert mixing ratios from wet to dry was moved further up in d_p_coupling so that it is called before the thermodynamic properties are calculated for physics.

An additional fix to close issue ESCOMP#690 was added to correct namelist default types which are used to control the effect of the SE sponge layer. se_sponge_del4_nu_div_fac has been redefined from and integer to a real type as it controls real valued coefficient. se_sponge_del4_lev was defined as a real but identifies a specific integer model level and has been redefined from a real to integer type.

closes ESCOMP#885
closes ESCOMP#690
closes ESCOMP#893
  • Loading branch information
jtruesdal committed Oct 6, 2023
2 parents ce55d98 + 2243090 commit 8cd44c5
Show file tree
Hide file tree
Showing 4 changed files with 84 additions and 8 deletions.
4 changes: 2 additions & 2 deletions bld/namelist_files/namelist_definition.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7901,7 +7901,7 @@ If < 0, se_sponge_del4_nu_fac is automatically set based on model top locatio
Default: Set by build-namelist.
</entry>

<entry id="se_sponge_del4_nu_div_fac" type="integer" category="se"
<entry id="se_sponge_del4_nu_div_fac" type="real" category="se"
group="dyn_se_inparm" valid_values="" >
Divergence damping hyperviscosity coefficient se_nu_div [m^4/s] for u,v is increased to
se_nu_p*se_sponge_del4_nu_div_fac following a hyperbolic tangent function
Expand All @@ -7915,7 +7915,7 @@ If &lt; 0, se_sponge_del4_nu_div_fac is automatically set based on model top loc
Default: Set by build-namelist.
</entry>

<entry id="se_sponge_del4_lev" type="real" category="se"
<entry id="se_sponge_del4_lev" type="integer" category="se"
group="dyn_se_inparm" valid_values="" >
Level index around which increased del4 damping is centered.

Expand Down
66 changes: 66 additions & 0 deletions doc/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,4 +1,70 @@
===============================================================

Tag name: cam6_3_130
Originator(s): pel, jet, cacraig
Date: Oct 06, 2023
One-line Summary: WACCMX-FV bug fix (correct calling sequenc of wet/dry species conversion), Derecho archive update
Github PR URL: https://github.com/ESCOMP/CAM/pull/887

Purpose of changes (include the issue number and title text for each relevant GitHub issue):
This tag closes the following issues:
- Add Derecho support for archiving baselines (https://github.com/ESCOMP/CAM/issue/893)
- bug fix: correct timing of wet/dry mixing ratio conversion (https://github.com/ESCOMP/CAM/issues/885)
- bug fix: correct se_sponge_del4_nu_div_fac and se_sponge_del4_lev NL type definitions (https://github.com/ESCOMP/CAM/issues/690)

Describe any changes made to build system:
Added Derecho support for archiving baselines

Describe any changes made to the namelist:
Corrected namelist type definitions for se_sponge_del4_nu_div_fac and se_sponge_del4_lev

List any changes to the defaults for the boundary datasets: N/A

Describe any substantial timing or memory changes: N/A

Code reviewed by: cacraig, nusbaume, pel

List all files eliminated: N/A

List all files added and what they do: N/A

List all existing files that have been modified, and describe the changes:

M bld/namelist_files/namelist_definition.xml
- correct namelist type definitions for se_sponge_del4_nu_div_fac and se_sponge_del4_lev

M src/dynamics/fv/dp_coupling.F90
- correct calling sequence for wet/dry constituent conversion

M test/system/archive_baseline.sh
- Update to archive Derecho baselines

If there were any failures reported from running test_driver.sh on any test
platform, and checkin with these failures has been OK'd by the gatekeeper,
then copy the lines from the td.*.status files for the failed tests to the
appropriate machine below. All failed tests must be justified.

cheyenne/intel/aux_cam: All BFB except
FAIL ERP_Ln9_Vnuopc.C96_C96_mg17.F2000climo.cheyenne_intel.cam-outfrq9s_mg3 MODEL_BUILD time=2
- pre-existing failure

FAIL ERP_Ln9_Vnuopc.f09_f09_mg17.FCSD_HCO.cheyenne_intel.cam-outfrq9s COMPARE_base_rest
FAIL SMS_Lh12_Vnuopc.f09_f09_mg17.FCSD_HCO.cheyenne_intel.cam-outfrq3h (Overall: DIFF)
- pre-existing failure

FAIL ERC_D_Ln9_Vnuopc.f19_f19_mg17.QPX2000.cheyenne_intel.cam-outfrq3s (Overall: DIFF)
FAIL ERS_Ln9_Vnuopc.f09_f09_mg17.FX2000.cheyenne_intel.cam-outfrq9s (Overall: DIFF)
FAIL ERS_Ln9_Vnuopc.f19_f19_mg17.FXSD.cheyenne_intel.cam-outfrq9s (Overall: DIFF)
FAIL SMS_D_Ln9_Vnuopc.f19_f19_mg17.FXHIST.cheyenne_intel.cam-outfrq9s_amie (Overall: DIFF)
- expected failures: WACCMX differences from correcting calling sequence for wet/dry mixing ratio conversion

izumi/nag/aux_cam: All BFB except
DAE_Vnuopc.f45_f45_mg37.FHS94.izumi_nag.cam-dae (Overall: FAIL)
- pre-existing failure

izumi/gnu/aux_cam: All BFB

===============================================================
===============================================================

Tag name: cam6_3_129
Expand Down
12 changes: 6 additions & 6 deletions src/dynamics/fv/dp_coupling.F90
Original file line number Diff line number Diff line change
Expand Up @@ -571,7 +571,12 @@ subroutine d_p_coupling(grid, phys_state, phys_tend, pbuf2d, dyn_out)
end if
end do
end do

!
! Convert dry type constituents from moist to dry mixing ratio
! (note: cam_thermo_dry_air_update assumes dry unless optional conversion factor provided)
!
call set_state_pdry(phys_state(lchnk)) ! First get dry pressure to use for this timestep
call set_wet_to_dry(phys_state(lchnk)) ! Dynamics had moist, physics wants dry
if (dry_air_species_num>0) then
!------------------------------------------------------------
! Apply limiters to mixing ratios of major species
Expand Down Expand Up @@ -608,11 +613,6 @@ subroutine d_p_coupling(grid, phys_state, phys_tend, pbuf2d, dyn_out)
end do

!
! Convert dry type constituents from moist to dry mixing ratio
!
call set_state_pdry(phys_state(lchnk)) ! First get dry pressure to use for this timestep
call set_wet_to_dry(phys_state(lchnk)) ! Dynamics had moist, physics wants dry.
!
! Ensure tracers are all positive
!
call qneg3('D_P_COUPLING',lchnk ,ncol ,pcols ,pver , &
Expand Down
10 changes: 10 additions & 0 deletions test/system/archive_baseline.sh
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,16 @@ case $hostname in
baselinedir="/glade/p/cesm/amwg/cesm_baselines/$cam_tag"
;;

de*)
echo "server: derecho"
if [ -z "$CAM_FC" ]; then
CAM_FC="INTEL"
fi
test_file_list="tests_pretag_derecho"
cam_tag=$1
baselinedir="/glade/p/cesm/amwg/derecho_baselines/$cam_tag"
;;

* ) echo "ERROR: machine $hostname not currently supported"; exit 1 ;;
esac

Expand Down

0 comments on commit 8cd44c5

Please sign in to comment.