[MITgcm-support] tutorial_global_oce_optim optimisation failed

Andrew McRae andrew.mcrae at physics.ox.ac.uk
Thu May 24 12:08:54 EDT 2018


Okay, just a small comment that this error seems to be guaranteed at the
first iteration.

The arrays gg and gold are declared in lsopt_top.

If "cold start" (first iteration), gg gets read in from the ecco_cost file
when simul is called at line 263 of lsopt_top.F

The loop at 405-407 makes gold a copy of gg.

The call to optline at line 436 then 'modifies' gg when it calls simul,
which loads gg from ecco_cost again.

At this point, gg and gold are identical, so the subtraction at lines
497-499 gives the zero vector, which is used in a dot product at line 501,
...

(For a warm start, gg is first read in from OPWARMD, which will contain the
previous gradient.  This is copied into gold.  Then gg is read from
ecco_cost, which will contain the new gradient, so won't be identical to
gold.)



On 27 April 2018 at 17:57, Matthew Mazloff <mmazloff at ucsd.edu> wrote:

> Hello
>
> Its been awhile, but I am pretty sure that is the normal output. It says
> “fail", but it did give you a new and ecco_ctrl_MIT_CE_000.opt0001
> (correct?) and if you unpack and run likely the cost will descend.
>
> I think it worked correctly. lsopt/optim are just confusing…but I think
> its working. I think all is good!
>
> Matt
>
>
>
> On Apr 27, 2018, at 8:25 AM, Andrew McRae <andrew.mcrae at physics.ox.ac.uk>
> wrote:
>
> Just separating this from the other thread
> <http://mailman.mitgcm.org/pipermail/mitgcm-support/2018-April/011521.html>,
> I got the bundled MITgcm optim routine built (having made these changes
> <https://github.com/MITgcm/MITgcm/compare/master...dorugeber:optim_fix>,
> based on this
> <http://mailman.mitgcm.org/pipermail/mitgcm-support/2010-September/006825.html>
> thread from 2010 and this
> <http://mailman.mitgcm.org/pipermail/mitgcm-support/2016-July/010527.html>
> one from 2016).
>
> I use OpenAD to create the adjoint.
>
> My steps are:
> 1) in the build directory, run ../../../tools/genmake2 -oad
> -mods=../code_oad
> 2) run make depend and make adAll
> 3) copy input_oad/ into a new folder scratch/
> 4) within scratch/, run ./prepare_run
> 5) copy mitgcmuv_ad from build/ into scratch/, copy optim.x into
> scratch/OPTIM/
> 6) run ./mitgcmuv_ad
> 7) in scratch/OPTIM, create symlinks to ../data.optim and ../data.ctrl
> 8) copy the files ecco_cost_MIT_CE_000.opt0000 and
> ecco_ctrl_MIT_CE_000.opt0000 into the OPTIM subdirectory
> 9) run ./optim.x within the subdirectory
>
> The full output is attached, but I assume the optimisation failed since
> the last lines are
>
>   optimization stopped because :
>   ifail =   4    the search direction is not a descent one
>
> Any ideas?  (I guess this isn't something that is tested in the daily
> builds?)
>
> In the meantime, I'll try the m1qn3 routine as in the other thread, which
> should help distinguish between a problem with the optimisation routine or
> the gradient generated by mitgcmuv_ad.
>
> Andrew
> <out.txt>_______________________________________________
> MITgcm-support mailing list
> MITgcm-support at mitgcm.org
> http://mailman.mitgcm.org/mailman/listinfo/mitgcm-support
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.mitgcm.org/pipermail/mitgcm-support/attachments/20180524/34c42d7a/attachment.html>


More information about the MITgcm-support mailing list