[ecco-support] [EXTERNAL] adxx_sst and sss

Wang, Ou (US 329B) ou.wang at jpl.nasa.gov
Mon Mar 27 12:57:45 EDT 2023


Hi Emma,

Thank you for the update. Your explanation of zero adxx_sst/sss and the solution make sense.

Best,
Ou

From: ecco-support <ecco-support-bounces at mit.edu> on behalf of Emma Boland <emmomp at bas.ac.uk>
Date: Monday, March 27, 2023 at 6:48 AM
To: ecco-support at mit.edu <ecco-support at mit.edu>
Subject: Re: [ecco-support] [EXTERNAL] adxx_sst and sss

Hi Ou,

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.

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.

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

In the last set of DO loops:

           if (xx_gentim2d_file(iarr)(1:6).EQ.'xx_sss')  salt
     &      (i,j,1,bi,bj)=salt(i,j,1,bi,bj)
     &      +xx_gentim2d(i,j,bi,bj,iarr)
           if (xx_gentim2d_file(iarr)(1:6).EQ.'xx_sst') theta
     &      (i,j,1,bi,bj)=theta(i,j,1,bi,bj)
     &       +xx_gentim2d(i,j,bi,bj,iarr)

Then below:

      _EXCH_XYZ_RL( theta, myThid )
      _EXCH_XYZ_RL( salt, myThid )

Cheers,

Emma
On 17/03/2023 17:29, Wang, Ou (US 329B) wrote:
Hi Emma,

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.)
xx_gentim2d_file(8)='xx_sst',
xx_gentim2d_file(9)='xx_sss',

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

Best,
Ou


From: ecco-support <ecco-support-bounces at mit.edu><mailto:ecco-support-bounces at mit.edu> on behalf of Emma Boland <emmomp at bas.ac.uk><mailto:emmomp at bas.ac.uk>
Date: Friday, March 17, 2023 at 4:00 AM
To: ecco-support at mit.edu<mailto:ecco-support at mit.edu> <ecco-support at mit.edu><mailto:ecco-support at mit.edu>
Subject: Re: [ecco-support] [EXTERNAL] adxx_sst and sss

Thanks Ian,

Trying to recompile with

#define ALLOW_SST_CONTROL
#define ALLOW_SSS_CONTROL

in my ctrl_options.h results in errors at compile thrown by TAF:

*ERROR* : type of variable xx_sss0 not defined.
*ERROR* : type of variable xx_sss1 not defined.

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

Is it possible to instead add xx_sst/sss to the GENTIM2D list? Which file is this defined in?

Thanks,

Emma


On 16/03/2023 01:13, Fenty, Ian G (US 329B) wrote:
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<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$>

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<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$>

#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><mailto:ecco-support-bounces at mit.edu> on behalf of Emma Boland <emmomp at bas.ac.uk><mailto:emmomp at bas.ac.uk>
Date: Tuesday, March 14, 2023 at 8:43 AM
To: ecco-support at mit.edu<mailto:ecco-support at mit.edu> <ecco-support at mit.edu><mailto: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.




_______________________________________________

ecco-support mailing list

ecco-support at mit.edu<mailto:ecco-support at mit.edu>

https://mailman.mit.edu/mailman/listinfo/ecco-support<https://urldefense.us/v3/__https:/mailman.mit.edu/mailman/listinfo/ecco-support__;!!PvBDto6Hs4WbVuu7!Pt9fH1e-yFwxucyvjoMrKjz369afGSKitbjIpYbpFQbI-SuLqaxx6TsMnoP2Sr-cBQjlrhbR0vzN0zPIROGu$>
--
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!Pt9fH1e-yFwxucyvjoMrKjz369afGSKitbjIpYbpFQbI-SuLqaxx6TsMnoP2Sr-cBQjlrhbR0vzN0yb0iKte$>

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



_______________________________________________

ecco-support mailing list

ecco-support at mit.edu<mailto:ecco-support at mit.edu>

https://mailman.mit.edu/mailman/listinfo/ecco-support<https://urldefense.us/v3/__https:/mailman.mit.edu/mailman/listinfo/ecco-support__;!!PvBDto6Hs4WbVuu7!LK3pX4xUsuFwgYWGn4-4xYPmFaYCYAAxibnnxVudYSCtpHmfztEVeMZRQ0EbI_1baje-7Us9WsFRrzo-BX-G$>
--
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!LK3pX4xUsuFwgYWGn4-4xYPmFaYCYAAxibnnxVudYSCtpHmfztEVeMZRQ0EbI_1baje-7Us9WsFRr6ODFHcJ$>

NERC is part of UK Research and Innovation www.ukri.org<https://urldefense.us/v3/__http:/www.ukri.org__;!!PvBDto6Hs4WbVuu7!LK3pX4xUsuFwgYWGn4-4xYPmFaYCYAAxibnnxVudYSCtpHmfztEVeMZRQ0EbI_1baje-7Us9WsFRr_-RIj-8$>
Please think of the environment before printing out this message
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.mit.edu/pipermail/ecco-support/attachments/20230327/0dea6cce/attachment-0001.htm>


More information about the ecco-support mailing list