<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">Hi Andrew<div class=""><br class=""></div><div class="">I would make sure your data.optim is compatible with optim_m1qn3. I have pasted an example here:</div><div class=""><br class=""></div><div class=""> more ../../SOCCOM/Optim/data.optim <br class="">#<br class=""># ********************************<br class=""># Off-line optimization parameters<br class=""># ********************************<br class=""> &OPTIM<br class=""> optimcycle=124,<br class=""> numiter=1000,<br class=""> nfunc=2,<br class=""> fmin= 2000000000.0,<br class=""> iprint=10,<br class=""> nupdate=3,<br class=""> /<br class="">#<br class=""> &M1QN3<br class=""> coldstart = .FALSE.,<br class=""> /<br class="">#</div><div class=""><br class=""></div><div class="">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.</div><div class=""><br class=""></div><div class="">Matt</div><div class=""><br class=""></div><div class=""><br class=""><div><br class=""><blockquote type="cite" class=""><div class="">On Apr 24, 2018, at 2:22 AM, Andrew McRae <<a href="mailto:andrew.mcrae@physics.ox.ac.uk" class="">andrew.mcrae@physics.ox.ac.uk</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><div class="">What changes do I need to make to get this working with, e.g., tutorial_global_oce_optim?<br class=""><br class=""></div><div class=""></div>I have added<br class=""><br class=""><div class=""> &M1QN3<br class=""> &end<br class=""></div><div class=""><br class="">to data.optim, and have updated the cycsh script as the filenames there seem outdated:<br class=""><br class="">11c10<br class=""><  cp -p OPTIM/ctrlhflux_tut_MITgcm.opt0$ii .<br class="">---<br class="">>  cp -p OPTIM/ecco_ctrl_MIT_CE_000.opt0$ii .<br class="">27,28c26,27<br class=""><  mv ctrlhflux_tut_MITgcm.opt0$ii $fich $direc<br class=""><  mv costhflux_tut_MITgcm.opt0$ii OPTIM/<br class="">---<br class="">>  mv ecco_ctrl_MIT_CE_000.opt0$ii $fich $direc<br class="">>  mv ecco_cost_MIT_CE_000.opt0$ii OPTIM/<br class=""><br class=""></div><div class="">but, following the instructions from 3.18.5 of the .pdf manual, the optimisation seems to fail from the second iteration onwards:<br class=""><br class="">Beginning of iteration 001<br class="">Running mitcgm_ad: iteration 001<br class="">STOP NORMAL END<br class="">Cleaning<br class="">rm: No match.<br class="">mkdir: cannot create directory ‘runtutorial001’: File exists<br class="">Line-search: iteration 001<br class=""> optimcycle=1,<br class="">Beginning of iteration 002<br class="">Running mitcgm_ad: iteration 002<br class="">STOP NORMAL END<br class="">Cleaning<br class="">rm: No match.<br class="">mkdir: cannot create directory ‘runtutorial002’: File exists<br class="">Line-search: iteration 002<br class=""> optimcycle=2,<br class="">STOP ABNORMAL in S/R OPTIM_SUB<br class="">Beginning of iteration 003<br class="">Running mitcgm_ad: iteration 003<br class=""></div><div class="">[Ctrl+C]<br class=""></div><div class=""><br class=""></div><div class="">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?<br class=""><br class=""></div><div class="">Thanks,<br class=""></div><div class="">Andrew<br class=""></div></div><div class="gmail_extra" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><br class=""><div class="gmail_quote">On 16 April 2018 at 11:24, Andrew McRae<span class="Apple-converted-space"> </span><span dir="ltr" class=""><<a href="mailto:andrew.mcrae@physics.ox.ac.uk" target="_blank" class="">andrew.mcrae@physics.ox.ac.uk</a>></span><span class="Apple-converted-space"> </span>wrote:<br class=""><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); padding-left: 1ex;"><div dir="ltr" class=""><div class="">Thanks, this seems to work (at least, build, and the testbed files run).<br class=""><br class=""></div><div class="">Hopefully this 5-year old code replaces the 10-year old code in master at some point!<span class="HOEnZb"><font color="#888888" class=""><br class=""></font></span></div><span class="HOEnZb"><font color="#888888" class=""><div class=""><br class=""></div><div class="">Andrew<br class=""></div></font></span><div class=""><div class="h5"><div class="gmail_extra"><br class=""><div class="gmail_quote">On 20 March 2018 at 19:37, Matthew Mazloff<span class="Apple-converted-space"> </span><span dir="ltr" class=""><<a href="mailto:mmazloff@ucsd.edu" target="_blank" class="">mmazloff@ucsd.edu</a>></span><span class="Apple-converted-space"> </span>wrote:<br class=""><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); padding-left: 1ex;"><div style="word-wrap: break-word; line-break: after-white-space;" class="">Hello<div class=""><br class=""></div><div class="">Lately I have been using:</div><div class=""><a href="http://wwwcvs.mitgcm.org/viewvc/MITgcm/MITgcm_contrib/mlosch/optim_m1qn3/?pathrev=HEAD" target="_blank" class="">http://wwwcvs.mitgcm.org/viewv<wbr class="">c/MITgcm/MITgcm_contrib/mlosch<wbr class="">/optim_m1qn3/?pathrev=HEAD</a></div><div class=""><br class=""></div><div class="">This is an alternative search algorithm code that I find easier to use (Thanks again Martin!). You may want to give it a try</div><div class=""><br class=""></div><div class="">-Matt</div><div class=""><br class=""></div><div class=""><div class=""><br class=""><blockquote type="cite" class=""><div class=""><div class="m_-7698259057553865295m_1695860332011635034h5"><div class="">On Mar 20, 2018, at 11:46 AM, Andrew McRae <<a href="mailto:andrew.mcrae@physics.ox.ac.uk" target="_blank" class="">andrew.mcrae@physics.ox.ac.uk</a><wbr class="">> wrote:</div><br class="m_-7698259057553865295m_1695860332011635034m_6005631553758179827Apple-interchange-newline"></div></div><div class=""><div class=""><div class="m_-7698259057553865295m_1695860332011635034h5"><div dir="ltr" class=""><div class=""><div class=""><div class=""><div class=""><div class=""><div class=""></div>Are these run as part of the daily builds?  I can't get it to build.<br class=""><br class="">Following part 3.18.4.2 of the .pdf manual (I don't think this section has been ported online yet)...<br class=""><br class=""></div>In lsopt/, the supplied blas libraries are 10+ years old and my compiler says the Pentium 4 blas1 library is incompatible.<br class=""><br class=""></div><div class="">In optim/, "make depend" doesn't work (makedepend undefined).<br class=""><br class="">"make" obviously causes the compiler to complain about -lblas1 not existing.<br class=""><br class="">After changing the makefile to use -lblas instead of -lblas1, "make" gives the output<br class=""><br class="">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<br class="">/usr/lib/gcc/x86_64-linux-gnu/<wbr class="">4.9/../../../x86_64-linux-gnu/<wbr class="">crt1.o: In function `_start':<br class="">(.text+0x20): undefined reference to `main'<br class="">optim_numbmod.o: In function `optim_numbmod_':<br class="">optim_numbmod.f:(.text+0x1ff1)<wbr class="">: undefined reference to `ilnblnk_'<br class="">optim_numbmod.f:(.text+0x2478)<wbr class="">: undefined reference to `ilnblnk_'<br class="">collect2: error: ld returned 1 exit status<br class="">Makefile:78: recipe for target 'optim.x' failed<br class="">make: *** [optim.x] Error 1<br class=""><br class=""></div><div class="">And this just looks like broken code rather than anything BLAS-related.  An undefined reference to main, and two undefined references to ilnblnk.<br class=""></div><br class="">ilnblnk is defined with<br class="">c     == external ==<br class="">     <span class="Apple-converted-space"> </span>integer  ilnblnk<br class=""><br class=""></div>Then used twice as<br class="">il = max(ilnblnk(record),1)<br class=""><br class=""></div>Any ideas?<br class=""></div></div></div></div>______________________________<wbr class="">_________________<br class="">MITgcm-support mailing list<br class=""><a href="mailto:MITgcm-support@mitgcm.org" target="_blank" class="">MITgcm-support@mitgcm.org</a><br class=""><a href="http://mailman.mitgcm.org/mailman/listinfo/mitgcm-support" target="_blank" class="">http://mailman.mitgcm.org/mail<wbr class="">man/listinfo/mitgcm-support</a><br class=""></div></blockquote></div><br class=""></div></div></blockquote></div><br class=""></div></div></div></div></blockquote></div><br class=""></div><span id="cid:300853BA-08F5-48F3-A2CF-00B68CC26648@lan"><m1qn3_output.txt></span><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">_______________________________________________</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">MITgcm-support mailing list</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><a href="mailto:MITgcm-support@mitgcm.org" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;" class="">MITgcm-support@mitgcm.org</a><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><a href="http://mailman.mitgcm.org/mailman/listinfo/mitgcm-support" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;" class="">http://mailman.mitgcm.org/mailman/listinfo/mitgcm-support</a></div></blockquote></div><br class=""></div></body></html>