[MITgcm-support] lsopt / optim routines

Martin Losch Martin.Losch at awi.de
Wed May 2 06:09:51 EDT 2018


Hi Andrew,

You can safely ignore this number, it’s supposed to be a dummy value (but it’s not what I intended it to be).

I can reproduce the large number and just checked in a fix (implicit declaration of a constant as real*4, but the argument of a function is defined as real*8, that’s why the numbers are so off). I want this number to be -9999. so that it is clear that it is not a real cost function value. Now it should print out the intended value (-9999.)

Martin

> On 27. Apr 2018, at 19:03, Andrew McRae <andrew.mcrae at physics.ox.ac.uk> wrote:
> 
> Using m1qn3, and having made these changes to data.optim, is the attached file reasonable output for the first iteration?
> 
> In particular, I'm a bit concerned by line 132:
> 
> pathei: ff    5.3046703247717040E+180
> 
> Thanks,
> Andrew
> 
> On 24 April 2018 at 18:06, Matthew Mazloff <mmazloff at ucsd.edu> wrote:
> Hi Andrew
> 
> I would make sure your data.optim is compatible with optim_m1qn3. I have pasted an example here:
> 
>  more ../../SOCCOM/Optim/data.optim 
> #
> # ********************************
> # Off-line optimization parameters
> # ********************************
>  &OPTIM
>  optimcycle=124,
>  numiter=1000,
>  nfunc=2,
>  fmin= 2000000000.0,
>  iprint=10,
>  nupdate=3,
>  /
> #
>  &M1QN3
>  coldstart = .FALSE.,
>  /
> #
> 
> And then I wouldn’t use a script that takes many steps at once. Try stepping through one step at a time and see where it fails.
> 
> Matt
> 
> 
> 
>> On Apr 24, 2018, at 2:22 AM, Andrew McRae <andrew.mcrae at physics.ox.ac.uk> wrote:
>> 
>> What changes do I need to make to get this working with, e.g., tutorial_global_oce_optim?
>> 
>> I have added
>> 
>>  &M1QN3
>>  &end
>> 
>> to data.optim, and have updated the cycsh script as the filenames there seem outdated:
>> 
>> 11c10
>> <  cp -p OPTIM/ctrlhflux_tut_MITgcm.opt0$ii .
>> ---
>> >  cp -p OPTIM/ecco_ctrl_MIT_CE_000.opt0$ii .
>> 27,28c26,27
>> <  mv ctrlhflux_tut_MITgcm.opt0$ii $fich $direc
>> <  mv costhflux_tut_MITgcm.opt0$ii OPTIM/
>> ---
>> >  mv ecco_ctrl_MIT_CE_000.opt0$ii $fich $direc
>> >  mv ecco_cost_MIT_CE_000.opt0$ii OPTIM/
>> 
>> but, following the instructions from 3.18.5 of the .pdf manual, the optimisation seems to fail from the second iteration onwards:
>> 
>> Beginning of iteration 001
>> Running mitcgm_ad: iteration 001
>> STOP NORMAL END
>> Cleaning
>> rm: No match.
>> mkdir: cannot create directory ‘runtutorial001’: File exists
>> Line-search: iteration 001
>>  optimcycle=1,
>> Beginning of iteration 002
>> Running mitcgm_ad: iteration 002
>> STOP NORMAL END
>> Cleaning
>> rm: No match.
>> mkdir: cannot create directory ‘runtutorial002’: File exists
>> Line-search: iteration 002
>>  optimcycle=2,
>> STOP ABNORMAL in S/R OPTIM_SUB
>> Beginning of iteration 003
>> Running mitcgm_ad: iteration 003
>> [Ctrl+C]
>> 
>> The file m1qn3_output.txt is attached.  I'm suspicious that lines 28-29 and 49-50 are the same; it looks like the step was never taken?
>> 
>> Thanks,
>> Andrew
>> 
>> On 16 April 2018 at 11:24, Andrew McRae <andrew.mcrae at physics.ox.ac.uk> wrote:
>> Thanks, this seems to work (at least, build, and the testbed files run).
>> 
>> Hopefully this 5-year old code replaces the 10-year old code in master at some point!
>> 
>> Andrew
>> 
>> On 20 March 2018 at 19:37, Matthew Mazloff <mmazloff at ucsd.edu> wrote:
>> Hello
>> 
>> Lately I have been using:
>> http://wwwcvs.mitgcm.org/viewvc/MITgcm/MITgcm_contrib/mlosch/optim_m1qn3/?pathrev=HEAD
>> 
>> This is an alternative search algorithm code that I find easier to use (Thanks again Martin!). You may want to give it a try
>> 
>> -Matt
>> 
>> 
>>> On Mar 20, 2018, at 11:46 AM, Andrew McRae <andrew.mcrae at physics.ox.ac.uk> wrote:
>>> 
>>> Are these run as part of the daily builds?  I can't get it to build.
>>> 
>>> Following part 3.18.4.2 of the .pdf manual (I don't think this section has been ported online yet)...
>>> 
>>> In lsopt/, the supplied blas libraries are 10+ years old and my compiler says the Pentium 4 blas1 library is incompatible.
>>> 
>>> In optim/, "make depend" doesn't work (makedepend undefined).
>>> 
>>> "make" obviously causes the compiler to complain about -lblas1 not existing.
>>> 
>>> After changing the makefile to use -lblas instead of -lblas1, "make" gives the output
>>> 
>>> f77 -o optim.x  optim_main.o optim_sub.o optim_numbmod.o optim_initmod.o optim_readdata.o optim_writedata.o optim_write_control.o xerbla.o simul.o -L. -L../lsopt/ -llsopt_ecco -lblas
>>> /usr/lib/gcc/x86_64-linux-gnu/4.9/../../../x86_64-linux-gnu/crt1.o: In function `_start':
>>> (.text+0x20): undefined reference to `main'
>>> optim_numbmod.o: In function `optim_numbmod_':
>>> optim_numbmod.f:(.text+0x1ff1): undefined reference to `ilnblnk_'
>>> optim_numbmod.f:(.text+0x2478): undefined reference to `ilnblnk_'
>>> collect2: error: ld returned 1 exit status
>>> Makefile:78: recipe for target 'optim.x' failed
>>> make: *** [optim.x] Error 1
>>> 
>>> And this just looks like broken code rather than anything BLAS-related.  An undefined reference to main, and two undefined references to ilnblnk.
>>> 
>>> ilnblnk is defined with
>>> c     == external ==
>>>       integer  ilnblnk
>>> 
>>> Then used twice as
>>> il = max(ilnblnk(record),1)
>>> 
>>> Any ideas?
>>> _______________________________________________
>>> MITgcm-support mailing list
>>> MITgcm-support at mitgcm.org
>>> http://mailman.mitgcm.org/mailman/listinfo/mitgcm-support
>> 
>> 
>> 
>> <m1qn3_output.txt>_______________________________________________
>> MITgcm-support mailing list
>> MITgcm-support at mitgcm.org
>> http://mailman.mitgcm.org/mailman/listinfo/mitgcm-support
> 
> 
> <out.txt>_______________________________________________
> MITgcm-support mailing list
> MITgcm-support at mitgcm.org
> http://mailman.mitgcm.org/mailman/listinfo/mitgcm-support



More information about the MITgcm-support mailing list