[MITgcm-devel] change ctrl_swapffields

Daniel Goldberg dngoldberg at gmail.com
Sat Feb 14 11:19:32 EST 2015


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: D <dgoldber at mit.edu>an.Goldberg at ed.ac.uk
web: http://ocean.mit.edu/~dgoldberg
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mitgcm.org/pipermail/mitgcm-devel/attachments/20150214/542f72aa/attachment.htm>


More information about the MITgcm-devel mailing list