File indexing completed on 2019-01-25 06:10:04 UTC
view on githubraw file Latest commit 88391fb6 on 2019-01-24 19:38:27 UTC
b2ea1d2979 Jean*0001 #include "ATM_PHYS_OPTIONS.h"
0002
0003
0004
0005
0006
0007
0008 SUBROUTINE ATM_PHYS_INIT_FIXED( myThid )
0009
0010
0011
0012
0013
0014 use gcm_params_mod, only: gcm_params_init
0015 use constants_mod, only: constants_init
0016 use radiation_mod, only: radiation_init
0017 use lscale_cond_mod, only: lscale_cond_init
0018 use dargan_bettsmiller_mod, only: dargan_bettsmiller_init
0019 use vert_turb_driver_mod, only: vert_turb_driver_init
0020 use vert_diff_mod, only: gcm_vert_diff_init
0021 use mixed_layer_mod, only: mixed_layer_init
0022
0023 IMPLICIT NONE
0024 #include "EEPARAMS.h"
0025 #include "SIZE.h"
0026 #include "PARAMS.h"
0027 #include "ATM_PHYS_PARAMS.h"
0028 #include "ATM_PHYS_VARS.h"
0029
0030
0031
0032 INTEGER myThid
0033
0034
0035
0036
0037
0038
0039 CHARACTER*(MAX_LEN_MBUF) msgBuf
0040 INTEGER iUnit
0041 INTEGER axes(4)
88391fb671 jm-c 0042 INTEGER i,j,k,bi,bj
c9694dc201 Jean*0043 _RL cst_albedo, cst_mxlDepth
b2ea1d2979 Jean*0044
0045 namelist / atmosphere_nml /
0046 & turb, ldry_convection, lwet_convection, do_virtual,
0047 & two_stream, mixed_layer_bc,
0048 & roughness_heat, roughness_moist, roughness_mom
0049
c9694dc201 Jean*0050 cst_albedo = 0.
0051 cst_mxlDepth = 1.
0052
b2ea1d2979 Jean*0053 _BARRIER
0054 _BEGIN_MASTER(myThid)
7a77863887 Mart*0055 module_is_initialized =.false.
0056 turb = .false.
0057 ldry_convection = .false.
0058 lwet_convection = .false.
0059 do_virtual = .false.
0060 two_stream = .true.
0061 mixed_layer_bc = .false.
0062 roughness_heat = 0.05
0063 roughness_moist = 0.05
0064 roughness_mom = 0.05
0065 WRITE(msgBuf,'(A)') 'ATM_PHYS_INIT_FIXED: opening data.atm_gray'
0066 CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
0067 & SQUEEZE_RIGHT , 1)
0068 CALL OPEN_COPY_DATA_FILE(
0069 I 'data.atm_gray', 'ATM_PHYS_INIT_FIXED',
0070 O iUnit,
0071 I myThid )
b2ea1d2979 Jean*0072
0073
7a77863887 Mart*0074 READ(UNIT=iUnit,NML=atmosphere_nml)
0075 WRITE(msgBuf,'(A)')
b2ea1d2979 Jean*0076 & 'ATM_PHYS_INIT_FIXED: finished reading data.atm_gray'
7a77863887 Mart*0077 CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
0078 & SQUEEZE_RIGHT , 1)
b2ea1d2979 Jean*0079
7a77863887 Mart*0080 #ifdef SINGLE_DISK_IO
0081 CLOSE(iUnit)
0082 #else
0083 CLOSE(iUnit,STATUS='DELETE')
0084 #endif /* SINGLE_DISK_IO */
b2ea1d2979 Jean*0085
0086 CALL GCM_PARAMS_INIT(
0087 I UNSET_RS, UNSET_RL, UNSET_I,
0088
0089 I SQUEEZE_RIGHT, SQUEEZE_LEFT, SQUEEZE_BOTH,
0090 I precFloat32, precFloat64,
0091 I debLevZero, debLevA, debLevB,
0092 I debLevC, debLevD, debLevE,
0093 I standardMessageUnit, errorMessageUnit,
0094 I debugLevel, debugMode,
0095 I myThid )
0096
0097 CALL CONSTANTS_INIT
0098 _END_MASTER(myThid)
0099 _BARRIER
0100
0101 CALL MIXED_LAYER_INIT ( 1, sNx, 1, sNy, Nr, axes,
0102
c9694dc201 Jean*0103 & startTime, cst_mxlDepth, myThid )
b2ea1d2979 Jean*0104 CALL GCM_VERT_DIFF_INIT ( sNx, sNy, Nr,
0105 I .true., myThid, do_virtual )
0106
0107 CALL LSCALE_COND_INIT( myThid )
0108
0109 IF (lwet_convection) THEN
0110 CALL DARGAN_BETTSMILLER_INIT( myThid )
0111 ENDIF
0112
0113 IF( two_stream) THEN
c9694dc201 Jean*0114 CALL RADIATION_INIT( 1, sNx, 1, sNy, Nr, nSx,nSy, axes,
0115 & startTime, cst_albedo, myThid )
b2ea1d2979 Jean*0116 ENDIF
0117
0118 IF (turb) THEN
0119 CALL VERT_TURB_DRIVER_INIT( sNx,sNy,Nr,axes,
0120 & startTime, myThid )
0121 ENDIF
0122
0123 module_is_initialized = .true.
0124
0125 DO bj = myByLo(myThid), myByHi(myThid)
0126 DO bi = myBxLo(myThid), myBxHi(myThid)
0127 DO j=1-OLy,sNy+OLy
0128 DO i=1-OLx,sNx+OLx
0129 atmPhys_Qflx(i,j,bi,bj) = 0. _d 0
c9694dc201 Jean*0130 atmPhys_MxLD(i,j,bi,bj) = cst_mxlDepth
0131 atmPhys_Albedo(i,j,bi,bj) = cst_albedo
b2ea1d2979 Jean*0132 ENDDO
0133 ENDDO
88391fb671 jm-c 0134 DO k=1,Nr
0135 DO j=1-OLy,sNy+OLy
0136 DO i=1-OLx,sNx+OLx
0137 atmPhys_Ozone(i,j,k,bi,bj) = 0. _d 0
0138 ENDDO
0139 ENDDO
0140 ENDDO
b2ea1d2979 Jean*0141 ENDDO
0142 ENDDO
c9694dc201 Jean*0143 IF ( atmPhys_qFlxFile .NE. ' ' ) THEN
0144 CALL READ_FLD_XY_RL( atmPhys_qFlxFile,' ',
b2ea1d2979 Jean*0145 & atmPhys_Qflx, 0, myThid )
0146 CALL EXCH_XY_RL( atmPhys_Qflx, myThid )
0147 ENDIF
c9694dc201 Jean*0148 IF ( atmPhys_mxldFile .NE. ' ' ) THEN
0149 CALL READ_FLD_XY_RL( atmPhys_mxldFile,' ',
0150 & atmPhys_MxLD, 0, myThid )
0151 CALL EXCH_XY_RL( atmPhys_MxLD, myThid )
0152 ENDIF
0153 IF ( atmPhys_albedoFile .NE. ' ' ) THEN
0154 CALL READ_FLD_XY_RL( atmPhys_albedoFile,' ',
0155 & atmPhys_Albedo, 0, myThid )
0156 CALL EXCH_XY_RL( atmPhys_Albedo, myThid )
0157 ENDIF
88391fb671 jm-c 0158 IF ( atmPhys_ozoneFile .NE. ' ' ) THEN
0159 CALL READ_FLD_XYZ_RL( atmPhys_ozoneFile,' ',
0160 & atmPhys_Ozone, 0, myThid )
0161 CALL EXCH_XYZ_RL( atmPhys_Ozone, myThid )
0162 ENDIF
b2ea1d2979 Jean*0163
0164 #ifdef ALLOW_MNC
0165
0166
0167
0168 #endif /* ALLOW_MNC */
0169
0170 #ifdef ALLOW_DIAGNOSTICS
0171 IF ( useDiagnostics ) THEN
0172 CALL ATM_PHYS_DIAGNOSTICS_INIT( myThid )
0173 ENDIF
0174 #endif
0175
0176 RETURN
0177 END