[MITgcm-support] using (zero-d) scalars as controls with state estimate/optimisation

Daniel Goldberg Dan.Goldberg at ed.ac.uk
Fri Feb 17 12:54:35 EST 2023


hi patrick

thanks for the swift response!

ok -- thought it would be easy with gentim/genarr! but sounds like not a great idea. changing the ad tool argument sounds doable, and ill go from there -- Im confident i can capture these adjoint variables in a file.

my concern though is how it will then get "packed" into ecco_cost* (im using default filenames) for optim_m1qn3 to then work with. would this require some changes to the ctrl package? you mention it's been done way back, was this at a time when the ctrl package was in use and produced similar files?

Best
Dan

--
Daniel Goldberg, PhD (he/him)
Reader in Glaciology
School of Geosciences, University of Edinburgh
Geography Building, Drummond Street, Edinburgh EH8 9XP


em: dan.goldberg at ed.ac.uk<mailto:dan.goldberg at ed.ac.uk>
web: https://www.geos.ed.ac.uk/homes/dgoldber
________________________________
From: MITgcm-support <mitgcm-support-bounces at mitgcm.org> on behalf of Patrick Heimbach <heimbach at mit.edu>
Sent: 17 February 2023 12:42
To: mitgcm-support at mitgcm.org <mitgcm-support at mitgcm.org>
Subject: Re: [MITgcm-support] using (zero-d) scalars as controls with state estimate/optimisation

This email was sent to you by someone outside the University.
You should only click on links or attachments if you are certain that the email is genuine and the content is safe.

Dan,



Should not be a problem and has been done way back.



Main thing is to make sure you specify corresponding control variable both in the code and in the argument list of the AD tool. Probably easiest is to add that variable in ctrl.h.

And then of course also have somewhere to write the adjoint variable. Bottom line, don’t use the gentim, genarr array as controls.



Remember how we bypassed writing control variables to file initially when getting OpenAD to work. Very much the same steps (but easier) apply here.



p.



From: MITgcm-support <mitgcm-support-bounces at mitgcm.org> on behalf of Daniel Goldberg <Dan.Goldberg at ed.ac.uk>
Date: Friday, February 17, 2023 at 11:30 AM
To: MITgcm Support <mitgcm-support at mitgcm.org>
Subject: [MITgcm-support] using (zero-d) scalars as controls with state estimate/optimisation

Hello All



As in the subject, I am wondering if any MITgcm/adjoint users have ever used a (zero-dimensional) scalar (either static, or time dependent) as a control, and have any examples of doing so or any advice as to whether it is a good idea. As far as I know, it is only possible to use 2D and 3D static and time varying fields.



I know that it is possible to ensure that gradients of a genarr2d or gentim2d control are spatially constant e.g. by using a global sum of the control array and adding to a scalar -- but this does not reduce the size of the gradient passed to lsopt or m1qn3, so im not sure if the results would be similar to a case where we simply consider the gradient of a scalar. So Im not sure if this is a suitable replacement. Apologies if what Im saying is unclear.



Many thanks

Dan



--

Daniel Goldberg, PhD (he/him)

Reader in Glaciology

School of Geosciences, University of Edinburgh
Geography Building, Drummond Street, Edinburgh EH8 9XP


em: dan.goldberg at ed.ac.uk<mailto:dan.goldberg at ed.ac.uk>
web: https://www.geos.ed.ac.uk/homes/dgoldber

The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336. Is e buidheann carthannais a th’ ann an Oilthigh Dhùn Èideann, clàraichte an Alba, àireamh clàraidh SC005336.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.mitgcm.org/pipermail/mitgcm-support/attachments/20230217/e3ca4d47/attachment-0001.html>


More information about the MITgcm-support mailing list