Changeset 3572 for trunk/LMDZ.PLUTO/libf/phypluto/physiq_mod.F90
- Timestamp:
- Jan 13, 2025, 2:52:33 PM (3 weeks ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LMDZ.PLUTO/libf/phypluto/physiq_mod.F90
r3558 r3572 18 18 use ioipsl_getin_p_mod, only: getin_p 19 19 use radinc_h, only : L_NSPECTI,L_NSPECTV,naerkind, corrkdir, banddir 20 use generic_cloud_common_h, only : epsi_generic, Psat_generic21 20 use gases_h, only: gnom, gfrac 22 21 use radcommon_h, only: sigma, glat, grav, BWNV, WNOI, DWNI, DWNV, WNOV 23 22 use suaer_corrk_mod, only: suaer_corrk 24 23 use radii_mod, only: su_aer_radii,haze_reffrad_fix 25 use aerosol_mod, only: i aero_haze, i_haze, haze_prof24 use aerosol_mod, only: i_haze, haze_prof 26 25 use surfdat_h, only: phisfi, zmea, zstd, zsig, zgam, zthe, & 27 26 dryness … … 36 35 igcm_co_gas,igcm_co_ice,igcm_prec_haze,lw_n2,lw_ch4,lw_co,& 37 36 alpha_lift, alpha_devil, qextrhor, & 38 nesp, is_chim, is_condensable ,constants_epsi_generic37 nesp, is_chim, is_condensable 39 38 use time_phylmdz_mod, only: ecritphy, iphysiq, nday 40 39 use phyetat0_mod, only: phyetat0,tab_cntrl_mod … … 50 49 callrad, callsoil, nosurf, & 51 50 callconduct,callmolvis,callmoldiff, & 52 aerohaze, corrk, diagdtau,&51 corrk, diagdtau, & 53 52 diurnal, enertest, fat1au, & 54 53 icetstep, intheat, iradia, kastprof, & … … 59 58 carbox, methane,condmetsurf,condcosurf, & 60 59 oldplutovdifc,oldplutocorrk,oldplutosedim, & 61 aerohaze,haze_proffix,haze_radproffix,&60 optichaze,haze_proffix,haze_radproffix, & 62 61 source_haze, tsurfmax, albmin_ch4, & 63 season, sedimentation, generic_condensation,&62 season, sedimentation, & 64 63 specOLR, & 65 64 startphy_file, testradtimes, & … … 67 66 global1d, szangle, & 68 67 callmufi 69 use generic_tracer_index_mod, only: generic_tracer_index70 68 use check_fields_mod, only: check_physics_fields 71 69 use conc_mod, only: rnew, cpnew, ini_conc_mod … … 78 76 use turb_mod, only : q2,sensibFlux,turb_resolved 79 77 use mass_redistribution_mod, only: mass_redistribution 80 use condensation_generic_mod, only: condensation_generic81 78 use datafile_mod, only: datadir 82 79 USE vertical_layers_mod, ONLY: ap,bp,aps,bps,presnivs,pseudoalt … … 295 292 real omega(ngrid,nlayer) ! omega velocity (Pa/s, >0 when downward) 296 293 297 integer i,l,ig,ierr,iq,nw,isoil,iesp, igcm_generic_gas, igcm_generic_ice 298 logical call_ice_gas_generic ! to call only one time the ice/vap pair of a tracer 294 integer i,l,ig,ierr,iq,nw,isoil,iesp 299 295 300 296 real zls ! Solar longitude (radians). … … 316 312 ! For Atmospheric Temperatures : (K/s) 317 313 real dtlscale(ngrid,nlayer) ! Largescale routine. 318 real dt_generic_condensation(ngrid,nlayer) ! condensation_generic routine.319 314 real zdtc(ngrid,nlayer) ! Condense_n2 routine. 320 315 real zdtdif(ngrid,nlayer) ! Turbdiff/vdifc routines. … … 338 333 real zdqsed(ngrid,nlayer,nq) ! Callsedim routine. 339 334 real zdqmr(ngrid,nlayer,nq) ! Mass_redistribution routine. 340 real dqvaplscale_generic(ngrid,nlayer,nq) ! condensation_generic routine.341 real dqcldlscale_generic(ngrid,nlayer,nq) ! condensation_generic routine.342 335 REAL,allocatable,save :: zdqchim(:,:,:) ! Calchim_asis routine 343 336 REAL,allocatable,save :: zdqschim(:,:) ! Calchim_asis routine … … 466 459 real dItot, dItot_tmp, dVtot, dVtot_tmp 467 460 real dWtot, dWtot_tmp, dWtots, dWtots_tmp 468 real psat_tmp ! AF24: to remove?469 470 real qsat_generic(ngrid,nlayer,nq) ! generic condensable tracers (GCS) specific concentration at saturation (kg/kg_of_air).471 real RH_generic(ngrid,nlayer,nq) ! generic condensable tracers (GCS) Relative humidity.472 real rneb_generic(ngrid,nlayer,nq) ! GCS cloud fraction (generic condensation).473 real psat_tmp_generic474 real, save :: metallicity ! metallicity of planet --- is not used here, but necessary to call function Psat_generic475 !$OMP THREADPRIVATE(metallicity)476 477 real reffrad_generic_zeros_for_wrf(ngrid,nlayer) ! !!! this is temporary, it is only a list of zeros, it will be replaced when a generic aerosol will be implemented478 461 479 462 real nconsMAX, vdifcncons(ngrid), cadjncons(ngrid) ! Vdfic water conservation test. By RW … … 650 633 endif 651 634 652 ! Set metallicity for GCS653 ! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~654 metallicity=0.0 ! default value --- is not used here but necessary to call function Psat_generic655 call getin_p("metallicity",metallicity) ! --- is not used here but necessary to call function Psat_generic656 657 635 if (ngrid.ne.1) then ! Note : no need to create a restart file in 1d. 658 636 call physdem0("restartfi.nc",longitude,latitude,nsoilmx,ngrid,nlayer,nq, & … … 677 655 call setspv ! Basic visible properties. 678 656 call sugas_corrk ! Set up gaseous absorption properties. 679 if ( aerohaze) then657 if (optichaze) then 680 658 call suaer_corrk ! Set up aerosol optical properties. 681 659 endif … … 754 732 755 733 ! Get Lyman alpha flux at specific Ls 756 if ( haze) then734 if (callmufi.or.haze) then 757 735 call lymalpha(zls,zfluxuv) 758 736 print*, 'Haze lyman-alpha zls,zfluxuv=',zls,zfluxuv … … 1040 1018 call abort 1041 1019 endif 1042 ! if(water) then !AF24: removed1043 1044 if(generic_condensation) then1045 do iq=1,nq1046 1047 call generic_tracer_index(nq,iq,igcm_generic_gas,igcm_generic_ice,call_ice_gas_generic)1048 1049 if (call_ice_gas_generic) then ! to call only one time the ice/vap pair of a tracer1050 1051 epsi_generic=constants_epsi_generic(iq)1052 1053 muvar(1:ngrid,1:nlayer)=mugaz/(1.e0+(1.e0/epsi_generic-1.e0)*pq(1:ngrid,1:nlayer,igcm_generic_gas))1054 muvar(1:ngrid,nlayer+1)=mugaz/(1.e0+(1.e0/epsi_generic-1.e0)*pq(1:ngrid,nlayer,igcm_generic_gas))1055 1056 endif1057 end do ! do iq=1,nq loop on tracers1058 ! take into account generic condensable specie (GCS) effect on mean molecular weight1059 1060 else1061 muvar(1:ngrid,1:nlayer+1)=mugaz1062 endif1063 1064 ! if(ok_slab_ocean) then !AF24: removed1065 1020 1066 1021 ! standard callcorrk … … 1071 1026 zdtlw,zdtsw,fluxsurf_lw,fluxsurf_sw,fluxtop_lw, & 1072 1027 fluxabs_sw,fluxtop_dn,reffrad,tau_col,ptime,pday, & 1073 cloudfrac,totcloudfrac,.false., &1074 1028 firstcall,lastcall) 1075 1029 albedo_equivalent(1:ngrid)=albedo(1:ngrid,1) … … 1077 1031 fluxsurf_sw(1:ngrid)*(1.-albedo(1:ngrid,1)) 1078 1032 else 1033 muvar(1:ngrid,1:nlayer+1)=mugaz 1079 1034 call callcorrk(ngrid,nlayer,pq,nq,qsurf, & 1080 1035 albedo,albedo_equivalent,emis,mu0,pplev,pplay,pt, & … … 1084 1039 fluxabs_sw,fluxtop_dn,OLR_nu,OSR_nu,GSR_nu, & 1085 1040 int_dtaui,int_dtauv, & 1086 tau_col,cloudfrac,totcloudfrac, & 1087 .false.,firstcall,lastcall) 1041 tau_col,firstcall,lastcall) 1088 1042 ! Radiative flux from the sky absorbed by the surface (W.m-2). 1089 1043 GSR=0.0 … … 1227 1181 taux,tauy) 1228 1182 1229 else ! if (oldplutovdifc) .and. (UseTurbDiff)1183 else ! if .not. (oldplutovdifc) .and. (UseTurbDiff) 1230 1184 1231 1185 zdh(1:ngrid,1:nlayer)=pdt(1:ngrid,1:nlayer)/zpopsk(1:ngrid,1:nlayer) … … 1548 1502 ! VI.1. Microphysics / Aerosol particles 1549 1503 ! ---------------------------------------- 1550 ! Production for microphysics1551 IF (callmufi .and. call_haze_prod_pCH4) THEN1552 zdqphot_prec(:,:) = 0.1553 zdqphot_ch4(:,:) = 0.1554 pdqmufi_prod(:,:,:) = 0.1555 1556 call hazecloud(ngrid,nlayer,nq,ptimestep, &1557 pplay,pplev,pq,pdq,dist_star,mu0,zfluxuv,pdqmufi_prod, &1558 zdqphot_prec,zdqphot_ch4,zdqconv_prec,declin)1559 ENDIF ! end callmufi .and. .and.call_haze_prod_pCH41560 1561 1504 ! Call of microphysics 1562 1505 IF (callmufi) THEN 1506 1507 ! Production for microphysics 1508 IF (call_haze_prod_pCH4) THEN 1509 zdqphot_prec(:,:) = 0. 1510 zdqphot_ch4(:,:) = 0. 1511 pdqmufi_prod(:,:,:) = 0. 1512 call hazecloud(ngrid,nlayer,nq,ptimestep, & 1513 pplay,pplev,pq,pdq,dist_star,mu0,zfluxuv,pdqmufi_prod, & 1514 zdqphot_prec,zdqphot_ch4,zdqconv_prec,declin) 1515 ENDIF ! end call_haze_prod_pCH4 1563 1516 1564 1517 pdqmufi(:,:,:) = 0. … … 1567 1520 1568 1521 pdq(:,:,:) = pdq(:,:,:) + pdqmufi(:,:,:) 1522 1523 ELSE 1524 IF (haze) THEN 1525 zdqphot_prec(:,:) = 0. 1526 zdqphot_ch4(:,:) = 0. 1527 zdqhaze(:,:,:) = 0. 1528 ! Forcing to a fixed haze profile if haze_proffix 1529 if (haze_proffix.and.i_haze.gt.0.) then 1530 call haze_prof(ngrid,nlayer,zzlay,pplay,pt, & 1531 reffrad,profmmr) 1532 zdqhaze(:,:,i_haze)=(profmmr(:,:)-pq(:,:,igcm_haze))/ptimestep 1533 else 1534 call hazecloud(ngrid,nlayer,nq,ptimestep, & 1535 pplay,pplev,pq,pdq,dist_star,mu0,zfluxuv,zdqhaze, & 1536 zdqphot_prec,zdqphot_ch4,zdqconv_prec,declin) 1537 endif 1538 pdq(:,:,:) = pdq(:,:,:) + zdqhaze(:,:,:) ! Should be updated 1539 ENDIF ! end haze 1540 1541 IF (fast.and.fasthaze) THEN 1542 call prodhaze(ngrid,nlayer,nq,ptimestep,pplev,pq,pdq,dist_star, & 1543 mu0,declin,zdqprodhaze,zdqsprodhaze,gradflux,fluxbot, & 1544 fluxlym_sol_bot,fluxlym_ipm_bot,flym_sol,flym_ipm) 1545 DO ig=1,ngrid 1546 pdq(ig,1,igcm_ch4_gas)=pdq(ig,1,igcm_ch4_gas)+ & 1547 zdqprodhaze(ig,igcm_ch4_gas) 1548 pdq(ig,1,igcm_prec_haze)=pdq(ig,1,igcm_prec_haze)+ & 1549 zdqprodhaze(ig,igcm_prec_haze) 1550 pdq(ig,1,igcm_haze)=abs(pdq(ig,1,igcm_haze)+ & 1551 zdqprodhaze(ig,igcm_haze)) 1552 qsurf(ig,igcm_haze)= qsurf(ig,igcm_haze)+ & 1553 zdqsprodhaze(ig)*ptimestep 1554 ENDDO 1555 ENDIF ! end fast.and.fasthaze 1556 1557 ! Sedimentation. 1558 if (sedimentation) then 1559 zdqsed(1:ngrid,1:nlayer,1:nq) = 0.0 1560 zdqssed(1:ngrid,1:nq) = 0.0 1561 if (oldplutosedim)then 1562 call callsedim_pluto(ngrid,nlayer,ptimestep, & 1563 pplev,zzlev,pt,pdt,rice_ch4,rice_co, & 1564 pq,pdq,zdqsed,zdqssed,nq,pphi) 1565 else 1566 call callsedim(ngrid,nlayer,ptimestep, & 1567 pplev,zzlev,pt,pdt,pq,pdq, & 1568 zdqsed,zdqssed,nq,pphi) 1569 endif 1570 ! Whether it falls as rain or snow depends only on the surface temperature 1571 pdq(1:ngrid,1:nlayer,1:nq) = pdq(1:ngrid,1:nlayer,1:nq) + zdqsed(1:ngrid,1:nlayer,1:nq) 1572 dqsurf(1:ngrid,1:nq) = dqsurf(1:ngrid,1:nq) + zdqssed(1:ngrid,1:nq) 1573 end if ! end of 'sedimentation' 1574 1569 1575 ENDIF ! end callmufi 1570 1571 IF (haze) THEN1572 zdqphot_prec(:,:) = 0.1573 zdqphot_ch4(:,:) = 0.1574 zdqhaze(:,:,:) = 0.1575 1576 ! Forcing to a fixed haze profile if haze_proffix1577 if (haze_proffix.and.i_haze.gt.0.) then1578 call haze_prof(ngrid,nlayer,zzlay,pplay,pt, &1579 reffrad,profmmr)1580 zdqhaze(:,:,i_haze)=(profmmr(:,:)-pq(:,:,igcm_haze))/ptimestep1581 else1582 call hazecloud(ngrid,nlayer,nq,ptimestep, &1583 pplay,pplev,pq,pdq,dist_star,mu0,zfluxuv,zdqhaze, &1584 zdqphot_prec,zdqphot_ch4,zdqconv_prec,declin)1585 endif1586 1587 pdq(:,:,:) = pdq(:,:,:) + zdqhaze(:,:,:) ! Should be updated1588 ENDIF ! end haze1589 1590 IF (fast.and.fasthaze) THEN1591 call prodhaze(ngrid,nlayer,nq,ptimestep,pplev,pq,pdq,dist_star, &1592 mu0,declin,zdqprodhaze,zdqsprodhaze,gradflux,fluxbot, &1593 fluxlym_sol_bot,fluxlym_ipm_bot,flym_sol,flym_ipm)1594 1595 DO ig=1,ngrid1596 pdq(ig,1,igcm_ch4_gas)=pdq(ig,1,igcm_ch4_gas)+ &1597 zdqprodhaze(ig,igcm_ch4_gas)1598 pdq(ig,1,igcm_prec_haze)=pdq(ig,1,igcm_prec_haze)+ &1599 zdqprodhaze(ig,igcm_prec_haze)1600 pdq(ig,1,igcm_haze)=abs(pdq(ig,1,igcm_haze)+ &1601 zdqprodhaze(ig,igcm_haze))1602 qsurf(ig,igcm_haze)= qsurf(ig,igcm_haze)+ &1603 zdqsprodhaze(ig)*ptimestep1604 ENDDO1605 ENDIF ! end fast.and.fasthaze1606 1607 ! Generic Condensation1608 if (generic_condensation) then1609 call condensation_generic(ngrid,nlayer,nq,ptimestep,pplev,pplay, &1610 pt,pq,pdt,pdq,dt_generic_condensation, &1611 dqvaplscale_generic,dqcldlscale_generic,rneb_generic)1612 pdt(1:ngrid,1:nlayer) = pdt(1:ngrid,1:nlayer)+dt_generic_condensation(1:ngrid,1:nlayer)1613 pdq(1:ngrid,1:nlayer,1:nq) = pdq(1:ngrid,1:nlayer,1:nq)+dqvaplscale_generic(1:ngrid,1:nlayer,1:nq)1614 pdq(1:ngrid,1:nlayer,1:nq) = pdq(1:ngrid,1:nlayer,1:nq)+dqcldlscale_generic(1:ngrid,1:nlayer,1:nq)1615 1616 if(enertest)then1617 do ig=1,ngrid1618 genericconddE(ig) = cpp*SUM(mass(:,:)*dt_generic_condensation(:,:))1619 enddo1620 1621 call planetwide_sumval(cpp*massarea(:,:)*dt_generic_condensation(:,:)/totarea_planet,dEtot)1622 1623 if (is_master) print*,'In generic condensation atmospheric energy change =',dEtot,' W m-2'1624 end if1625 1626 ! Let's loop on tracers1627 cloudfrac(:,:)=0.01628 do iq=1,nq1629 call generic_tracer_index(nq,iq,igcm_generic_gas,igcm_generic_ice,call_ice_gas_generic)1630 if (call_ice_gas_generic) then ! to call only one time the ice/vap pair of a tracer1631 do l = 1, nlayer1632 do ig=1,ngrid1633 cloudfrac(ig,l)=rneb_generic(ig,l,iq)1634 enddo1635 enddo1636 endif1637 end do ! do iq=1,nq loop on tracers1638 ! endif ! .not. water1639 1640 endif !generic_condensation1641 1642 ! Sedimentation.1643 if (sedimentation) then1644 1645 zdqsed(1:ngrid,1:nlayer,1:nq) = 0.01646 zdqssed(1:ngrid,1:nq) = 0.01647 1648 if (oldplutosedim)then1649 call callsedim_pluto(ngrid,nlayer,ptimestep, &1650 pplev,zzlev,pt,pdt,rice_ch4,rice_co, &1651 pq,pdq,zdqsed,zdqssed,nq,pphi)1652 1653 else1654 call callsedim(ngrid,nlayer,ptimestep, &1655 pplev,zzlev,pt,pdt,pq,pdq, &1656 zdqsed,zdqssed,nq,pphi)1657 endif1658 1659 ! Whether it falls as rain or snow depends only on the surface temperature1660 pdq(1:ngrid,1:nlayer,1:nq) = pdq(1:ngrid,1:nlayer,1:nq) + zdqsed(1:ngrid,1:nlayer,1:nq)1661 dqsurf(1:ngrid,1:nq) = dqsurf(1:ngrid,1:nq) + zdqssed(1:ngrid,1:nq)1662 1663 end if ! end of 'sedimentation'1664 1576 1665 1577 ! --------------- … … 1999 1911 endif ! end of 'tracer' 2000 1912 2001 2002 2003 ! Calculate RH_generic (Generic Relative Humidity) for diagnostic.2004 if(generic_condensation)then2005 RH_generic(:,:,:)=0.02006 do iq=1,nq2007 2008 call generic_tracer_index(nq,iq,igcm_generic_gas,igcm_generic_ice,call_ice_gas_generic)2009 2010 if (call_ice_gas_generic) then ! to call only one time the ice/vap pair of a tracer2011 2012 do l = 1, nlayer2013 do ig=1,ngrid2014 call Psat_generic(zt(ig,l),pplay(ig,l),metallicity,psat_tmp_generic,qsat_generic(ig,l,iq))2015 RH_generic(ig,l,iq) = zq(ig,l,igcm_generic_gas) / qsat_generic(ig,l,iq)2016 enddo2017 enddo2018 2019 end if2020 2021 end do ! iq=1,nq2022 2023 endif ! end of 'generic_condensation'2024 2025 2026 1913 if (methane) then 2027 1914 IF (fast) then ! zq is the mixing ratio supposingly mixed in all atmosphere … … 2064 1951 zrho_haze(:,:)=0. 2065 1952 zdqrho_photprec(:,:)=0. 2066 IF (haze.and. aerohaze) then1953 IF (haze.and.optichaze) then 2067 1954 DO ig=1,ngrid 2068 1955 DO l=1,nlayer … … 2312 2199 call write_output("dEzradlw","radiative heating","w.m^-2",dEzradlw) 2313 2200 endif 2314 2315 if (generic_condensation) then2316 call write_output("genericconddE","heat from generic condensation","W m-2",genericconddE)2317 call write_output("dt_generic_condensation","heating from generic condensation","K s-1",dt_generic_condensation)2318 endif2319 2320 2201 endif ! end of 'enertest' 2321 2202 … … 2448 2329 endif 2449 2330 2450 if ( aerohaze) then2331 if (optichaze) then 2451 2332 call write_output("tau_col",& 2452 2333 "Total aerosol optical depth","opacity",tau_col)
Note: See TracChangeset
for help on using the changeset viewer.