/[MITgcm]/MITgcm_contrib/mlosch/optim_m1qn3/optim_readparms.F
ViewVC logotype

Diff of /MITgcm_contrib/mlosch/optim_m1qn3/optim_readparms.F

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.7 by mlosch, Wed May 9 18:33:38 2012 UTC revision 1.9 by mlosch, Thu May 10 16:56:33 2012 UTC
# Line 85  c--   Preset the optimization parameters Line 85  c--   Preset the optimization parameters
85        ff         = 0.        ff         = 0.
86  cdfer      expId      = 'MIT_CE_000'  cdfer      expId      = 'MIT_CE_000'
87        yctrlid    = 'MIT_CE_000'        yctrlid    = 'MIT_CE_000'
88          yctrlposunpack      = '.opt'
89          yctrlpospack        = '.opt'
90          ctrlname            = 'ecco_ctrl'
91          costname            = 'ecco_cost'
92          scalname            = ' '
93          maskname            = ' '
94          metaname            = ' '
95        coldStart  = .false.        coldStart  = .false.
96    
97        modeldataunit = 14        modeldataunit = 14
# Line 142  c--   Read optimization parameters from Line 149  c--   Read optimization parameters from
149          epsx = eps          epsx = eps
150          epsg = eps          epsg = eps
151        endif        endif
152    c     always force cold start for the 0th cycle
153          if ( optimcycle .eq. 0 ) coldStart=.true.
154    
155        call optim_readdata ( nn, ctrlname, .true., ff, vv)  c     read header from costname rather than ctrlname, because the
156    c     cost function value in costname is what we need, ctrlname only
157    c     contains a valid cost function value for the 0th iteration
158          call optim_readdata ( nn, costname, .true., ff, vv)
159                
160        if ( dfminFrac.lt.0.0 .or. dfminFrac.ge.1.0) then        if ( dfminFrac.lt.0.0 .or. dfminFrac.ge.1.0) then
161         print*, ' OPTIM_READPARMS: dfminFrac = ', dfminFrac,         print*, ' OPTIM_READPARMS: dfminFrac = ', dfminFrac,
# Line 152  c--   Read optimization parameters from Line 164  c--   Read optimization parameters from
164        endif        endif
165        if ( dfminFrac.ne.0.0 ) dfminFrac = 1.0 - dfminFrac        if ( dfminFrac.ne.0.0 ) dfminFrac = 1.0 - dfminFrac
166        if ( fmin.eq.UNSET_RL ) then        if ( fmin.eq.UNSET_RL ) then
167         if ( optimcycle .eq. 0 ) then         if ( coldStart ) then
168  c     only in this case does ff contain the actual cost function value  c     only in this case does ff contain the actual cost function value
169          fmin = dfminFrac*ff          fmin = dfminFrac*ff
170         else         else
# Line 160  c     otherwise we (ab-)use the file ctr Line 172  c     otherwise we (ab-)use the file ctr
172          fmin = ff          fmin = ff
173         endif         endif
174        endif        endif
175        if ( optimcycle.eq.0 ) then        if ( coldStart ) then
176         if ( fmin.le.0.0 ) then         if ( fmin.le.0.0 ) then
177          print '(A,E12.6,A)', ' OPTIM_READPARMS: fmin = ', fmin,          print '(A,E12.6,A)', ' OPTIM_READPARMS: fmin = ', fmin,
178       &       ' should be > 0'       &       ' should be > 0'
# Line 178  c--   Do some final printout. Line 190  c--   Do some final printout.
190        print*, ' OPTIM_READPARMS: Iteration number = ', optimcycle        print*, ' OPTIM_READPARMS: Iteration number = ', optimcycle
191        print*, ' number of control variables       = ', nn        print*, ' number of control variables       = ', nn
192        print*, ' cost function value in ', ctrlname, '  = ', ff        print*, ' cost function value in ', ctrlname, '  = ', ff
193          if ( coldStart ) then
194           print*, ' expected cost function minimum    = ', fmin
195           print*, ' expected cost function decrease   = ', ff-fmin
196          endif
197        print '(a,4a,i4.4)',        print '(a,4a,i4.4)',
198       &        ' Data will be read from the following file: ',       &        ' Data will be read from the following file: ',
199       &     ctrlname,'_',yctrlid(1:10),'.opt', optimcycle       &     ctrlname,'_',yctrlid(1:10),'.opt', optimcycle

Legend:
Removed from v.1.7  
changed lines
  Added in v.1.9

  ViewVC Help
Powered by ViewVC 1.1.22