Back to home page

MITgcm

 
 

    


File indexing completed on 2018-03-02 18:43:06 UTC

view on githubraw file Latest commit add29e06 on 2018-01-31 20:35:05 UTC
aa076db465 Ed H*0001 #include "REGRID_OPTIONS.h"
                0002 
                0003 C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
                0004 CBOP 0
                0005 C     !ROUTINE: REGRID_READPARMS
                0006 
                0007 C     !INTERFACE:
                0008       SUBROUTINE REGRID_READPARMS( myThid )
                0009 
                0010 C     !DESCRIPTION:
                0011 C     Initialize REGRID variables and constants.
                0012 
                0013 C     !USES:
                0014       IMPLICIT NONE
                0015 #include "SIZE.h"
                0016 #include "EEPARAMS.h"
                0017 #include "PARAMS.h"
                0018 #include "GRID.h"
                0019 #include "REGRID_SIZE.h"
                0020 #include "REGRID.h"
                0021 
                0022 C     !INPUT PARAMETERS:
                0023       INTEGER myThid
                0024 CEOP
                0025 
                0026 #ifdef ALLOW_REGRID
                0027 
                0028       CHARACTER*(MAX_LEN_MBUF) msgBuf
                0029       CHARACTER*(MAX_LEN_FNAM) blank
                0030       INTEGER iUnit, i
                0031 
                0032       NAMELIST /REGRID_PARM01/
                0033      &     regrid_MNC, regrid_MDSIO,
                0034      &     regrid_ngrids, regrid_fbname_in,
                0035      &     regrid_nout
                0036 
587d15c8e3 Jean*0037 C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
                0038 
                0039       IF ( .NOT.useREGRID ) THEN
                0040 C-    pkg REGRID is not used
                0041         _BEGIN_MASTER(myThid)
                0042 C-    Track pkg activation status:
                0043 C     print a (weak) warning if data.regrid is found
                0044          CALL PACKAGES_UNUSED_MSG( 'useREGRID', ' ', ' ' )
                0045         _END_MASTER(myThid)
                0046         RETURN
                0047       ENDIF
                0048 
aa076db465 Ed H*0049       _BEGIN_MASTER(myThid)
                0050 
                0051       DO i = 1,MAX_LEN_FNAM
                0052         blank(i:i) = ' '
                0053       ENDDO
                0054 
                0055 C     Default values for REGRID
                0056       REGRID_MNC      = useMNC
                0057       REGRID_MDSIO    = .FALSE.
                0058       regrid_ngrids   = 0
                0059       DO i = 1,REGRID_NGRID_MAX
                0060         REGRID_fbname_in(i)(1:MAX_LEN_FNAM) = blank(1:MAX_LEN_FNAM)
                0061         REGRID_fbname_out(i)(1:MAX_LEN_FNAM) = blank(1:MAX_LEN_FNAM)
                0062         regrid_nout(i) = 0
                0063       ENDDO
587d15c8e3 Jean*0064 
aa076db465 Ed H*0065       WRITE(msgBuf,'(A)') 'REGRID_READPARMS: opening data.regrid'
                0066       CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
                0067      &                    SQUEEZE_RIGHT , 1)
                0068       CALL OPEN_COPY_DATA_FILE(
                0069      I                     'data.regrid', 'REGRID_READPARMS',
                0070      O                     iUnit,
                0071      I                     myThid )
                0072 
                0073 C     Read parameters from open data file
                0074       READ(UNIT=iUnit,NML=REGRID_PARM01)
587d15c8e3 Jean*0075       WRITE(msgBuf,'(A)')
aa076db465 Ed H*0076      &     'REGRID_READPARMS: finished reading data.regrid'
                0077       CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
                0078      &     SQUEEZE_RIGHT , 1)
                0079 C     Close the open data file
7a77863887 Mart*0080 #ifdef SINGLE_DISK_IO
aa076db465 Ed H*0081       CLOSE(iUnit)
7a77863887 Mart*0082 #else
                0083       CLOSE(iUnit,STATUS='DELETE')
                0084 #endif /* SINGLE_DISK_IO */
aa076db465 Ed H*0085 
                0086 C     Make sure that we locally honor the global MNC on/off flag
                0087       REGRID_MNC = REGRID_MNC .AND. useMNC
                0088 #ifndef ALLOW_MNC
                0089 C     Fix to avoid running without getting any output:
                0090       REGRID_MNC = .FALSE.
                0091 #endif
                0092       REGRID_MDSIO = (.NOT. REGRID_MNC) .OR. outputTypesInclusive
                0093 
                0094       _END_MASTER(myThid)
                0095 
                0096 C--   Everyone else must wait for the parameters to be loaded
                0097       _BARRIER
                0098 
                0099 #endif /* ALLOW_REGRID */
                0100 
                0101       RETURN
                0102       END