-
Notifications
You must be signed in to change notification settings - Fork 159
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make stochastic physics independent of fv3atm and its submodules (#145)
* atmos_model.F90: remove dependency of stochastic physics on IPD_Control * Add mpi_wrapper to stochastic_physics to substitute calls to fv_mp_mod routines * Make cellular automata code independent of fv_mp_mod * Make cellular automata code independent of atmosphere_mod * Add halo exchange routine to stochastic_physics code * Remove dependency on GFS_coupling_type from stochastic_physics.F90 * Remove dependency on GFS_grid_type in stochastic_physics and stochastic_physics_sfc * Cleanup work, avoid unnecessary data copies * Move stochastic physics code into its own wrapper/driver * Remove dependency on Statein, Coupling and Intdiag DDT from cellular_automata_sgs.F90 * Compile kinddef module, cleanup stochastic_physics_wrapper.F90 * Update cmake build system * Fix a bug in atmos_model.F90, inadvertetly removed a closing parenthesis * Update to build system for stochastic_physics_wrapper following cmake updates * Update gnumake build to include stochastic_physics wrapper * Remove commented out lines from stochastic_physics/makefile Co-authored-by: Jun Wang <[email protected]>
- Loading branch information
1 parent
e66fc3d
commit aada773
Showing
10 changed files
with
461 additions
and
128 deletions.
There are no files selected for viewing
Validating CODEOWNERS rules …
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,7 @@ | ||
# This is a comment. | ||
# Each line is a file pattern followed by one or more owners. | ||
# Order is important; the last matching pattern takes the most | ||
# precedence. | ||
|
||
# The components are owned by their respective teams | ||
/FV3/ @noaa-emc/fv3atm-team |
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,56 @@ | ||
--- | ||
name: Bug report | ||
about: Create a report to fix bugs | ||
title: '' | ||
labels: bug | ||
assignees: '' | ||
|
||
--- | ||
|
||
## Description | ||
Provide a clear and concise description of what the bug is. | ||
Also give a description of how to fix the bug. | ||
|
||
|
||
### To Reproduce: | ||
What compilers/machines are you seeing this with? | ||
Give explicit steps to reproduce the behavior. | ||
1. do this | ||
2. then that | ||
3. then, oops, look at the bug | ||
|
||
|
||
## Additional context | ||
Add any other context about the problem here. | ||
Directly reference any issues or PRs in this or other repositories that this is related to, and describe how they are related. Example: | ||
- needs to be fixed also in noaa-emc/nems/issues/<issue_number> | ||
- needed for noaa-emc/fv3atm/pull/<pr_number> | ||
|
||
|
||
## Output | ||
|
||
**Screenshots** | ||
If applicable, drag and drop screenshots to help explain your problem. | ||
|
||
**output logs** | ||
If applicable, include relevant output logs. | ||
Either drag and drop the entire log file here (if a long log) or | ||
|
||
``` | ||
paste the code here (if a short section of log) | ||
``` | ||
|
||
## Testing: | ||
|
||
1. Have you tested the code changes? On what platforms? | ||
|
||
2. Have you run regression test in ufs-weather-model or ufs-s2s-model with code changes? | ||
- Will the baseline results change? | ||
- If the baseline results change, is it expected? Please give brief explanation. | ||
|
||
## Dependent PRs: | ||
|
||
Directly reference any issues or PRs in this or other repositories that this is related to, and describe how they are related. Example: | ||
- required to support noaa-emc/GFDL_atmos_cubed_sphere/issues/<issue_number> | ||
- ncar/ccpp-physics/pull/<pr_number> | ||
- associated ufs-weather-model/pull/<pr_number> |
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,32 @@ | ||
--- | ||
name: Feature request | ||
about: Suggest an idea for this project | ||
title: '' | ||
labels: enhancement | ||
assignees: '' | ||
|
||
--- | ||
|
||
## Description | ||
Provide a clear and concise description of what the problem is. Ex. I'm always frustrated when [...] | ||
|
||
## Solution | ||
Add a clear and concise description of what solution you provide. | ||
|
||
## Alternatives | ||
If applicable, add a description of any alternative solutions or features you've considered. | ||
|
||
## Testing: | ||
|
||
1. Have you tested the code changes? On what platforms? | ||
2. Have you run regression test in ufs-weather-model or ufs-s2s-model with code changes? | ||
- Will the baseline results change? | ||
- If yes, please give brief explanation of your code updates on the regression test. | ||
|
||
## Dependent PRs: | ||
|
||
Directly reference any issues or PRs in this or other repositories that this is related to, and describe how they are related. Example: | ||
- required to support noaa-emc/GFDL_atmos_cubed_sphere/issues/<issue_number> | ||
- ncar/ccpp-physics/pull/<pr_number> | ||
- associated ufs-weather-model/pull/<pr_number> | ||
|
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,37 @@ | ||
## Description | ||
|
||
(Instructions: this, and all subsequent sections of text should be removed and filled in as appropriate.) | ||
Provide a detailed description of what this PR does. | ||
What bug does it fix, or what feature does it add? | ||
Is a change of answers expected from this PR? | ||
|
||
|
||
|
||
### Issue(s) addressed | ||
|
||
Link the issues to be closed with this PR, whether in this repository, or in another repository. | ||
(Remember, issues should always be created before starting work on a PR branch!) | ||
- fixes #<issue_number> | ||
- fixes noaa-emc/fv3atm/issues/<issue_number> | ||
|
||
|
||
|
||
## Testing | ||
|
||
How were these changes tested? | ||
What compilers / HPCs was it tested with? | ||
Are the changes covered by regression tests? (If not, why? Do new tests need to be added?) | ||
Have the ufs-weather-model regression test been run? On what platform? | ||
- Will the code updates change regression test baseline? If yes, why? Please show the baseline directory below. | ||
- Please commit the regression test log files in your ufs-weather-model branch | ||
|
||
|
||
## Dependencies | ||
|
||
If testing this branch requires non-default branches in other repositories, list them. | ||
Those branches should have matching names (ideally) | ||
|
||
Do PRs in upstream repositories need to be merged first? | ||
If so add the "waiting for other repos" label and list the upstream PRs | ||
- waiting on noaa-emc/nems/pull/<pr_number> | ||
- waiting on noaa-emc/fv3atm/pull/<pr_number> |
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
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 |
---|---|---|
@@ -1,62 +1,19 @@ | ||
|
||
if(32BIT) | ||
remove_definitions(-DOVERLOAD_R4) | ||
remove_definitions(-DOVERLOAD_R8) | ||
message ("Force 64 bits in stochastic_physics") | ||
if(CMAKE_Fortran_COMPILER_ID MATCHES "Intel") | ||
if(REPRO) | ||
string (REPLACE "-i4 -real-size 32" "-i4 -real-size 64" CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS}") | ||
else() | ||
string (REPLACE "-i4 -real-size 32" "-i4 -real-size 64 -no-prec-div -no-prec-sqrt" CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS}") | ||
endif() | ||
elseif(CMAKE_Fortran_COMPILER_ID MATCHES "GNU") | ||
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fdefault-real-8") | ||
endif() | ||
endif() | ||
|
||
add_library( | ||
stochastic_physics | ||
stochastic_physics_wrapper | ||
|
||
../../stochastic_physics/plumes.f90 | ||
|
||
../../stochastic_physics/stochy_gg_def.f | ||
../../stochastic_physics/stochy_resol_def.f | ||
../../stochastic_physics/stochy_layout_lag.f | ||
../../stochastic_physics/four_to_grid_stochy.F | ||
../../stochastic_physics/glats_stochy.f | ||
../../stochastic_physics/sumfln_stochy.f | ||
../../stochastic_physics/gozrineo_stochy.f | ||
../../stochastic_physics/num_parthds_stochy.f | ||
../../stochastic_physics/get_ls_node_stochy.f | ||
../../stochastic_physics/get_lats_node_a_stochy.f | ||
../../stochastic_physics/setlats_a_stochy.f | ||
../../stochastic_physics/setlats_lag_stochy.f | ||
../../stochastic_physics/epslon_stochy.f | ||
../../stochastic_physics/getcon_lag_stochy.f | ||
../../stochastic_physics/pln2eo_stochy.f | ||
../../stochastic_physics/dozeuv_stochy.f | ||
../../stochastic_physics/dezouv_stochy.f | ||
|
||
../../stochastic_physics/spectral_layout.F90 | ||
../../stochastic_physics/getcon_spectral.F90 | ||
../../stochastic_physics/stochy_namelist_def.F90 | ||
../../stochastic_physics/compns_stochy.F90 | ||
../../stochastic_physics/stochy_internal_state_mod.F90 | ||
../../stochastic_physics/stochastic_physics.F90 | ||
../../stochastic_physics/stochy_patterngenerator.F90 | ||
../../stochastic_physics/stochy_data_mod.F90 | ||
../../stochastic_physics/get_stochy_pattern.F90 | ||
../../stochastic_physics/initialize_spectral_mod.F90 | ||
../../stochastic_physics/cellular_automata_global.F90 | ||
../../stochastic_physics/cellular_automata_sgs.F90 | ||
../../stochastic_physics/update_ca.F90 | ||
./stochastic_physics_wrapper.F90 | ||
) | ||
|
||
target_include_directories(stochastic_physics_wrapper PRIVATE ${CMAKE_BINARY_DIR}/stochastic_physics) | ||
if(CCPP) | ||
target_include_directories(stochastic_physics PRIVATE ${CMAKE_BINARY_DIR}/FV3/ccpp/framework/src) | ||
target_include_directories(stochastic_physics PRIVATE ${CMAKE_BINARY_DIR}/FV3/ccpp/physics) | ||
target_include_directories(stochastic_physics_wrapper PRIVATE ${CMAKE_BINARY_DIR}/FV3/ccpp/framework/src) | ||
target_include_directories(stochastic_physics_wrapper PRIVATE ${CMAKE_BINARY_DIR}/FV3/ccpp/physics) | ||
endif() | ||
target_link_libraries(stochastic_physics PRIVATE fms) | ||
target_link_libraries(stochastic_physics PRIVATE gfsphysics) | ||
target_link_libraries(stochastic_physics PRIVATE fv3dycore) | ||
target_link_libraries(stochastic_physics PRIVATE sp::sp_d) | ||
# DH* is there a better way to do this? | ||
target_include_directories(stochastic_physics_wrapper PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/../mod>) | ||
# *DH | ||
target_link_libraries(stochastic_physics_wrapper fms) | ||
target_link_libraries(stochastic_physics_wrapper stochastic_physics) | ||
target_link_libraries(stochastic_physics_wrapper gfsphysics) | ||
target_link_libraries(stochastic_physics_wrapper fv3dycore) | ||
|
Oops, something went wrong.