Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
c4db3e4
add wl
oksanaguba Jan 24, 2022
f7fc18b
switch to dp adjust
oksanaguba Jan 27, 2022
e668a16
adding cp terms
oksanaguba Jan 27, 2022
ea8449c
confirmed cp=pw, confirmed fixer_pb_simple ok up to 1e-9, wip
oksanaguba Jan 30, 2022
9c3a71c
fixing sign, a lot of comments
oksanaguba Feb 6, 2022
9cd857e
Merge remote-tracking branch 'origin/og/wl' into og/cpterms-columnfixer
oksanaguba Apr 4, 2022
b7ed63a
run with cpstar, only T scaled, glob energy uses cpdry
oksanaguba Apr 6, 2022
9a296ee
fix ratio bug
oksanaguba Apr 6, 2022
45642f0
add cpstar to energy def
oksanaguba Apr 11, 2022
8054363
add dme_adjust_wl, cpp, cpe terms in output, redef cpterms with cp co…
oksanaguba Apr 23, 2022
fd360b3
comments, typos
oksanaguba May 10, 2022
976c30c
cpstar, cpstar as a const, debugging statements
oksanaguba May 12, 2022
b912f54
add wl, cpstar, enthalpy options as namelist vars
oksanaguba May 12, 2022
80f7cea
translate wl variable into a homme wl variable
oksanaguba May 12, 2022
4cb77ec
clean logic using new nl variables
oksanaguba May 12, 2022
8c8bf60
fix energy function for nl vars
oksanaguba May 13, 2022
50f8764
add statistics on fluxes
oksanaguba May 16, 2022
93a47f2
fix mass factor for prect
oksanaguba May 16, 2022
74d98e9
add dycore var for fixer
oksanaguba May 17, 2022
49013c3
add wl to pdeldry
oksanaguba May 21, 2022
cdeb76c
add vapor pw diagnostics
oksanaguba Jul 5, 2022
9510e8a
the prev commit reset cp for use_enthalpy_cl, fixing it
oksanaguba Jul 5, 2022
688e8c7
adding cpwv enthalpy
oksanaguba Jul 5, 2022
89461ec
use cpstar in check_energy, pu,redo logic around it.
oksanaguba Jul 6, 2022
fcd4aca
fixing diagnostics of PW, fixing init of cpstar for the fixer
oksanaguba Jul 7, 2022
a728b52
add check energy for dadadj
oksanaguba Jul 13, 2022
2f470e7
more info on reprosum fails
oksanaguba Jul 13, 2022
db2b849
debug state, not cleaned
oksanaguba Jul 13, 2022
582b519
clean some debuggin
oksanaguba Jul 13, 2022
77bb4e1
fix bug for uninited cp var, add interface version of PU
oksanaguba Jul 14, 2022
b012758
fix bug in call with cpstar, debug info
oksanaguba Aug 23, 2022
901ee65
remove debug info
oksanaguba Aug 23, 2022
f24186b
apply the fix 2x, add a comment about teloc pcols
oksanaguba Aug 24, 2022
7ff5a27
fix string
oksanaguba Aug 25, 2022
0559392
fix bug in pw computation
oksanaguba Dec 5, 2022
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
10 changes: 10 additions & 0 deletions components/eam/bld/build-namelist
Original file line number Diff line number Diff line change
Expand Up @@ -3848,6 +3848,16 @@ if ($nl->get_value('use_gw_convect') =~ /$TRUE/io) {
add_default($nl, 'use_gw_energy_fix' , 'val'=>'.true.');


add_default($nl, 'use_waterloading' , 'val'=>'.true.');
add_default($nl, 'use_cpstar' , 'val'=>'.true.');
add_default($nl, 'use_enthalpy_cpdry' , 'val'=>'.true.');
add_default($nl, 'use_enthalpy_cl' , 'val'=>'.false.');
add_default($nl, 'use_enthalpy_cpwv' , 'val'=>'.false.');
add_default($nl, 'use_enthalpy_theoretical' , 'val'=>'.false.');
add_default($nl, 'use_global_cpterms_dme' , 'val'=>'.true.');
add_default($nl, 'dycore_fixer_only' , 'val'=>'.false.');


# Some complexity to unpack.
# 1. In WACCM, we want tau_0_ubc = .false., because it hasn't been tuned
# for that option.
Expand Down
25 changes: 25 additions & 0 deletions components/eam/bld/namelist_files/namelist_defaults_eam.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1678,6 +1678,31 @@ with se_tstep, dt_remap_factor, dt_tracer_factor set to -1
<gw_convect_hcf phys="default"> 10.0 </gw_convect_hcf>
<effgw_oro phys="default"> 0.375 </effgw_oro>
<use_gw_energy_fix phys="default"> .true. </use_gw_energy_fix>

<!-- this var affects DME adjustment only -->
<use_waterloading phys="default"> .true. </use_waterloading>

<!-- this var=true can only be used with use_waterloading=true -->
<!-- this is used in calculations of energy for DME adjust -->
<use_cpstar phys="default"> .true. </use_cpstar>

<!-- for the next 3 vars, 1 and only 1 can be set to true -->
<!-- this var=true computes enthalpies of qflx and prect with cpdry -->
<use_enthalpy_cpdry phys="default"> .true. </use_enthalpy_cpdry>

<!-- this var=true computes enthalpies of qflx and prect with cl -->
<use_enthalpy_cl phys="default"> .false. </use_enthalpy_cl>

<!-- this var=true computes enthalpies of qflx and prect with all correct c -->
<use_enthalpy_theoretical phys="default"> .false. </use_enthalpy_theoretical>

<!-- this var=true removes enthalpies/eflx from dme -->
<use_global_cpterms_dme phys="default"> .true. </use_global_cpterms_dme>

<!-- this var=true removes PW from fixer, resetting energy -->
<dycore_fixer_only phys="default"> .false. </dycore_fixer_only>


<clubb_C14 phys="default"> 2.5D0 </clubb_C14>
<clubb_tk1 phys="default"> 268.15D0 </clubb_tk1>
<dust_emis_fact phys="default"> 1.50D0 </dust_emis_fact>
Expand Down
46 changes: 46 additions & 0 deletions components/eam/bld/namelist_files/namelist_definition.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1028,6 +1028,52 @@ IEFLX fixer options
Default: 0
</entry>



<entry id="use_waterloading" type="logical" category="fixers"
group="phys_ctl_nl" valid_values="" >
Default: set by build-namelist.
</entry>

<entry id="use_cpstar" type="logical" category="fixers"
group="phys_ctl_nl" valid_values="" >
Default: set by build-namelist.
</entry>

<entry id="use_enthalpy_cpdry" type="logical" category="fixers"
group="phys_ctl_nl" valid_values="" >
Default: set by build-namelist.
</entry>

<entry id="use_enthalpy_cl" type="logical" category="fixers"
group="phys_ctl_nl" valid_values="" >
Default: set by build-namelist.
</entry>

<entry id="use_enthalpy_cpwv" type="logical" category="fixers"
group="phys_ctl_nl" valid_values="" >
Default: set by build-namelist.
</entry>

<entry id="use_enthalpy_theoretical" type="logical" category="fixers"
group="phys_ctl_nl" valid_values="" >
Default: set by build-namelist.
</entry>

<entry id="use_global_cpterms_dme" type="logical" category="fixers"
group="phys_ctl_nl" valid_values="" >
Default: set by build-namelist.
</entry>

<entry id="dycore_fixer_only" type="logical" category="fixers"
group="phys_ctl_nl" valid_values="" >
Default: set by build-namelist.
</entry>





<!-- Gravity Wave Drag -->

<entry id="use_gw_oro" type="logical" category="gw_drag"
Expand Down
3 changes: 3 additions & 0 deletions components/eam/src/control/cam_control_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ module cam_control_mod

integer :: magfield_fix_year = 1995

!to pass waterloading logic to homme
logical :: cam_ctrl_waterloading = .false.

contains

subroutine cam_ctrl_set_physics_type(phys_package)
Expand Down
3 changes: 2 additions & 1 deletion components/eam/src/control/physconst.F90
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ module physconst
shr_const_rwv, shr_const_zvir, shr_const_pi, &
shr_const_rearth, shr_const_sday, shr_const_cday, &
shr_const_spval, shr_const_omega, shr_const_cpvir, &
shr_const_tktrip
shr_const_cpice, shr_const_tktrip
use ppgrid, only: pcols, pver, pverp, begchunk, endchunk ! Dimensions and chunk bounds

implicit none
Expand All @@ -37,6 +37,7 @@ module physconst
real(r8), public, parameter :: cday = shr_const_cday ! sec in calendar day ~ sec
real(r8), public, parameter :: cpair = shr_const_cpdair ! specific heat of dry air (J/K/kg)
real(r8), public, parameter :: cpliq = shr_const_cpfw ! specific heat of fresh h2o (J/K/kg)
real(r8), public, parameter :: cpice = shr_const_cpice ! specific heat of fresh ice (J/K/kg)
real(r8), public, parameter :: karman = shr_const_karman ! Von Karman constant
real(r8), public, parameter :: latice = shr_const_latice ! Latent heat of fusion (J/kg)
real(r8), public, parameter :: latvap = shr_const_latvap ! Latent heat of vaporization (J/kg)
Expand Down
11 changes: 11 additions & 0 deletions components/eam/src/dynamics/se/dp_coupling.F90
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,9 @@ subroutine d_p_coupling(phys_state, phys_tend, pbuf2d, dyn_out)
ioff = idmb2(1)
phys_state(lchnk)%ps(icol) = ps_tmp(ioff,ie)
phys_state(lchnk)%phis(icol) = zs_tmp(ioff,ie)

phys_state(lchnk)%oldps(icol) = ps_tmp(ioff,ie)

do ilyr = 1,pver
phys_state(lchnk)%t(icol,ilyr) = T_tmp(ioff,ilyr,ie)
phys_state(lchnk)%u(icol,ilyr) = uv_tmp(ioff,1,ilyr,ie)
Expand All @@ -190,6 +193,7 @@ subroutine d_p_coupling(phys_state, phys_tend, pbuf2d, dyn_out)
do m = 1,pcnst
do ilyr = 1,pver
phys_state(lchnk)%q(icol,ilyr,m) = q_tmp(ioff,ilyr,m,ie)
phys_state(lchnk)%oldq(icol,ilyr,m) = q_tmp(ioff,ilyr,m,ie)
end do ! ilyr
end do ! m
end do ! icol
Expand Down Expand Up @@ -254,6 +258,9 @@ subroutine d_p_coupling(phys_state, phys_tend, pbuf2d, dyn_out)
do icol = 1,ncols
phys_state(lchnk)%ps (icol) = cbuffer(cpter(icol,0))
phys_state(lchnk)%phis(icol) = cbuffer(cpter(icol,0)+1)

phys_state(lchnk)%oldps (icol) = cbuffer(cpter(icol,0))

do ilyr = 1,pver
phys_state(lchnk)%t (icol,ilyr) = cbuffer(cpter(icol,ilyr))
phys_state(lchnk)%u (icol,ilyr) = cbuffer(cpter(icol,ilyr)+1)
Expand All @@ -265,6 +272,7 @@ subroutine d_p_coupling(phys_state, phys_tend, pbuf2d, dyn_out)
end if
do m = 1,pcnst
phys_state(lchnk)%q(icol,ilyr,m) = cbuffer(cpter(icol,ilyr)+tsize-pcnst-1+m)
phys_state(lchnk)%oldq(icol,ilyr,m) = cbuffer(cpter(icol,ilyr)+tsize-pcnst-1+m)
end do ! m
end do ! ilyr
end do ! icol
Expand Down Expand Up @@ -551,6 +559,9 @@ subroutine derived_phys(phys_state, phys_tend, pbuf2d)
do i = 1,ncol
phys_state(lchnk)%pdel (i,k) = phys_state(lchnk)%pint(i,k+1) &
-phys_state(lchnk)%pint(i,k)

phys_state(lchnk)%oldpdel (i,k) = phys_state(lchnk)%pdel (i,k)

phys_state(lchnk)%rpdel(i,k) = 1._r8/phys_state(lchnk)%pdel(i,k)
phys_state(lchnk)%exner (i,k) = (phys_state(lchnk)%pint(i,pver+1) &
/phys_state(lchnk)%pmid(i,k))**cappa
Expand Down
2 changes: 1 addition & 1 deletion components/eam/src/dynamics/se/se_single_column_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ subroutine apply_SC_forcing(elem,hvcoord,tl,n,t_before_advance,nets,nete)
use scamMod, only: single_column, use_3dfrc
use kinds, only : real_kind
use dimensions_mod, only : np, np, nlev, npsq
use control_mod, only : use_cpstar, qsplit
use control_mod, only : qsplit
use hybvcoord_mod, only : hvcoord_t
use element_mod, only : element_t
use physical_constants, only : Cp, Rgas, cpwater_vapor
Expand Down
Loading