Back to home page

MITgcm

 
 

    


File indexing completed on 2023-11-05 05:10:19 UTC

view on githubraw file Latest commit 65754df4 on 2023-11-04 17:55:24 UTC
7bfe6112e8 Jean*0001 #include "CTRL_OPTIONS.h"
a8a10cb8d2 Patr*0002 
                0003       subroutine optim_readparms(
65754df434 Mart*0004      I                            myThid )
a8a10cb8d2 Patr*0005 
                0006 c     ==================================================================
                0007 c     SUBROUTINE optim_readparms
                0008 c     ==================================================================
                0009 c
                0010 c     o Initialise the optimization part of the ECCO release.
                0011 c
                0012 c     started: Christian Eckert eckert@mit.edu 03-Mar-2000
                0013 c
951926fb9b Jean*0014 c     changed:
a8a10cb8d2 Patr*0015 c
                0016 c     ==================================================================
                0017 c     SUBROUTINE optim_readparms
                0018 c     ==================================================================
                0019 
65754df434 Mart*0020       IMPLICIT NONE
a8a10cb8d2 Patr*0021 
                0022 c     == global variables ==
                0023 #include "EEPARAMS.h"
a6d74b8fe7 Gael*0024 #include "SIZE.h"
                0025 #include "PARAMS.h"
65754df434 Mart*0026 #include "OPTIMCYCLE.h"
a8a10cb8d2 Patr*0027 
                0028 c     == routine arguments ==
65754df434 Mart*0029       INTEGER myThid
a8a10cb8d2 Patr*0030 
                0031 c     == local variables ==
65754df434 Mart*0032       INTEGER iUnit
bf1ddabffe Mart*0033 c     this is a dummy parameter that is never used; it is introduced here
                0034 c     so that we can have compatible namelists between mitgmcuv_ad and
                0035 c     optim.x compiled from optim_m1qn3
                0036       _RL dfminFrac
65754df434 Mart*0037       CHARACTER*(MAX_LEN_MBUF) msgBuf
                0038 
                0039 C     These variables were formerly defined in optim.h, but they are
                0040 C     only used in the offline optimization, but never within the
                0041 C     MITgcm.  packages. We define them here locally to allow to keep
                0042 C     the namelist intact.
                0043       INTEGER nvars
                0044       INTEGER numiter
                0045       INTEGER nfunc
                0046       INTEGER iprint
                0047       INTEGER nupdate
                0048       _RL epsf
                0049       _RL epsx
                0050       _RL fmin
                0051       _RL epsg
                0052       _RL eps
                0053       LOGICAL nondimcontrol
a8a10cb8d2 Patr*0054 
                0055 c     == end of interface ==
                0056 
                0057 c--   Optimization parameters.
65754df434 Mart*0058       NAMELIST /optim/
a8a10cb8d2 Patr*0059      &                 optimcycle, nvars,
                0060      &                 nondimcontrol,
bf1ddabffe Mart*0061      &                 numiter, nfunc, fmin, dfminFrac, iprint,
a8a10cb8d2 Patr*0062      &                 epsf, epsx, epsg,
                0063      &                 nupdate, eps
                0064 
a6d74b8fe7 Gael*0065       IF ( .NOT.useCTRL ) THEN
                0066 C-    pkg CTRL is not used
                0067         _BEGIN_MASTER(myThid)
                0068 C-    Track pkg activation status:
                0069 C     print a (weak) warning if data.optim is found
37e373688b Mart*0070          CALL PACKAGES_UNUSED_MSG( 'useCTRL',
                0071      I                             'OPTIM_READPARMS', 'optim' )
a6d74b8fe7 Gael*0072         _END_MASTER(myThid)
                0073         RETURN
                0074       ENDIF
                0075 
65754df434 Mart*0076       _BEGIN_MASTER( myThid )
a8a10cb8d2 Patr*0077 
                0078 c--     Set default values.
                0079         optimcycle    =   0
                0080         nvars         =  10
                0081         nondimcontrol =  .false.
                0082         numiter       =   0
                0083         nfunc         =   1
                0084         fmin          =   0.0 _d 0
bf1ddabffe Mart*0085         dfminFrac     =   0.0 _d 0
a8a10cb8d2 Patr*0086         iprint        =  10
                0087         epsx          =   1.e-6
                0088         epsg          =   1.e-6
                0089         eps           =  -1.e-6
                0090         nupdate       =   0
                0091 
9aaf43452b Patr*0092         WRITE(msgBuf,'(A)') 'OPTIM_READPARMS: opening data.optim'
                0093         CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
                0094      &                    SQUEEZE_RIGHT , 1)
                0095 
                0096         CALL OPEN_COPY_DATA_FILE(
                0097      I                          'data.optim', 'OPTIM_READPARMS',
                0098      O                          iUnit,
                0099      I                          myThid )
                0100 
                0101         READ(unit = iUnit, nml = optim)
                0102 
951926fb9b Jean*0103         WRITE(msgBuf,'(A)')
9aaf43452b Patr*0104      &       'OPTIM_READPARMS: finished reading data.optim'
                0105         CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
                0106      &                  SQUEEZE_RIGHT , 1)
                0107 
7a77863887 Mart*0108 #ifdef SINGLE_DISK_IO
                0109         CLOSE(iUnit)
                0110 #else
                0111         CLOSE(iUnit,STATUS='DELETE')
                0112 #endif /* SINGLE_DISK_IO */
a8a10cb8d2 Patr*0113 
65754df434 Mart*0114       _END_MASTER( myThid )
a8a10cb8d2 Patr*0115 
                0116       _BARRIER
                0117 
37e373688b Mart*0118       RETURN
                0119       END