Back to home page

MITgcm

 
 

    


File indexing completed on 2024-03-02 06:10:02 UTC

view on githubraw file Latest commit 5cf43646 on 2024-03-01 18:50:49 UTC
5cf4364659 Mart*0001 #include "CTRL_OPTIONS.h"
4cee17c1be Patr*0002 
                0003       subroutine simul(
                0004      I                  indic,
                0005      I                  nn,
                0006      I                  xx,
                0007      O                  objf,
                0008      O                  adxx
                0009      &                )
                0010 
                0011 c     ==================================================================
                0012 c     SUBROUTINE simul
                0013 c     ==================================================================
                0014 c
                0015 c     o This routine is called by the large-scale optimization lsopt.
                0016 c
                0017 c       Input  : indic - Parameter (not used here).
                0018 c                nn    - Number of control variables.
                0019 c                xx    - Array  of control variables.
                0020 c
                0021 c       Output : objf  - Value of objective function.
                0022 c                adxx  - Gradients of objective function with respect
                0023 c                        to the control variables.
                0024 c
                0025 c
                0026 c     started: Christian Eckert eckert@mit.edu 15-Feb-2000
                0027 c
                0028 c     changed: Christian Eckert eckert@mit.edu 10-Mar-2000
                0029 c
                0030 c              - Added ECCO layout.
                0031 c
                0032 c     changed:  Patrick Heimbach heimbach@mit.edu 19-Jun-2000
                0033 c               - finished, revised and debugged
                0034 c
                0035 c     ==================================================================
                0036 c     SUBROUTINE simul
                0037 c     ==================================================================
                0038 
                0039       implicit none
                0040 
                0041 c     == global variables ==
                0042 
                0043 #include "EEPARAMS.h"
                0044 #include "SIZE.h"
5cf4364659 Mart*0045 #include "CTRL_SIZE.h"
65754df434 Mart*0046 #include "CTRL.h"
4cee17c1be Patr*0047 
                0048 c     == routine arguments ==
                0049 
                0050       integer indic
                0051       integer nn
                0052       _RL   xx(nn)
                0053       _RL   objf
                0054       _RL   adxx(nn)
                0055 
                0056 c     == local variables ==
                0057 
                0058       integer i
                0059       _RL   adobjf
                0060 
                0061       logical lheaderonly
                0062 
                0063 c     == end of interface ==
                0064 
d8317e9df0 Patr*0065       print *, 'pathei-lsopt in simul'
                0066 
4cee17c1be Patr*0067 c--   Call the combined modified forward model and the adjoint model.
                0068       do i = 1,nn
d8317e9df0 Patr*0069         adxx(i) = 0.
4cee17c1be Patr*0070       enddo
d8317e9df0 Patr*0071 
                0072       adobjf = 1.
4cee17c1be Patr*0073 c
                0074       lheaderonly = .false.
d8317e9df0 Patr*0075 
                0076       print *, 'pathei-lsopt vor optim_readdata'
                0077 
4cee17c1be Patr*0078       call optim_readdata( nn, ctrlname, lheaderonly, objf,   xx )
                0079       call optim_readdata( nn, costname, lheaderonly, objf, adxx )
                0080 
                0081       indic = indic
                0082 
                0083 cph(
                0084       print *, ' leaving simul with nn, objf = ', nn, objf
                0085       print *, ' leaving simul with xx, adxx = ', xx(1), adxx(1)
                0086       do i=1,nn
                0087 c         if (xx(i).EQ.'NaN') then
                0088 c            print *, 'pathei - out: i = ', i
                0089 c         end if
                0090       end do
                0091 cph)
                0092 
                0093       return
                0094       end