-
Notifications
You must be signed in to change notification settings - Fork 15
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
Add calculation of solar zenith angle and Earth–Sun distance #337
Merged
mattldawson
merged 37 commits into
ESCOMP:development
from
mattldawson:develop-328-orbital-properties
Dec 31, 2024
Merged
Changes from all commits
Commits
Show all changes
37 commits
Select commit
Hold shift + click to select a range
6b6262c
and orbital data module
mattldawson 6a78028
draft updates to call orbital data functions during simulation
mattldawson 85507a5
update musica dependency modules
mattldawson 64972ba
update MUSICA dependencies
mattldawson c5b59b2
merge development into develop-328-orbital-properties
peverwhee 1503ca4
Sort `use` statements and adjust indentation
kuanchihwang 0374d8d
Implement MPAS subdriver
kuanchihwang 01af24b
Support for computing edge wind tendency in MPAS subdriver
kuanchihwang 7a06bcb
Implement `dyn_run`
kuanchihwang eb3792f
Wire up `dyn_run`
kuanchihwang 22c26d5
Sort `use` statements and add comments
kuanchihwang 3c4faa5
Factor out variable finalization
kuanchihwang 0e3a2d1
Implement `reverse`
kuanchihwang 7e34e0c
Refactor assignments between CAM-SIMA and MPAS in terms of `reverse`
kuanchihwang eb81389
Implement `dyn_exchange_constituent_state`
kuanchihwang d6fc775
Switch to use `dyn_exchange_constituent_state`
kuanchihwang 9b81368
Implement dynamics-physics coupling and vice versa
kuanchihwang c6d65bd
Wire up dynamics-physics coupling
kuanchihwang ffded6e
Add more detailed comments about an MPAS subroutine
kuanchihwang f58a958
Fix grammar in comments
kuanchihwang 4f1fe50
Only call `reverse` once per cell when performing conversion
kuanchihwang 4de2299
Pass arguments by keywords for better clarity
kuanchihwang cf1e015
Rename internal subroutines
kuanchihwang 19ff182
Include error codes and messages returned by external procedures
kuanchihwang ac8fbe0
Just use equation of state
kuanchihwang 0a7d866
Do not assume no water at top of model
kuanchihwang 47c41ba
Add more detailed comments about equation derivation
kuanchihwang 1472273
add function argument
mattldawson 3c153f5
merge development into develop-328-optical-properties
mattldawson 1ceba5a
update dockerfile
mattldawson b473122
use photons in units
mattldawson afee2af
address reviewer comments
mattldawson 253a5eb
address reviewer comments
mattldawson da5891c
update atmopsheric physics
mattldawson 252cdb1
Merge branch 'development' into develop-328-orbital-properties
mattldawson 404e8e4
update atmos phys commit and change radians to rad
mattldawson be4ee44
ignore vscode files
mattldawson File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,3 +15,4 @@ test_driver_*.sh | |
*~ | ||
.#* | ||
\#*# | ||
**/.vscode/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,197 @@ | ||
! Copyright (C) 2024 National Science Foundation-National Center for Atmospheric Research | ||
! SPDX-License-Identifier: Apache-2.0 | ||
module musica_ccpp_dependencies | ||
!-------------------------------------------------------------------------- | ||
! | ||
! This module temporarily provides data that MUSICA chemistry consumes but | ||
! does not produce. The values are realistic but are not based on the | ||
! actual model state. These should be removed as the producers of this data | ||
! are added to CAM-SIMA or as CCPP-compliant physics schemes. | ||
! | ||
! IMPORTANT: This module must be completely removed before doing any actual | ||
! science with MUSICA chemistry in CAM-SIMA. | ||
! | ||
!-------------------------------------------------------------------------- | ||
|
||
use ccpp_kinds, only: kind_phys | ||
|
||
implicit none | ||
private | ||
|
||
public :: musica_ccpp_dependencies_init | ||
|
||
!> \section arg_table_musica_ccpp_dependencies Argument Table | ||
!! \htmlinclude arg_table_musica_ccpp_dependencies.html | ||
!! | ||
integer, public, protected :: photolysis_wavelength_grid_section_dimension = 102 | ||
integer, public, protected :: photolysis_wavelength_grid_interface_dimension = 103 | ||
real(kind_phys), allocatable, public, protected :: photolysis_wavelength_grid_interfaces(:) | ||
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)' | ||
|
||
!============================================================================== | ||
contains | ||
!============================================================================== | ||
|
||
subroutine musica_ccpp_dependencies_init(horizontal_dimension, & | ||
vertical_layer_dimension, log_file_unit) | ||
|
||
use cam_abortutils, only: check_allocate | ||
|
||
!----------------------------------------------------------------------- | ||
! | ||
! Initialize the MUSICA scheme dependencies. | ||
! | ||
!----------------------------------------------------------------------- | ||
|
||
integer, intent(in) :: horizontal_dimension | ||
integer, intent(in) :: vertical_layer_dimension | ||
integer, intent(in) :: log_file_unit | ||
|
||
integer :: error_code | ||
character(len=*), parameter :: subroutine_name = & | ||
trim(module_name)//':(musica_ccpp_dependencies_init)' | ||
|
||
write(log_file_unit,*) 'WARNING: Using placeholder data for MUSICA chemistry.' | ||
|
||
allocate(photolysis_wavelength_grid_interfaces(photolysis_wavelength_grid_interface_dimension), & | ||
stat=error_code) | ||
call check_allocate(error_code, subroutine_name, & | ||
'photolysis_wavelength_grid_interfaces(photolysis_wavelength_grid_interface_dimension)', & | ||
file=__FILE__, line=__LINE__) | ||
allocate(extraterrestrial_radiation_flux(photolysis_wavelength_grid_section_dimension), & | ||
stat=error_code) | ||
call check_allocate(error_code, subroutine_name, & | ||
'extraterrestrial_radiation_flux(photolysis_wavelength_grid_section_dimension)', & | ||
file=__FILE__, line=__LINE__) | ||
allocate(surface_albedo(horizontal_dimension), stat=error_code) | ||
call check_allocate(error_code, subroutine_name, & | ||
'surface_albedo(horizontal_dimension)', & | ||
file=__FILE__, line=__LINE__) | ||
allocate(blackbody_temperature_at_surface(horizontal_dimension), stat=error_code) | ||
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, & | ||
121.4e-9_kind_phys, & | ||
121.9e-9_kind_phys, & | ||
123.5e-9_kind_phys, & | ||
124.3e-9_kind_phys, & | ||
125.5e-9_kind_phys, & | ||
126.3e-9_kind_phys, & | ||
127.1e-9_kind_phys, & | ||
130.1e-9_kind_phys, & | ||
131.1e-9_kind_phys, & | ||
135.0e-9_kind_phys, & | ||
140.0e-9_kind_phys, & | ||
145.0e-9_kind_phys, & | ||
150.0e-9_kind_phys, & | ||
155.0e-9_kind_phys, & | ||
160.0e-9_kind_phys, & | ||
165.0e-9_kind_phys, & | ||
168.0e-9_kind_phys, & | ||
171.0e-9_kind_phys, & | ||
173.0e-9_kind_phys, & | ||
174.4e-9_kind_phys, & | ||
175.4e-9_kind_phys, & | ||
177.0e-9_kind_phys, & | ||
178.6e-9_kind_phys, & | ||
180.2e-9_kind_phys, & | ||
181.8e-9_kind_phys, & | ||
183.5e-9_kind_phys, & | ||
185.2e-9_kind_phys, & | ||
186.9e-9_kind_phys, & | ||
188.7e-9_kind_phys, & | ||
190.5e-9_kind_phys, & | ||
192.3e-9_kind_phys, & | ||
194.2e-9_kind_phys, & | ||
196.1e-9_kind_phys, & | ||
198.0e-9_kind_phys, & | ||
200.0e-9_kind_phys, & | ||
202.0e-9_kind_phys, & | ||
204.1e-9_kind_phys, & | ||
206.2e-9_kind_phys, & | ||
208.0e-9_kind_phys, & | ||
211.0e-9_kind_phys, & | ||
214.0e-9_kind_phys, & | ||
217.0e-9_kind_phys, & | ||
220.0e-9_kind_phys, & | ||
223.0e-9_kind_phys, & | ||
226.0e-9_kind_phys, & | ||
229.0e-9_kind_phys, & | ||
232.0e-9_kind_phys, & | ||
235.0e-9_kind_phys, & | ||
238.0e-9_kind_phys, & | ||
241.0e-9_kind_phys, & | ||
244.0e-9_kind_phys, & | ||
247.0e-9_kind_phys, & | ||
250.0e-9_kind_phys, & | ||
253.0e-9_kind_phys, & | ||
256.0e-9_kind_phys, & | ||
259.0e-9_kind_phys, & | ||
263.0e-9_kind_phys, & | ||
267.0e-9_kind_phys, & | ||
271.0e-9_kind_phys, & | ||
275.0e-9_kind_phys, & | ||
279.0e-9_kind_phys, & | ||
283.0e-9_kind_phys, & | ||
287.0e-9_kind_phys, & | ||
291.0e-9_kind_phys, & | ||
295.0e-9_kind_phys, & | ||
298.5e-9_kind_phys, & | ||
302.5e-9_kind_phys, & | ||
305.5e-9_kind_phys, & | ||
308.5e-9_kind_phys, & | ||
311.5e-9_kind_phys, & | ||
314.5e-9_kind_phys, & | ||
317.5e-9_kind_phys, & | ||
322.5e-9_kind_phys, & | ||
327.5e-9_kind_phys, & | ||
332.5e-9_kind_phys, & | ||
337.5e-9_kind_phys, & | ||
342.5e-9_kind_phys, & | ||
347.5e-9_kind_phys, & | ||
350.0e-9_kind_phys, & | ||
355.0e-9_kind_phys, & | ||
360.0e-9_kind_phys, & | ||
365.0e-9_kind_phys, & | ||
370.0e-9_kind_phys, & | ||
375.0e-9_kind_phys, & | ||
380.0e-9_kind_phys, & | ||
385.0e-9_kind_phys, & | ||
390.0e-9_kind_phys, & | ||
395.0e-9_kind_phys, & | ||
400.0e-9_kind_phys, & | ||
405.0e-9_kind_phys, & | ||
410.0e-9_kind_phys, & | ||
415.0e-9_kind_phys, & | ||
420.0e-9_kind_phys, & | ||
430.0e-9_kind_phys, & | ||
440.0e-9_kind_phys, & | ||
450.0e-9_kind_phys, & | ||
500.0e-9_kind_phys, & | ||
550.0e-9_kind_phys, & | ||
600.0e-9_kind_phys, & | ||
650.0e-9_kind_phys, & | ||
700.0e-9_kind_phys, & | ||
750.0e-9_kind_phys & | ||
/) | ||
|
||
end subroutine musica_ccpp_dependencies_init | ||
|
||
end module musica_ccpp_dependencies |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
[ccpp-table-properties] | ||
name = musica_ccpp_dependencies | ||
type = module | ||
[ccpp-arg-table] | ||
name = musica_ccpp_dependencies | ||
type = module | ||
[ photolysis_wavelength_grid_section_dimension ] | ||
standard_name = photolysis_wavelength_grid_section_dimension | ||
units = count | ||
type = integer | ||
dimensions = () | ||
protected = True | ||
[ photolysis_wavelength_grid_interface_dimension ] | ||
standard_name = photolysis_wavelength_grid_interface_dimension | ||
units = count | ||
type = integer | ||
dimensions = () | ||
protected = True | ||
[ photolysis_wavelength_grid_interfaces ] | ||
standard_name = photolysis_wavelength_grid_interfaces | ||
units = m | ||
type = real | kind = kind_phys | ||
dimensions = (photolysis_wavelength_grid_interface_dimension) | ||
protected = True | ||
[ extraterrestrial_radiation_flux ] | ||
standard_name = extraterrestrial_radiation_flux | ||
units = photons cm-2 s-1 nm-1 | ||
type = real | kind = kind_phys | ||
dimensions = (photolysis_wavelength_grid_section_dimension) | ||
protected = True | ||
[ surface_albedo ] | ||
standard_name = surface_albedo_due_to_UV_and_VIS_direct | ||
units = none | ||
nusbaume marked this conversation as resolved.
Show resolved
Hide resolved
|
||
type = real | kind = kind_phys | ||
dimensions = (horizontal_dimension) | ||
protected = True | ||
[ blackbody_temperature_at_surface ] | ||
standard_name = blackbody_temperature_at_surface | ||
type = real | kind = kind_phys | ||
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 |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just to confirm - these appear to be realistic values for a first version of MUSICA in CAM-SIMA, while the necessary physical quantities are not fully available yet. Is this correct?
Just to make sure since if "realistic" values are provided here at initialization it might be difficult to debug later when something's supposed to be provided from a physical scheme and the values are not as expected. But if this is a placeholder then it is fine!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is just a placeholder, but I tried to add more text to the comments describing this module to make clear that it should be entirely removed once the things that actually provide this information are in place, and before doing any real science. Let me know if it's more clear now, or if we should add anything else.