PREP-CHEM-SRC的编译和运行

WRF-Chem modeling emissions

Posted by 吴锴 on April 16, 2023
1. 编译PREP-CHEM-SRC时需要注意编译HDF5的选项.

For compile PREP-CHEM-SRC, you should use the following command to compile HDF5.

./configure FC=ifort CC=icc --prefix=/path/you/want/install/hdf5 --enable-fortran --enable-cxx
make
make check
make install
make check-install
2. 使用PREP-CHEM-SRC

Revise the PREP-CHEM-SRC relevant input as follows.

PREP-CHEM-SRC的主要用法是:
bin文件夹下:prep_chem_sources.inp (作用类似于namelist)和 prep_chem_sources_RADM_WRF_FIM_.exe (这里我主要使用RADM作为化学机制)
prep_chem_sources.inp:
RP_INPUT
!#################################################################
!  CCATT-BRAMS/MCGA-CPTEC/WRF-Chem/FIM-Chem emission models CPTEC/INPE
!  version 1.5: Mar 2015
!  contact: gmai@cptec.inpe.br   - http://meioambiente.cptec.inpe.br
!#################################################################


!---------------- grid_type of the grid output
   grid_type= 'lambert',
   rams_anal_prefix = '../ANL/OPQUE',
!---------------- date of emission
    ihour=00,
    iday=26,
    imon=09,
    iyear=2016,

!---------------- select the sources datasets to be used(这里有不同的排放清单,大部分从prep-chem研发团队的网站上可以下载,下载后放入特定路径中,然后将路径分写入下面xxx_dir=''use_retro=1,  ! 1 = yes, 0 = not
   retro_data_dir='/pathway/RETRO/anthro',

   use_edgar =3,  ! 0 - not,
                  ! 1 - Version 3,
                  ! 2 - Version 4 for some species
                  ! 3 - Version HTAP

   edgar_data_dir='/pathway/EDGAR-HTAP',

   use_gocart=1,
   gocart_data_dir='/pathway/emissions',

   use_streets =1,
   streets_data_dir='pathway/STREETS',

   use_seac4rs =1,
   seac4rs_data_dir='/pathway/SEAC4RS',


   use_fwbawb =1,

fwbawb_data_dir ='/pathway/Emissions_Yevich_Logan',

   use_bioge =2, ! 1 - geia, 2 - megan
   ! ######
   ! # BIOGENIC = 0
   bioge_data_dir ='/pathway/MEGAN/2000',
   ! # MEGAN = 1
   ! ######
   !bioge_data_dir='/home/Yang/wrf_chem/emissions/source_data/MEGAN/2000',
   ! ######

   use_gfedv2=1,
   gfedv2_data_dir='/home/Yang/wrf_chem/emissions/source_data/GFEDv2-8days',

   use_bbem=0,
   use_bbem_plumerise=0,

!--------------------------------------------------------------------------------------------------

!---------------- if  the merging of gfedv2 with bbem is desired (=1, yes, 0 = no)
   merge_GFEDv2_bbem =0,

!---------------- Fire product for BBBEM/BBBEM-plumerise emission models
   bbem_wfabba_data_dir   ='./datain/Emission_data/fires_data/GOES/f',
   bbem_modis_data_dir    ='./datain/Emission_data/fires_data/MODIS/Fires',
   bbem_inpe_data_dir     ='./datain/Emission_data/fires_data/DSA/Focos',
   bbem_extra_data_dir    ='NONE',

!---------------- veg type data set (dir + prefix)
   veg_type_data_dir      ='./datain/surface_data/GL_IGBP_MODIS_INPE/MODIS',


!---------------- vcf type data set (dir + prefix)
  use_vcf = 0,
  vcf_type_data_dir      ='./datain/surface_data/VCF/data_out/2005/VCF',
!---------------- olson data set (dir + prefix)
  olson_data_dir      ='./datain/Emission_data/OLSON2/OLSON',

!---------------- carbon density data set (dir + prefix)

   carbon_density_data_dir='./datain/surface_data/GL_OGE_INPE/OGE',

   fuel_data_dir      ='./datain/Emission_data/Carbon_density_Saatchi/amazon_biomass_final.gra',


!---------------- gocart background
   use_gocart_bg=1,
   gocart_bg_data_dir='/home/Yang/wrf_chem/emissions/source_data/GOCART',

!---------------- volcanoes emissions
   use_volcanoes =0,
   volcano_index =1143, !REDOUBT

   use_these_values='NONE',
! define a text file for using external values for INJ_HEIGHT, DURATION,
! MASS ASH (units are meters - seconds - kilograms) and the format for
   begin_eruption='201303280000',  !begin time UTC of eruption YYYYMMDDhhmm

!---------------- degassing volcanoes emissions
   use_degass_volcanoes =0,
   degass_volc_data_dir ='./datain/Emission_data/VOLC_SO2',

!---------------- user specific  emissions directory
!---------------- Update for South America megacities
   user_data_dir='NONE',


!--------------------------------------------------------------------------------------------------
   pond=1,   ! mad/mfa  0 -> molar mass weighted
             !          1 -> Reactivity weighted

!---------------- for grid type 'll' or 'gg' only
   grid_resolucao_lon=1.0,
   grid_resolucao_lat=1.0,


   nlat=320,          ! if gg (only global grid)
   lon_beg   = -180., ! (-180.:+180.) long-begin of the output file
   lat_beg   =  -90., ! ( -90.:+90. ) lat -begin of the output file
   delta_lon =  360, ! total long extension of the domain (360 for global)
   delta_lat =  180, ! total lat  extension of the domain (180 for global)

!---------------- For regional grids (polar or lambert)

   NGRIDS   = 2,            ! Number of grids to run(domian数量)

   NNXP     = 91,79,86,46,        ! Number of x gridpoints (同namelist.wps中e_ws)
   NNYP     = 73,61,74,46,        ! Number of y gridpoints
   NXTNEST  = 0,1,1,1,          ! Grid number which is the next coarser grid (同namelist.wps中parent_id)
   DELTAX   = 45000.,
   DELTAY   = 45000.,         ! X and Y grid spacing (最外面一层domain的间距)

   ! Nest ratios between this grid and the next coarser grid.
   NSTRATX  = 1,3,3,4,           ! x-direction (domain之间间距的比例)
   NSTRATY  = 1,3,3,4,           ! y-direction

   NINEST = 1,37,0,0,        ! Grid point on the next coarser (同namelist.wps中i_parent_start)
   NJNEST = 1,23,0,0,        !  nest where the lower southwest
                             !  corner of this nest will start.
                             !  If NINEST or NJNEST = 0, use CENTLAT/LON
   POLELAT  =  28.14, !-89.99,          ! If polar, latitude/longitude of pole point (同namelist.wps中ref_lat)
   POLELON  =  112.771,         ! If lambert, lat/lon of grid origin (x=y=0.)

   STDLAT1  = 30.,           ! If polar for BRAMS, use 90.0 in STDLAT2
   STDLAT2  = 60.,         ! If lambert, standard latitudes of projection
                            !(truelat2/truelat1 from namelist.wps, STDLAT1 < STDLAT2)
                            ! If mercator STDLAT1 = 1st true latitude
   CENTLAT  = 28.14,!-89.99,  -23., 27.5,  27.5, (与上面polelat一样)
   CENTLON  = 112.771,  -46.,-80.5, -80.5,



!---------------- model output domain for each grid (only set up for rams)
   lati =  -90.,  -90.,   -90.,

   latf =  +90.,  +90.,   +90.,
   loni = -180., -180.,  -180.,
   lonf =  180.,  180.,   180.,

!---------------- project rams grid (polar sterogr) to lat/lon: 'YES' or 'NOT'
   proj_to_ll='YES',

!---------------- output file prefix (may include directory other than the current) (这里可以修改输出文件名的前缀)
   chem_out_prefix = 'WRF',
   chem_out_format = 'vfm',
!---------------- convert to WRF/CHEM (yes,not)
  special_output_to_wrf = 'YES',

$END


修改好.inp后就可以./prep_chem_sources_RADM_WRF_FIM_.exe
接着会生成文件
WRF-T-2016-11-15-000000-g3-ab.bin (人为排放)
WRF-T-2016-11-15-000000-g3-bb.bin  (biomass)
WRF-T-2016-11-15-000000-g3-gocartBG.bin (全球背景排放)
将这些文件分别链接为
emissopt3_d01
emissfire_d01
wrf_gocart_bg
然后./convert_emiss.exe
最后根据namelist.input里的定义修改清单的文件名,这里注意清单需要一层一层的转