Changeset 2804 for trunk/LMDZ.GENERIC
- Timestamp:
- Oct 19, 2022, 11:24:44 AM (2 years ago)
- Location:
- trunk/LMDZ.GENERIC/libf/phystd
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LMDZ.GENERIC/libf/phystd/aeropacity.F90
r2803 r2804 31 31 ! dust removal, simplification by Robin Wordsworth (2009) 32 32 ! Generic n-layer aerosol - J. Vatant d'Ollone (2020) 33 ! Radiative Generic Condensable aerosols - Lucas Teinturier (2022)33 ! Radiative Generic Condensable Species - Lucas Teinturier (2022) 34 34 ! 35 35 ! Input … … 94 94 integer igen_ice,igen_vap ! to store the index of generic tracer 95 95 logical dummy_bool ! dummy boolean just in case we need one 96 ! integer i_rgcs_ice(aerogeneric) 96 97 ! identify tracers 97 98 IF (firstcall) THEN 98 99 ia =0 99 100 write(*,*) "Tracers found in aeropacity:" 100 101 do iq=1,nq … … 662 663 ! Initialization 663 664 aerosol(1:ngrid,1:nlayer,iaer) = 0.D0 664 igen_ice = -1 665 igen_vap = -1 666 ! Get index of the ice tracer (for pq, mol, rho_q) 667 call generic_tracer_index(nq,2*iaer,igen_vap,igen_ice,dummy_bool) 668 if (igen_ice .eq. -1) then 669 !if igen_ice not changed by generic_tracer_index, it means it's an ice tracer => igen_ice=2*iaer 670 igen_ice = 2*iaer 671 endif 665 igen_ice = i_rgcs_ice(ia) 672 666 ! Let's loop on the horizontal and vertical grid 673 667 do ig=1,ngrid … … 694 688 end do 695 689 696 do ig=1,ngrid697 do l=1,nlayer698 do iaer = 1, naerkind699 if(aerosol(ig,l,iaer).gt.1.e3)then700 print*,'WARNING: aerosol=',aerosol(ig,l,iaer)701 print*,'at ig=',ig,', l=',l,', iaer=',iaer702 print*,'QREFvis3d=',QREFvis3d(ig,l,iaer)703 print*,'reffrad=',reffrad(ig,l,iaer)704 endif705 end do706 end do707 end do708 709 do ig=1,ngrid710 if(tau_col(ig).gt.1.e3)then711 print*,'WARNING: tau_col=',tau_col(ig)712 print*,'at ig=',ig713 print*,'aerosol=',aerosol(ig,:,:)714 print*,'QREFvis3d=',QREFvis3d(ig,:,:)715 print*,'reffrad=',reffrad(ig,:,:)716 endif717 end do690 ! do ig=1,ngrid 691 ! do l=1,nlayer 692 ! do iaer = 1, naerkind 693 ! if(aerosol(ig,l,iaer).gt.1.e3)then 694 ! print*,'WARNING: aerosol=',aerosol(ig,l,iaer) 695 ! print*,'at ig=',ig,', l=',l,', iaer=',iaer 696 ! print*,'QREFvis3d=',QREFvis3d(ig,l,iaer) 697 ! print*,'reffrad=',reffrad(ig,l,iaer) 698 ! endif 699 ! end do 700 ! end do 701 ! end do 702 703 ! do ig=1,ngrid 704 ! if(tau_col(ig).gt.1.e3)then 705 ! print*,'WARNING: tau_col=',tau_col(ig) 706 ! print*,'at ig=',ig 707 ! print*,'aerosol=',aerosol(ig,:,:) 708 ! print*,'QREFvis3d=',QREFvis3d(ig,:,:) 709 ! print*,'reffrad=',reffrad(ig,:,:) 710 ! endif 711 ! end do 718 712 return 719 713 end subroutine aeropacity -
trunk/LMDZ.GENERIC/libf/phystd/aerosol_mod.F90
r2803 r2804 24 24 ! Generic aerosols 25 25 integer, dimension(:),allocatable,save :: iaero_generic 26 !$OMP THREADPRIVATE(iaero_co2,iaero_h2o,iaero_dust,iaero_h2so4,noaero,iaero_back2lay,iaero_nh3,iaero_nlay,iaero_aurora,iaero_generic) 26 integer,dimension(:),allocatable,save :: i_rgcs_ice 27 !$OMP THREADPRIVATE(iaero_co2,iaero_h2o,iaero_dust,iaero_h2so4,noaero,iaero_back2lay,iaero_nh3,iaero_nlay,iaero_aurora,iaero_generic,i_rgcs_ice) 27 28 28 29 !================================================================== -
trunk/LMDZ.GENERIC/libf/phystd/callcorrk.F90
r2803 r2804 501 501 reffrad,QREFvis3d,QREFir3d, & 502 502 tau_col,cloudfrac,totcloudfrac,clearsky) 503 504 505 503 506 504 !----------------------------------------------------------------------- 507 505 do ig=1,ngrid ! Starting Big Loop over every GCM column -
trunk/LMDZ.GENERIC/libf/phystd/generic_tracer_index_mod.F90
r2722 r2804 20 20 21 21 USE tracer_h, only: noms, is_condensable 22 integer nq,iq, igcm_generic_vap, igcm_generic_ice 22 integer nq,iq, igcm_generic_vap, igcm_generic_ice, i_shortname, ii 23 23 logical call_ice_vap_generic 24 24 character(len=10) :: shortname 25 25 if((is_condensable(iq)==1) .and. (index(noms(iq),"vap") .ne. 0) & 26 26 .and. (index(noms(iq),"h2o") .eq. 0) .and. (index(noms(iq),"co2") .eq. 0)) then … … 30 30 igcm_generic_ice = -1 31 31 32 ! We look for the corresponding ice traceur (before or after in the list of traceurs, maybe could be generalised to the whole list) 33 if (iq .ne. nq) then 34 if ((noms(iq)(1:len(trim(noms(iq)))-4) .eq. noms(iq+1)(1:len(trim(noms(iq+1)))-4)) .and. (index(noms(iq+1),"ice") .ne. 0)) then 35 igcm_generic_ice = iq+1 36 end if 37 end if 38 if ((iq .gt. 1)) then 39 if ((noms(iq)(1:len(trim(noms(iq)))-4) .eq. noms(iq-1)(1:len(trim(noms(iq-1)))-4)) .and. (index(noms(iq-1),"ice") .ne. 0)) then 40 igcm_generic_ice = iq-1 41 end if 42 end if 43 if (igcm_generic_ice .eq. -1) then 44 write(*,*) "ERROR : You set a vap traceur but you forgot to set the corresponding ice traceur, & 45 or the pair vap/ice is not written one after another in traceur.def" 32 ! ! ! We look for the corresponding ice traceur (before or after in the list of traceurs, maybe could be generalised to the whole list) 33 ! ! if (iq .ne. nq) then 34 ! ! if ((noms(iq)(1:len(trim(noms(iq)))-4) .eq. noms(iq+1)(1:len(trim(noms(iq+1)))-4)) .and. (index(noms(iq+1),"ice") .ne. 0)) then 35 ! ! igcm_generic_ice = iq+1 36 ! ! end if 37 ! ! end if 38 ! ! if ((iq .gt. 1)) then 39 ! ! if ((noms(iq)(1:len(trim(noms(iq)))-4) .eq. noms(iq-1)(1:len(trim(noms(iq-1)))-4)) .and. (index(noms(iq-1),"ice") .ne. 0)) then 40 ! ! igcm_generic_ice = iq-1 41 ! ! end if 42 ! ! end if 43 ! ! if (igcm_generic_ice .eq. -1) then 44 ! ! write(*,*) "ERROR : You set a vap traceur but you forgot to set the corresponding ice traceur, & 45 ! ! or the pair vap/ice is not written one after another in traceur.def" 46 ! ! endif 47 48 ! ! call_ice_vap_generic = .true. 49 i_shortname = index(noms(iq),'_')-1 50 shortname=noms(iq)(1:i_shortname) 51 ! We look for the corresponding ice traceur, first if it's before the vap traceur in pq 52 if (iq>1 ) then 53 do ii=1,iq-1 54 if (index(noms(ii),adjustl(trim(shortname))) .ne. 0) then 55 igcm_generic_ice=ii 56 exit 57 endif 58 ENDDO 46 59 endif 47 60 ! if we didn't find it before, we look after the vap tracer in pq 61 if (igcm_generic_ice .eq. -1 .and. (iq<nq)) then 62 do ii=iq+1,nq 63 if (index(noms(ii),adjustl(trim(shortname))) .ne. 0) then 64 igcm_generic_ice=ii 65 exit 66 endif 67 enddo 68 endif 48 69 call_ice_vap_generic = .true. 49 50 70 else 51 71 -
trunk/LMDZ.GENERIC/libf/phystd/iniaerosol.F
r2803 r2804 4 4 use radinc_h, only: naerkind 5 5 use aerosol_mod 6 use tracer_h, only: n_rgcs, nqtot, is_rgcs 6 7 use callkeys_mod, only: aeroco2,aeroh2o,dusttau,aeroh2so4, 7 8 & aeroback2lay,aeronh3, nlayaero, aeronlay, aeroaurora, … … 20 21 c======================================================================= 21 22 22 integer i, ia 23 integer i, ia, iq 23 24 24 25 ! Special case, dyn. allocation for n-layer depending on callphys.def 25 26 IF(.NOT.ALLOCATED(iaero_nlay)) ALLOCATE(iaero_nlay(nlayaero)) 26 27 iaero_nlay(:) = 0 27 ! Do the same for iaero_generic 28 ! Do the same for iaero_generic and i_rgcs_ice 28 29 IF (.not. allocated(iaero_generic)) 29 30 & allocate(iaero_generic(aerogeneric)) 31 if (.not. allocated(i_rgcs_ice)) 32 & allocate(i_rgcs_ice(aerogeneric)) 33 ! Init of i_rgcs_ice 34 i_rgcs_ice(:) =0.0 35 ia = 1 36 do iq=1,nqtot 37 if (is_rgcs(iq) .eq. 1) then 38 i_rgcs_ice(ia)=iq 39 ia = ia+1 40 endif 41 enddo 42 ! We check that we have the right number 43 ! for aerogeneric (coherent between 44 ! callphys and traceur.def) 45 ! if (aerogeneric .ne. n_rgcs) then 46 ! print*,'iniaerosol: aerogeneric is not' 47 ! & 'equal to the number of RGCS in traceur.def' 48 ! print*,'iniaerosol: check your' 49 ! &'callphys.def and your traceur.def' 50 ! call abort_physics("inaerosol: Aborting") 51 ! endif 30 52 iaero_generic(:)=0 31 53 ia=0 … … 86 108 enddo 87 109 endif 88 write(*,*)'--- Generic Condensable Aerosols',iaero_generic 110 write(*,*)'--- Radiative Generic Condensable Species = ' 111 &,iaero_generic 89 112 write(*,*) '=== Number of aerosols= ', ia 90 113 -
trunk/LMDZ.GENERIC/libf/phystd/initracer.F90
r2785 r2804 120 120 ENDIF 121 121 IF (.NOT. allocated(is_condensable)) allocate(is_condensable(nq)) !LT 122 IF (.NOT. allocated(is_rgcs)) allocate(is_rgcs(nq)) !LT 122 123 IF (.NOT. allocated(constants_mass)) allocate(constants_mass(nq)) 123 124 IF (.NOT. allocated(constants_delta_vapH)) allocate(constants_delta_vapH(nq)) … … 148 149 149 150 is_condensable(:)= 0 150 151 is_rgcs(:) = 0 151 152 constants_mass(:)=0 152 153 constants_delta_vapH(:)=0 … … 489 490 ngt = sum(is_condensable) 490 491 write(*,*) 'Number of generic tracer is ngt = ',ngt 492 493 ! Calculate number of radiative generic condensable species 494 n_rgcs = sum(is_rgcs) 495 write(*,*)'Number of Radiative Generic Condensable Species is n_rgcs = ',n_rgcs 496 if (n_rgcs> ngt/2) then 497 write(*,*) 'You have more Radiative Generic Condensable Species than Generic Condensable Species' 498 write(*,*)'This is not possible: check your Modern traceur.def' 499 call abort_physic("initracer, issue with # of RGCS and GCS") 500 endif 501 491 502 ! Processing modern traceur options 492 503 if(moderntracdef) then … … 693 704 ' rho=', rho_q(iq) 694 705 endif 706 !option is_rgcs 707 if (index(tracline,'is_rgcs') .ne. 0) then 708 read(tracline(index(tracline,'is_rgcs=') & 709 +len('is_rgcs='):),*) is_rgcs(iq) 710 write(*,*)'Parameter value (traceur.def) :'// & 711 'is_rgcs=',is_rgcs(iq) 712 else 713 write(*,*)'Parameter value (default) : '// & 714 'is_rgcs = ',is_rgcs(iq) 715 endif 695 716 end subroutine get_tracdat 696 717 -
trunk/LMDZ.GENERIC/libf/phystd/radii_mod.F90
r2803 r2804 30 30 ! Jeremy Leconte (2012) 31 31 ! Extended to dust, CO2, NH3, 2-lay,Nlay,auroral aerosols by ?? 32 ! Added Radiative Generic Condensable Aerosols effective radii32 ! Added Radiative Generic Condensable Species effective radii 33 33 ! calculations (Lucas Teinturier 2022) 34 34 ! … … 42 42 use aerosol_mod, only: iaero_back2lay, iaero_co2, iaero_dust, & 43 43 iaero_h2o, iaero_h2so4, iaero_nh3, iaero_nlay, iaero_aurora, & 44 iaero_generic 44 iaero_generic, i_rgcs_ice 45 45 use callkeys_mod, only: size_nh3_cloud, nlayaero, aeronlay_size, aeronlay_nueff,aerogeneric 46 46 use tracer_h, only: radius, nqtot, is_rgcs 47 47 Implicit none 48 48 … … 55 55 logical, save :: firstcall=.true. 56 56 !$OMP THREADPRIVATE(firstcall) 57 integer :: iaer, ia 58 real :: temprad !temporary variable for radius when we have Radiative Generic Condensable aerosols 57 integer :: iaer, ia , iq, i_rad 58 59 59 do iaer=1,naerkind 60 60 ! these values will change once the microphysics gets to work … … 107 107 endif 108 108 109 do ia=1,aerogeneric ! Radiative Generic Condensable aerosols109 do ia=1,aerogeneric ! Radiative Generic Condensable Species 110 110 if (iaer .eq. iaero_generic(ia)) then 111 call generic_get_traceur_radius(iaer,temprad)112 reffrad(1:ngrid,1:nlayer,iaer)= temprad111 i_rad = i_rgcs_ice(ia) 112 reffrad(1:ngrid,1:nlayer,iaer)=radius(i_rad) 113 113 nueffrad(1:ngrid,1:nlayer,iaer) = 0.1 114 114 endif 115 115 enddo ! generic radiative condensable aerosols 116 116 117 117 if(iaer.gt.5)then ! I think this could be commented out by this needs testing. It works with 5 aerosols (LT 2022) 118 118 print*,'Error in callcorrk, naerkind is too high (>5).' … … 122 122 endif 123 123 enddo ! iaer=1,naerkind 124 124 125 125 126 126 if (radfixed) then … … 390 390 !================================================================== 391 391 392 !==================================================================393 subroutine generic_get_traceur_radius(iaer,radii)394 !==================================================================395 ! Purpose396 ! -------397 ! Get the generic traceur radius inputted in modern_traceur.def398 ! for the specie "specie"399 !400 ! Authors401 ! -------402 ! Lucas Teinturier (2022)403 !404 !==================================================================405 Use tracer_h, only: radius, noms, nqtot406 Implicit none407 408 integer, intent(in) :: iaer !index of aerosol which radius we're looking for409 real, intent(out) :: radii !radii(ngrid,nlayer,naerkind) ! Particle radii (m)410 integer :: iq !just a loop index411 412 if (index(noms(1),'ice') .ne. 0) then !traceur.def is organized with _ice then _vap413 radii=radius(2*iaer-1)414 elseif (index(noms(1),'vap') .ne. 0) then !traceur.def is organized with _vap then _ice415 radii = radius(2*iaer)416 else417 print*,"radii_mod: tracer is neither ice or vap :",noms(1)418 print*,"Aborting"419 call abort420 endif421 422 end subroutine generic_get_traceur_radius423 424 392 end module radii_mod 425 393 !================================================================== -
trunk/LMDZ.GENERIC/libf/phystd/suaer_corrk.F90
r2803 r2804 233 233 endif 234 234 ! the following was added by LT 235 do ia=1,aerogeneric ! Read Radiative Generic Condensable Aerosols data235 do ia=1,aerogeneric ! Read Radiative Generic Condensable Species data 236 236 if (iaer .eq. iaero_generic(ia)) then 237 if (index(noms( 2*iaer),'Fe') .ne. 0) then237 if (index(noms(i_rgcs_ice(ia)),'Fe') .ne. 0) then 238 238 print*,"Reading Fe file" 239 239 file_id(iaer,1)='Fe.ocst.txt' … … 241 241 lamrefvis(iaer) = 1.0E-6 !random pick 242 242 lamrefir(iaer) = 1.0E-6 !dummy but random pick 243 else if (index(noms( 2*iaer),'Mn') .ne. 0) then243 else if (index(noms(i_rgcs_ice(ia)),'Mn') .ne. 0) then 244 244 print*,"Reading MnS file" 245 245 file_id(iaer,1)='MnS.ocst.txt' … … 247 247 lamrefvis(iaer) = 1.0E-6 !random pick 248 248 lamrefir(iaer) = 1.0E-6 !dummy but random pick 249 else if (index(noms( 2*iaer),'Mg') .ne. 0) then249 else if (index(noms(i_rgcs_ice(ia)),'Mg') .ne. 0) then 250 250 print*,"Reading Mg2SiO4 file" 251 251 file_id(iaer,1)='Mg2SiO4.ocst.txt' … … 253 253 lamrefvis(iaer) = 1.0E-6 !random pick 254 254 lamrefir(iaer) = 1.0E-6 !dummy but random pick 255 else if (index(noms( 2*iaer),'Cr') .ne. 0) then255 else if (index(noms(i_rgcs_ice(ia)),'Cr') .ne. 0) then 256 256 print*,"Reading Cr file" 257 257 file_id(iaer,1)='Cr.ocst.txt' … … 261 261 else 262 262 ! If you want to add another specie, copy,paste & adapt the elseif block up here to your new specie (LT 2022) 263 call abort_physic("suaer_corrk", "Unknown specie in generic condensable aerosols",1)263 call abort_physic("suaer_corrk", "Unknown specie in radiative generic condensable species",1) 264 264 endif 265 265 endif 266 266 enddo ! ia=1,aerogeneric 267 267 enddo 268 268 269 269 !------------------------------------------------------------------ 270 270 -
trunk/LMDZ.GENERIC/libf/phystd/tracer_h.F90
r2785 r2804 7 7 integer, save :: nesp ! number of species in the chemistry 8 8 integer, save :: ngt ! number of generic tracers 9 <<<<<<< HEAD 9 10 !$OMP THREADPRIVATE(nqtot,nesp,ngt) 11 ======= 12 integer, save :: n_rgcs ! number of Radiative Generic Condensable Species 13 !$OMP THREADPRIVATE(nqtot,nesp,ngt,n_rgcs) 14 >>>>>>> d67f7c1... This is the RGCS scheme 10 15 11 16 logical :: moderntracdef=.false. ! Standard or modern traceur.def … … 41 46 !$OMP THREADPRIVATE(is_recomb,is_recomb_qset,is_recomb_qotf) 42 47 integer, save, allocatable :: is_condensable(:) ! 1 if tracer is generic, else 0 (added LT) 48 <<<<<<< HEAD 43 49 !$OMP THREADPRIVATE(is_condensable) !also added by LT 44 50 51 ======= 52 integer,save,allocatable :: is_rgcs(:) ! 1 if tracer is a radiative generic condensable specie, else 0 (added LT 2022) 53 >>>>>>> d67f7c1... This is the RGCS scheme 45 54 ! Lists of constants for condensable tracers 46 55 integer, save, allocatable :: constants_mass(:) ! molecular mass of the specie (g/mol) … … 55 64 !$OMP THREADPRIVATE(constants_RLVTT_generic,constants_metallicity_coeff) 56 65 66 <<<<<<< HEAD 67 ======= 68 !$OMP THREADPRIVATE(is_condensable,is_rgcs) !also added by LT 69 >>>>>>> d67f7c1... This is the RGCS scheme 57 70 ! tracer indexes: these are initialized in initracer and should be 0 if the 58 71 ! corresponding tracer does not exist
Note: See TracChangeset
for help on using the changeset viewer.