Changeset 1663 for trunk/LMDZ.TITAN/libf


Ignore:
Timestamp:
Feb 14, 2017, 11:02:36 AM (8 years ago)
Author:
jvatant
Message:

+ Modifs in haze routine

+ Interpolation corrected (log-lin instead of bilin)
+ Added the case of vertical extension

+ Output useful diagnostics in physiq_mod

Location:
trunk/LMDZ.TITAN/libf/phytitan
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/LMDZ.TITAN/libf/phytitan/disr_haze.F90

    r1648 r1663  
    11subroutine disr_haze(dz,press,wno,taeros,ssa,cbar)
     2
    23use datafile_mod, only: datadir
     4
    35IMPLICIT NONE
    46
    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
     21real*8,intent(in)   :: dz, press, wno
     22real*8,intent(inout):: taeros, ssa, cbar
    723
    824!---------------------------
    9 ! Attention !!
     25! NB !!
    1026! taeros is the integrated extinction over the layer
    1127! (extinction * thickness of layer)
    1228!---------------------------
    1329
    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)
     30integer             :: i, j, iw, ip, ierr
     31real*8              :: wln, factw, factp
     32real*8              :: tmp_p, fact_t, fact_s, fact_c
     33integer,parameter   :: nbwl_PL=328, nblev_PL=162
     34real*8,save         :: ext_PL(nblev_PL,nbwl_PL), ssa_PL(nblev_PL,nbwl_PL)
    1835real*8,save         :: asf_PL(nblev_PL,nbwl_PL)
    19 real*8,save         :: wl_PL(nbwl_PL),press_PL(nblev_PL)
     36real*8,save         :: wl_PL(nbwl_PL), press_PL(nblev_PL)
    2037logical,save        :: firstcall=.true.
    2138character(len=15)   :: dummy
    2239
    2340if (firstcall) then
    24    print*,"DISR HAZE - PANAYOTIS LAVVAS"
    25 
     41   print*,"We use DISR haze mean profile from P.Lavvas"
    2642
    2743! read PL table   
     
    4056   enddo
    4157   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
    4359   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
    4465
    4566   firstcall=.false.
     
    6586enddo
    6687
     88!----------------- Interpolate values from the hazetable  --------------------
     89
    6790if(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))
     92else
     93  factw = 0. ! If we reach the end of the table we keep the last value
    6994endif
    7095if(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))
    7297else
    73 !  factp=(log10(press)-log10(press_PL(nblev_PL)))/(log10(1.e-10)-log10(press_PL(nblev_PL)))
    7498  factp=0.
    7599endif
    76100
    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
     103taeros = ( 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
     106ssa    = ( 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
     109cbar   = ( 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
     116if(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
    99139endif
    100140
  • trunk/LMDZ.TITAN/libf/phytitan/physiq_mod.F90

    r1648 r1663  
    12781278      endif ! end of 'enertest'
    12791279
     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)
    12801283
    12811284        ! 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)
    12861289       
    12871290        ! For Debugging.
    1288         !call writediagfi(ngrid,'pphi','Geopotential',' ',3,pphi)
     1291        call writediagfi(ngrid,'pphi','Geopotential',' ',3,pphi)
    12891292       
    12901293
Note: See TracChangeset for help on using the changeset viewer.