<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Windows-1252">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:Consolas;
panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
font-size:10.0pt;
font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
pre
{mso-style-priority:99;
mso-style-link:"HTML Preformatted Char";
margin:0in;
font-size:10.0pt;
font-family:"Courier New";}
span.HTMLPreformattedChar
{mso-style-name:"HTML Preformatted Char";
mso-style-priority:99;
mso-style-link:"HTML Preformatted";
font-family:Consolas;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
{page:WordSection1;}
--></style>
</head>
<body lang="EN-US" link="blue" vlink="purple" style="word-wrap:break-word">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt">Hi Emma,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">Thank you for the update. Your explanation of zero adxx_sst/sss and the solution make sense.
<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">Best,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">Ou<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal" style="margin-bottom:12.0pt"><b><span style="font-size:12.0pt;color:black">From:
</span></b><span style="font-size:12.0pt;color:black">ecco-support <ecco-support-bounces@mit.edu> on behalf of Emma Boland <emmomp@bas.ac.uk><br>
<b>Date: </b>Monday, March 27, 2023 at 6:48 AM<br>
<b>To: </b>ecco-support@mit.edu <ecco-support@mit.edu><br>
<b>Subject: </b>Re: [ecco-support] [EXTERNAL] adxx_sst and sss<o:p></o:p></span></p>
</div>
<p>Hi Ou, </p>
<p>That's what I tried initially and what results in zeros in the adxx files, I was trying the SST/S control as an alternative. I have however tried a bit harder to get the gentim2d method to work.
</p>
<p>The real problem is that SST and SSS in this context are actually relaxation fields, as used by the EXF package, and ECCOv4 doesn't use relaxation out of the box. This means there is no relaxation to perturb, resulting in zero sensitivities. This is not
clear as xx_sst/sss are not documented at all and I naively thought they were direct perturbations to the theta and salt fields.</p>
<p>If anyone else is interested in getting it working, I did solve it by altering ctrl_map_forcing.F so that the old xx_sss and xx_sst are renamed xx_sssclim and xx_sstclim, and then adding the following lines to directly perturb the k=1 theta and salt fields
(using ctrl_map_ini.F as a guide):</p>
<p>In the last set of DO loops:</p>
<p> if (xx_gentim2d_file(iarr)(1:6).EQ.'xx_sss') salt<br>
& (i,j,1,bi,bj)=salt(i,j,1,bi,bj)<br>
& +xx_gentim2d(i,j,bi,bj,iarr)<br>
if (xx_gentim2d_file(iarr)(1:6).EQ.'xx_sst') theta<br>
& (i,j,1,bi,bj)=theta(i,j,1,bi,bj)<br>
& +xx_gentim2d(i,j,bi,bj,iarr)</p>
<p>Then below:</p>
<p> _EXCH_XYZ_RL( theta, myThid )<br>
_EXCH_XYZ_RL( salt, myThid )</p>
<p>Cheers,</p>
<p>Emma</p>
<div>
<p class="MsoNormal">On 17/03/2023 17:29, Wang, Ou (US 329B) wrote:</p>
</div>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<p class="MsoNormal"><span style="font-size:11.0pt">Hi Emma,</span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> </span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">You can add the two new controls xx_sst and xx_sss by modifying data.ctrl. You would add two new entries as follows (along with weights, multiplies etc.)</span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">xx_gentim2d_file(8)='xx_sst',</span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">xx_gentim2d_file(9)='xx_sss',</span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> </span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">You don’t need to recompile the code. The controls xx_sst and xx_sst are already defined in the code (S/R ctrl_map_forcing.F).</span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> </span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">Best,</span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">Ou</span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> </span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> </span></p>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal" style="margin-bottom:12.0pt"><b><span style="font-size:12.0pt;color:black">From:
</span></b><span style="font-size:12.0pt;color:black">ecco-support </span><a href="mailto:ecco-support-bounces@mit.edu"><span style="font-size:12.0pt"><ecco-support-bounces@mit.edu></span></a><span style="font-size:12.0pt;color:black"> on behalf of Emma Boland
</span><a href="mailto:emmomp@bas.ac.uk"><span style="font-size:12.0pt"><emmomp@bas.ac.uk></span></a><span style="font-size:12.0pt;color:black"><br>
<b>Date: </b>Friday, March 17, 2023 at 4:00 AM<br>
<b>To: </b></span><a href="mailto:ecco-support@mit.edu"><span style="font-size:12.0pt">ecco-support@mit.edu</span></a><span style="font-size:12.0pt;color:black">
</span><a href="mailto:ecco-support@mit.edu"><span style="font-size:12.0pt"><ecco-support@mit.edu></span></a><span style="font-size:12.0pt;color:black"><br>
<b>Subject: </b>Re: [ecco-support] [EXTERNAL] adxx_sst and sss</span></p>
</div>
<p>Thanks Ian,</p>
<p>Trying to recompile with </p>
<p>#define ALLOW_SST_CONTROL<br>
#define ALLOW_SSS_CONTROL </p>
<p>in my ctrl_options.h results in errors at compile thrown by TAF:</p>
<p>*ERROR* : type of variable xx_sss0 not defined.<br>
*ERROR* : type of variable xx_sss1 not defined.</p>
<p>As far as I can see xx_sss0 and xx_sss1 have types defined in ctrl.h so not sure why I'm getting this...</p>
<p>Is it possible to instead add xx_sst/sss to the GENTIM2D list? Which file is this defined in?</p>
<p>Thanks,</p>
<p>Emma</p>
<p> </p>
<div>
<p class="MsoNormal">On 16/03/2023 01:13, Fenty, Ian G (US 329B) wrote:</p>
</div>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<p class="MsoNormal"><span style="font-size:11.0pt">Hi Emma,</span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> </span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">MITgcm code within “#ifdef blocks” are only compiled if the variable is defined via a ‘define directive’.
</span></p>
<p class="MsoNormal"><a href="https://urldefense.us/v3/__https:/www.gsp.com/cgi-bin/man.cgi?section=1&topic=fpp*Conditional_source_code_selection__;Iw!!PvBDto6Hs4WbVuu7!Pt9fH1e-yFwxucyvjoMrKjz369afGSKitbjIpYbpFQbI-SuLqaxx6TsMnoP2Sr-cBQjlrhbR0vzN01oSaQor$"><span style="font-size:11.0pt">https://www.gsp.com/cgi-bin/man.cgi?section=1&topic=fpp#Conditional_source_code_selection</span></a></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> </span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">Take the code block below as an example.</span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> </span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">#ifdef ZZZ</span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> X = 1+1</span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">#endif</span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> </span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">The code X = 1+1 would only be compiled if ‘ZZZ’ were defined via a define directive. The corresponding define directive is simply:</span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> </span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">#define ZZZ</span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> </span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">Define directives are added to the *.h files (like CTRL_OPTIONS.h) that you modify to configure your model setup. After changing define directives in your *.h files, you have to recompile your code:</span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> </span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">Take a look at the following lines from the CTRL_OPTIONS.h file used for ECCO V4r4: </span><a href="https://urldefense.us/v3/__https:/github.com/ECCO-GROUP/ECCO-v4-Configurations/blob/bdaaf6308e8e09f08a52d28f559119ff34a59827/ECCOv4*20Release*204/code/CTRL_OPTIONS.h*L43-L45__;JSUj!!PvBDto6Hs4WbVuu7!Pt9fH1e-yFwxucyvjoMrKjz369afGSKitbjIpYbpFQbI-SuLqaxx6TsMnoP2Sr-cBQjlrhbR0vzN02LpyaBt$"><span style="font-size:11.0pt">https://github.com/ECCO-GROUP/ECCO-v4-Configurations/blob/bdaaf6308e8e09f08a52d28f559119ff34a59827/ECCOv4%20Release%204/code/CTRL_OPTIONS.h#L43-L45</span></a></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> </span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">#define ALLOW_UVEL0_CONTROL</span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">#define ALLOW_VVEL0_CONTROL</span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> </span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">I believe all you need to do to enable adxx_sst and adxx_sss is to add the following define directives to your CTRL_OPTIONS.h file and then recompile.</span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">#define ALLOW_SST_CONTROL</span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">#define ALLOW_SSS_CONTROL </span>
</p>
<p class="MsoNormal"><span style="font-size:11.0pt"> </span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">-Ian</span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> </span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> </span></p>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal" style="margin-bottom:12.0pt"><b><span style="font-size:12.0pt;color:black">From:
</span></b><span style="font-size:12.0pt;color:black">ecco-support </span><a href="mailto:ecco-support-bounces@mit.edu"><span style="font-size:12.0pt"><ecco-support-bounces@mit.edu></span></a><span style="font-size:12.0pt;color:black"> on behalf of Emma Boland
</span><a href="mailto:emmomp@bas.ac.uk"><span style="font-size:12.0pt"><emmomp@bas.ac.uk></span></a><span style="font-size:12.0pt;color:black"><br>
<b>Date: </b>Tuesday, March 14, 2023 at 8:43 AM<br>
<b>To: </b></span><a href="mailto:ecco-support@mit.edu"><span style="font-size:12.0pt">ecco-support@mit.edu</span></a><span style="font-size:12.0pt;color:black">
</span><a href="mailto:ecco-support@mit.edu"><span style="font-size:12.0pt"><ecco-support@mit.edu></span></a><span style="font-size:12.0pt;color:black"><br>
<b>Subject: </b>[EXTERNAL] [ecco-support] adxx_sst and sss</span></p>
</div>
<p>Hi All,</p>
<p>I've been successfully running ECCOv4 r4 in adjoint mode and generating sensitivities such as adxx_qnet, adxx_tauu. I'm now interested in looking at sensitivities to SST and SSS, and can see from the ctrl package code that it should be possible to add xx_sst
and xx_sss as control variables. I've run a short test and I am indeed generating adxx_sst/sss but they are coming out all zeros (other adxx files from the same run are non-zero).
</p>
<p>Can anyone let me know if I need to do anything else to get adxx_sst and sss working? I can see from inspection of the code that the ctrl variable contributions are only summed if ALLOW_SS[T/S]_CONTROL are defined but I can't see where these logical variables
are set?</p>
<p>Thanks,</p>
<p>Emma</p>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt">-- <br>
<b>Dr Emma Boland</b> | Physical Oceanographer | British Antarctic Survey<br>
High Cross, Madingley Road, Cambridge CB3 0ET <br>
</span><a href="mailto:emmomp@bas.ac.uk"><span style="font-size:11.0pt">emmomp@bas.ac.uk</span></a><span style="font-size:11.0pt"> | Phone: (0)1223 221276<br>
Web: </span><a href="https://urldefense.us/v3/__http:/www.bas.ac.uk/profile/emmomp__;!!PvBDto6Hs4WbVuu7!KqAR5K2Ly_GVOlNnINtQg86KXmArMOpbpYV-3GovYvQSXdql-efsfa7dTakASpvvvhGygy7DFaNAn1k2pdjHFQ$"><span style="font-size:11.0pt">www.bas.ac.uk/profile/eboland</span></a><span style="font-size:11.0pt">
<br>
<br>
NERC is part of UK Research and Innovation </span><a href="https://urldefense.us/v3/__http:/www.ukri.org__;!!PvBDto6Hs4WbVuu7!KqAR5K2Ly_GVOlNnINtQg86KXmArMOpbpYV-3GovYvQSXdql-efsfa7dTakASpvvvhGygy7DFaNAn1mpprZxJg$"><span style="font-size:11.0pt">www.ukri.org</span></a><span style="font-size:11.0pt">
<br>
Please think of the environment before printing out this message</span></p>
</div>
<p class="MsoNormal" style="margin-bottom:12.0pt"><span style="font-size:11.0pt"><br>
<br>
This email and any attachments are intended solely for the use of the named recipients. If you are not the intended recipient you must not use, disclose, copy or distribute this email or any of its attachments and should notify the sender immediately and delete
this email from your system. UK Research and Innovation (UKRI) has taken every reasonable precaution to minimise risk of this email or any attachments containing viruses or malware but the recipient should carry out its own virus and malware checks before
opening the attachments. UKRI does not accept any liability for any losses or damages which the recipient may sustain due to presence of any viruses.</span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><br>
<br>
<br>
</span></p>
<pre>_______________________________________________</pre>
<pre>ecco-support mailing list</pre>
<pre><a href="mailto:ecco-support@mit.edu">ecco-support@mit.edu</a></pre>
<pre><a href="https://urldefense.us/v3/__https:/mailman.mit.edu/mailman/listinfo/ecco-support__;!!PvBDto6Hs4WbVuu7!Pt9fH1e-yFwxucyvjoMrKjz369afGSKitbjIpYbpFQbI-SuLqaxx6TsMnoP2Sr-cBQjlrhbR0vzN0zPIROGu$">https://mailman.mit.edu/mailman/listinfo/ecco-support</a></pre>
</blockquote>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt">-- <br>
<b>Dr Emma Boland</b> | Physical Oceanographer | British Antarctic Survey<br>
High Cross, Madingley Road, Cambridge CB3 0ET <br>
</span><a href="mailto:emmomp@bas.ac.uk"><span style="font-size:11.0pt">emmomp@bas.ac.uk</span></a><span style="font-size:11.0pt"> | Phone: (0)1223 221276<br>
Web: </span><a href="https://urldefense.us/v3/__http:/www.bas.ac.uk/profile/emmomp__;!!PvBDto6Hs4WbVuu7!Pt9fH1e-yFwxucyvjoMrKjz369afGSKitbjIpYbpFQbI-SuLqaxx6TsMnoP2Sr-cBQjlrhbR0vzN0yb0iKte$"><span style="font-size:11.0pt">www.bas.ac.uk/profile/eboland</span></a><span style="font-size:11.0pt">
<br>
<br>
NERC is part of UK Research and Innovation </span><a href="https://urldefense.us/v3/__http:/www.ukri.org__;!!PvBDto6Hs4WbVuu7!Pt9fH1e-yFwxucyvjoMrKjz369afGSKitbjIpYbpFQbI-SuLqaxx6TsMnoP2Sr-cBQjlrhbR0vzN05JyEaUz$"><span style="font-size:11.0pt">www.ukri.org</span></a><span style="font-size:11.0pt">
<br>
Please think of the environment before printing out this message</span></p>
</div>
<p class="MsoNormal"><span style="font-size:11.0pt"><br>
<br>
<o:p></o:p></span></p>
<pre>_______________________________________________</pre>
<pre>ecco-support mailing list</pre>
<pre><a href="mailto:ecco-support@mit.edu">ecco-support@mit.edu</a></pre>
<pre><a href="https://urldefense.us/v3/__https:/mailman.mit.edu/mailman/listinfo/ecco-support__;!!PvBDto6Hs4WbVuu7!LK3pX4xUsuFwgYWGn4-4xYPmFaYCYAAxibnnxVudYSCtpHmfztEVeMZRQ0EbI_1baje-7Us9WsFRrzo-BX-G$">https://mailman.mit.edu/mailman/listinfo/ecco-support</a></pre>
</blockquote>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt">-- <br>
<b>Dr Emma Boland</b> | Physical Oceanographer | British Antarctic Survey<br>
High Cross, Madingley Road, Cambridge CB3 0ET <br>
</span><a href="mailto:emmomp@bas.ac.uk"><span style="font-size:11.0pt">emmomp@bas.ac.uk</span></a><span style="font-size:11.0pt"> | Phone: (0)1223 221276<br>
Web: </span><a href="https://urldefense.us/v3/__http:/www.bas.ac.uk/profile/emmomp__;!!PvBDto6Hs4WbVuu7!LK3pX4xUsuFwgYWGn4-4xYPmFaYCYAAxibnnxVudYSCtpHmfztEVeMZRQ0EbI_1baje-7Us9WsFRr6ODFHcJ$"><span style="font-size:11.0pt">www.bas.ac.uk/profile/eboland</span></a><span style="font-size:11.0pt">
<br>
<br>
NERC is part of UK Research and Innovation </span><a href="https://urldefense.us/v3/__http:/www.ukri.org__;!!PvBDto6Hs4WbVuu7!LK3pX4xUsuFwgYWGn4-4xYPmFaYCYAAxibnnxVudYSCtpHmfztEVeMZRQ0EbI_1baje-7Us9WsFRr_-RIj-8$"><span style="font-size:11.0pt">www.ukri.org</span></a><span style="font-size:11.0pt">
<br>
Please think of the environment before printing out this message<o:p></o:p></span></p>
</div>
</div>
</body>
</html>