-
Notifications
You must be signed in to change notification settings - Fork 243
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
further cleaning of pkg/autodiff, pkg/ctrl, if necessary #786
Comments
adcommon.h
establishes the transformation of ad variables from var_ad
to advar
. But the only place that this is used is in addummy_in_stepping.f
. It seems like we could just rewrite this using the suffix form that TAF naturally generates, and save the headache of updating adcommon.h
every time the common blocks change.
I am copying here some pieces that were mentioned in issue #440 and relevant to "adcommon,h" point:
And regarding the file names "adcommon.h" and "g_common.h", there is some discussion in issue #547 |
Thanks @jm-c for the tag and apologies for delays here. I do remember originally thinking that the adcommon.h is not necessary, and then having the realization that any hand written adjoint code relies on having adcommon.h. So, I think that item can be checked or crossed off safely. |
I would like to add a new bullet point to the list: seems like the call to |
Makes sense! |
With #788 merged, the mapping of the control variables to indices, grid type etc, is now "safer" in the sense, that there are only two places where the mapping is hardwired:
I would like to try this: define an additional character arrays The small disadvantage is that we then have two places where the control variable names are stored: ( |
The way we specify which control var to perturb in We could decide to change this and define which control var to perturb by setting the control var/file name in This would make the grdchk selection a little bit easier and independent of the ordering in |
very good idea. The associated code changes are very few, once the variable name ( |
Regarding bullet-point 1, was mentioned in issue #440 discussion, then added to to the list there, and we (including myself) commented about it back at that time; |
I can change this bullet point and add that we will not change this (and remove the "ticklable" bullet). What about the last one ( |
After closing #440, this is a new place for collecting and discussing cleanup of pkg/ctrl and pkg/autodiff. The remaining item on the list was:
pkg/grdchk
could be cleaned up to remove reference to unavailable control variables, also the relationship betweengrdchkvarindex
,index
, andncvarindex(index)
should be more transparent in the stdout (s/r ctrl_summary
), so that is easier to find out which variablegrdchkvarindex
refers to (currentlyindex
, but I am not sure that that's the best choice). Now that the number control variables has been reduced, one could changencvarindex
to be the same asindex
and then it's clear what to use forgrdchkvarindex
. OR/AND: one could set theindex
according to the position indata.ctrl
(for all control variables, not sure what to do about the obcs-contols, though). The only thing thatncvarindex
seems to be used is to make sure that it is set (in ctrl_pack/unpack and inoptim/optim_readdata.F
). (PR grdchk incremental improvement #788 and another pkg/ctrl cleanup with implications for pkg/grdchk #796)pkg/ctrl/CTRLh.h
defined in common blocks that are only used as local variables in one file, e.g.filenvartype
, etc. (PR another pkg/ctrl cleanup with implications for pkg/grdchk #796)TURNOFF_MODEL_IO
in ctrl_init_ctrlvar.F is executed each time a control variable is set-up (e.g., 5 control-vars, called 5 times). Solution: move the test for filecost_final
from ctrl_init_ctrlvar.F (again, no need to check 5 times) to the calling routine ctrl_init.F and pass the information (new argument) to ctrl_init_ctrlvar.F (PR another pkg/ctrl cleanup with implications for pkg/grdchk #796)wunit
at all?The text was updated successfully, but these errors were encountered: