[MITgcm-devel] OAD_convert and S/Rs within k-loops
Jean-Michel Campin
jmc at mit.edu
Fri Mar 8 14:00:23 EST 2019
Hi Dan,
I don't see any reason why we would like to keep these 2 arguments
in these 2 S/R ; Long ago (before Aug 2003) tFld was used in CALC_GRAD_PHI_HYD
(and at that time, sFld should have been used too) but it got replaced
to use "alphRho" instead (which is more consistent too).
And did not find any use of tFld,sFld in DIAGS_PHI_RLOW.
An other thing is that we could also safely remove tFld & sFld from
argument list of calling S/R CALC_PHI_HYD and use instead theta & salt
(available in common block). Was needed for the old implementation
of staggerTimeStep (until July 2004) but not the case anymore.
I will create a PR with tFld,sFld removed from CALC_GRAD_PHI_HYD
and DIAGS_PHI_RLOW (+ may be CALC_PHI_HYD also) soon.
Cheers,
Jean-Michel
On Fri, Mar 08, 2019 at 03:42:27PM +0000, Daniel Goldberg wrote:
> Hi All
>
> (apologies if this gets double posted)
>
> I have noticed that CALC_PHI_HYD passes the arrays SFLD and TFLD to
> CALC_GRAD_PHI_HYD and DIAGS_PHI_RLOW, but i can't see where these arrays
> are then used within these called subroutines -- are the arguments required?
>
> If not, i would think the performance hit is negligible in most cases, but
> when compiling with OpenAD the result is that OAD_convert is called to
> convert the active arrays SFLD and TFLD to real arrays -- and since this is
> called within the dynamics loop, the unncessary array conversion takes
> place Nr times per time step.
>
> In my current setup this seems to increase "plain mode" run time (and
> presumably adjoint mode too) by at least 200%. Im unsure if there is
> anywhere else such a performance hit is occuring. (Of course, i set
> useDiagPhiRlow to .false., but i can't avoid calling CALC_GRAD_PHI_HYD!)
> There may be a way to "trick" openad into not behaving this way -- but i
> wanted to check whether these arguments are even needed.
>
> Best
> Dan
>
>
> --
>
> Daniel Goldberg, PhD
> Sr. Lecturer in Glaciology
> School of Geosciences, University of Edinburgh
> Geography Building, Drummond Street, Edinburgh EH8 9XP
>
>
> em: dan.goldberg at ed.ac.uk
> web: https://www.geos.ed.ac.uk/homes/dgoldber
> _______________________________________________
> MITgcm-devel mailing list
> MITgcm-devel at mitgcm.org
> http://mailman.mitgcm.org/mailman/listinfo/mitgcm-devel
More information about the MITgcm-devel
mailing list