Changeset 2898 for trunk/LMDZ.GENERIC
- Timestamp:
- Feb 21, 2023, 9:08:49 AM (21 months ago)
- Location:
- trunk/LMDZ.GENERIC
- Files:
-
- 1 deleted
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LMDZ.GENERIC/README
r2875 r2898 1778 1778 - handle case when moist adjustement is not called in physiq: some of its 1779 1779 outputs still need be set to zero as they are used later on. 1780 1781 == 21/02/2023 == EM 1782 Some cleanup in aerosol_mod.F90 : integrate "iniaerosol" in the module. 1783 Also adapted kcm1d to follow up on recent code updates. -
trunk/LMDZ.GENERIC/libf/phystd/aerosol_mod.F90
r2831 r2898 2 2 module aerosol_mod 3 3 implicit none 4 save 4 5 5 !================================================================== 6 6 7 7 ! aerosol indexes: these are initialized to be 0 if the 8 8 ! corresponding aerosol was not activated in callphys.def 9 ! -- otherwise a value is given ininiaerosol10 integer :: iaero_co2 = 011 integer :: iaero_h2o = 012 integer :: iaero_dust = 013 integer :: iaero_h2so4 = 014 logical :: noaero = .false.9 ! -- otherwise a value is set via iniaerosol 10 integer, save, protected :: iaero_co2 = 0 11 integer, save, protected :: iaero_h2o = 0 12 integer, save, protected :: iaero_dust = 0 13 integer, save, protected :: iaero_h2so4 = 0 14 logical, save, protected :: noaero = .false. 15 15 !$OMP THREADPRIVATE(iaero_co2,iaero_h2o,iaero_dust,iaero_h2so4,noaero) 16 16 17 17 ! two-layer simple aerosol model 18 integer :: iaero_back2lay = 018 integer, save, protected :: iaero_back2lay = 0 19 19 ! NH3 cloud 20 integer :: iaero_nh3 = 020 integer, save, protected :: iaero_nh3 = 0 21 21 ! N-layer aerosol model (replaces the 2-layer and hard-coded clouds) 22 integer,dimension(:), allocatable,save:: iaero_nlay22 integer,dimension(:), allocatable, save, protected :: iaero_nlay 23 23 ! Auroral aerosols 24 integer :: iaero_aurora = 024 integer, save, protected :: iaero_aurora = 0 25 25 !$OMP THREADPRIVATE(iaero_back2lay,iaero_nh3,iaero_nlay,iaero_aurora) 26 26 27 27 ! Generic aerosols 28 integer, dimension(:), allocatable,save:: iaero_generic29 integer, dimension(:),allocatable,save:: i_rgcs_ice28 integer, dimension(:), allocatable, save, protected :: iaero_generic 29 integer, dimension(:), allocatable, save, protected :: i_rgcs_ice 30 30 !$OMP THREADPRIVATE(iaero_generic,i_rgcs_ice) 31 31 32 32 ! Venus clouds 33 integer :: iaero_venus1 = 034 integer :: iaero_venus2 = 035 integer :: iaero_venus2p = 036 integer :: iaero_venus3 = 037 integer :: iaero_venusUV = 033 integer, save, protected :: iaero_venus1 = 0 34 integer, save, protected :: iaero_venus2 = 0 35 integer, save, protected :: iaero_venus2p = 0 36 integer, save, protected :: iaero_venus3 = 0 37 integer, save, protected :: iaero_venusUV = 0 38 38 !$OMP THREADPRIVATE(iaero_venus1,iaero_venus2,iaero_venus2p) 39 39 !$OMP THREADPRIVATE(iaero_venus3,iaero_venusUV) 40 40 41 !================================================================== 42 43 contains 44 45 SUBROUTINE iniaerosol 46 47 use mod_phys_lmdz_para, only : is_master 48 use radinc_h, only: naerkind 49 use tracer_h, only: n_rgcs, nqtot, is_rgcs 50 use callkeys_mod, only: aeroco2, aeroh2o, dusttau, aeroh2so4, & 51 aeroback2lay, aeronh3, nlayaero, aeronlay, & 52 aeroaurora, aerogeneric, & 53 aerovenus1, aerovenus2, aerovenus2p, & 54 aerovenus3, aerovenusUV 55 56 IMPLICIT NONE 57 !======================================================================= 58 ! subject: 59 ! -------- 60 ! Initialization related to aerosols 61 ! (CO2 aerosols, dust, water, chemical species, ice...) 62 ! 63 ! author: Laura Kerber, S. Guerlet 64 ! ------ 65 ! 66 !======================================================================= 67 68 integer :: i, ia, iq 69 70 ! Special case, dyn. allocation for n-layer depending on callphys.def 71 IF(.NOT.ALLOCATED(iaero_nlay)) ALLOCATE(iaero_nlay(nlayaero)) 72 iaero_nlay(:) = 0 73 ! Do the same for iaero_generic and i_rgcs_ice 74 IF (.not. allocated(iaero_generic)) allocate(iaero_generic(aerogeneric)) 75 if (.not. allocated(i_rgcs_ice)) allocate(i_rgcs_ice(aerogeneric)) 76 77 ! Init of i_rgcs_ice 78 i_rgcs_ice(:) =0 79 ia = 1 80 do iq=1,nqtot 81 if (is_rgcs(iq) .eq. 1) then 82 i_rgcs_ice(ia)=iq 83 ia = ia+1 84 endif 85 enddo 86 87 iaero_generic(:)=0 88 ia=0 89 if (aeroco2) then 90 ia=ia+1 91 iaero_co2=ia 92 endif 93 if (is_master) write(*,*) '--- CO2 aerosol = ', iaero_co2 94 95 if (aeroh2o) then 96 ia=ia+1 97 iaero_h2o=ia 98 endif 99 if (is_master) write(*,*) '--- H2O aerosol = ', iaero_h2o 100 101 if (dusttau.gt.0) then 102 ia=ia+1 103 iaero_dust=ia 104 endif 105 if (is_master) write(*,*) '--- Dust aerosol = ', iaero_dust 106 107 if (aeroh2so4) then 108 ia=ia+1 109 iaero_h2so4=ia 110 endif 111 if (is_master) write(*,*) '--- H2SO4 aerosol = ', iaero_h2so4 41 112 42 !================================================================== 113 if (aeroback2lay) then 114 ia=ia+1 115 iaero_back2lay=ia 116 endif 117 if (is_master) write(*,*) '--- Two-layer aerosol = ', iaero_back2lay 118 119 if (aeronh3) then 120 ia=ia+1 121 iaero_nh3=ia 122 endif 123 if (is_master) write(*,*) '--- NH3 Cloud = ', iaero_nh3 124 125 if (aeronlay) then 126 do i=1,nlayaero 127 ia=ia+1 128 iaero_nlay(i)=ia 129 enddo 130 endif 131 if (is_master) write(*,*) '--- N-layer aerosol = ', iaero_nlay 132 133 if (aeroaurora) then 134 ia=ia+1 135 iaero_aurora=ia 136 endif 137 if (is_master) write(*,*) '--- Auroral aerosols = ', iaero_aurora 138 139 if (aerovenus1) then 140 ia=ia+1 141 iaero_venus1=ia 142 endif 143 if (is_master) write(*,*) '--- Venus cloud, mode 1 aerosol = ', iaero_venus1 144 145 if (aerovenus2) then 146 ia=ia+1 147 iaero_venus2=ia 148 endif 149 if (is_master) write(*,*) '--- Venus cloud, mode 2 aerosol = ', iaero_venus2 150 151 if (aerovenus2p) then 152 ia=ia+1 153 iaero_venus2p=ia 154 endif 155 if (is_master) write(*,*) '--- Venus cloud, mode 2p aerosol = ', iaero_venus2p 156 157 if (aerovenus3) then 158 ia=ia+1 159 iaero_venus3=ia 160 endif 161 if (is_master) write(*,*) '--- Venus cloud, mode 3 aerosol = ', iaero_venus3 162 163 if (aerovenusUV) then 164 ia=ia+1 165 iaero_venusUV=ia 166 endif 167 if (is_master) write(*,*) '--- Venus cloud, UV absorber = ', iaero_venusUV 168 169 if (aerogeneric .ne. 0) then 170 do i=1,aerogeneric 171 ia = ia+1 172 iaero_generic(i) = ia 173 enddo 174 endif 175 176 if (is_master) then 177 write(*,*)'--- Radiative Generic Condensable Species = ',iaero_generic 178 179 write(*,*) '=== Number of aerosols= ', ia 180 endif ! of is_master 181 182 ! For the zero aerosol case, we currently make a dummy co2 aerosol which is zero everywhere. 183 ! (See aeropacity.F90 for how this works). A better solution would be to turn off the 184 ! aerosol machinery in the no aerosol case, but this would be complicated. LK 185 186 if (ia.eq.0) then !For the zero aerosol case. 187 ia = 1 188 noaero = .true. 189 iaero_co2=ia 190 endif 191 192 if (ia.ne.naerkind) then 193 if (is_master) then 194 print*, 'Aerosols counted not equal to naerkind' 195 print*, 'Compile with tag -s',ia,'to run' 196 print*, 'or change options in callphys.def' 197 print*, 'Abort in iniaerosol' 198 endif 199 call abort_physic("iniaerosl",'wrong number of aerosols',1) 200 endif ! of if (ia.ne.naerkind) 201 202 END SUBROUTINE iniaerosol 203 43 204 end module aerosol_mod 44 205 !================================================================== -
trunk/LMDZ.GENERIC/libf/phystd/dyn1d/kcm1d.F90
r2785 r2898 10 10 use callkeys_mod, only: pceil, tstrat, tracer, global1d 11 11 use inifis_mod, only: inifis 12 use aerosol_mod, only: iniaerosol 13 use callcorrk_mod, only: callcorrk 12 14 use comcstfi_mod 13 15 use mod_grid_phy_lmdz, only : regular_lonlat … … 56 58 real,allocatable :: vmr(:,:) ! tracer mixing ratio [mol/mol] 57 59 real,allocatable :: qsurf(:) ! tracer surface budget [kg/kg] ???? 58 real psurf,psurf_n,tsurf 59 60 real emis , albedo, albedo_equivalent60 real psurf,psurf_n,tsurf(1) 61 62 real emis(1), albedo(1), albedo_equivalent(1) 61 63 real albedo_wv(1,L_NSPECTV) 62 64 … … 65 67 real dtsw(llm) ! heating rate (K/s) due to SW 66 68 real dtlw(llm) ! heating rate (K/s) due to LW 67 real fluxsurf_lw ! incident LW flux to surf (W/m2)68 real fluxtop_lw ! outgoing LW flux to space (W/m2)69 real fluxsurf_sw ! incident SW flux to surf (W/m2)70 real fluxsurfabs_sw ! absorbed SW flux by the surf (W/m2)71 real fluxabs_sw ! SW flux absorbed by planet (W/m2)72 real fluxtop_dn ! incident top of atmosphere SW flux (W/m2)69 real fluxsurf_lw(1) ! incident LW flux to surf (W/m2) 70 real fluxtop_lw(1) ! outgoing LW flux to space (W/m2) 71 real fluxsurf_sw(1) ! incident SW flux to surf (W/m2) 72 real fluxsurfabs_sw(1) ! absorbed SW flux by the surf (W/m2) 73 real fluxabs_sw(1) ! SW flux absorbed by planet (W/m2) 74 real fluxtop_dn(1) ! incident top of atmosphere SW flux (W/m2) 73 75 74 76 ! not used 75 real cloudfrac( llm)76 real totcloudfrac 77 real tau_col 77 real cloudfrac(1,llm) 78 real totcloudfrac(1) 79 real tau_col(1) 78 80 79 81 real dTstrat … … 81 83 real OLR_nu(1,L_NSPECTI) 82 84 real OSR_nu(1,L_NSPECTV) 85 real GSR_nu(1,L_NSPECTV) 86 real int_dtaui(1,llm,L_NSPECTI) 87 real int_dtauv(1,llm,L_NSPECTV) 83 88 real Eatmtot 84 89 … … 100 105 pi=2.E+0*asin(1.E+0) 101 106 102 cloudfrac( :) = 0.0103 totcloudfrac = 0.0107 cloudfrac(1,:) = 0.0 108 totcloudfrac(1) = 0.0 104 109 105 110 … … 254 259 write(*,*) " albedo = ",albedo 255 260 do iw=1,L_NSPECTV 256 albedo_wv(1,iw)=albedo 261 albedo_wv(1,iw)=albedo(1) 257 262 enddo 258 263 … … 360 365 361 366 362 call iniaerosol ()367 call iniaerosol 363 368 364 369 … … 372 377 dtlw,dtsw,fluxsurf_lw,fluxsurf_sw, & 373 378 fluxsurfabs_sw,fluxtop_lw, & 374 fluxabs_sw,fluxtop_dn,OLR_nu,OSR_nu,tau_col, & 375 cloudfrac,totcloudfrac,.false.,firstcall,lastcall) 379 fluxabs_sw,fluxtop_dn,OLR_nu,OSR_nu,GSR_nu, & 380 int_dtaui,int_dtauv, & 381 tau_col,cloudfrac,totcloudfrac, & 382 .false.,firstcall,lastcall) 376 383 377 384 !write(*,*) 'BASE 3' … … 397 404 ! skin temperature (gray approx.) using analytic pure H2 expression 398 405 !Tstrat = (fluxabs_sw/(2*sigma))**0.25 ! skin temperature (gray approx.) 399 Tstrat = (fluxtop_lw /(2*sigma))**0.25 ! skin temperature (gray approx.)406 Tstrat = (fluxtop_lw(1)/(2*sigma))**0.25 ! skin temperature (gray approx.) 400 407 dTstrat = dTstrat-Tstrat 401 408 … … 422 429 tsurf,fract,dist_star,aerosol,muvar, & 423 430 dtlw,dtsw,fluxsurf_lw,fluxsurf_sw,fluxsurfabs_sw, & 424 fluxtop_lw, fluxabs_sw,fluxtop_dn,OLR_nu,OSR_nu, & 425 tau_col, & 426 cloudfrac,totcloudfrac,.false.,firstcall,lastcall) 431 fluxtop_lw, fluxabs_sw,fluxtop_dn,OLR_nu,OSR_nu,GSR_nu, & 432 int_dtaui,int_dtauv, & 433 tau_col,cloudfrac,totcloudfrac, & 434 .false.,firstcall,lastcall) 427 435 428 436 -
trunk/LMDZ.GENERIC/libf/phystd/physiq_mod.F90
r2891 r2898 21 21 use radcommon_h, only: sigma, glat, grav, BWNV, WNOI, DWNI, DWNV, WNOV 22 22 use radii_mod, only: h2o_reffrad, co2_reffrad 23 use aerosol_mod, only: i aero_co2, iaero_h2o23 use aerosol_mod, only: iniaerosol, iaero_co2, iaero_h2o 24 24 use surfdat_h, only: phisfi, zmea, zstd, zsig, zgam, zthe, & 25 25 dryness … … 512 512 ! Initialize aerosol indexes. 513 513 ! ~~~~~~~~~~~~~~~~~~~~~~~~~~~ 514 call iniaerosol ()514 call iniaerosol 515 515 516 516 #ifdef CPP_XIOS
Note: See TracChangeset
for help on using the changeset viewer.