Changeset 4153 for trunk/LMDZ.TITAN/libf/phytitan/callcorrk.F90
- Timestamp:
- Mar 25, 2026, 2:01:37 PM (6 days ago)
- File:
-
- 1 edited
-
trunk/LMDZ.TITAN/libf/phytitan/callcorrk.F90 (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LMDZ.TITAN/libf/phytitan/callcorrk.F90
r4148 r4153 1 1 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, & 3 4 pt,tsurf,fract,dist_star, & 4 5 dtlw,dtsw,fluxsurf_lw, & … … 7 8 OLR_nu,OSR_nu, & 8 9 int_dtaui,int_dtauv,popthi,popthv,poptti,popttv, & 9 lastcall )10 lastcall, zlss, zls) 10 11 11 12 use mod_phys_lmdz_para, only : is_master … … 15 16 USE tracer_h 16 17 use comcstfi_mod, only: pi, mugaz, cpp 17 use callkeys_mod, only: global1d, szangle, &18 use callkeys_mod, only: global1d, szangle, updatecorrhtrdr, & 18 19 diurnal,tracer,seashaze,corrk_recombin, & 19 20 strictboundcorrk,specOLR,diagdtau, & 20 21 tplanckmin,tplanckmax,callclouds,Fcloudy 21 22 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 22 25 23 26 implicit none … … 67 70 REAL,INTENT(IN) :: pplay(ngrid,nlayer) ! Mid-layer pressure (Pa). 68 71 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 69 73 REAL,INTENT(IN) :: pt(ngrid,nlayer) ! Air temperature (K). 70 74 REAL,INTENT(IN) :: tsurf(ngrid) ! Surface temperature (K). … … 72 76 REAL,INTENT(IN) :: dist_star ! Distance star-planet (AU). 73 77 logical,intent(in) :: lastcall ! Signals last call to physics. 78 REAL,INTENT(IN) :: zlss ! sub-solar longitude 79 REAL,INTENT(IN) :: zls ! solar longitude 74 80 75 81 ! OUTPUT … … 140 146 ! Optical diagnostics 141 147 ! 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) 144 150 ! Clouds 145 151 REAL*8 diag_optti(L_LEVELS,L_NSPECTI,3) … … 199 205 !======================================================================= 200 206 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 201 213 202 214 ! How much light do we get ? … … 503 515 !----------------------------------------------------------------------- 504 516 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 505 563 ! Clear column : 506 564 cdcolumn = 0 … … 863 921 864 922 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 865 928 IF( ALLOCATED( gasi ) ) DEALLOCATE( gasi ) 866 929 IF( ALLOCATED( gasv ) ) DEALLOCATE( gasv )
Note: See TracChangeset
for help on using the changeset viewer.
