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

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

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

revision 1.4 by mlosch, Wed May 9 18:33:38 2012 UTC revision 1.6 by mlosch, Mon Jun 4 12:23:34 2012 UTC
# Line 155  c Line 155  c
155        print *, ' OPTIM_SUB   xx(1) = ', xx(1)        print *, ' OPTIM_SUB   xx(1) = ', xx(1)
156        print *, ' OPTIM_SUB adxx(1) = ', adxx(1)        print *, ' OPTIM_SUB adxx(1) = ', adxx(1)
157                
 c     compute expected decrease of cost function from objf and fmin;  
 c     this value is only used for a cold start of m1qn3_offline, for a  
 c     warm start df1 is overwritten with data from a restart file  
       df1=objf-fmin  
       if ( df1 .le. 0. ) then  
        print *, ' OPTIM_SUB: df1 = objf-fmin = ', df1, ' should be > 0.'  
        stop 'ABNORMAL in S/R OPTIM_SUB'  
       endif  
   
 c     global variable coldStart is set in s/r optim_readparms  
 c     the default is false, always set it to true for the 0th cycle  
       if ( optimcycle .eq. 0 ) coldStart=.true.  
158        if ( coldStart ) then        if ( coldStart ) then
159  c--   cold start  c--   cold start
160         print *, ' OPTIM_SUB: cold start, optimcycle =', optimcycle         print *, ' OPTIM_SUB: cold start, optimcycle =', optimcycle
# Line 175  c     this variable is the only one of t Line 163  c     this variable is the only one of t
163  c     that needs to be initialized here to make sure that we have a  c     that needs to be initialized here to make sure that we have a
164  c     clean start  c     clean start
165         reentry  = 0         reentry  = 0
166    c     compute expected decrease of cost function from objf and fmin;
167    c     this value is only used for a cold start of m1qn3_offline, for a
168    c     warm start df1 is overwritten with data from a restart file
169           df1=objf-fmin
170           if ( df1 .le. 0. ) then
171            print *, ' OPTIM_SUB: df1 = objf-fmin = ', df1,
172         &       ' but should be > 0.'
173            stop 'ABNORMAL in S/R OPTIM_SUB'
174           endif
175    
176  c     open output file for m1qn3  c     open output file for m1qn3
177         open(io,file=fname_m1qn3,status='unknown')         open(io,file=fname_m1qn3,status='unknown')
178        else        else
# Line 195  c     simul_rc,euclid,ctonbe,ctcabe are Line 193  c     simul_rc,euclid,ctonbe,ctcabe are
193  c     are provided within m1qn3. euclid, ctonbe, ctcabe can be replaced  c     are provided within m1qn3. euclid, ctonbe, ctcabe can be replaced
194  c     by something more efficient, simul_rc is a dummy routine for  c     by something more efficient, simul_rc is a dummy routine for
195  c     the reverse communication mode and should not be changed.  c     the reverse communication mode and should not be changed.
196        print *, ' OPTIM_SUB: call m1qn3_offline'        print *, ' OPTIM_SUB: call m1qn3_offline ........'
197        call m1qn3_offline (simul_rc,euclid,ctonbe,ctcabe,        call m1qn3_offline (simul_rc,euclid,ctonbe,ctcabe,
198       &     nn,xx,objf,adxx,dxmin,df1,       &     nn,xx,objf,adxx,dxmin,df1,
199       &     epsg,normtype,impres,io,imode,omode,niter,nsim,       &     epsg,normtype,impres,io,imode,omode,niter,nsim,
200       &     iz,dz,ndz,reverse,indic,izs,rzs,dzs)       &     iz,dz,ndz,reverse,indic,izs,rzs,dzs)
201        close(io)        close(io)
202          print *, ' OPTIM_SUB: ...........................'
203        print *, ' OPTIM_SUB: returned from m1qn3_offline'        print *, ' OPTIM_SUB: returned from m1qn3_offline'
204          print *, ' OPTIM_SUB:      nn = ', nn
205          print *, ' OPTIM_SUB:   xx(1) = ', xx(1), xx(2)
206          print *, ' OPTIM_SUB: adxx(1) = ', adxx(1), adxx(2)
207          print *, ' OPTIM_SUB: omode   = ', omode
208          print *, ' OPTIM_SUB: niter   = ', niter
209          print *, ' OPTIM_SUB: nsim    = ', nsim
210          print *, ' OPTIM_SUB: reverse = ', reverse
211    
212  c     write state of m1qn3 into pickup file for warm restart  c     write state of m1qn3 into pickup file for warm restart
213        call optim_store_m1qn3(ndz,iz,dz,niter,nsim,epsg,df1,        call optim_store_m1qn3(ndz,iz,dz,niter,nsim,epsg,df1,

Legend:
Removed from v.1.4  
changed lines
  Added in v.1.6

  ViewVC Help
Powered by ViewVC 1.1.22