Mixed mode FMS discussion #814
Replies: 10 comments 3 replies
-
Comparing approach1 and approach2, I think approach1 is cleaner. |
Beta Was this translation helpful? Give feedback.
-
Is this simple example for the horiz_interp_type in horiz_interp_type.F90? |
Beta Was this translation helpful? Give feedback.
-
@bensonr @thomas-robinson which approach and data type update do you prefer? |
Beta Was this translation helpful? Give feedback.
-
I added a PR MinsukJi-NOAA/FMS_tests#1 to the repository. It uses the I also added a nullify for the pointer in approach2. I agree that approach1 is cleaner. I don't think I see an advantage to using approach2, unless you just really like working with the pointer. We have started moving away from pointers as much as possible in the FMS code, but in this case it seems like it's being used in a correct manner. There used to be an If you pulled the type definitions into the module using it, then you wouldn't have to make grid_base public like I had to. I don't know if that's an option for the real code though. @GFDL-Eric do you have anything to add? |
Beta Was this translation helpful? Give feedback.
-
Thank you for the feedback @junwang-noaa and @thomas-robinson. I also prefer approach 1. As Jun mentioned, all of them need some kind of modifications upstream, but I think changing to |
Beta Was this translation helpful? Give feedback.
-
Another possible approach that is not in https://github.com/MinsukJi-NOAA/FMS_tests is to do something like this:
with a constructor assigning But I have yet to come up with a non-messy way to do this... One issue was that |
Beta Was this translation helpful? Give feedback.
-
I won't recommend this approach as there could be many variables x,y,...,
checking the data type for those variables could make the code really messy.
…On Fri, Sep 10, 2021 at 9:05 AM Minsuk Ji ***@***.***> wrote:
Another possible approach that is not in
https://github.com/MinsukJi-NOAA/FMS_tests is to do something like this:
type :: grid_all
integer :: i, j
class(*), pointer :: x, y
end type grid
type(grid_all) :: grid
with a constructor assigning class(*), pointer components to either
real(4) or real(8).
But I have yet to come up with a non-messy way to do this... One issue was
that select type (grid%x) does not work.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#814 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AI7D6TNIB2SCCOH6ZH26Q7TUBH7AVANCNFSM5DX4AXSA>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
|
Beta Was this translation helpful? Give feedback.
-
I agree with @junwang-noaa especially because you have them all as either r4 or r8, so extending the If |
Beta Was this translation helpful? Give feedback.
-
If we're operating under the assumption that all subcomponents of the grid
type are the same kind (r4 or r8), and I believe we are, then I prefer
approach 1.
…On Fri, Sep 10, 2021 at 10:02 AM Tom Robinson ***@***.***> wrote:
I agree with @junwang-noaa <https://github.com/junwang-noaa> especially
because you have them all as either r4 or r8, so extending the gird_all
type makes more sense.
If x could be r4 and y could be r8, then this class(*) :: x,y might make
more sense.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#814 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AB3MSXMRGBRZJOHA4R4QLTTUBIFWJANCNFSM5DX4AXSA>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
|
Beta Was this translation helpful? Give feedback.
-
@thomas-robinson @GFDL-Eric Do you know where I can find some documentation on how to build and run unit tests on NOAA R&D platforms (e.g. Hera)? |
Beta Was this translation helpful? Give feedback.
-
Related codes are here: https://github.com/MinsukJi-NOAA/FMS_tests
If any one can take a look at the above repository and comment, it would be helpful for me.
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions