Back to home page

MITgcm

 
 

    


File indexing completed on 2018-03-02 18:41:31 UTC

view on githubraw file Latest commit add29e06 on 2018-01-31 20:35:05 UTC
5da8ce63fa Dimi*0001 #include "ICEFRONT_OPTIONS.h"
                0002 
                0003 CBOP
                0004 C !ROUTINE: ICEFRONT_READPARMS
                0005 
                0006 C !INTERFACE: ==========================================================
                0007       SUBROUTINE ICEFRONT_READPARMS( myThid )
                0008 
                0009 C !DESCRIPTION:
                0010 C     Initialize ICEFRONT parameters, read in data.icefront
                0011 
                0012 C !USES: ===============================================================
                0013       IMPLICIT NONE
                0014 #include "SIZE.h"
                0015 #include "EEPARAMS.h"
                0016 #include "ICEFRONT.h"
                0017 #include "PARAMS.h"
8126484198 Dimi*0018 #ifdef ALLOW_SHELFICE
                0019 # include "SHELFICE.h"
                0020 #endif
5da8ce63fa Dimi*0021 
                0022 C !INPUT PARAMETERS: ===================================================
16ee41eab1 Jean*0023 C  myThid               :: my thread Id number
5da8ce63fa Dimi*0024       INTEGER myThid
                0025 
                0026 C !OUTPUT PARAMETERS: ==================================================
                0027 C  none
                0028 
                0029 #ifdef ALLOW_ICEFRONT
                0030 
                0031 C !LOCAL VARIABLES: ====================================================
2b549faceb Jean*0032 C  iUnit                :: unit number for I/O
                0033 C  msgBuf               :: message buffer
5da8ce63fa Dimi*0034       INTEGER iUnit
                0035       CHARACTER*(MAX_LEN_MBUF) msgBuf
                0036 CEOP
                0037 
                0038       NAMELIST /ICEFRONT_PARM01/
                0039      &     rhoIcefront, ICEFRONTkappa,
                0040      &     ICEFRONTlatentHeat, ICEFRONTHeatCapacity_Cp,
                0041      &     ICEFRONTthetaSurface,
8126484198 Dimi*0042      &     applyIcefrontTendT,applyIcefrontTendS,
                0043      &     ICEFRONTdepthFile, ICEFRONTlengthFile
e34b832b57 Yun *0044 
e3eaf00330 Jean*0045 #ifdef ALLOW_EXF
                0046       NAMELIST /ICEFRONT_EXF_PARM02/
dd27fc9274 Jean*0047      &     SGRunOffFile,   SGRunOffperiod,   SGRunOffStartTime,
e3eaf00330 Jean*0048      &     SGRunOffstartdate1, SGRunOffstartdate2,
                0049      &     SGRunOffconst,      SGRunOff_inscal,
                0050      &     SGRunOff_remov_intercept, SGRunOff_remov_slope
                0051 #endif /* ALLOW_EXF */
                0052 
ae4c29e0db Jean*0053       IF ( .NOT.useICEFRONT ) THEN
                0054 C-    pkg ICEFRONT is not used
                0055         _BEGIN_MASTER(myThid)
                0056 C-    Track pkg activation status:
                0057          ICEFRONTisON = .FALSE.
                0058 C     print a (weak) warning if data.icefront is found
                0059          CALL PACKAGES_UNUSED_MSG( 'useICEFRONT', ' ', ' ' )
                0060         _END_MASTER(myThid)
                0061         RETURN
                0062       ENDIF
                0063 
5da8ce63fa Dimi*0064       _BEGIN_MASTER(myThid)
                0065 
                0066 C This routine has been called by the main model so we set our
                0067 C internal flag to indicate we are in business
ae4c29e0db Jean*0068       ICEFRONTisON = .TRUE.
5da8ce63fa Dimi*0069 
                0070 C Set defaults values for parameters in ICEFRONT.h
8126484198 Dimi*0071 #ifdef ALLOW_SHELFICE
                0072       IF (useShelfice) THEN
                0073 C Use the same values as in SHELFICE
                0074        ICEFRONTlatentHeat       = SHELFICElatentHeat
                0075        ICEFRONTHeatCapacity_Cp  = SHELFICEHeatCapacity_Cp
                0076        rhoIcefront              = rhoShelfice
                0077        ICEFRONTkappa            = SHELFICEkappa
                0078        ICEFRONTthetaSurface     = SHELFICEthetaSurface
                0079       ELSE
                0080 #else /* ifndef ALLOW_SHELFICE */
                0081       IF (.TRUE.) THEN
                0082 #endif /* ALLOW_SHELFICE */
                0083 C Default values when SHELFICE is not used
                0084        ICEFRONTlatentHeat       =  334.0 _d 3
                0085        ICEFRONTHeatCapacity_Cp  = 2000.0 _d 0
                0086        rhoIcefront              =  917.0 _d 0
                0087        ICEFRONTkappa            =   1.54 _d -06
                0088        ICEFRONTthetaSurface     = - 20.0 _d 0
                0089       ENDIF
                0090 
5da8ce63fa Dimi*0091       recip_ICEFRONTlatentHeat =    0.0 _d 0
8126484198 Dimi*0092       ICEFRONTlengthFile       = ' '
                0093       ICEFRONTdepthFile        = ' '
                0094       applyIcefrontTendS       = .TRUE.
                0095       applyIcefrontTendT       = .TRUE.
e3eaf00330 Jean*0096 
                0097 #ifdef ALLOW_EXF
                0098       SGRunOffstartdate1       = 0
                0099       SGRunOffstartdate2       = 0
dd27fc9274 Jean*0100       SGRunOffStartTime        = UNSET_RL
e3eaf00330 Jean*0101       SGRunOffperiod           = 0.0 _d 0
                0102       SGRunOffconst            = 0.0 _d 0
                0103       SGRunOff_remov_intercept = 0.0 _d 0
                0104       SGRunOff_remov_slope     = 0.0 _d 0
                0105       SGRunOff_inscal          = 1.0 _d 0
                0106       SGRunOffFile             = ' '
                0107 C-    internal parameters (not in namelist):
                0108       SGRunOffmask             = 'c'
                0109 #endif /* ALLOW_EXF */
e34b832b57 Yun *0110 
5da8ce63fa Dimi*0111 C Open and read the data.icefront file
                0112       WRITE(msgBuf,'(A)') ' ICEFRONT_READPARMS: opening data.icefront'
e3eaf00330 Jean*0113       CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
                0114      &                    SQUEEZE_RIGHT, myThid )
5da8ce63fa Dimi*0115       CALL OPEN_COPY_DATA_FILE(
                0116      I                   'data.icefront', 'ICEFRONT_READPARMS',
                0117      O                   iUnit,
                0118      I                   myThid )
e3eaf00330 Jean*0119 
                0120       WRITE(msgBuf,'(A)') ' ICEFRONT_READPARMS: reading ICEFRONT_PARM01'
                0121       CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
                0122      &                    SQUEEZE_RIGHT, myThid )
5da8ce63fa Dimi*0123       READ(UNIT=iUnit,NML=ICEFRONT_PARM01)
e3eaf00330 Jean*0124 
                0125 #ifdef ALLOW_EXF
                0126       IF ( useEXF ) THEN
                0127        WRITE(msgBuf,'(A)')
                0128      &     ' ICEFRONT_READPARMS: reading ICEFRONT_EXF_PARM02'
                0129        CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
                0130      &                     SQUEEZE_RIGHT, myThid )
                0131        READ( UNIT=iUnit, NML=ICEFRONT_EXF_PARM02 )
                0132       ENDIF
                0133 #endif /* ALLOW_EXF */
                0134 
5da8ce63fa Dimi*0135       WRITE(msgBuf,'(A)')
                0136      &  ' ICEFRONT_READPARMS: finished reading data.icefront'
e3eaf00330 Jean*0137       CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
                0138      &                    SQUEEZE_RIGHT, myThid )
5da8ce63fa Dimi*0139 
                0140 C Close the open data file
7a77863887 Mart*0141 #ifdef SINGLE_DISK_IO
5da8ce63fa Dimi*0142       CLOSE(iUnit)
7a77863887 Mart*0143 #else
                0144       CLOSE(iUnit,STATUS='DELETE')
                0145 #endif /* SINGLE_DISK_IO */
5da8ce63fa Dimi*0146 
                0147 C Now set-up any remaining parameters that result from the input parameters
                0148       IF ( ICEFRONTlatentHeat .NE. 0. _d 0 )
                0149      &     recip_ICEFRONTlatentHeat = 1. _d 0/ICEFRONTlatentHeat
16ee41eab1 Jean*0150 
5da8ce63fa Dimi*0151       _END_MASTER(myThid)
                0152 C Everyone else must wait for the parameters to be loaded
                0153       _BARRIER
                0154 
                0155 #endif /* ALLOW_ICEFRONT */
                0156 
                0157       RETURN
                0158       END