-
Notifications
You must be signed in to change notification settings - Fork 14
New shared module for functions used in both DynCore and AdvCore #413
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
Open
lizziel
wants to merge
4
commits into
GEOS-ESM:release/MAPL-v3
Choose a base branch
from
geoschem:ewlundgr/refactor_DynCore_functions_used_in_AdvCore
base: release/MAPL-v3
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+152
−114
Open
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
1e11d2f
Move DynCore_GridCompMod functions used in AdvCore to new shared module
lizziel ac2bd97
Explicitly set access in fv_shared.F90
lizziel bed958e
Add access declarations to jw.f90 and sw.f90 and improve readability
lizziel 5177646
Merge branch 'release/MAPL-v3' into ewlundgr/refactor_DynCore_functio…
lizziel 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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,98 @@ | ||
| #include "MAPL.h" | ||
|
|
||
| MODULE fv_shared | ||
|
|
||
| USE ESMF | ||
| USE MAPL, ONLY : MAPL_FieldGet, MAPL_Verify | ||
|
|
||
| IMPLICIT NONE | ||
|
|
||
| private | ||
|
|
||
| public :: get_short_name | ||
| public :: field_is_cloud_water_species | ||
| public :: is_name_in_list | ||
|
|
||
| ! | ||
| ! Functions used in both AdvCore_GridCompMod and DynCore_GridCompMod | ||
| ! | ||
|
|
||
| CONTAINS | ||
|
|
||
| function get_short_name(field, rc) result(short_name) | ||
| type(ESMF_Field) :: field | ||
| integer, intent(out) :: rc | ||
| character(len=:), allocatable :: short_name | ||
|
|
||
| character(len=:), allocatable :: standard_name | ||
| integer :: status | ||
|
|
||
| call MAPL_FieldGet(field, standard_name=standard_name, _RC) | ||
| select case (trim(standard_name)) | ||
| case ("specific_humidity") | ||
| short_name = "Q" | ||
| case ("mass_fraction_of_large_scale_cloud_liquid_water") | ||
| short_name = "QLLS" | ||
| case ("mass_fraction_of_convective_cloud_liquid_water") | ||
| short_name = "QLCN" | ||
| case ("mass_fraction_of_large_scale_cloud_ice_water") | ||
| short_name = "QILS" | ||
| case ("mass_fraction_of_convective_cloud_ice_water") | ||
| short_name = "QICN" | ||
| case ("large_scale_cloud_area_fraction") | ||
| short_name = "CLLS" | ||
| case ("convective_cloud_area_fraction") | ||
| short_name = "CLCN" | ||
| case ("mass_fraction_of_rain") | ||
| short_name = "QRAIN" | ||
| case ("mass_fraction_of_snow") | ||
| short_name = "QSNOW" | ||
| case ("mass_fraction_of_graupel") | ||
| short_name = "QGRAUPEL" | ||
| case default | ||
| ! _FAIL("Unrecognized standard_name: " // trim(standard_name)) | ||
| short_name = trim(standard_name) | ||
| end select | ||
|
|
||
| _RETURN(_SUCCESS) | ||
| end function get_short_name | ||
|
|
||
| function field_is_cloud_water_species(field_name) result(is_cloud_water_species) | ||
| character(len=*), intent(in) :: field_name | ||
| logical :: is_cloud_water_species | ||
|
|
||
| is_cloud_water_species = .false. | ||
| if ( & | ||
| (trim(field_name) == "Q") .or. & | ||
| (trim(field_name) == "QLCN") .or. & | ||
| (trim(field_name) == "QLLS") .or. & | ||
| (trim(field_name) == "QICN") .or. & | ||
| (trim(field_name) == "QILS") .or. & | ||
| (trim(field_name) == "CLCN") .or. & | ||
| (trim(field_name) == "CLLS") .or. & | ||
| (trim(field_name) == "NCPL") .or. & | ||
| (trim(field_name) == "NCPI") .or. & | ||
| (trim(field_name) == "QRAIN") .or. & | ||
| (trim(field_name) == "QSNOW") .or. & | ||
| (trim(field_name) == "QGRAUPEL")) then | ||
| is_cloud_water_species = .true. | ||
| end if | ||
| end function field_is_cloud_water_species | ||
|
|
||
| function is_name_in_list(name, list) result(is_in_list) | ||
| character(len=*), intent(in) :: name | ||
| character(len=ESMF_MAXSTR), intent(in) :: list(:) | ||
| logical :: is_in_list | ||
|
|
||
| integer :: n | ||
|
|
||
| is_in_list = .false. | ||
| do n = 1, size(list) | ||
| if (trim(name) == trim(list(n))) then | ||
| is_in_list = .true. | ||
| exit | ||
| end if | ||
| end do | ||
| end function is_name_in_list | ||
|
|
||
| END MODULE fv_shared | ||
This file contains hidden or 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 hidden or 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
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.
Uh oh!
There was an error while loading. Please reload this page.