[MITgcm-devel] change ctrl_swapffields

Patrick Heimbach heimbach at mit.edu
Sat Feb 14 11:24:22 EST 2015


Hi Dan,

very good catch!
Shouldn’t be an issue, but to be sure, 
I can run testreport -ad once you’ve checked in the change.

p.

On Feb 14, 2015, at 11:19 AM, Daniel Goldberg <dngoldberg at gmail.com> wrote:

> Hello Patrick, Gael,
> 
> I would like to make the following change to ctrl_swapffields. As of now lines 58-67 read
> 
>       DO bj=myByLo(myThid),myByHi(myThid)
>         DO bi=myBxLo(myThid),myBxHi(myThid)
>           DO j = 1,sNy
>             DO i = 1,sNx
>               ffld0(i,j,bi,bj) = ffld1(i,j,bi,bj)
>               ffld1(i,j,bi,bj) = 0. _d 0
>             ENDDO
>           ENDDO
>         ENDDO
>       ENDDO
> 
> but i would like to change it to
> 
>       DO bj=myByLo(myThid),myByHi(myThid)
>         DO bi=myBxLo(myThid),myBxHi(myThid)
>           DO j = 1,sNy
>             DO i = 1,sNx
>               ffld0(i,j,bi,bj) = ffld1(i,j,bi,bj)
>             ENDDO
>           ENDDO
>         ENDDO
>       ENDDO
>       DO bj=myByLo(myThid),myByHi(myThid)
>         DO bi=myBxLo(myThid),myBxHi(myThid)
>           DO j = 1,sNy
>             DO i = 1,sNx
>               ffld1(i,j,bi,bj) = 0. _d 0
>             ENDDO
>           ENDDO
>         ENDDO
>       ENDDO
> 
> the reason is that when openad generates the adjoint of these lines, the result is that ffld1%d is set to zero, which should not be the case. the above seems to fix this. Is there any issue with this change?
> 
> Thanks
> Dan
> 
> -- 
> 
> Daniel Goldberg, PhD
> Lecturer in Glaciology
> School of Geosciences, University of Edinburgh
> Geography Building, Drummond Street, Edinburgh EH8 9XP
> 
> 
> em: Dan.Goldberg at ed.ac.uk
> web: http://ocean.mit.edu/~dgoldberg
> _______________________________________________
> MITgcm-devel mailing list
> MITgcm-devel at mitgcm.org
> http://mitgcm.org/mailman/listinfo/mitgcm-devel


---
Patrick Heimbach | heimbach at mit.edu | http://www.mit.edu/~heimbach
MIT | EAPS 54-1420 | 77 Massachusetts Ave | Cambridge MA 02139 USA
FON +1-617-253-5259 | FAX +1-617-253-4464 | SKYPE patrick.heimbach

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 1588 bytes
Desc: not available
URL: <http://mitgcm.org/pipermail/mitgcm-devel/attachments/20150214/277ebd8d/attachment.p7s>


More information about the MITgcm-devel mailing list