Changeset 2242 for trunk/LMDZ.TITAN/libf/phytitan/optci.F90
- Timestamp:
- Feb 17, 2020, 5:44:12 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LMDZ.TITAN/libf/phytitan/optci.F90
r2133 r2242 6 6 tgasref,pfgasref,wnoi,scalep,indi 7 7 use gases_h 8 use datafile_mod, only: haze_opt_file 8 9 use comcstfi_mod, only: r 9 10 use callkeys_mod, only: continuum,graybody,corrk_recombin, & 10 11 callclouds,callmufi,seashaze,uncoupl_optic_haze 11 12 use tracer_h, only : nmicro,nice 12 use MMP_OPTICS13 13 14 14 implicit none … … 83 83 ! variables for k in units m^-1 84 84 real*8 dz(L_LEVELS) 85 !real*8 rho !! see test below86 85 87 86 integer igas, jgas, ilay … … 89 88 integer interm 90 89 91 real*8 m0as,m3as,m0af,m3af 92 real*8 ext_s,sca_s,ssa_s,asf_s 93 real*8 ext_f,sca_f,ssa_f,asf_f 90 ! Variables for haze optics 91 character(len=200) file_path 92 logical file_ok 93 integer dumch 94 real*8 dumwvl 95 96 real*8 m3as,m3af 97 real*8 dtauaer_s,dtauaer_f 98 real*8,save :: rhoaer_s(L_NSPECTI),ssa_s(L_NSPECTI),asf_s(L_NSPECTI) 99 real*8,save :: rhoaer_f(L_NSPECTI),ssa_f(L_NSPECTI),asf_f(L_NSPECTI) 100 !$OMP THREADPRIVATE(rhoaer_s,rhoaer_f,ssa_s,ssa_f,asf_s,asf_f) 101 94 102 logical,save :: firstcall=.true. 95 !$OMP THREADPRIVATE(firstcall) 103 !$OMP THREADPRIVATE(firstcall) 104 96 105 97 106 !! AS: to save time in computing continuum (see bilinearbig) … … 101 110 ENDIF 102 111 103 ! Some initialisation be acause there's a pb with disr_haze at the limits (nw=1)112 ! Some initialisation because there's a pb with disr_haze at the limits (nw=1) 104 113 ! I should check this - For now we set vars to zero : better than nans - JVO 2017 105 106 dhaze_t(:,:) = 0. 107 ssa_t(:,:) = 0. 108 asf_t(:,:) = 0. 114 DHAZE_T(:,:) = 0.0 115 SSA_T(:,:) = 0.0 116 ASF_T(:,:) = 0.0 117 118 ! Load tabulated haze optical properties if needed. 119 ! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 120 IF (firstcall .AND. callmufi .AND. (.NOT. uncoupl_optic_haze)) THEN 121 OPEN(12,file=TRIM(haze_opt_file),form='formatted') ! The file has been inquired in physiq_mod firstcall 122 READ(12,*) ! dummy header 123 DO NW=1,L_NSPECTI 124 READ(12,*) dumch, dumwvl, rhoaer_f(nw), ssa_f(nw), asf_f(nw), rhoaer_s(nw), ssa_s(nw), asf_s(nw) 125 ENDDO 126 CLOSE(12) 127 ENDIF 109 128 110 129 !======================================================================= … … 118 137 do K=2,L_LEVELS 119 138 120 ilay = k / 2 ! int. arithmetic => gives the gcm layer index139 ilay = L_NLAYRAD+1 - k/2 ! int. arithmetic => gives the gcm layer index (reversed) 121 140 122 141 DPR(k) = PLEV(K)-PLEV(K-1) … … 137 156 do K=2,L_LEVELS 138 157 139 ilay = k / 2 ! int. arithmetic => gives the gcm layer index158 ilay = L_NLAYRAD+1 - k/2 ! int. arithmetic => gives the gcm layer index (reversed) 140 159 141 ! Optical coupling of YAMMS is plugged but inactivated for now142 ! as long as the microphysics only isn't fully debugged -- JVO 01/18143 160 IF (callmufi .AND. (.NOT. uncoupl_optic_haze)) THEN 144 m0as = pqmo(ilay,1) 145 m3as = pqmo(ilay,2) 146 m0af = pqmo(ilay,3) 147 m3af = pqmo(ilay,4) 148 149 IF (.NOT.mmp_sph_optics_ir(m0as,m3as,nw,ext_s,sca_s,ssa_s,asf_s)) & 150 CALL abort_gcm("optcv", "Fatal error in mmp_sph_optics_ir", 12) 151 IF (.NOT.mmp_fra_optics_ir(m0af,m3af,nw,ext_f,sca_f,ssa_f,asf_f)) & 152 CALL abort_gcm("optcv", "Fatal error in mmp_fra_optics_ir", 12) 153 dhaze_T(k,nw) = ext_s+ext_f 154 SSA_T(k,nw) = (sca_s+sca_f)/dhaze_T(k,nw) 155 ASF_T(k,nw) = (asf_s*sca_s + asf_f*sca_f) /(sca_s+sca_f) 161 m3as = pqmo(ilay,2) / 2.0 162 m3af = pqmo(ilay,4) / 2.0 163 164 IF ( ilay .lt. 18 ) THEN 165 m3as = pqmo(18,2) / 2.0 *dz(k)/dz(18) 166 m3af = pqmo(18,4) / 2.0 *dz(k)/dz(18) 167 ENDIF 168 169 dtauaer_s = m3as*rhoaer_s(nw) 170 dtauaer_f = m3af*rhoaer_f(nw) 171 DHAZE_T(k,nw) = dtauaer_s + dtauaer_f 172 173 IF ( dtauaer_s + dtauaer_f .GT. 1.D-30 ) THEN 174 SSA_T(k,nw) = ( dtauaer_s*ssa_s(nw) + dtauaer_f*ssa_f(nw) ) / ( dtauaer_s+dtauaer_f ) 175 ASF_T(k,nw) = ( dtauaer_s*ssa_s(nw)*asf_s(nw) + dtauaer_f*ssa_f(nw)*asf_f(nw) ) & 176 / ( ssa_s(nw)*dtauaer_s + ssa_f(nw)*dtauaer_f ) 177 ELSE 178 DHAZE_T(k,nw) = 0.D0 179 SSA_T(k,nw) = 1.0 180 ASF_T(k,nw) = 1.0 181 ENDIF 182 156 183 IF (callclouds.and.firstcall) & 157 184 WRITE(*,*) 'WARNING: In optci, optical properties & … … 159 186 ELSE 160 187 ! Call fixed vertical haze profile of extinction - same for all columns 161 call disr_haze(dz(k),plev(k),wnoi(nw), dhaze_T(k,nw),SSA_T(k,nw),ASF_T(k,nw))162 if (seashaze) dhaze_T(k,nw) = dhaze_T(k,nw)*seashazefact(k)188 call disr_haze(dz(k),plev(k),wnoi(nw),DHAZE_T(k,nw),SSA_T(k,nw),ASF_T(k,nw)) 189 if (seashaze) DHAZE_T(k,nw) = DHAZE_T(k,nw)*seashazefact(k) 163 190 ENDIF 164 191
Note: See TracChangeset
for help on using the changeset viewer.