Ignore:
Timestamp:
Mar 25, 2026, 2:01:37 PM (6 days ago)
Author:
aarfaux
Message:

Titan PCM:

Add a correction to the shortwave heating rates based on htrdr calculations, and
additional related modifications.

File:
1 edited

Legend:

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

    r4148 r4153  
    11      subroutine callcorrk(ngrid,nlayer,pq,nq,qsurf,zday,      &
    2           albedo,albedo_equivalent,emis,mu0,pplev,pplay,zzlev, &
     2          albedo,albedo_equivalent,emis,mu0,                   &
     3          pplev,pplay,zzlev,zzlay,                             &
    34          pt,tsurf,fract,dist_star,                            &
    45          dtlw,dtsw,fluxsurf_lw,                               &
     
    78          OLR_nu,OSR_nu,                                       &
    89          int_dtaui,int_dtauv,popthi,popthv,poptti,popttv,     &
    9           lastcall)
     10          lastcall, zlss, zls)
    1011
    1112      use mod_phys_lmdz_para, only : is_master
     
    1516      USE tracer_h
    1617      use comcstfi_mod, only: pi, mugaz, cpp
    17       use callkeys_mod, only: global1d, szangle,                      &
     18      use callkeys_mod, only: global1d, szangle, updatecorrhtrdr,           &
    1819                              diurnal,tracer,seashaze,corrk_recombin, &
    1920                              strictboundcorrk,specOLR,diagdtau,      &
    2021                              tplanckmin,tplanckmax,callclouds,Fcloudy
    2122      use geometry_mod, only: latitude
     23      use phys_state_var_mod, only: htrdr_dtauv, htrdr_ssav, htrdr_asymv
     24      use hrcorr_mod, only: hr_write_oprop_nc, hr_optcv
    2225
    2326      implicit none
     
    6770      REAL,INTENT(IN) :: pplay(ngrid,nlayer)       ! Mid-layer pressure (Pa).
    6871      REAL,INTENT(IN) :: zzlev(ngrid,nlayer+1)     ! Altitude at the atmospheric layer boundaries (ref : local surf).
     72      REAL,INTENT(IN) :: zzlay(ngrid,nlayer)       ! Mid-layer altitude
    6973      REAL,INTENT(IN) :: pt(ngrid,nlayer)          ! Air temperature (K).
    7074      REAL,INTENT(IN) :: tsurf(ngrid)              ! Surface temperature (K).
     
    7276      REAL,INTENT(IN) :: dist_star                 ! Distance star-planet (AU).
    7377      logical,intent(in) :: lastcall               ! Signals last call to physics.
     78      REAL,INTENT(IN) :: zlss                      ! sub-solar longitude
     79      REAL,INTENT(IN) :: zls                       ! solar longitude
    7480     
    7581      ! OUTPUT
     
    140146      ! Optical diagnostics
    141147      ! Haze
    142       REAL*8 diag_opthi(L_LEVELS,L_NSPECTI,6)
    143       REAL*8 diag_opthv(L_LEVELS,L_NSPECTV,6)
     148      REAL*8 diag_opthi(L_LEVELS,L_NSPECTI,3)
     149      REAL*8 diag_opthv(L_LEVELS,L_NSPECTV,3)
    144150      ! Clouds
    145151      REAL*8 diag_optti(L_LEVELS,L_NSPECTI,3)
     
    199205!=======================================================================
    200206
     207      if (lastcall .and. updatecorrhtrdr) then
     208          ALLOCATE(htrdr_dtauv(ngrid,L_NLAYRAD,L_NSPECTV,L_NGAUSS))
     209          ALLOCATE(htrdr_ssav(ngrid,L_NLAYRAD,L_NSPECTV,L_NGAUSS))
     210          ALLOCATE(htrdr_asymv(ngrid,L_NLAYRAD,L_NSPECTV,L_NGAUSS))
     211      endif
     212         
    201213
    202214      ! How much light do we get ?
     
    503515!-----------------------------------------------------------------------
    504516
     517         if (lastcall .and. updatecorrhtrdr) then
     518             ! Clear column :
     519             cdcolumn = 0
     520             call hr_optcv(pqmo(ig,:,:),nlayer,zzlev(ig,:),plevrad,tmid,pmid,    &
     521                  dtauv_cc,tauv_cc,taucumv_cc,wbarv_cc,cosbv_cc,tauray,taugsurf,seashazefact,&
     522                  diag_opthv,diag_opttv_cc,cdcolumn)
     523             ! Dark column :
     524             cdcolumn = 1
     525             call hr_optcv(pqmo(ig,:,:),nlayer,zzlev(ig,:),plevrad,tmid,pmid,    &
     526                  dtauv_dc,tauv_dc,taucumv_dc,wbarv_dc,cosbv_dc,tauray,taugsurf,seashazefact,&
     527                  diag_opthv,diag_opttv_dc,cdcolumn)
     528
     529             ! Mean opacity, ssa and asf :
     530             where (dtauv_cc(:,:,:) .le. 100 .and. dtauv_dc(:,:,:) .le. 100.)
     531                dtauv(:,:,:) = (1-Fcloudy)*dtauv_cc(:,:,:) + Fcloudy*dtauv_dc(:,:,:)
     532             elsewhere
     533                dtauv(:,:,:) = dtauv_dc(:,:,:) ! No need to average...
     534             endwhere
     535             do ng = 1, L_NGAUSS
     536                do nw = 1, L_NSPECTV
     537                   taucumv(1,nw,ng) = 0.0d0
     538                   do k = 2, L_LEVELS
     539                      if ((taucumv_cc(k,nw,ng).le.100.) .and. (taucumv_dc(k,nw,ng).le.100.)) then
     540                         taucumv(k,nw,ng) = taucumv(k-1,nw,ng) + (1-Fcloudy)*taucumv_cc(k,nw,ng) + Fcloudy*taucumv_dc(k,nw,ng)
     541                      else
     542                         taucumv(k,nw,ng) = taucumv(k-1,nw,ng) + taucumv_dc(k,nw,ng) ! No need to average...
     543                      end if
     544                   end do
     545                   do l = 1, L_NLAYRAD
     546                      tauv(l,nw,ng) = taucumv(2*l,nw,ng)
     547                   end do
     548                   tauv(l,nw,ng) = taucumv(2*L_NLAYRAD+1,nw,ng)
     549                end do
     550             end do
     551
     552             wbarv = ((1-Fcloudy) * wbarv_cc*dtauv_cc            + Fcloudy * wbarv_dc *dtauv_dc)
     553             wbarv = wbarv /((1-Fcloudy) * dtauv_cc              + Fcloudy * dtauv_dc  + 1.e-30)
     554
     555             cosbv = ((1-Fcloudy) * cosbv_cc * wbarv_cc*dtauv_cc + Fcloudy * cosbv_dc  * wbarv_dc *dtauv_dc)
     556             cosbv = cosbv /((1-Fcloudy) * wbarv_cc*dtauv_cc     + Fcloudy * wbarv_dc *dtauv_dc + 1.e-30)
     557             !------------------------------------------------------------------------------
     558             htrdr_dtauv(ig,:,:,:) = dtauv(L_NLAYRAD:1:-1,:,:)
     559             htrdr_ssav(ig,:,:,:)  = wbarv(L_NLAYRAD:1:-1,:,:)
     560             htrdr_asymv(ig,:,:,:) = cosbv(L_NLAYRAD:1:-1,:,:)
     561         endif
     562
    505563         ! Clear column :
    506564         cdcolumn = 0
     
    863921
    864922      if (lastcall) then
     923
     924         if(updatecorrhtrdr) then
     925             call hr_write_oprop_nc(ngrid, nlayer, zzlev, zzlay, pplev, tsurf, modulo(zlss,2*pi), zls)
     926         endif
     927
    865928        IF( ALLOCATED( gasi ) ) DEALLOCATE( gasi )
    866929        IF( ALLOCATED( gasv ) ) DEALLOCATE( gasv )
Note: See TracChangeset for help on using the changeset viewer.