<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Windows-1252">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);" class="elementToProof">
hi patrick</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);" class="elementToProof">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);" class="elementToProof">
thanks for the swift response!</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);" class="elementToProof">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);" class="elementToProof">
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.</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);" class="elementToProof">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);" class="elementToProof">
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?</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);" class="elementToProof">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);" class="elementToProof">
Best</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);" class="elementToProof">
Dan</div>
<div class="elementToProof">
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div id="Signature">
<div><span style="color:rgb(34, 34, 34);font-family:Arial, Helvetica, sans-serif;font-size:small;text-align:start;background-color:rgb(255, 255, 255);display:inline !important">--</span><br style="color:rgb(34, 34, 34);font-family:Arial, Helvetica, sans-serif;font-size:small;text-align:start">
<div dir="ltr" data-smartmail="gmail_signature" style="color:rgb(34, 34, 34);font-family:Arial, Helvetica, sans-serif;font-size:small;text-align:start">
<div dir="ltr">
<div dir="ltr">
<div><span style="font-size:12.8px">Daniel Goldberg, PhD (he/him)</span><br>
</div>
<div dir="ltr"><span style="font-size:12.8px">Reader in Glaciology</span>
<div style="font-size:12.8px">School of Geosciences, University of Edinburgh<br>
<span style="color:rgb(0, 0, 0);font-family:arial, helvetica, clean, sans-serif;line-height:15px">Geography Building, Drummond Street, Edinburgh EH8 9XP</span><br>
<br>
<br>
em: <a href="mailto:dan.goldberg@ed.ac.uk" target="_blank" style="color:rgb(17, 85, 204)">dan.goldberg@ed.ac.uk</a><br>
web: <a href="https://www.geos.ed.ac.uk/homes/dgoldber" target="_blank" style="color:rgb(17, 85, 204)">https://www.geos.ed.ac.uk/homes/dgoldber</a></div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div id="appendonsend"></div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> MITgcm-support <mitgcm-support-bounces@mitgcm.org> on behalf of Patrick Heimbach <heimbach@mit.edu><br>
<b>Sent:</b> 17 February 2023 12:42<br>
<b>To:</b> mitgcm-support@mitgcm.org <mitgcm-support@mitgcm.org><br>
<b>Subject:</b> Re: [MITgcm-support] using (zero-d) scalars as controls with state estimate/optimisation</font>
<div> </div>
</div>
<style>
<!--
@font-face
{font-family:"Cambria Math"}
@font-face
{font-family:Calibri}
@font-face
{}
p.x_MsoNormal, li.x_MsoNormal, div.x_MsoNormal
{margin:0in;
font-size:11.0pt;
font-family:"Calibri",sans-serif}
a:link, span.x_MsoHyperlink
{color:blue;
text-decoration:underline}
span.x_EmailStyle19
{font-family:"Calibri",sans-serif;
color:windowtext}
.x_MsoChpDefault
{font-size:10.0pt}
@page WordSection1
{margin:1.0in 1.0in 1.0in 1.0in}
div.x_WordSection1
{}
-->
</style>
<div lang="EN-US" link="blue" vlink="purple" style="word-wrap:break-word">
<div style="background-color:#fff2e6; border:2px dotted #ff884d"><span style="font-size:12pt; font-family:sans-serif; color:black; font-weight:bold; padding:.2em">This email was sent to you by someone outside the University.</span>
<div style="font-size:10pt; font-family:sans-serif; font-style:normal; padding:.2em">
You should only click on links or attachments if you are certain that the email is genuine and the content is safe.</div>
</div>
<div>
<div class="x_WordSection1">
<p class="x_MsoNormal"><span style="font-size:12.0pt">Dan,</span></p>
<p class="x_MsoNormal"><span style="font-size:12.0pt"> </span></p>
<p class="x_MsoNormal"><span style="font-size:12.0pt">Should not be a problem and has been done way back.</span></p>
<p class="x_MsoNormal"><span style="font-size:12.0pt"> </span></p>
<p class="x_MsoNormal"><span style="font-size:12.0pt">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.</span></p>
<p class="x_MsoNormal"><span style="font-size:12.0pt">And then of course also have somewhere to write the adjoint variable. Bottom line, don’t use the gentim, genarr array as controls.</span></p>
<p class="x_MsoNormal"><span style="font-size:12.0pt"> </span></p>
<p class="x_MsoNormal"><span style="font-size:12.0pt">Remember how we bypassed writing control variables to file initially when getting OpenAD to work. Very much the same steps (but easier) apply here.</span></p>
<p class="x_MsoNormal"><span style="font-size:12.0pt"> </span></p>
<p class="x_MsoNormal"><span style="font-size:12.0pt">p.</span></p>
<p class="x_MsoNormal"><span style="font-size:12.0pt"> </span></p>
<div style="border:none; border-top:solid #B5C4DF 1.0pt; padding:3.0pt 0in 0in 0in">
<p class="x_MsoNormal" style="margin-right:0in; margin-bottom:12.0pt; margin-left:.5in">
<b><span style="font-size:12.0pt; color:black">From: </span></b><span style="font-size:12.0pt; color:black">MITgcm-support <mitgcm-support-bounces@mitgcm.org> on behalf of Daniel Goldberg <Dan.Goldberg@ed.ac.uk><br>
<b>Date: </b>Friday, February 17, 2023 at 11:30 AM<br>
<b>To: </b>MITgcm Support <mitgcm-support@mitgcm.org><br>
<b>Subject: </b>[MITgcm-support] using (zero-d) scalars as controls with state estimate/optimisation</span></p>
</div>
<div>
<p class="x_MsoNormal" style="margin-left:.5in; background:white"><span style="font-size:12.0pt; color:black">Hello All</span></p>
</div>
<div>
<p class="x_MsoNormal" style="margin-left:.5in; background:white"><span style="font-size:12.0pt; color:black"> </span></p>
</div>
<div>
<p class="x_MsoNormal" style="margin-left:.5in; background:white"><span style="font-size:12.0pt; color:black">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.</span></p>
</div>
<div>
<p class="x_MsoNormal" style="margin-left:.5in; background:white"><span style="font-size:12.0pt; color:black"> </span></p>
</div>
<div>
<p class="x_MsoNormal" style="margin-left:.5in; background:white"><span style="font-size:12.0pt; color:black">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.</span></p>
</div>
<div>
<p class="x_MsoNormal" style="margin-left:.5in; background:white"><span style="font-size:12.0pt; color:black"> </span></p>
</div>
<div>
<p class="x_MsoNormal" style="margin-left:.5in; background:white"><span style="font-size:12.0pt; color:black">Many thanks</span></p>
</div>
<div>
<p class="x_MsoNormal" style="margin-left:.5in; background:white"><span style="font-size:12.0pt; color:black">Dan</span></p>
</div>
<div>
<div>
<p class="x_MsoNormal" style="margin-left:.5in"><span style="font-size:12.0pt; color:black"> </span></p>
</div>
<div id="x_Signature">
<div>
<p class="x_MsoNormal" style="margin-left:.5in"><span style="font-size:12.0pt; font-family:"Arial",sans-serif; color:#222222; background:white">--</span></p>
<div>
<div>
<div>
<div>
<p class="x_MsoNormal" style="margin-left:.5in"><span style="font-size:9.5pt; font-family:"Arial",sans-serif; color:#222222">Daniel Goldberg, PhD (he/him)</span><span style="font-size:12.0pt; font-family:"Arial",sans-serif; color:#222222"></span></p>
</div>
<div>
<p class="x_MsoNormal" style="margin-left:.5in"><span style="font-size:9.5pt; font-family:"Arial",sans-serif; color:#222222">Reader in Glaciology</span><span style="font-size:12.0pt; font-family:"Arial",sans-serif; color:#222222">
</span></p>
<div>
<p class="x_MsoNormal" style="margin-left:.5in"><span style="font-size:9.5pt; font-family:"Arial",sans-serif; color:#222222">School of Geosciences, University of Edinburgh<br>
</span><span style="font-size:9.5pt; font-family:"Arial",sans-serif; color:black">Geography Building, Drummond Street, Edinburgh EH8 9XP</span><span style="font-size:9.5pt; font-family:"Arial",sans-serif; color:#222222"><br>
<br>
<br>
em: <a href="mailto:dan.goldberg@ed.ac.uk" target="_blank"><span style="color:#1155CC">dan.goldberg@ed.ac.uk</span></a><br>
web: <a href="https://www.geos.ed.ac.uk/homes/dgoldber" target="_blank"><span style="color:#1155CC">https://www.geos.ed.ac.uk/homes/dgoldber</span></a></span></p>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<p class="x_MsoNormal" style="margin-left:.5in">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. </p>
</div>
</div>
</div>
</body>
</html>