[MITgcm-devel] Re: seaice_evp

Patrick Heimbach heimbach at MIT.EDU
Thu Jun 7 12:43:01 EDT 2007


Martin,

the term
    SQRT(deltaC)/deltaCreg
must be getting awfully small.
If I replace it by
    MAX( SQRT(deltaC)/deltaCreg , 1. _d -12 )
the adjoint is back to "stable".
I just picked the E-12 randomly. Not sure what a good scale is.

-Patrick



On Jun 7, 2007, at 12:28 PM, Patrick Heimbach wrote:

>
> Hmm, I see.
> So you suggest avoiding the lines
>             deltaC = SQRT(deltaC)
>             deltaZ = SQRT(deltaZ)
> altogether
> since deltaC and deltaZ are needed only once to evaluate
> pressC, pressZ and do instead (e.g. for pressC):
>             IF ( deltaC .GT. 0. _d 0 ) THEN
>                pressC = press0(I,J,bi,bj)*SQRT(deltaC)/deltaCreg
>             ELSE
>                pressC = 0.
>             ENDIF
>
> I actually just tried this for the adjoint and results are even worse.
>
> -Patrick
>
>
>
> On Jun 7, 2007, at 11:55 AM, Martin Losch wrote:
>
>> Hi Patrick,
>>
>> the plan was to have pressC = press0*DeltaC/MAX 
>> (DeltaC,SEAICE_EPS), effectively.
>> You suggestion gives
>> pressC = press0 if DeltaC > 0 and
>> pressC = 0 if deltaC = 0, which is not the same.
>> I am not sure if that's OK, but why not do it as you suggest for  
>> ALLOW_AUTODIFF?
>>
>> Sorry about the multiple updates. I consider all of this bug  
>> fixes ...
>>
>> Martin
>>
>>
>> On 7 Jun 2007, at 17:39, Patrick Heimbach wrote:
>>
>>>
>>> Hi Martin,
>>>
>>> your change of yesterday in seaice_evp.F messed up the adjoint  
>>> again.
>>> I had thought that you'd implement changes such as to leave  
>>> computation
>>> unchanged in case of ALLOW_AUTODIFF.
>>> Changing to
>>>             IF ( deltaC .GT. 0. _d 0 ) deltaC = SQRT(deltaC)
>>> makes gradient rise by 10 orders of magn.
>>>
>>> I understand using the former lines
>>>             deltaC = SQRT(MAX(deltaC,SEAICE_EPS_SQ))
>>> will cause deltaC to be non-zero where it wasn't before.
>>> That's reasonable, but the above should be treated differently then:
>>>             IF ( deltaC .GT. 0. _d 0 )
>>>      &           deltaC = SQRT(MAX(deltaC,SEAICE_EPS_SQ))
>>>
>>> In this case your argument (Delta = 0 gets replaced by SEAICE_EPS)
>>> doesn't hold anymore since it Delta remains zero where it was  
>>> before,
>>> and unless SEAICE_EPS is chosen badly, it should work.
>>>
>>> What speaks against implementing it this way?
>>>
>>> -Patrick
>>>
>>> PS:
>>> Could we reduce the code and reference output update turnaround
>>> from maybe daily to weekly...?
>>
>> _______________________________________________
>> MITgcm-devel mailing list
>> MITgcm-devel at mitgcm.org
>> http://mitgcm.org/mailman/listinfo/mitgcm-devel
>
> ---
> Dr Patrick Heimbach | heimbach at mit.edu | http://www.mit.edu/~heimbach
> MIT | EAPS, 54-1518 | 77 Massachusetts Ave | Cambridge, MA 02139, USA
> FON: +1-617-253-5259 | FAX: +1-617-253-4464 | SKYPE: patrick.heimbach
>
>
> _______________________________________________
> MITgcm-devel mailing list
> MITgcm-devel at mitgcm.org
> http://mitgcm.org/mailman/listinfo/mitgcm-devel

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





More information about the MITgcm-devel mailing list