-
Notifications
You must be signed in to change notification settings - Fork 12
Report stencil argument intents, update fv3core docstrings #107
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
Conversation
Co-authored-by: Oliver Elbert <[email protected]>
oelbert
left a comment
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.
A few small changes, mostly just cleanup for duplicated in/out hinting. I didn't double-check the signatures, but I think it's ok and I could go back over it if you want.
fv3core/fv3core/stencils/a2b_ord4.py
Outdated
| # lon_agrid (in): | ||
| # lat_agrid (in): | ||
| # lon (in): | ||
| # lat (in): |
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.
What is the use of these comments separate from the docstring?
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.
I'll delete this for now. I put it in because this is probably what we'll want to do when refactoring (put all the signatures in one place, then reason about data flow), but I think it's premature for this step.
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.
Done.
| self._qout_y_edge_north( | ||
| qin, self._dya, self._edge_n, qout, self._tmp_qout_edges | ||
| ) | ||
|
|
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.
Presumably this is to make fusion easier?
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.
Yes.
| ) | ||
|
|
||
| def _vorticity_calc(self, wk, vort, delpc, dt): | ||
| # this function is kept because it has a translate test, if its |
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.
I guess it's ok to keep this but it seems strange and I would want to cut it in a future PR
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.
I could move this to the translate class itself, if that would be better?
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.
Yeah, I think that would be better
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.
OK, updated here and where I did a similar thing in c_sw.
fv3core/fv3core/stencils/fxadv.py
Outdated
| vc (in): covariant c-grid y-wind (in) | ||
| cosa_u (in): ??? (in) | ||
| rsin_u (in): ??? (in) | ||
| uc_contra (out): contravariant c-grid x-wind (out) |
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.
remove duplicated in/out information
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.
Will fix.
| pk3 (inout): gets updated to B-grid | ||
| delp: vertical delta in pressure (in) | ||
| dt: model atmospheric timestep (in) | ||
| ptop: pressure at top of atmosphere (in) |
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.
Fix formatting/duplication here
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.
Will fix.
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.
Done.
fv3core/fv3core/stencils/c_sw.py
Outdated
| w: vertical velocity (in) | ||
| uc: C-grid x-velocity (inout) | ||
| vc: C-grid y-velocity (inout) | ||
| ua: A-grid x-velocity (in) | ||
| va: A-grid y-velocity (in) | ||
| ut: u * dx (inout) | ||
| vt: v * dy (inout) | ||
| divgd: D-grid horizontal divergence (inout) | ||
| omga: Vertical pressure velocity (inout) | ||
| ua: A-grid x-velocity (inout) | ||
| va: A-grid y-velocity (inout) | ||
| ut: u * dx (out) | ||
| vt: v * dy (out) | ||
| divgd: D-grid horizontal divergence (out) | ||
| omga: Vertical pressure velocity (out) | ||
| dt2: Half a model timestep in seconds (in) |
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.
The layouts of these are inconsistent with the other in/out documentation
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.
Will fix, and will double-check their values.
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.
Done.
fv3core/fv3core/stencils/d_sw.py
Outdated
| delpc (inout): C-grid vertical delta in pressure (inout) | ||
| delp (inout): D-grid vertical delta in pressure (inout), | ||
| ptc : C-grid potential temperature (inout) | ||
| pt (inout): D-grid potential teperature | ||
| u (inout): D-grid x-velocity (inout) | ||
| v (inout): D-grid y-velocity (inout) | ||
| w (inout): vertical velocity (inout) | ||
| uc (in): C-grid x-velocity (in) | ||
| vc (in): C-grid y-velocity (in) | ||
| ua (in): A-grid x-velocity (in) | ||
| va (in) A-grid y-velocity (in) | ||
| divgd: D-grid horizontal divergence (inout) | ||
| mfx: accumulated x mass flux (inout) | ||
| mfy: accumulated y mass flux (inout) | ||
| cx: accumulated Courant number in the x direction (inout) | ||
| cy: accumulated Courant number in the y direction (inout) | ||
| crx: local courant number in the x direction (inout) | ||
| cry: local courant number in the y direction (inout) | ||
| xfx: flux of area in x-direction, in units of m^2 (in) | ||
| yfx: flux of area in y-direction, in units of m^2 (in) | ||
| q_con: total condensate mixing ratio (inout) | ||
| zh: geopotential height defined on layer interfaces (in) | ||
| heat_source: accumulated heat source (inout) | ||
| diss_est: dissipation estimate (inout) | ||
| dt: acoustic timestep in seconds (in) | ||
| mfx (inout): accumulated x mass flux (inout) | ||
| mfy (inout): accumulated y mass flux (inout) |
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.
More duplication
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.
Will fix.
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.
Fixed.
|
launch jenkins |
…pace into feature/report_stencil_signatures
oelbert
left a comment
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.
Looks good!
Purpose
This PR adds a script to generate a report with all stencil call signatures showing in/out/inout intents, and makes use of its output to update fv3core (outside of remapping, which will be done in another PR).
Code changes:
driverwhich reports the call signature of each stencil, and aggregated call signatures for classes containing stencilsDriverandDriverConfigtopace.drivernamespaceInfrastructure changes:
Checklist
Before submitting this PR, please make sure:
pace-util, HISTORY has been updated