-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3300 from GEOS-ESM/feature/pchakrab/configurable-…
…gridcomp-read-k-values Allow Configurable gridcomp to read k values from config file
- Loading branch information
Showing
9 changed files
with
137 additions
and
55 deletions.
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
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
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,21 @@ | ||
esma_set_this (OVERRIDE MAPL.state) | ||
|
||
set(srcs | ||
StateGet.F90 | ||
) | ||
|
||
list (APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}") | ||
|
||
if (BUILD_WITH_PFLOGGER) | ||
find_package (PFLOGGER REQUIRED) | ||
endif () | ||
|
||
esma_add_library(${this} | ||
SRCS ${srcs} | ||
DEPENDENCIES MAPL.shared ESMF::ESMF | ||
TYPE SHARED | ||
) | ||
|
||
# if (PFUNIT_FOUND) | ||
# add_subdirectory(tests EXCLUDE_FROM_ALL) | ||
# endif () |
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,50 @@ | ||
#include "MAPL_Generic.h" | ||
|
||
module mapl3g_StateGet | ||
|
||
use mapl_ErrorHandling | ||
use esmf | ||
|
||
implicit none | ||
private | ||
|
||
public :: MAPL_StateGet | ||
|
||
interface MAPL_StateGet | ||
procedure get_bundle_from_state_ | ||
end interface MAPL_StateGet | ||
|
||
contains | ||
|
||
type(ESMF_FieldBundle) function get_bundle_from_state_(state, rc) result(bundle) | ||
type(ESMF_State), intent(in) :: state | ||
integer, optional, intent(out) :: rc | ||
|
||
character(len=ESMF_MAXSTR), allocatable :: item_name(:) | ||
type (ESMF_StateItem_Flag), allocatable :: item_type(:) | ||
type(ESMF_Field) :: field | ||
type(ESMF_FieldStatus_Flag) :: field_status | ||
integer :: item_count, idx, status | ||
|
||
! bundle to pack fields in | ||
bundle = ESMF_FieldBundleCreate(_RC) | ||
call ESMF_StateGet(state, itemCount=item_count, _RC) | ||
allocate(item_name(item_count), _STAT) | ||
allocate(item_type(item_count), _STAT) | ||
call ESMF_StateGet(state, itemNameList=item_name, itemTypeList=item_type, _RC) | ||
do idx = 1, item_count | ||
if (item_type(idx) /= ESMF_STATEITEM_FIELD) then | ||
_FAIL("FieldBundle has not been implemented yet") | ||
end if | ||
call ESMF_StateGet(state, item_name(idx), field, _RC) | ||
call ESMF_FieldGet(field, status=field_status, _RC) | ||
if (field_status == ESMF_FIELDSTATUS_COMPLETE) then | ||
call ESMF_FieldBundleAdd(bundle, [field], _RC) | ||
end if | ||
end do | ||
deallocate(item_name, item_type, _STAT) | ||
|
||
_RETURN(_SUCCESS) | ||
end function get_bundle_from_state_ | ||
|
||
end module mapl3g_StateGet |