Back to home page

MITgcm

 
 

    


File indexing completed on 2018-03-02 18:37:37 UTC

view on githubraw file Latest commit add29e06 on 2018-01-31 20:35:05 UTC
7f58e89433 Jean*0001 #include "CPP_OPTIONS.h"
                0002 
8276725b84 Jean*0003 CBOP 0
                0004 C !ROUTINE: CPL_READ_PARAMS
                0005 
                0006 C !INTERFACE:
                0007       SUBROUTINE CPL_READ_PARAMS( msgUnit )
                0008 
                0009 C !DESCRIPTION:
7f58e89433 Jean*0010 C     *==========================================================*
                0011 C     | SUBROUTINE CPL_READ_PARAMS
8276725b84 Jean*0012 C     | o Read coupler and mapping parameters
7f58e89433 Jean*0013 C     *==========================================================*
                0014 
8276725b84 Jean*0015 C !USES:
                0016       IMPLICIT NONE
                0017 C     == Global variables ==
7f58e89433 Jean*0018 #include "CPL_PARAMS.h"
                0019 
8276725b84 Jean*0020 C !INPUT/OUTPUT PARAMETERS:
                0021 C     msgUnit          :: log-file I/O unit
                0022       INTEGER msgUnit
                0023 
                0024 C !LOCAL VARIABLES:
6502611145 Jean*0025       INTEGER ioUnit
                0026       LOGICAL fileExist
8276725b84 Jean*0027 CEOP
7f58e89433 Jean*0028 
6502611145 Jean*0029       NAMELIST /COUPLER_PARAMS/
                0030      &     cpl_sequential,
                0031      &     cpl_exchange_RunOff,
                0032      &     cpl_exchange1W_sIce, cpl_exchange2W_sIce,
                0033      &     cpl_exchange_SaltPl, cpl_exchange_DIC,
                0034      &     runOffMapSize, runOffMapFile
7f58e89433 Jean*0035 
6502611145 Jean*0036 C--   Default values for Coupler parameters
                0037       cpl_sequential = 0
                0038 C     default coupling-exch selector value: fit a simple warm
                0039 C     aqua-planet (no land, no seaice, no CO2/DIC coupling)
                0040       cpl_exchange_RunOff = 0
                0041       cpl_exchange1W_sIce = 0
                0042       cpl_exchange2W_sIce = 0
                0043       cpl_exchange_SaltPl = 0
                0044       cpl_exchange_DIC    = 0
                0045       runOffMapSize = 0
                0046       runOffMapFile = ' '
                0047 C-    other parameters:
                0048       cplErrorCount = 0
                0049       fileExist = .FALSE.
                0050 
                0051 C--   Read-in parameter file:
                0052       INQUIRE( FILE='data.cpl', EXIST=fileExist )
                0053       IF ( fileExist ) THEN
                0054         WRITE(msgUnit,'(2A)') 'CPL_READ_PARAMS: ',
                0055      &                        'Reading parameter file "data.cpl"'
                0056         ioUnit = 88
                0057         OPEN( ioUnit, FILE='data.cpl',STATUS='old')
                0058         READ( ioUnit, COUPLER_PARAMS )
                0059         CLOSE(ioUnit )
                0060       ELSE
                0061         cplErrorCount = 1
                0062         WRITE(msgUnit,'(2A)') ' *** ERROR *** CPL_READ_PARAMS: ',
                0063      &                'parameter file "data.cpl" not found'
                0064         WRITE(msgUnit,'(2A,I4,A)') ' *** ERROR *** CPL_READ_PARAMS: ',
                0065      &                '==> set ErrorCount=', cplErrorCount, ' (Fatal)'
                0066       ENDIF
                0067 
db74e45e6e Jean*0068 C--   Check parameter consistency:
                0069       IF ( cpl_exchange2W_sIce.EQ.3 .AND. cpl_sequential.EQ.0 ) THEN
                0070         cplErrorCount = cplErrorCount + 1
                0071         WRITE(msgUnit,'(2A)') ' *** ERROR *** CPL_READ_PARAMS: ',
                0072      &       'needs "cpl_sequential=1" to use: cpl_exchange2W_sIce=3'
                0073         WRITE(msgUnit,'(2A,I4,A)') ' *** ERROR *** CPL_READ_PARAMS: ',
                0074      &                '==> set ErrorCount=', cplErrorCount, ' (Fatal)'
                0075       ENDIF
                0076       IF ( cpl_exchange2W_sIce.EQ.1 .AND. cpl_sequential.EQ.1 ) THEN
                0077         cplErrorCount = cplErrorCount + 1
                0078         WRITE(msgUnit,'(2A)') ' *** ERROR *** CPL_READ_PARAMS: ',
                0079      &       'needs "cpl_sequential=0" to use: cpl_exchange2W_sIce=1'
                0080         WRITE(msgUnit,'(2A,I4,A)') ' *** ERROR *** CPL_READ_PARAMS: ',
                0081      &                '==> set ErrorCount=', cplErrorCount, ' (Fatal)'
                0082       ENDIF
                0083 
6502611145 Jean*0084 C--   Print summary of Coupler parameters value
                0085       IF ( cplErrorCount.EQ.0 ) THEN
                0086         WRITE(msgUnit,'(2A)') 'CPL_READ_PARAMS: ',
                0087      &   '------  Coupler parameter Summary:  -----------------'
                0088 
                0089 C-    main coupling time-stepping selector:
                0090         WRITE(msgUnit,'(2A,I4)') 'CPL_READ_PARAMS: ',
                0091      &           ' cpl_sequential = ', cpl_sequential
                0092 
                0093 C-    cpl_exchange field selector:
                0094         WRITE(msgUnit,'(2A,I4)') 'CPL_READ_PARAMS: ',
                0095      &           ' cpl_exchange_RunOff =', cpl_exchange_RunOff
                0096         WRITE(msgUnit,'(2A,I4)') 'CPL_READ_PARAMS: ',
                0097      &           ' cpl_exchange1W_sIce =', cpl_exchange1W_sIce
                0098         WRITE(msgUnit,'(2A,I4)') 'CPL_READ_PARAMS: ',
                0099      &           ' cpl_exchange2W_sIce =', cpl_exchange2W_sIce
                0100         WRITE(msgUnit,'(2A,I4)') 'CPL_READ_PARAMS: ',
                0101      &           ' cpl_exchange_SaltPl =', cpl_exchange_SaltPl
                0102         WRITE(msgUnit,'(2A,I4)') 'CPL_READ_PARAMS: ',
                0103      &           ' cpl_exchange_DIC    =', cpl_exchange_DIC
                0104 
                0105 C-    run-off mapping parameters:
8276725b84 Jean*0106         WRITE(msgUnit,'(2A,I8)') 'CPL_READ_PARAMS: ',
6502611145 Jean*0107      &                ' runOffMapSize=', runOffMapSize
8276725b84 Jean*0108         WRITE(msgUnit,'(3A)') 'CPL_READ_PARAMS: ',
6502611145 Jean*0109      &                ' runOffMapFile=', runOffMapFile
                0110 
                0111         WRITE(msgUnit,'(2A)') 'CPL_READ_PARAMS: ',
                0112      &   '------  End of Coupler parameter Summary ------------'
                0113       ENDIF
7f58e89433 Jean*0114 
                0115       RETURN
                0116       END