Changeset 1663 for trunk/LMDZ.TITAN/libf
- Timestamp:
- Feb 14, 2017, 11:02:36 AM (8 years ago)
- Location:
- trunk/LMDZ.TITAN/libf/phytitan
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LMDZ.TITAN/libf/phytitan/disr_haze.F90
r1648 r1663 1 1 subroutine disr_haze(dz,press,wno,taeros,ssa,cbar) 2 2 3 use datafile_mod, only: datadir 4 3 5 IMPLICIT NONE 4 6 5 real*8,intent(in) :: dz,press,wno 6 real*8,intent(inout):: taeros,ssa,cbar 7 ! ========================================================================== 8 ! 9 ! Purpose : 10 ! Interpolate values of extinction coefficient, single scattering albedo 11 ! and asymetry factor from hazetable ( Lavvas et al. 2010, mean profile, no 12 ! detached layer) 13 ! 14 ! + JVO 2017 : Vertical extension out of table implemented 15 ! 16 ! Author : 17 ! Jan Vatant d'Ollone (2016) 18 ! 19 ! ========================================================================== 20 21 real*8,intent(in) :: dz, press, wno 22 real*8,intent(inout):: taeros, ssa, cbar 7 23 8 24 !--------------------------- 9 ! Attention!!25 ! NB !! 10 26 ! taeros is the integrated extinction over the layer 11 27 ! (extinction * thickness of layer) 12 28 !--------------------------- 13 29 14 integer :: i,j,iw,ip,ierr 15 real*8 :: wln,factw,factp 16 integer,parameter :: nbwl_PL=328,nblev_PL=162 17 real*8,save :: ext_PL(nblev_PL,nbwl_PL),ssa_PL(nblev_PL,nbwl_PL) 30 integer :: i, j, iw, ip, ierr 31 real*8 :: wln, factw, factp 32 real*8 :: tmp_p, fact_t, fact_s, fact_c 33 integer,parameter :: nbwl_PL=328, nblev_PL=162 34 real*8,save :: ext_PL(nblev_PL,nbwl_PL), ssa_PL(nblev_PL,nbwl_PL) 18 35 real*8,save :: asf_PL(nblev_PL,nbwl_PL) 19 real*8,save :: wl_PL(nbwl_PL), press_PL(nblev_PL)36 real*8,save :: wl_PL(nbwl_PL), press_PL(nblev_PL) 20 37 logical,save :: firstcall=.true. 21 38 character(len=15) :: dummy 22 39 23 40 if (firstcall) then 24 print*,"DISR HAZE - PANAYOTIS LAVVAS" 25 41 print*,"We use DISR haze mean profile from P.Lavvas" 26 42 27 43 ! read PL table … … 40 56 enddo 41 57 close(11) 42 ! convert press_PL into millibar for comparison to press in the generic (wtf press in mbar but ok ... to be modified at some point anyway)58 ! convert press_PL into millibar for comparison to press in the generic 43 59 press_PL(:)=press_PL(:)*1E-2 60 61 ! Correction of the table according to Lavvas et al. 2010 (ext coeff = constant < 80 km / 20 mbar ) because of condensation 62 ! do i=1,49 63 ! ext_PL(i,:) = ext_PL(50,:) 64 ! enddo 44 65 45 66 firstcall=.false. … … 65 86 enddo 66 87 88 !----------------- Interpolate values from the hazetable -------------------- 89 67 90 if(iw.ne.nbwl_PL) then 68 factw=(wln-wl_PL(iw))/(wl_PL(iw+1)-wl_PL(iw)) 91 factw = (wln-wl_PL(iw)) / (wl_PL(iw+1)-wl_PL(iw)) 92 else 93 factw = 0. ! If we reach the end of the table we keep the last value 69 94 endif 70 95 if(ip.ne.nblev_PL) then 71 factp =(log10(press)-log10(press_PL(ip)))/(log10(press_PL(ip+1))-log10(press_PL(ip)))96 factp = (press-press_PL(ip)) / (press_PL(ip+1)-press_PL(ip)) 72 97 else 73 ! factp=(log10(press)-log10(press_PL(nblev_PL)))/(log10(1.e-10)-log10(press_PL(nblev_PL)))74 98 factp=0. 75 99 endif 76 100 77 if ((iw.ne.nbwl_PL).and.(ip.ne.nblev_PL)) then 78 taeros= ext_PL(ip,iw) *(1-factw)*(1-factp)+ext_PL(ip+1,iw) *(1-factw)*factp & 79 +ext_PL(ip,iw+1)*factw *(1-factp)+ext_PL(ip+1,iw+1)*factw *factp 80 ssa = ssa_PL(ip,iw) *(1-factw)*(1-factp)+ssa_PL(ip+1,iw) *(1-factw)*factp & 81 +ssa_PL(ip,iw+1)*factw *(1-factp)+ssa_PL(ip+1,iw+1)*factw *factp 82 cbar = asf_PL(ip,iw) *(1-factw)*(1-factp)+asf_PL(ip+1,iw) *(1-factw)*factp & 83 +asf_PL(ip,iw+1)*factw *(1-factp)+asf_PL(ip+1,iw+1)*factw *factp 84 else if ((iw.eq.nbwl_PL).and.(ip.ne.nblev_PL)) then 85 taeros= ext_PL(ip,iw)*(1-factp)+ext_PL(ip+1,iw)*factp 86 ssa = ssa_PL(ip,iw)*(1-factp)+ssa_PL(ip+1,iw)*factp 87 cbar = asf_PL(ip,iw)*(1-factp)+asf_PL(ip+1,iw)*factp 88 else if ((iw.ne.nbwl_PL).and.(ip.eq.nblev_PL)) then 89 taeros= ext_PL(ip,iw) *(1-factw)*(1-factp) & 90 +ext_PL(ip,iw+1)*factw *(1-factp) 91 ssa = ssa_PL(ip,iw) *(1-factw)*(1-factp) & 92 +ssa_PL(ip,iw+1)*factw *(1-factp) 93 cbar = asf_PL(ip,iw) *(1-factw)*(1-factp) & 94 +asf_PL(ip,iw+1)*factw *(1-factp) 95 else if ((iw.eq.nbwl_PL).and.(ip.eq.nblev_PL)) then 96 taeros= ext_PL(ip,iw)*(1-factp) 97 ssa = ssa_PL(ip,iw)*(1-factp) 98 cbar = asf_PL(ip,iw)*(1-factp) 101 ! Lin-Log interpolation : linear on wln, logarithmic on press 102 103 taeros = ( ext_PL(ip,iw)*(1.-factw) + ext_PL(ip,iw+1) *factw ) ** (1.-factp) & 104 *( ext_PL(ip+1,iw)*(1.-factw) + ext_PL(ip+1,iw+1)*factw ) ** factp 105 106 ssa = ( ssa_PL(ip,iw)*(1.-factw) + ssa_PL(ip,iw+1) *factw ) ** (1.-factp) & 107 *( ssa_PL(ip+1,iw)*(1.-factw) + ssa_PL(ip+1,iw+1)*factw ) ** factp 108 109 cbar = ( asf_PL(ip,iw)*(1.-factw) + asf_PL(ip,iw+1) *factw ) ** (1.-factp) & 110 *( asf_PL(ip+1,iw)*(1.-factw) + asf_PL(ip+1,iw+1)*factw ) ** factp 111 112 ! In case of vertical extension over the max of the table 113 ! We take the scale height on the last 5 levels (more it's not quite log) 114 ! Arbitray threshold pressure value, just to deal with the last level press=0 115 116 if(ip.eq.nblev_PL) then 117 118 tmp_p = press 119 120 if ( tmp_p .lt. 1.E-15 ) then 121 tmp_p = 1.E-15 122 endif 123 124 fact_t = log10( ( ext_PL(ip,iw)*(1.-factw) + ext_PL(ip,iw+1) *factw ) & 125 / ( ext_PL(ip-5,iw)*(1.-factw) + ext_PL(ip-5,iw+1) *factw ) ) 126 fact_s = log10( ( ssa_PL(ip,iw)*(1.-factw) + ssa_PL(ip,iw+1) *factw ) & 127 / ( ssa_PL(ip-5,iw)*(1.-factw) + ssa_PL(ip-5,iw+1) *factw ) ) 128 fact_c = log10( ( asf_PL(ip,iw)*(1.-factw) + asf_PL(ip,iw+1) *factw ) & 129 / ( asf_PL(ip-5,iw)*(1.-factw) + asf_PL(ip-5,iw+1) *factw ) ) 130 131 fact_t = fact_t / log10( press_PL(ip) / press_PL(ip-5) ) 132 fact_s = fact_s / log10( press_PL(ip) / press_PL(ip-5) ) 133 fact_c = fact_c / log10( press_PL(ip) / press_PL(ip-5) ) 134 135 taeros = taeros * ( tmp_p / press_PL(ip) ) ** fact_t 136 ssa = ssa * ( tmp_p / press_PL(ip) ) ** fact_s 137 cbar = cbar * ( tmp_p / press_PL(ip) ) ** fact_c 138 99 139 endif 100 140 -
trunk/LMDZ.TITAN/libf/phytitan/physiq_mod.F90
r1648 r1663 1278 1278 endif ! end of 'enertest' 1279 1279 1280 ! Temporary inclusions for winds diagnostics. 1281 call writediagfi(ngrid,"zdudif","Turbdiff tend. zon. wind","m s-2",3,zdudif) 1282 call writediagfi(ngrid,"zdudyn","Dyn. tend. zon. wind","m s-2",3,zdudyn) 1280 1283 1281 1284 ! Temporary inclusions for heating diagnostics. 1282 !call writediagfi(ngrid,"zdtsw","SW heating","T s-1",3,zdtsw)1283 !call writediagfi(ngrid,"zdtlw","LW heating","T s-1",3,zdtlw)1284 !call writediagfi(ngrid,"dtrad","radiative heating","K s-1",3,dtrad)1285 !call writediagfi(ngrid,"zdtdyn","Dyn. heating","T s-1",3,zdtdyn)1285 call writediagfi(ngrid,"zdtsw","SW heating","T s-1",3,zdtsw) 1286 call writediagfi(ngrid,"zdtlw","LW heating","T s-1",3,zdtlw) 1287 call writediagfi(ngrid,"dtrad","radiative heating","K s-1",3,dtrad) 1288 call writediagfi(ngrid,"zdtdyn","Dyn. heating","T s-1",3,zdtdyn) 1286 1289 1287 1290 ! For Debugging. 1288 !call writediagfi(ngrid,'pphi','Geopotential',' ',3,pphi)1291 call writediagfi(ngrid,'pphi','Geopotential',' ',3,pphi) 1289 1292 1290 1293
Note: See TracChangeset
for help on using the changeset viewer.