/[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.1 by mlosch, Thu Apr 26 11:10:06 2012 UTC revision 1.2 by mlosch, Fri Apr 27 09:50:46 2012 UTC
# Line 48  c     == local variables == Line 48  c     == local variables ==
48    
49        _RL   objf        _RL   objf
50    
51  #if defined (DYNAMIC)  #ifdef DYNAMIC
52        _RL   xx(nn)        _RL, dimension(:), allocatable :: xx, adxx
       _RL   adxx(nn)  
 #elif defined (USE_POINTER) || (MAX_INDEPEND == 0)  
       _RL   xx  
       _RL   adxx  
       pointer (pxx,xx(1))  
       pointer (padxx,adxx(1))  
53  #else  #else
54        integer nmax        integer nmax
55        parameter( nmax = MAX_INDEPEND )        parameter( nmax = MAX_INDEPEND )
# Line 69  c     formal parameters of m1qn3 Line 63  c     formal parameters of m1qn3
63        _RL dxmin,df1        _RL dxmin,df1
64        character*3 normtype        character*3 normtype
65  c     work arrays  c     work arrays
66        integer ndz, mupdate        integer ndz
67  CML      _RL dz(ndz)  CML      _RL dz(ndz)
68        double precision, dimension(:), allocatable :: dz        double precision, dimension(:), allocatable :: dz
69  c     extra dummy variables  c     extra dummy variables
# Line 90  c     == end of interface == Line 84  c     == end of interface ==
84    
85  c--   Allocate memory for the control variables and the gradient vector.  c--   Allocate memory for the control variables and the gradient vector.
86  #if defined(DYNAMIC)  #if defined(DYNAMIC)
87  #elif defined(USE_POINTER) || (MAX_INDEPEND == 0)        allocate(   xx(nn) )
88        call myalloc( pxx  ,  nn*REAL_BYTE )        allocate( adxx(nn) )
       call myalloc( padxx,  nn*REAL_BYTE )  
89  #endif  #endif
90    
91  #if defined (DYNAMIC)  #ifndef DYNAMIC
 #elif defined(USE_POINTER) || (MAX_INDEPEND == 0)  
 #else  
92        if (nn .gt. nmax) then        if (nn .gt. nmax) then
93          print*,' OPTIMUM: Not enough space.'          print*,' OPTIMUM: Not enough space.'
94          print*,'          nmax = ',nmax          print*,'          nmax = ',nmax
# Line 213  c     mistakes it for the real one Line 204  c     mistakes it for the real one
204        call optim_writedata( nn, ctrlname, .false., -9999., xx )        call optim_writedata( nn, ctrlname, .false., -9999., xx )
205    
206  c     clean up  c     clean up
207    #ifdef DYNAMIC
208          deallocate(xx, adxx)
209    #endif /* DYNAMIC */
210        deallocate(dz)        deallocate(dz)
211    
212  c     stopping criterion  c     stopping criterion

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2

  ViewVC Help
Powered by ViewVC 1.1.22