<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
<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. <br>
</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.<br>
</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:<br>
</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 )<br>
</p>
<ul>
</ul>
<p><span style="font-size:11.0pt">Cheers,</span></p>
<p><span style="font-size:11.0pt">Emma</span></p>
<div class="moz-cite-prefix">On 17/03/2023 17:29, Wang, Ou (US 329B)
wrote:<br>
</div>
<blockquote type="cite" cite="mid:BLAPR09MB6179D89E877D5571A06F048EC4BD9@BLAPR09MB6179.namprd09.prod.outlook.com">
<meta name="Generator" content="Microsoft Word 15 (filtered
medium)">
<style>@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;}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",serif;}span.EmailStyle22
{mso-style-type:personal-reply;
font-family:"Calibri",sans-serif;
color:windowtext;}.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;}div.WordSection1
{page:WordSection1;}</style>
<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">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.)<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">xx_gentim2d_file(8)='xx_sst',<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">xx_gentim2d_file(9)='xx_sss',<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">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).<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>
<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 <a class="moz-txt-link-rfc2396E" href="mailto:ecco-support-bounces@mit.edu"><ecco-support-bounces@mit.edu></a>
on behalf of Emma Boland <a class="moz-txt-link-rfc2396E" href="mailto:emmomp@bas.ac.uk"><emmomp@bas.ac.uk></a><br>
<b>Date: </b>Friday, March 17, 2023 at 4:00 AM<br>
<b>To: </b><a class="moz-txt-link-abbreviated
moz-txt-link-freetext" href="mailto:ecco-support@mit.edu">ecco-support@mit.edu</a>
<a class="moz-txt-link-rfc2396E" href="mailto:ecco-support@mit.edu"><ecco-support@mit.edu></a><br>
<b>Subject: </b>Re: [ecco-support] [EXTERNAL] adxx_sst
and sss<o:p></o:p></span></p>
</div>
<p>Thanks Ian,<o:p></o:p></p>
<p>Trying to recompile with <o:p></o:p></p>
<p>#define ALLOW_SST_CONTROL<br>
#define ALLOW_SSS_CONTROL <o:p></o:p></p>
<p>in my ctrl_options.h results in errors at compile thrown by
TAF:<o:p></o:p></p>
<p>*ERROR* : type of variable xx_sss0 not defined.<br>
*ERROR* : type of variable xx_sss1 not defined.<o:p></o:p></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...<o:p></o:p></p>
<p>Is it possible to instead add xx_sst/sss to the GENTIM2D
list? Which file is this defined in?<o:p></o:p></p>
<p>Thanks,<o:p></o:p></p>
<p>Emma<o:p></o:p></p>
<p><o:p> </o:p></p>
<div>
<p class="MsoNormal">On 16/03/2023 01:13, Fenty, Ian G (US
329B) wrote:<o:p></o:p></p>
</div>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<p class="MsoNormal"><span style="font-size:11.0pt">Hi Emma,</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> </span><o:p></o:p></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><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><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$" moz-do-not-send="true">https://www.gsp.com/cgi-bin/man.cgi?section=1&topic=fpp#Conditional_source_code_selection</a></span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> </span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt">Take the
code block below as an example.</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> </span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt">#ifdef ZZZ</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> X = 1+1</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt">#endif</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> </span><o:p></o:p></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><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> </span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt">#define
ZZZ</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> </span><o:p></o:p></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><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> </span><o:p></o:p></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: <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$" moz-do-not-send="true">https://github.com/ECCO-GROUP/ECCO-v4-Configurations/blob/bdaaf6308e8e09f08a52d28f559119ff34a59827/ECCOv4%20Release%204/code/CTRL_OPTIONS.h#L43-L45</a></span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> </span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt">#define
ALLOW_UVEL0_CONTROL</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt">#define
ALLOW_VVEL0_CONTROL</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> </span><o:p></o:p></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><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt">#define
ALLOW_SST_CONTROL</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt">#define
ALLOW_SSS_CONTROL </span> <o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> </span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt">-Ian</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> </span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> </span><o:p></o:p></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 <a href="mailto:ecco-support-bounces@mit.edu" moz-do-not-send="true">
<ecco-support-bounces@mit.edu></a> on behalf of
Emma Boland <a href="mailto:emmomp@bas.ac.uk" moz-do-not-send="true"> <emmomp@bas.ac.uk></a><br>
<b>Date: </b>Tuesday, March 14, 2023 at 8:43 AM<br>
<b>To: </b><a href="mailto:ecco-support@mit.edu" moz-do-not-send="true" class="moz-txt-link-freetext">ecco-support@mit.edu</a>
<a href="mailto:ecco-support@mit.edu" moz-do-not-send="true"> <ecco-support@mit.edu></a><br>
<b>Subject: </b>[EXTERNAL] [ecco-support] adxx_sst and
sss</span><o:p></o:p></p>
</div>
<p>Hi All,<o:p></o:p></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). <o:p></o:p></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?<o:p></o:p></p>
<p>Thanks,<o:p></o:p></p>
<p>Emma<o:p></o:p></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>
<a href="mailto:emmomp@bas.ac.uk" moz-do-not-send="true" class="moz-txt-link-freetext">emmomp@bas.ac.uk</a> |
Phone: (0)1223 221276<br>
Web: <a href="https://urldefense.us/v3/__http:/www.bas.ac.uk/profile/emmomp__;!!PvBDto6Hs4WbVuu7!KqAR5K2Ly_GVOlNnINtQg86KXmArMOpbpYV-3GovYvQSXdql-efsfa7dTakASpvvvhGygy7DFaNAn1k2pdjHFQ$" moz-do-not-send="true"> www.bas.ac.uk/profile/eboland</a>
<br>
<br>
NERC is part of UK Research and Innovation <a href="https://urldefense.us/v3/__http:/www.ukri.org__;!!PvBDto6Hs4WbVuu7!KqAR5K2Ly_GVOlNnINtQg86KXmArMOpbpYV-3GovYvQSXdql-efsfa7dTakASpvvvhGygy7DFaNAn1mpprZxJg$" moz-do-not-send="true"> www.ukri.org</a> <br>
Please think of the environment before printing out this
message</span><o:p></o:p></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><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><br>
<br>
<o:p></o:p></span></p>
<pre>_______________________________________________<o:p></o:p></pre>
<pre>ecco-support mailing list<o:p></o:p></pre>
<pre><a href="mailto:ecco-support@mit.edu" moz-do-not-send="true" class="moz-txt-link-freetext">ecco-support@mit.edu</a><o:p></o:p></pre>
<pre><a href="https://urldefense.us/v3/__https:/mailman.mit.edu/mailman/listinfo/ecco-support__;!!PvBDto6Hs4WbVuu7!Pt9fH1e-yFwxucyvjoMrKjz369afGSKitbjIpYbpFQbI-SuLqaxx6TsMnoP2Sr-cBQjlrhbR0vzN0zPIROGu$" moz-do-not-send="true">https://mailman.mit.edu/mailman/listinfo/ecco-support</a><o:p></o:p></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>
<a href="mailto:emmomp@bas.ac.uk" moz-do-not-send="true" class="moz-txt-link-freetext">emmomp@bas.ac.uk</a> |
Phone: (0)1223 221276<br>
Web: <a href="https://urldefense.us/v3/__http:/www.bas.ac.uk/profile/emmomp__;!!PvBDto6Hs4WbVuu7!Pt9fH1e-yFwxucyvjoMrKjz369afGSKitbjIpYbpFQbI-SuLqaxx6TsMnoP2Sr-cBQjlrhbR0vzN0yb0iKte$" moz-do-not-send="true"> www.bas.ac.uk/profile/eboland</a>
<br>
<br>
NERC is part of UK Research and Innovation <a href="https://urldefense.us/v3/__http:/www.ukri.org__;!!PvBDto6Hs4WbVuu7!Pt9fH1e-yFwxucyvjoMrKjz369afGSKitbjIpYbpFQbI-SuLqaxx6TsMnoP2Sr-cBQjlrhbR0vzN05JyEaUz$" moz-do-not-send="true"> www.ukri.org</a> <br>
Please think of the environment before printing out this
message<o:p></o:p></span></p>
</div>
</div>
<br>
<fieldset class="moz-mime-attachment-header"></fieldset>
<pre class="moz-quote-pre" wrap="">_______________________________________________
ecco-support mailing list
<a class="moz-txt-link-abbreviated moz-txt-link-freetext" href="mailto:ecco-support@mit.edu">ecco-support@mit.edu</a>
<a class="moz-txt-link-freetext" href="https://mailman.mit.edu/mailman/listinfo/ecco-support">https://mailman.mit.edu/mailman/listinfo/ecco-support</a>
</pre>
</blockquote>
<div class="moz-signature">-- <br>
<b>Dr Emma Boland</b> | Physical Oceanographer | British Antarctic
Survey<br>
High Cross, Madingley Road, Cambridge CB3 0ET <br>
<a href="mailto:emmomp@bas.ac.uk" class="moz-txt-link-freetext">emmomp@bas.ac.uk</a><a>
| Phone: (0)1223 221276<br>
Web: </a><a class="moz-txt-link-abbreviated" href="http://www.bas.ac.uk/profile/emmomp">www.bas.ac.uk/profile/eboland</a>
<br>
<br>
NERC is part of UK Research and Innovation <a href="www.ukri.org" class="moz-txt-link-freetext">www.ukri.org</a> <br>
Please think of the environment before printing out this message</div>
</body>
</html>