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.
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
Port z ifc #564
base: main
Are you sure you want to change the base?
Port z ifc #564
Changes from 56 commits
991a0b1
417d667
727814b
7a83403
91c4d31
40adcbf
5c42bdd
fb9299a
2ff7134
1b0cc4e
efbd294
fdf8622
d2918c6
c5d2ca3
a7d94f3
729e218
1020de3
3cced34
06b52a2
6a87418
1296dfb
ccd19a8
c4aa67c
423a74f
16af8d2
3a27f32
5a5824c
d82b858
51cb72e
1e2963a
397219c
4546333
d5b5e41
0c56879
b2d3ae2
1d0adb3
ee013bb
3e05c6e
7dfaa2c
e4f21a0
0086d92
6ae8737
7d5cf88
bcc54ea
e07a404
15d8839
dbbcc1e
1104571
8d05431
6c72c4d
7e7b478
8b2618d
e48d56f
855aec7
73f6c82
95b61c2
fcd808a
f421d22
554ffd2
fffaea3
f62c3c1
0659559
4bf99b0
1f2f18f
45c16e0
7e7f174
f0f4d7b
c2d1471
7d5ff3d
34cfe29
ed72109
ed61a3f
7c56b1e
6cc170f
da45e4f
b8e938b
8cd3c9c
2f4b103
36747c0
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
Can you reflect this in the code, by splitting into functions with good names? At least I would split what you do in
init_vert_coordinate
into 2 functions, one which computes the height (down to here) and another one that does this layer thickness thing that comes from here on. Then theinit_vert_coordinate
calls both of them.This is some pseudo code. (I don't even know what would be a proper name for the vct_a compared to the z_ifc...) The idea that I want to transport is, suppose I read icon4py code then depending on what interests me I am happy with seeing somewhere
compute_vertical_height_field
, I know what is happening in the function and go on (supposedly that the function does this and only this). If I am interested in the height field, then I can jump into the function and I see that 1. it takes contribution fromtopology
andvct_a
, 2. there is something to take into account of the thickness of the resulting layers, 3. the previously (or configured) flat layer needs to still be consistent. May that is all that interests me. So I go on. Only if I need to know how the thickness of the minimal layers is determined I need to jump further down into the 2nd of these functions. Otherwise the reader does not need to care of the gritty details of indices and fields and dimension and etc.Good code transports meaning and it is always organized in different levels of abstraction or details. Such that a reader can ignore the details if he does not need them.
And you write code once and you read it 1000 times...
This is one of the reasons why ICON code is so hard to understand that there is (almost) no level in the code above the most detailed one. If I want to see what algorithm they use they throw 3 nested loops at me. From these I need to make sense what relations ship they are computing.