-
Notifications
You must be signed in to change notification settings - Fork 2
data_override for scalars #13
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
Merged
Merged
Changes from all commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
15fdb29
first version of pointer to array subroutines
00d0ec5
maybe working c_diag_manager
41c1d16
Merge remote-tracking branch 'origin/main' into diag_manager_2
6add3bb
add 2d test
2f825b6
add with-yaml to fms build
725a631
add untracked file
cf3246e
add TODO comments to tests
03d0805
combine 2d and 3d test
a2b22ae
data_override_init
b3a53a5
Merge remote-tracking branch 'origin/main' into data_override
da9b9ab
fix merge error
14d5db5
make optional arguments null pointers
f3db270
woking version before merge
fe176e4
Merge remote-tracking branch 'origin/data_override' into data_override
a86c92d
add scalar
4f12959
Merge remote-tracking branch 'origin/main' into data_override_0d
b2383fe
fix comment in test_data_override_ongrid
0ed947f
commit files that were not commited previously?
8b765dc
add untracked files
7cecfcb
UNTRACKED FILES
727ace0
update cfms_init in test_update_domain
64a408c
Merge remote-tracking branch 'origin/main' into data_override_0d
c4d3942
fix merging error
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,10 +1,21 @@ | ||
| #ifndef C_DATA_OVERRIDE_H | ||
| #define C_DATA_OVERRIDE_H | ||
|
|
||
| #include <stdbool.h> | ||
|
|
||
| extern const int CFLOAT_MODE; | ||
| extern const int CDOUBLE_MODE; | ||
|
|
||
| extern void cFMS_data_override_0d_cfloat(char *gridname, char *fieldname_code, float *data_out, bool *override, | ||
| int *data_index); | ||
|
|
||
| extern void cFMS_data_override_0d_cdouble(char *gridname, char *fieldname_code, float *data_out, bool *override, | ||
| int *data_index); | ||
|
|
||
| extern void cFMS_data_override_init(int *atm_domain_id, int *ocn_domain_id, int *ice_domain_id, int *land_domain_id, | ||
| int *land_domainUG_id, int *mode); | ||
|
|
||
| extern void cFMS_data_override_set_time(int *year, int *month, int *day, int *hour, int *minute, int *second, | ||
| int *tick, char *err_msg); | ||
|
|
||
| #endif |
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,15 @@ | ||
| #undef CFMS_DATA_OVERRIDE_0D_ | ||
| #undef CFMS_DATA_OVERRIDE_0D_BINDC_ | ||
| #undef CFMS_DATA_OVERRIDE_0D_TYPE_ | ||
| #define CFMS_DATA_OVERRIDE_0D_ cFMS_data_override_0d_cfloat | ||
| #define CFMS_DATA_OVERRIDE_0D_BINDC_ "cFMS_data_override_0d_cfloat" | ||
| #define CFMS_DATA_OVERRIDE_0D_TYPE_ real(c_float) | ||
| #include "c_data_override_0d.inc" | ||
|
|
||
| #undef CFMS_DATA_OVERRIDE_0D_ | ||
| #undef CFMS_DATA_OVERRIDE_0D_BINDC_ | ||
| #undef CFMS_DATA_OVERRIDE_0D_TYPE_ | ||
| #define CFMS_DATA_OVERRIDE_0D_ cFMS_data_override_0d_cdouble | ||
| #define CFMS_DATA_OVERRIDE_0D_BINDC_ "cFMS_data_override_0d_cdouble" | ||
| #define CFMS_DATA_OVERRIDE_0D_TYPE_ real(c_double) | ||
| #include "c_data_override_0d.inc" |
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,32 @@ | ||
| subroutine CFMS_DATA_OVERRIDE_0D_(gridname, fieldname_code, data_out, override, data_index) & | ||
| bind(C, name=CFMS_DATA_OVERRIDE_0D_BINDC_) | ||
|
|
||
| use FMS, only : fms_time_manager_get_date | ||
|
|
||
| implicit none | ||
| character(c_char), intent(in) :: gridname(NAME_LENGTH) | ||
| character(c_char), intent(in) :: fieldname_code(NAME_LENGTH) | ||
| CFMS_DATA_OVERRIDE_0D_TYPE_, intent(out) :: data_out | ||
| logical(c_bool), intent(out), optional :: override | ||
| integer, intent(in), optional :: data_index | ||
|
|
||
| character(len=NAME_LENGTH-1) :: gridname_f | ||
| character(len=NAME_LENGTH-1) :: fieldname_code_f | ||
|
|
||
| CFMS_DATA_OVERRIDE_0D_TYPE_ :: data_out_f | ||
| logical :: override_f | ||
|
|
||
| gridname_f = fms_string_utils_c2f_string(gridname) | ||
| fieldname_code_f = fms_string_utils_c2f_string(fieldname_code) | ||
|
|
||
| call fms_data_override(gridname = gridname_f, & | ||
| fieldname_code = fieldname_code_f, & | ||
| data_out = data_out, & | ||
| time = data_override_time, & | ||
| override = override_f, & | ||
| data_index = data_index) | ||
|
|
||
| if(present(override)) override = logical(override_f, c_bool) | ||
|
|
||
| end subroutine CFMS_DATA_OVERRIDE_0D_ | ||
|
|
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
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
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.
@fmalatino, cfms_init changed.
time_manager_init and calendar setting have been removed from c_diag_manager.
time_manager_init is now called in cfms_init.
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.
Noted. Will update in subsequent PR in pyFMS. To track these changes lets open issues in pyFMS moving forward.