Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updates for ZM round 4 #345

Open
wants to merge 25 commits into
base: development
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 24 commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
b34d949
Merge remote-tracking branch 'upstream/development' into cam_sima_tes…
cacraigucar May 3, 2024
d221725
Change to get cam_sima_zm to compile
cacraigucar Jul 22, 2024
e4e6b38
Merge remote-tracking branch 'court/history_court' into cam_sima_testing
cacraigucar Jul 24, 2024
7e164e5
Remove nsteps from registry as now in there
cacraigucar Jul 24, 2024
b1afafd
Fix typo in metadata file
cacraigucar Aug 7, 2024
03890e8
Merge remote-tracking branch 'court/history_court' into cam_sima_testing
cacraigucar Aug 7, 2024
18a608f
Updates to aid in getting ZM running in CAM-SIMA
cacraigucar Aug 14, 2024
ee433ee
Merge remote-tracking branch 'court/history_court' into cam_sima_testing
cacraigucar Aug 23, 2024
3c63ad1
read in all constituents from file; not just build-time ones
Sep 20, 2024
28becd1
clarify variable name
Sep 20, 2024
75cdffb
fix bug from copied code
Sep 20, 2024
006f412
fix unit tests
Sep 20, 2024
6bfe67a
Update registry for ZM
cacraigucar Sep 23, 2024
dc7b04a
fix air composition standard names; add more water species to registry
Sep 25, 2024
3adb55e
Merge remote-tracking branch 'court/read-all-const' into cam_sima_tes…
cacraigucar Sep 25, 2024
c12b6cf
Merge remote-tracking branch 'court/read-all-const' into cam_sima_tes…
cacraigucar Sep 25, 2024
30656a2
fix missing line from merge conflict
cacraigucar Sep 27, 2024
b93ab05
Merge remote-tracking branch 'upstream/development' into cam_sima_tes…
cacraigucar Dec 9, 2024
77ba066
Merge remote-tracking branch 'upstream/development' into cam_sima_tes…
cacraigucar Dec 18, 2024
6040b85
Merge remote-tracking branch 'upstream/development' into cam_sima_tes…
cacraigucar Jan 3, 2025
85a1096
Update unit test sample files
cacraigucar Jan 3, 2025
c33eb21
Fix cloud_area_fraction conflict
cacraigucar Jan 6, 2025
3c5ac5e
Merge tag 'sima0_01_000' into cam_sima_testing
cacraigucar Jan 13, 2025
395fe91
Merge remote-tracking branch 'upstream/development' into cam_sima_tes…
cacraigucar Jan 16, 2025
b6c814d
Address reviewer comments
cacraigucar Jan 27, 2025
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
16 changes: 13 additions & 3 deletions cime_config/atm_in_paramgen.py
Original file line number Diff line number Diff line change
Expand Up @@ -1495,11 +1495,21 @@ def write(self, output_path):
# Write all variables within that group (sorted alphabetically):
for var in sorted(self._data[nml_group], key=var_sort_key):
#Extract variable value(s):
val = self._data[nml_group][var]["values"].strip()
val = self._data[nml_group][var]["values"] #.strip()

#If no value is set then move to the next variable:
#Raise error if no value found:
if val is None:
continue
emsg = f"Namelist entry '{var}' is missing a "
emsg += "valid/default 'value' element."
raise AtmInParamGenError(emsg)
else:
#If value found then strip white space:
val = val.strip()
#End if

#If no value is set then move to the next variable:
#if val is None:
# continue
Comment on lines +1510 to +1512
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can these comments be removed?

#End if

#Extract variable type:
Expand Down
2 changes: 1 addition & 1 deletion src/data/physconst.meta
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
dimensions = ()
protected = True
[ cpliq ]
standard_name = specific_heat_of_liquid_water_at_20c
standard_name = specific_heat_of_liquid_water_at_constant_pressure
long_name = Specific heat of fresh H2O
units = J kg-1 K-1
type = real | kind = kind_phys
Expand Down
2 changes: 1 addition & 1 deletion src/data/ref_pres.meta
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
dimensions = ()
protected = True
[ trop_cloud_top_lev ]
standard_name = index_of_pressure_at_troposhere_cloud_top
standard_name = index_of_pressure_at_troposphere_cloud_top
jimmielin marked this conversation as resolved.
Show resolved Hide resolved
units = index
type = integer
dimensions = ()
Expand Down
71 changes: 71 additions & 0 deletions src/data/registry.xml
Original file line number Diff line number Diff line change
Expand Up @@ -491,5 +491,76 @@
<long_name>graupel mass mixing ratio with respect to moist air plus all airborne condensates</long_name>
<ic_file_input_names>GRAUQM cnst_GRAUQM</ic_file_input_names>
</variable>

<!-- cam_in Variables -->
<variable local_name="landfrac"
standard_name="land_area_fraction"
units="fraction" type="real" kind="kind_phys"
allocatable="allocatable">
<dimensions>horizontal_dimension</dimensions>
<ic_file_input_names>landfrac cam_in_landfrac</ic_file_input_names>
</variable>

<!-- Zhang McFarlane (ZM) Variables -->
<!-- Note that no_deep_pbl defaults to false, but needs to be set to true for diag_TKE or UW schemes -->
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this comment outdated? I don't see no_deep_pbl here.

<variable local_name="pblh"
standard_name="atmosphere_boundary_layer_thickness"
units="m" type="real" kind="kind_phys"
allocatable="allocatable">
<dimensions>horizontal_dimension</dimensions>
<ic_file_input_names>pblh pbuf_pblh</ic_file_input_names>
</variable>
<variable local_name="delt"
standard_name="half_timestep_for_physics"
units="s" type="real" kind="kind_phys">
</variable>
<variable local_name="tpert"
standard_name="convective_temperature_perturbation_due_to_pbl_eddies"
units="K" type="real" kind="kind_phys"
allocatable="allocatable">
<dimensions>horizontal_dimension</dimensions>
<ic_file_input_names>tpert pbuf_tpert</ic_file_input_names>
</variable>
<variable local_name="ql"
jimmielin marked this conversation as resolved.
Show resolved Hide resolved
standard_name="in_cloud_water_vapor_mixing_ratio_wrt_moist_air_and_condensed_water_due_to_deep_convection"
units="kg kg-1" type="real" kind="kind_phys"
allocatable="allocatable">
<dimensions>horizontal_dimension vertical_layer_dimension</dimensions>
<ic_file_input_names>ICWMRDP pbuf_ICWMRDP</ic_file_input_names>
</variable>
<variable local_name="cldfrc"
standard_name="cloud_area_fraction"
units="fraction" type="real" kind="kind_phys"
allocatable="allocatable">
<dimensions>horizontal_dimension vertical_layer_dimension</dimensions>
<initial_value>0.7_kind_phys</initial_value>
<ic_file_input_names>CLD pbuf_CLD</ic_file_input_names>
</variable>
<variable local_name="domomtran"
standard_name="flag_for_momentum_transport_by_zhang_mcfarlane_deep_convection_scheme"
units="flag" type="logical"
access="protected" >
<initial_value>.true.</initial_value>
</variable>
<variable local_name="il1g"
standard_name="index_of_first_column_of_gathered_deep_convection_arrays"
units="index" type="integer"
access="protected" >
<initial_value>1</initial_value>
</variable>
<variable local_name="dpdry"
jimmielin marked this conversation as resolved.
Show resolved Hide resolved
standard_name="air_pressure_thickness_of_dry_air_for_deep_convection_for_gathered_convective_columns"
units="hPa" type="real" kind="kind_phys"
allocatable="allocatable">
<dimensions>horizontal_dimension vertical_layer_dimension</dimensions>
</variable>
<variable local_name="fracis"
standard_name="fraction_of_water_insoluble_convectively_transported_species"
units="fraction" type="real" kind="kind_phys"
allocatable="allocatable"
access="protected" >
<dimensions>horizontal_dimension vertical_layer_dimension number_of_ccpp_constituents</dimensions>
<initial_value>1</initial_value>
</variable>
</file>
</registry>
8 changes: 1 addition & 7 deletions src/physics/utils/musica_ccpp_dependencies.F90
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ module musica_ccpp_dependencies
real(kind_phys), allocatable, public, protected :: extraterrestrial_radiation_flux(:)
real(kind_phys), allocatable, public, protected :: surface_albedo(:)
real(kind_phys), allocatable, public, protected :: blackbody_temperature_at_surface(:)
real(kind_phys), allocatable, public, protected :: cloud_area_fraction(:,:)

! local parameters
character(len=*), parameter :: module_name = '(musica_ccpp_dependencies)'
Expand Down Expand Up @@ -77,14 +76,9 @@ subroutine musica_ccpp_dependencies_init(horizontal_dimension, &
call check_allocate(error_code, subroutine_name, &
'blackbody_temperature_at_surface(horizontal_dimension)', &
file=__FILE__, line=__LINE__)
allocate(cloud_area_fraction(horizontal_dimension, vertical_layer_dimension), stat=error_code)
call check_allocate(error_code, subroutine_name, &
'cloud_area_fraction(horizontal_dimension, vertical_layer_dimension)', &
file=__FILE__, line=__LINE__)

surface_albedo(:) = 0.1_kind_phys
blackbody_temperature_at_surface(:) = 292.3_kind_phys
cloud_area_fraction(:,:) = 0.7_kind_phys
extraterrestrial_radiation_flux(:) = 1.0e14_kind_phys
photolysis_wavelength_grid_interfaces = (/ &
120.0e-9_kind_phys, &
Expand Down Expand Up @@ -194,4 +188,4 @@ subroutine musica_ccpp_dependencies_init(horizontal_dimension, &

end subroutine musica_ccpp_dependencies_init

end module musica_ccpp_dependencies
end module musica_ccpp_dependencies
6 changes: 0 additions & 6 deletions src/physics/utils/musica_ccpp_dependencies.meta
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,3 @@
units = K
dimensions = (horizontal_dimension)
protected = True
[ cloud_area_fraction ]
standard_name = cloud_area_fraction
type = real | kind = kind_phys
units = fraction
dimensions = (horizontal_dimension,vertical_layer_dimension)
protected = True
3 changes: 2 additions & 1 deletion src/physics/utils/phys_comp.F90
Original file line number Diff line number Diff line change
Expand Up @@ -177,12 +177,13 @@ subroutine phys_init()
use cam_thermo_formula, only: cam_thermo_formula_init
use physics_types, only: allocate_physics_types_fields
use cam_ccpp_cap, only: cam_ccpp_physics_initialize
use cam_constituents, only: num_advected

call cam_thermo_init(columns_on_task, pver, pverp)
call cam_thermo_formula_init()

call allocate_physics_types_fields(columns_on_task, pver, pverp, &
set_init_val_in=.true., reallocate_in=.false.)
num_advected, set_init_val_in=.true., reallocate_in=.false.)
jimmielin marked this conversation as resolved.
Show resolved Hide resolved
call cam_ccpp_physics_initialize(phys_suite_name)
if (errcode /= 0) then
call endrun('cam_ccpp_physics_initialize: '//trim(errmsg))
Expand Down
24 changes: 24 additions & 0 deletions src/physics/utils/ppgrid.F90
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@

module ppgrid

!-----------------------------------------------------------------------
!
! Purpose: USED ONLY FOR BACKWARDS COMPATIBILITY WITH CAM!!!!
! PLEASE DELETE ONCE NO LONGER NEEDED BY "to_be_ccppized"
! PHYSICS SCHEMES!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
! Thanks!
!-----------------------------------------------------------------------

use physics_grid, only: pcols => columns_on_task
use vert_coord, only: pver => pver, pverp => pverp !WILL NEED TO CHANGE THESE NAMES TO
!SOMETHING ELSE IN CAM-SIMA!
Comment on lines +13 to +14
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i'm guessing this is a question for @nusbaume - do these variable names need to change?


implicit none
private
save

public pcols
public pver
public pverp

end module ppgrid
4 changes: 4 additions & 0 deletions src/utils/time_manager.F90
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,8 @@ subroutine timemgr_init( &
ref_tod, stop_ymd, stop_tod, curr_ymd, curr_tod, &
perpetual_run, perpetual_ymd, initial_run)

use phys_vars_init_check, only: mark_as_initialized

! Initialize the time manager.

! Arguments
Expand Down Expand Up @@ -152,6 +154,8 @@ subroutine timemgr_init( &
call timemgr_print()
end if

call mark_as_initialized('current_timestep_number')

end subroutine timemgr_init

!===========================================================================
Expand Down
Loading