| 1 |
mlosch |
1.3 |
c $Header: /u/gcmpack/MITgcm_contrib/mlosch/optim_m1qn3/optim_main.F,v 1.2 2012/04/27 09:48:53 mlosch Exp $ |
| 2 |
mlosch |
1.2 |
c $Name: $ |
| 3 |
mlosch |
1.1 |
c ================================================================== |
| 4 |
|
|
c |
| 5 |
|
|
c optim2: Routines for doing an off-line optimization with m1qn3 |
| 6 |
|
|
c after the ECCO forward and adjoint model have been run. |
| 7 |
|
|
c |
| 8 |
|
|
c optim_main - driver routine |
| 9 |
|
|
c - optim_readparms :: read namelist files and number of control |
| 10 |
|
|
c parameters |
| 11 |
|
|
c - optim_sub :: driver for m1qn3 |
| 12 |
|
|
c + optim_readdata :: read control vector or gradient and cost |
| 13 |
|
|
c function |
| 14 |
|
|
c + optim_writedata :: write control vector |
| 15 |
|
|
c + optim_store_m1qn3 :: store/restore the state of the optimizer |
| 16 |
|
|
c + m1qn3_offline :: optimization routine |
| 17 |
|
|
c > ddot :: LAPACK routine, required by m1qn3_offline |
| 18 |
|
|
c |
| 19 |
|
|
c Documentation: |
| 20 |
|
|
c |
| 21 |
|
|
c m1qn3_offline is based on m1qn3 v3.3, downloaded here: |
| 22 |
|
|
c https://who.rocq.inria.fr/Jean-Charles.Gilbert/modulopt/ |
| 23 |
|
|
c optimization-routines/m1qn3/m1qn3.html |
| 24 |
|
|
c To make work offline, the "save" statement have been replace |
| 25 |
|
|
c by common blocks, by which variables are passed to |
| 26 |
|
|
c optim_store_m1qn3 where they are stored on disk. In order to |
| 27 |
|
|
c reduce the number of variables to be saved, some have been move |
| 28 |
|
|
c down to where they are first used, e.g. barmul, tesf, etc. |
| 29 |
|
|
c |
| 30 |
|
|
c The driver routines optime_*.F are adapted from the original |
| 31 |
|
|
c optim-pkg of the MITgcm. |
| 32 |
|
|
c |
| 33 |
|
|
c Martin.Losch@awi.de 24-Apr-2012 |
| 34 |
|
|
c |
| 35 |
|
|
c ================================================================== |
| 36 |
|
|
|
| 37 |
|
|
program optim_main |
| 38 |
|
|
|
| 39 |
|
|
c ================================================================== |
| 40 |
|
|
c program optim_main |
| 41 |
|
|
c ================================================================== |
| 42 |
|
|
c |
| 43 |
|
|
c o Driver routine for the ECCO optimization package. |
| 44 |
|
|
c ================================================================== |
| 45 |
|
|
|
| 46 |
|
|
implicit none |
| 47 |
|
|
|
| 48 |
|
|
c == global variables == |
| 49 |
|
|
|
| 50 |
|
|
c == routine arguments == |
| 51 |
|
|
|
| 52 |
|
|
c == local variables == |
| 53 |
|
|
|
| 54 |
|
|
integer nn |
| 55 |
|
|
_RL ff |
| 56 |
|
|
|
| 57 |
|
|
c == end of interface == |
| 58 |
|
|
|
| 59 |
|
|
c-- Headline. |
| 60 |
|
|
print* |
| 61 |
|
|
print*,' ==================================================' |
| 62 |
|
|
print*,' Large Scale Optimization with off-line capability.' |
| 63 |
|
|
print*,' ==================================================' |
| 64 |
|
|
print* |
| 65 |
|
|
|
| 66 |
|
|
c-- Get the number of control variables and other namelist |
| 67 |
|
|
c parameters |
| 68 |
mlosch |
1.2 |
nn=1 |
| 69 |
|
|
ff=-9999. |
| 70 |
mlosch |
1.1 |
call optim_readparms( nn, ff ) |
| 71 |
|
|
|
| 72 |
|
|
c-- Call the subroutine that will set up the optimization routine |
| 73 |
|
|
call optim_sub( nn, ff ) |
| 74 |
|
|
|
| 75 |
|
|
c-- Succesful termination. |
| 76 |
|
|
print* |
| 77 |
|
|
print*,' ======================================' |
| 78 |
|
|
print*,' Large Scale Optimization run finished.' |
| 79 |
|
|
print*,' ======================================' |
| 80 |
|
|
print* |
| 81 |
|
|
end |