[ecco-support] [EXTERNAL] adxx_sst and sss

Fenty, Ian G (US 329B) ian.fenty at jpl.nasa.gov
Wed Mar 15 21:13:53 EDT 2023


Hi Emma,

MITgcm code within “#ifdef blocks” are only compiled if the variable is defined via a ‘define directive’.
https://www.gsp.com/cgi-bin/man.cgi?section=1&topic=fpp#Conditional_source_code_selection

Take the code block below as an example.

#ifdef ZZZ
 X = 1+1
#endif

The code X = 1+1 would only be compiled if ‘ZZZ’ were defined via a define directive.  The corresponding define directive is simply:

#define ZZZ

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:

Take a look at the following lines from the CTRL_OPTIONS.h file used for ECCO V4r4:  https://github.com/ECCO-GROUP/ECCO-v4-Configurations/blob/bdaaf6308e8e09f08a52d28f559119ff34a59827/ECCOv4%20Release%204/code/CTRL_OPTIONS.h#L43-L45

#define ALLOW_UVEL0_CONTROL
#define ALLOW_VVEL0_CONTROL

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.
#define ALLOW_SST_CONTROL
#define ALLOW_SSS_CONTROL

-Ian


From: ecco-support <ecco-support-bounces at mit.edu> on behalf of Emma Boland <emmomp at bas.ac.uk>
Date: Tuesday, March 14, 2023 at 8:43 AM
To: ecco-support at mit.edu <ecco-support at mit.edu>
Subject: [EXTERNAL] [ecco-support] adxx_sst and sss

Hi All,

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).

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?

Thanks,

Emma
--
Dr Emma Boland | Physical Oceanographer | British Antarctic Survey
High Cross, Madingley Road, Cambridge CB3 0ET
emmomp at bas.ac.uk<mailto:emmomp at bas.ac.uk> | Phone: (0)1223 221276
Web: www.bas.ac.uk/profile/eboland<https://urldefense.us/v3/__http:/www.bas.ac.uk/profile/emmomp__;!!PvBDto6Hs4WbVuu7!KqAR5K2Ly_GVOlNnINtQg86KXmArMOpbpYV-3GovYvQSXdql-efsfa7dTakASpvvvhGygy7DFaNAn1k2pdjHFQ$>

NERC is part of UK Research and Innovation www.ukri.org<https://urldefense.us/v3/__http:/www.ukri.org__;!!PvBDto6Hs4WbVuu7!KqAR5K2Ly_GVOlNnINtQg86KXmArMOpbpYV-3GovYvQSXdql-efsfa7dTakASpvvvhGygy7DFaNAn1mpprZxJg$>
Please think of the environment before printing out this message


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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.mit.edu/pipermail/ecco-support/attachments/20230316/c299dd1a/attachment-0001.htm>


More information about the ecco-support mailing list