Skip to content

Commit

Permalink
Merging in updates from ccpp-framework and atmospheric_physcis. Updat…
Browse files Browse the repository at this point in the history
…ing gravit standard name. Making etamid visible via metadata file.
  • Loading branch information
mwaxmonsky committed Mar 15, 2024
1 parent 81224d5 commit 19e1586
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 8 deletions.
2 changes: 1 addition & 1 deletion Externals_CAM.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ required = True
local_path = src/physics/ncar_ccpp
protocol = git
repo_url = https://github.com/mwaxmonsky/atmospheric_physics
tag = 3c1d72c3b8e641da00ca10e485e9877dc9cc167f
tag = 9705c32c2c2e9b47655a3a057d25b5acbed20210
required = True

[externals_description]
Expand Down
2 changes: 1 addition & 1 deletion src/data/physconst.meta
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@
dimensions = ()
protected = True
[ gravit ]
standard_name = gravitational_acceleration
standard_name = standard_gravitational_acceleration
units = m s-2
type = real | kind = kind_phys
dimensions = ()
Expand Down
9 changes: 9 additions & 0 deletions src/data/registry.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
<metadata_file>$SRCROOT/src/data/cam_thermo.meta</metadata_file>
<metadata_file>$SRCROOT/src/data/ref_pres.meta</metadata_file>
<metadata_file>$SRCROOT/src/dynamics/utils/vert_coord.meta</metadata_file>
<metadata_file>$SRCROOT/src/dynamics/utils/hycoef.meta</metadata_file>
<!-- Variables registered to physics_types -->
<file name="physics_types" type="module">
<use module="ccpp_kinds" reference="kind_phys"/>
Expand Down Expand Up @@ -355,5 +356,13 @@
<dimensions>horizontal_dimension vertical_layer_dimension</dimensions>
<initial_value>zvir</initial_value>
</variable>
<variable local_name="heating_rate"
standard_name="tendency_of_dry_air_enthalpy_at_constant_pressure"
units="J kg-1 s-1" type="real" kind="kind_phys"
allocatable="allocatable">
<long_name>ff</long_name>
<dimensions>horizontal_dimension vertical_layer_dimension</dimensions>
<ic_file_input_names>tendency_of_air_enthalpy</ic_file_input_names>
</variable>
</file>
</registry>
15 changes: 9 additions & 6 deletions src/dynamics/utils/hycoef.F90
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
module hycoef

use shr_kind_mod, only: r8 => shr_kind_r8
use ccpp_kinds, only: kind_phys
use spmd_utils, only: masterproc
use vert_coord, only: pver, pverp
use cam_logfile, only: iulog
Expand Down Expand Up @@ -28,8 +29,6 @@ module hycoef
real(r8), public, allocatable, target :: hybi(:) ! ps component of hybrid coordinate - interfaces
real(r8), public, allocatable, target :: hybm(:) ! ps component of hybrid coordinate - midpoints

real(r8), public, allocatable :: etamid(:) ! hybrid coordinate - midpoints

real(r8), public, allocatable :: hybd(:) ! difference in b (hybi) across layers
real(r8), public, allocatable :: hypi(:) ! reference pressures at interfaces
real(r8), public, allocatable :: hypm(:) ! reference pressures at midpoints
Expand All @@ -47,6 +46,10 @@ module hycoef
type(var_desc_t) :: hyam_desc, hyai_desc, hybm_desc, hybi_desc, p0_desc
public init_restart_hycoef, write_restart_hycoef

!> \section arg_table_hycoef Argument Table
!! \htmlinclude hycoef.html
real(kind_phys), public, :: etamid(pver) ! hybrid coordinate - midpoints

!=======================================================================
contains
!=======================================================================
Expand Down Expand Up @@ -123,10 +126,10 @@ subroutine hycoef_init(file, psdry)
call endrun(subname//': allocate hybm(pver) failed with stat: '//to_str(iret))
end if

allocate(etamid(pver), stat=iret)
if (iret /= 0) then
call endrun(subname//': allocate etamid(pver) failed with stat: '//to_str(iret))
end if
!allocate(etamid(pver), stat=iret)
!if (iret /= 0) then
! call endrun(subname//': allocate etamid(pver) failed with stat: '//to_str(iret))
!end if

allocate(hybd(pver), stat=iret)
if (iret /= 0) then
Expand Down
13 changes: 13 additions & 0 deletions src/dynamics/utils/hycoef.meta
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[ccpp-table-properties]
name = hycoef
type = module
[ccpp-arg-table]
name = hycoef
type = module

[ etamid ]
standard_name = sum_of_sigma_pressure_hybrid_coordinate_a_coefficient_and_sigma_pressure_hybrid_coordinate_b_coefficient
type = real | kind = kind_phys
units = 1
dimensions = (vertical_layer_dimension)

0 comments on commit 19e1586

Please sign in to comment.