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

Get metadata for ESMF_FieldBundle for History3G #2841

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
444d040
Procedure to get output info from fields
darianboggs May 7, 2024
57cd182
Add OutputInfoSet for History Collection output
darianboggs May 9, 2024
d38b34b
Test_OutputInfo.pf & Test_UngriddedDimInfo.pf pass
darianboggs May 14, 2024
579d423
Testing get_output_info_bundle
darianboggs May 14, 2024
3ac30c8
Merge branch 'release/MAPL-v3' into feature/wdboggs/get_history_colle…
darianboggs May 14, 2024
07de0f9
Comment out OutputInfo and OutputInfoSet tests
darianboggs May 14, 2024
71a13a0
All tests pass for output info objects.
darianboggs May 14, 2024
264154c
Begin refactor
darianboggs May 15, 2024
d2be5a4
Latest changes
darianboggs May 20, 2024
0fd6e6a
Merge branch 'release/MAPL-v3' into feature/wdboggs/get_history_colle…
darianboggs May 20, 2024
83868cc
Remove unused modules and procedures
darianboggs May 20, 2024
cb1dd8d
All tests passing for OutputInfo.
darianboggs May 22, 2024
56632cd
Merge branch 'release/MAPL-v3' into feature/wdboggs/get_history_colle…
darianboggs May 22, 2024
ad8c501
Update CHANGELOG.md
darianboggs May 22, 2024
9627ac8
Update base/MAPL_ESMF_InfoKeys.F90
darianboggs May 22, 2024
01e6c34
Update gridcomps/History3G/OutputInfo.F90
darianboggs May 22, 2024
75a0804
Update gridcomps/History3G/OutputInfo.F90
darianboggs May 22, 2024
d69a50d
Update base/MAPL_ESMF_InfoKeys.F90
darianboggs May 22, 2024
375a4ac
Refactoring per reviews
darianboggs May 23, 2024
ae7fe6e
Correct include statement
darianboggs May 23, 2024
e4a0aa8
Fix for failing tests for intel & gcc
darianboggs May 23, 2024
23329df
Remove history3g_test_utility_*.h & macros
darianboggs May 23, 2024
f02fa5d
Merge branch 'release/MAPL-v3' into feature/wdboggs/get_history_colle…
darianboggs May 23, 2024
cd07746
Make relative tolerance optional argument
darianboggs May 23, 2024
16b953d
Merge branch 'release/MAPL-v3' into feature/wdboggs/get_history_colle…
darianboggs May 28, 2024
dfe0c3c
Merge branch 'release/MAPL-v3' into feature/wdboggs/get_history_colle…
darianboggs May 31, 2024
27118be
Implement PR review suggestions
darianboggs Jun 3, 2024
bd54516
Resolve final issues from PR review
darianboggs Jun 4, 2024
db05ef1
Fixed access problem with intel & gfortran
darianboggs Jun 6, 2024
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
1 change: 1 addition & 0 deletions base/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ set (srcs
MAPL_XYGridFactory.F90
MAPL_NetCDF.F90 Plain_netCDF_Time.F90
MAPL_DateTime_Parsing_ESMF.F90 MAPL_ObsUtil.F90
MAPL_ESMF_InfoKeys.F90
# Orphaned program: should not be in this library.
# tstqsat.F90
)
Expand Down
76 changes: 76 additions & 0 deletions base/MAPL_ESMF_InfoKeys.F90
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
#include "MAPL_Exceptions.h"
module mapl3g_esmf_info_keys

use MAPL_ErrorHandling

implicit none

public :: KEY_UNGRIDDED_DIMS
public :: KEY_VERT_DIM
public :: KEY_VERT_GEOM
public :: KEY_UNITS
public :: KEY_LONG_NAME
public :: KEY_STANDARD_NAME
public :: KEY_NUM_LEVELS
public :: KEY_VLOC
public :: KEY_NUM_UNGRID_DIMS
public :: KEYSTUB_DIM
public :: KEY_UNGRIDDED_NAME
public :: KEY_UNGRIDDED_UNITS
public :: KEY_UNGRIDDED_COORD
public :: KEY_DIM_STRINGS
public :: make_dim_key
private

! FieldSpec info keys
character(len=*), parameter :: PREFIX = 'MAPL/'
character(len=*), parameter :: KEY_UNGRIDDED_DIMS = PREFIX // 'ungridded_dims/'
character(len=*), parameter :: KEY_VERT_DIM = PREFIX // 'vertical_dim/'
character(len=*), parameter :: KEY_VERT_GEOM = PREFIX // 'vertical_geom/'
character(len=*), parameter :: KEY_UNITS = PREFIX // 'units'
character(len=*), parameter :: KEY_LONG_NAME = PREFIX // 'long_name'
character(len=*), parameter :: KEY_STANDARD_NAME = PREFIX // 'standard_name'

! VerticalGeom info keys
character(len=*), parameter :: KEY_NUM_LEVELS = KEY_VERT_GEOM // 'num_levels'

! VerticalDimSpec info keys
character(len=*), parameter :: KEY_VLOC = KEY_VERT_DIM // 'vloc'

! UngriddedDims info keys
character(len=*), parameter :: KEY_NUM_UNGRID_DIMS = KEY_UNGRIDDED_DIMS // 'num_ungridded_dimensions'
character(len=*), parameter :: KEYSTUB_DIM = KEY_UNGRIDDED_DIMS // 'dim_'

! UngriddedDim info keys
character(len=*), parameter :: KEY_UNGRIDDED_NAME = 'name'
character(len=*), parameter :: KEY_UNGRIDDED_UNITS = 'units'
character(len=*), parameter :: KEY_UNGRIDDED_COORD = 'coordinates'

character(len=*), parameter :: KEY_DIM_STRINGS(9) = [ &
KEYSTUB_DIM // '1', KEYSTUB_DIM // '2', KEYSTUB_DIM // '3', &
KEYSTUB_DIM // '4', KEYSTUB_DIM // '5', KEYSTUB_DIM // '6', &
KEYSTUB_DIM // '7', KEYSTUB_DIM // '8', KEYSTUB_DIM // '9']

contains

function make_dim_key(n, rc) result(key)
darianboggs marked this conversation as resolved.
Show resolved Hide resolved
character(len=:), allocatable :: key
integer, intent(in) :: n
integer, optional, intent(out) :: rc
integer :: status
character(len=32) :: raw

key = ''
_ASSERT(n > 0, 'Index must be positive.')
if(n <= size(KEY_DIM_STRINGS)) then
key = KEY_DIM_STRINGS(n)
_RETURN(_SUCCESS)
end if
write(raw, fmt='(I0)', iostat=status) n
_ASSERT(status == 0, 'Write failed')
key = KEYSTUB_DIM // trim(raw)
_RETURN(_SUCCESS)

end function make_dim_key

end module mapl3g_esmf_info_keys
10 changes: 8 additions & 2 deletions generic3g/specs/UngriddedDim.F90
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ module mapl3g_UngriddedDim

interface UngriddedDim
module procedure new_UngriddedDim_extent
module procedure new_UngriddedDim_name_and_extent
module procedure new_UngriddedDim_name_and_coords
module procedure new_UngriddedDim_name_units_and_coords
end interface UngriddedDim
Expand All @@ -42,7 +43,6 @@ module mapl3g_UngriddedDim

character(*), parameter :: UNKNOWN_DIM_NAME = 'NONE'
character(*), parameter :: UNKNOWN_DIM_UNITS = 'NONE'


contains

Expand All @@ -66,13 +66,19 @@ pure function new_UngriddedDim_name_and_coords(name, coordinates) result(spec)
end function new_UngriddedDim_name_and_coords


pure function new_UngriddedDim_name_and_extent(name, extent) result(spec)
character(*), intent(in) :: name
integer, intent(in) :: extent
type(UngriddedDim) :: spec
spec = UngriddedDim(name, default_coords(extent))
end function new_UngriddedDim_name_and_extent

pure function new_UngriddedDim_extent(extent) result(spec)
integer, intent(in) :: extent
type(UngriddedDim) :: spec
spec = UngriddedDim(UNKNOWN_DIM_NAME, default_coords(extent))
end function new_UngriddedDim_extent


pure function default_coords(extent, lbound) result(coords)
real, allocatable :: coords(:)
integer, intent(in) :: extent
Expand Down
3 changes: 2 additions & 1 deletion gridcomps/History3G/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ set(srcs
HistoryGridComp.F90
HistoryCollectionGridComp.F90
HistoryCollectionGridComp_private.F90
)
OutputInfo.F90
)

find_package (MPI REQUIRED)

Expand Down
10 changes: 9 additions & 1 deletion gridcomps/History3G/HistoryCollectionGridComp_private.F90
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ module mapl3g_HistoryCollectionGridComp_private
use MAPL_NewArthParserMod, only: parser_variables_in_expression
use MAPL_TimeStringConversion
use MAPL_BaseMod, only: MAPL_UnpackTime
use mapl3g_output_info, only: get_num_levels, get_vertical_dim_spec_names
use mapl3g_output_info, only: get_vertical_dim_spec_name, get_ungridded_dims
use gFTL2_StringSet

implicit none
private
Expand Down Expand Up @@ -62,7 +65,12 @@ subroutine register_imports(gridcomp, hconfig, rc)
type(StringVector) :: variable_names
integer :: status

var_list = ESMF_HConfigCreateAt(hconfig, keystring=VAR_LIST_KEY, _RC)
var_list = ESMF_HConfigCreateAt(hconfig, keystring=VAR_LIST_KEY, rc=status)
if(status==ESMF_RC_NOT_FOUND) then
_FAIL(VAR_LIST_KEY // ' was not found.')
end if
_VERIFY(status)

iter_begin = ESMF_HConfigIterBegin(var_list,_RC)
iter_end = ESMF_HConfigIterEnd(var_list,_RC)
iter = iter_begin
Expand Down
Loading