1 ! This program that converts the following emissions data into
2 ! into WRF input data data files. The potential fields are:
3 ! 1) anthropogenic emissions data
4 ! 2) biogenic emissions data
5 ! 3) GOCART dust errosion factor
6 ! 4) GOCART sea salt emissions factor
7 ! 5) GOCART dimethyl sulfide emissions
8 ! 6) Wild fire biomass burn location obtained from GOES-ABBA data
10 ! The WRF namelist.input file is used to decide which data
11 ! is to be converted when this program is executed.
14 PROGRAM convert_emissions
15 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
21 ! USE module_domain, ONLY : domain, alloc_and_configure_domain, &
22 ! domain_clock_set, domain_clock_get, head_grid, program_name, domain_clockprint
23 ! USE module_initialize_real, ONLY : wrfu_initialize, rebalance_driver, find_my_parent
24 USE module_driver_constants
25 USE module_configure, ONLY : grid_config_rec_type, model_config_rec, &
26 initial_config, get_config_as_buffer, set_config_as_buffer
32 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
35 USE module_get_file_names
37 USE module_big_step_utilities_em
39 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
43 SUBROUTINE init_domain_constants_em_ptr ( parent , nest )
46 TYPE(domain), POINTER :: parent , nest
47 END SUBROUTINE init_domain_constants_em_ptr
53 SUBROUTINE Setup_Timekeeping( grid )
55 TYPE(domain), POINTER :: grid
56 END SUBROUTINE Setup_Timekeeping
59 INTEGER, PARAMETER :: rnum8=4
62 INTEGER :: loop , levels_to_process
65 TYPE(domain) , POINTER :: keep_grid, grid_ptr, null_domain, grid, ingrid
66 TYPE (grid_config_rec_type) :: config_flags, config_flags_in
67 INTEGER :: number_at_same_level
69 INTEGER :: max_dom, domain_id
70 INTEGER :: id1, id , fid, ierr
71 INTEGER :: idum1, idum2 , ihour, icnt
74 INTEGER, PARAMETER :: configbuflen = 4* CONFIG_BUF_LEN
75 INTEGER :: configbuf( configbuflen )
76 LOGICAL , EXTERNAL :: wrf_dm_on_monitor
79 REAL :: dt_from_file, tstart_from_file, tend_from_file
80 INTEGER :: ids , ide , jds , jde , kds , kde
81 INTEGER :: ips , ipe , jps , jpe , kps , kpe
82 INTEGER :: ims , ime , jms , jme , kms , kme
83 INTEGER :: i , j , k , idts, ntsd, emi_frame, nemi_frames
86 INTEGER :: debug_level = 0
87 INTEGER, PARAMETER :: iklev=55
88 real,dimension(iklev) :: p_g,p_wrf
89 REAL :: p00, t00, a, p_surf, pd_surf,p_top
90 integer :: kbot,ktop,k_initial,k_final,kk4,ko,kl
91 REAL, ALLOCATABLE, DIMENSION(:) :: gocart_lev
92 REAL, ALLOCATABLE, DIMENSION(:,:) :: tmp2
93 REAL, ALLOCATABLE, DIMENSION(:,:,:) :: tmp_oh,tmp_no3,tmp_h2o2,tmp3,interpolate
94 REAL, ALLOCATABLE :: dumc0(:,:,:),dumc4(:,:,:),zlevel(:,:,:)
95 REAL, ALLOCATABLE :: dumc1(:,:)
99 real, allocatable, dimension (:,:) :: ash_mass,ash_height,erup_dt
100 real, allocatable, dimension (:,:) :: so2_mass, volc_vent
101 real, allocatable, dimension (:) :: vert_mass_dist
102 real, dimension(10) :: size_dist
103 real :: x1,percen_mass_umbrel,base_umbrel,ashz_above_vent
107 REAL, ALLOCATABLE :: plvl(:,:,:)
108 REAL, ALLOCATABLE :: pdsl(:,:)
111 CHARACTER (LEN=80) :: message
113 CHARACTER(LEN=24) :: previous_date , this_date , next_date
114 CHARACTER(LEN=19) :: start_date_char , end_date_char , current_date_char , next_date_char
115 CHARACTER(LEN= 4) :: loop_char
117 INTEGER :: start_year , start_month , start_day , start_hour , start_minute , start_second
118 INTEGER :: end_year , end_month , end_day , end_hour , end_minute , end_second
119 INTEGER :: interval_seconds , real_data_init_type
121 INTEGER :: time_loop_max , time_loop
123 REAL :: cen_lat, cen_lon, moad_cen_lat, truelat1, truelat2, gmt, stand_lon, dum1
124 INTEGER :: map_proj, julyr, julday, iswater, isice, isurban, isoilwater
125 ! Add a logical leap-year variable as we want to calculate Julian day from the volc_d01 file
127 ! Add beg_yr, beg_mon, and beg_jul to calculate the eruption Julian day and hour from the
128 ! volc_d01 data file as it can be different than the run start day and hour.
129 INTEGER :: iswaterr,itest,beg_yr,beg_mon,beg_jul,beg_day,beg_hour
131 INTEGER :: inew_nei = 0
132 INTEGER :: inew_ch4 = 1 ! set to 0 if the emission inventory doesn't include CH4
136 INTEGER :: itime_f = 0
138 REAL :: dx,dy,area,eh
140 CHARACTER(LEN= 8) :: chlanduse
143 CHARACTER (LEN=80) :: inpname , eminame, dum_str, wrfinname
144 CHARACTER (LEN=80) :: bdyname, bdyname2
145 CHARACTER (LEN=20) :: dname
146 CHARACTER (LEN=12) :: dname2
147 CHARACTER (LEN=256) :: timestr
149 ! MBO is separated, SESQ is added
150 ! Number of reference emission and LAI files to open
151 INTEGER, PARAMETER :: numfil=21
152 INTEGER :: status,system
153 ! Filenames of reference emissions and LAI
155 CHARACTER*12 emfil(numfil)
156 DATA emfil/'ISO','OLI','API','LIM','XYL','HC3','ETE','OLT', &
157 'KET','ALD','HCHO','ETH','ORA2','CO','NR','SESQ','MBO', &
158 'NOAG_GROW','NOAG_NONGROW','NONONAG','ISOP'/
160 ! these are needed on some compilers, eg compaq/alpha, to
161 ! permit pass by reference through the registry generated
162 ! interface to med_read_emissions, below
164 INTEGER :: sm31 , em31 , sm32 , em32 , sm33 , em33
167 #include "version_decl"
168 #include "commit_decl"
170 #define DM_BCAST_MACRO(A) CALL wrf_dm_bcast_bytes ( A , size ( A ) * rnum8 )
172 ! Get the NAMELIST data for input.
174 ! Define the name of this program (program_name defined in module_domain)
176 program_name = "WRF-CHEM " // TRIM(release_version) // " EMISSIONS PREPROCESSOR"
179 CALL disable_quilting
183 CALL wrf_debug ( 100 , 'convert_emiss: calling init_modules ' )
184 CALL init_modules(1) ! Phase 1 returns after MPI_INIT() (if it is called)
185 #ifdef NO_LEAP_CALENDAR
186 CALL WRFU_Initialize( defaultCalKind=WRFU_CAL_NOLEAP, rc=rc )
188 CALL WRFU_Initialize( defaultCalKind=WRFU_CAL_GREGORIAN, rc=rc )
190 CALL init_modules(2) ! Phase 2 resumes after MPI_INIT() (if it is called)
194 IF ( wrf_dm_on_monitor() ) THEN
197 CALL get_config_as_buffer( configbuf, configbuflen, nbytes )
198 CALL wrf_dm_bcast_bytes( configbuf, nbytes )
199 CALL set_config_as_buffer( configbuf, configbuflen )
200 CALL wrf_dm_initialize
205 ! And here is an instance of using the information in the NAMELIST.
207 CALL nl_get_debug_level ( 1, debug_level )
208 CALL set_wrf_debug_level ( debug_level )
210 ! Allocated and configure the mother domain. Since we are in the nesting down
211 ! mode, we know a) we got a nest, and b) we only got 1 nest.
213 NULLIFY( null_domain )
215 CALL wrf_message ( program_name )
216 CALL wrf_message ( commit_version )
217 write(message,FMT='(A)') ' allocate for wrfinput_d01 '
218 CALL alloc_and_configure_domain ( domain_id = 1 , &
220 parent = null_domain , &
224 ! Set up time initializations.
226 CALL Setup_Timekeeping ( grid )
228 CALL domain_clock_set( head_grid, &
229 time_step_seconds=model_config_rec%interval_seconds )
230 CALL wrf_debug ( 100 , 'convert_gocart: calling model_to_grid_config_rec ' )
231 CALL model_to_grid_config_rec ( grid%id , model_config_rec , config_flags )
232 CALL wrf_debug ( 100 , 'convert_gocart: calling set_scalar_indices_from_config ' )
233 CALL set_scalar_indices_from_config ( grid%id , idum1, idum2 )
235 ! Initialize the I/O for WRF.
237 CALL wrf_debug ( 100 , 'convert_gocart: calling init_wrfio' )
241 CALL get_config_as_buffer( configbuf, configbuflen, nbytes )
242 CALL wrf_dm_bcast_bytes( configbuf, nbytes )
243 CALL set_config_as_buffer( configbuf, configbuflen )
246 ! ! Get the grid info from the wrfinput file
248 CALL wrf_debug ( 100, message )
249 write(message,FMT='(A)') ' set scalars for wrfinput_d01 '
250 CALL wrf_debug ( 100, message )
251 CALL set_scalar_indices_from_config ( grid%id , idum1, idum2 )
253 write(message,FMT='(A)') ' construct filename for wrfinput_d01 '
254 CALL wrf_debug ( 100, message )
255 CALL construct_filename1( wrfinname , 'wrfinput' , grid%id , 2 )
257 write(message,FMT='(A,A)') ' open file ',TRIM(wrfinname)
258 CALL wrf_message ( message )
259 CALL open_r_dataset ( fid, TRIM(wrfinname) , head_grid , config_flags , "DATASET=INPUT", ierr )
263 CALL med_initialdata_input( head_grid , config_flags )
265 write(message,FMT='(A)') ' wrfinput open error check '
266 CALL wrf_debug ( 100, message )
267 IF ( ierr .NE. 0 ) THEN
268 WRITE( wrf_err_message , FMT='(A,A,A,I8)' ) &
269 'program convert_emiss: error opening ',TRIM(wrfinname),' for reading ierr=',ierr
270 CALL WRF_ERROR_FATAL ( wrf_err_message )
272 write(message,FMT='(A)') ' past opening wrfinput_d01 '
273 CALL wrf_debug ( 00, message )
276 CALL close_dataset ( fid , config_flags , "DATASET=INPUT" )
279 ! An available simple timer from the timing module.
281 CALL set_scalar_indices_from_config ( grid%id , idum1, idum2 )
283 CALL Setup_Timekeeping ( grid )
284 CALL domain_clock_set( grid, &
285 time_step_seconds=model_config_rec%interval_seconds )
286 CALL domain_clock_get( grid, current_timestr=timestr )
287 write(message,FMT='(A,A)') ' current_time ',Trim(timestr)
288 CALL wrf_debug ( 100, message )
290 CALL model_to_grid_config_rec ( grid%id , model_config_rec , config_flags )
292 ! Figure out the starting and ending dates in a character format.
294 start_year = model_config_rec%start_year (grid%id)
295 start_month = model_config_rec%start_month (grid%id)
296 start_day = model_config_rec%start_day (grid%id)
297 start_hour = model_config_rec%start_hour (grid%id)
298 start_minute = model_config_rec%start_minute(grid%id)
299 start_second = model_config_rec%start_second(grid%id)
301 end_year = model_config_rec% end_year (grid%id)
302 end_month = model_config_rec% end_month (grid%id)
303 end_day = model_config_rec% end_day (grid%id)
304 end_hour = model_config_rec% end_hour (grid%id)
305 end_minute = model_config_rec% end_minute(grid%id)
306 end_second = model_config_rec% end_second(grid%id)
309 int_sec = config_flags%auxinput5_interval
310 if ( int_sec == 0 ) then
311 int_sec = config_flags%auxinput5_interval_s
313 if ( int_sec == 0 ) then
314 int_sec = 60 * config_flags%auxinput5_interval_m
316 if ( int_sec == 0 ) then
317 int_sec = 3600 * config_flags%auxinput5_interval_h
319 if ( int_sec == 0 ) then
320 int_sec = 86400 * config_flags%auxinput5_interval_d
322 CALL domain_clock_set( grid, &
323 time_step_seconds=int_Sec )
326 real_data_init_type = model_config_rec%real_data_init_type
328 WRITE ( start_date_char , FMT = '(I4.4,"-",I2.2,"-",I2.2,"_",I2.2,":",I2.2,":",I2.2)' ) &
329 start_year,start_month,start_day,start_hour,start_minute,start_second
330 WRITE ( end_date_char , FMT = '(I4.4,"-",I2.2,"-",I2.2,"_",I2.2,":",I2.2,":",I2.2)' ) &
331 end_year, end_month, end_day, end_hour, end_minute, end_second
332 print *,'START DATE ',start_date_char, int_sec, model_config_rec%interval_seconds
333 print *,'END DATE ',end_date_char
335 ! these are needed on some compilers, eg compaq/alpha, to
336 ! permit pass by reference through the registry generated
337 ! interface to med_read_emissions, below
346 CALL get_ijk_from_grid ( grid , &
347 ids, ide, jds, jde, kds, kde, &
348 ims, ime, jms, jme, kms, kme, &
349 ips, ipe, jps, jpe, kps, kpe )
350 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
352 ! Allocate scratch arrays
354 ALLOCATE (dumc0(ids:ide,kds:grid%kemit,jds:jde))
355 ! ALLOCATE (dumc4(ids:ide-1,kds:grid%kemit,jds:jde-1))
356 ALLOCATE (dumc1(ids:ide,jds:jde))
358 ALLOCATE( tmp_oh(ids:ide,jds:jde,iklev) )
359 ALLOCATE( tmp_h2o2(ids:ide,jds:jde,iklev) )
360 ALLOCATE( tmp_no3(ids:ide,jds:jde,iklev) )
361 ALLOCATE( tmp2(ids:ide,jds:jde) )
362 ALLOCATE( tmp3(ids:ide,jds:jde,3) )
363 ALLOCATE( interpolate(ids:ide,kds:kde,jds:jde) )
364 ALLOCATE( gocart_lev(iklev))
365 if(config_flags%emiss_opt_vol == 1 .or. config_flags%emiss_opt_vol == 2) then
366 ALLOCATE( ash_mass(ids:ide,jds:jde) )
367 ALLOCATE( so2_mass(ids:ide,jds:jde) )
368 ALLOCATE( volc_vent(ids:ide,jds:jde) )
369 ALLOCATE( ash_height(ids:ide,jds:jde) )
370 ALLOCATE( erup_dt(ids:ide,jds:jde) )
371 ALLOCATE( vert_mass_dist(kds:kde) )
372 ALLOCATE( zlevel(ids:ide,kds:kde,jds:jde) )
378 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
380 ! read reference fields that some of the GOCART modules require (can be run with other modules too?)
382 if(config_flags%chem_opt == GOCART_SIMPLE &
383 .or. config_flags%chem_opt == GOCARTRACM_KPP &
384 .or. config_flags%chem_opt == CHEM_VOLC &
385 .or. config_flags%dmsemis_opt == DMSGOCART &
386 .or. config_flags%dust_opt == DUSTGOCART &
388 write(message,FMT='(A)') ' READ GOCART BACKGROUND DATA '
389 CALL wrf_debug ( 00, message )
392 IF (wrf_dm_on_monitor()) THEN
393 OPEN(19,FILE='wrf_gocart_backg',FORM='UNFORMATTED')
396 OPEN(19,FILE='wrf_gocart_backg',FORM='UNFORMATTED')
400 IF (wrf_dm_on_monitor()) THEN
401 read(19)tmp2(ids:ide ,jds:jde )
405 print *,ids,ide,jds,jde
406 read(19)tmp2(ids:ide ,jds:jde )
408 grid%dms_0(ips:ipe,jps:jpe) = tmp2(ips:ipe,jps:jpe)
411 IF (wrf_dm_on_monitor()) THEN
412 read(19)tmp3(ids:ide ,jds:jde ,1:3)
416 read(19)tmp3(ids:ide ,jds:jde ,1:3)
419 ! grid%erod(ips:ipe,jps:jpe,i)=tmp3(ips:ipe,jps:jpe,i)
423 IF (wrf_dm_on_monitor()) THEN
424 read(19)gocart_lev(1:iklev)
426 DM_BCAST_MACRO(gocart_lev)
428 read(19)gocart_lev(1:iklev)
431 write(*,*) 'GOCART_LEV: ',gocart_lev(:)
434 IF (wrf_dm_on_monitor()) THEN
435 read(19)tmp_h2o2(ids:ide,jds:jde,1:iklev)
437 DM_BCAST_MACRO(tmp_h2o2)
439 read(19)tmp_h2o2(ids:ide,jds:jde,1:iklev)
443 IF (wrf_dm_on_monitor()) THEN
444 read(19)tmp_oh(ids:ide,jds:jde,1:iklev)
446 DM_BCAST_MACRO(tmp_oh)
448 read(19)tmp_oh(ids:ide,jds:jde,1:iklev)
452 IF (wrf_dm_on_monitor()) THEN
453 read(19)tmp_no3(ids:ide,jds:jde,1:iklev)
455 DM_BCAST_MACRO(tmp_no3)
457 read(19)tmp_no3(ids:ide,jds:jde,1:iklev)
462 ! CALL input_ext_chem_gocart_bg ( grid )
463 write(message,FMT='(A)') ' PAST GOCART BACKGROUND DATA'
464 CALL wrf_debug ( 00, message )
466 grid%input_from_file = .false.
468 write(message,FMT='(A)') ' OPEN GOCART BACKGROUND DATA WRF file'
469 CALL wrf_debug ( 00, message )
471 CALL construct_filename1( inpname , 'wrfchemi_gocart_bg' , grid%id , 2 )
472 CALL open_w_dataset ( id1, TRIM(inpname) , grid , config_flags , output_auxinput8 , "DATASET=AUXINPUT8", ierr )
473 write(message,FMT='(A,A)') ' GOCART BACKGROUND DATA file name: ',TRIM(inpname)
474 CALL wrf_message ( message )
476 IF ( ierr .NE. 0 ) THEN
477 CALL wrf_error_fatal( 'convert_emiss: error opening wrfchem emissions file for writing' )
480 write(message,FMT='(A)') ' PAST OPEN GOCART BACKGROUND DATA WRF file '
481 CALL wrf_debug ( 100, message )
483 CALL calc_current_date ( grid%id , 0. )
484 CALL geth_newdate ( current_date_char, current_date, 3600 )
485 current_date = current_date_char // '.0000'
487 ! if( stand_lon == 0. ) then
488 ! stand_lon = cen_lon
491 ! if( moad_cen_lat == 0. ) then
492 ! moad_cen_lat = cen_lat
497 IF( (config_flags%chem_opt == GOCART_SIMPLE) .OR. &
498 (config_flags%chem_opt == CHEM_VOLC) .OR. &
499 (config_flags%chem_opt == GOCARTRACM_KPP) ) then
500 ! interpolate 3d fields to WRF in vertical
503 p_g(k) = log10( gocart_lev(k) * 1023.)
505 CALL nl_get_base_pres ( 1 , p00 )
506 CALL nl_get_base_temp ( 1 , t00 )
507 CALL nl_get_base_lapse ( 1 , a )
508 call nl_get_p_top_requested (1,p_top)
517 p_surf = p00 * EXP ( -t00/a + ( (t00/a)**2 - 2.*g*grid%ht(i,j)/a/r_d ) **0.5 )
519 grid%pb(i,k,j) = grid%znu(k)*(p_surf - p_top) + p_top
523 if( p_g(kg) <= log10(.01*grid%pb(i,kw,j)) ) then
525 ktop = max(min(kg,iklev-1),2)
529 fac= (tmp_no3(i ,j ,ktop)-tmp_no3(i ,j ,kbot))/ (p_g(ktop) - p_g(kbot))
530 grid%backg_no3(i, kw, j) = tmp_no3(i ,j ,kbot)+fac*(log10(.01*grid%pb(i,kw,j))-p_g(kbot))
533 fac= (tmp_oh(i ,j ,ktop)-tmp_oh(i ,j ,kbot))/ (p_g(ktop) - p_g(kbot))
534 grid%backg_oh(i, kw, j) = tmp_oh(i ,j ,kbot)+fac*(log10(.01*grid%pb(i,kw,j))-p_g(kbot))
537 fac= (tmp_h2o2(i ,j ,ktop)-tmp_h2o2(i ,j ,kbot) )/(p_g(ktop) - p_g(kbot))
538 grid%backg_h2o2(i, kw, j) = tmp_h2o2(i ,j ,kbot)+fac*(log10(.01*grid%pb(i,kw,j))-p_g(kbot))
545 #if ( NMM_CORE == 1 )
547 ! Get scalar grid point heights
548 ALLOCATE( plvl(ips:ipe,kps:kpe,jps:jpe) )
549 ALLOCATE( pdsl(ips:ipe,jps:jpe) )
551 IF(grid%sigma.EQ. 1)THEN
554 pdsl(i,j)=grid%pd(i,j)
560 pdsl(i,j)=grid%res(i,j)*grid%pd(i,j)
568 plvl(i,k,j)=grid%eta1(k)*grid%pdtop+grid%eta2(k)*pdsl(i,j)+grid%pt
578 if( p_g(kg) <= log10(.01*plvl(i,kw,j)) ) then
580 ktop = max(min(kg,iklev-1),2)
584 fac= (tmp_no3(i ,j ,ktop)-tmp_no3(i ,j ,kbot))/ (p_g(ktop) - p_g(kbot))
585 grid%backg_no3(i, kw, j) = tmp_no3(i ,j ,kbot)+fac*(log10(.01*plvl(i,kw,j))-p_g(kbot))
588 fac= (tmp_oh(i ,j ,ktop)-tmp_oh(i ,j ,kbot))/ (p_g(ktop) - p_g(kbot))
589 grid%backg_oh(i, kw, j) = tmp_oh(i ,j ,kbot)+fac*(log10(.01*plvl(i,kw,j))-p_g(kbot))
592 fac= (tmp_h2o2(i ,j ,ktop)-tmp_h2o2(i ,j ,kbot) )/(p_g(ktop) - p_g(kbot))
593 grid%backg_h2o2(i, kw, j) = tmp_h2o2(i ,j ,kbot)+fac*(log10(.01*plvl(i,kw,j))-p_g(kbot))
602 ENDIF ! chem_opt gocart_simple or gocartracm
604 CALL output_auxinput8 ( id1 , grid , config_flags , ierr )
606 CALL close_dataset ( id1 , config_flags , "DATASET=AUXOUTPUT8" )
608 ENDIF ! chem_opt gocart_simple,dmsgocart,dustgocart
611 DEALLOCATE( tmp_h2o2 )
612 DEALLOCATE( tmp_no3 )
615 DEALLOCATE( interpolate )
617 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
620 if(config_flags%emiss_opt_vol == 1 .or. config_flags%emiss_opt_vol == 2) then
621 write(message, FMT='(A,4I6)') ' I am reading global volcanic emissions, dims: =',ids, ide-1, jds, jde-1
622 call wrf_message( TRIM( message ) )
623 CALL construct_filename1 ( bdyname , 'volc' , grid%id , 2 )
625 IF (wrf_dm_on_monitor()) THEN
626 open (92,file=bdyname,form='unformatted')
629 OPEN(92,FILE=bdyname,FORM='UNFORMATTED')
631 write(message, FMT='(A,A)') ' OPENED FILE: ',TRIM(bdyname)
632 call wrf_message( TRIM( message ) )
634 IF (wrf_dm_on_monitor()) THEN
638 CALL wrf_dm_bcast_bytes ( nv_g , rnum8 )
639 CALL wrf_dm_bcast_bytes ( dname , rnum8 )
640 CALL wrf_dm_bcast_bytes ( dname2 , rnum8 )
647 CALL geth_julgmt ( config_flags%julyr , config_flags%julday , config_flags%gmt )
648 ! dname = YYYYMMDDHHMMSS
650 ! read in the eruption beg_yr and beg_mon from the volc_d01 data file
651 read(unit=dname2(1:4), FMT='(I4)')beg_yr
652 read(unit=dname2(5:6), FMT='(I2)')beg_mon
653 read(unit=dname2(7:8), FMT='(I2)')beg_day
654 read(unit=dname2(9:10), FMT='(I2)')beg_hour
656 ! convert the date from the volc_d01 data file to Julian day
658 IF((MOD(beg_yr,4) .EQ. 0 .AND. MOD(beg_yr,100).NE.0 ).OR. MOD(beg_yr,400).EQ.0 ) THEN
666 beg_jul = ((275*beg_mon)/9) - K*((beg_mon+9)/12) + beg_day - 30
668 write(0,*)' DNAME2 = ',dname2,beg_jul,beg_hour
670 IF (wrf_dm_on_monitor()) THEN
673 DM_BCAST_MACRO(size_dist)
674 ! write(0,*)size_dist
678 ! write(0,*)'size_dist = ',size_dist,ids,ide,jds,jde
679 if(config_flags%emiss_opt_vol == 2 ) then
681 IF (wrf_dm_on_monitor()) THEN
682 ! write(0,*)'now do so2 '
683 read(92)so2_mass(ids:ide ,jds:jde )
685 DM_BCAST_MACRO(so2_mass)
686 ! write(0,*)maxval(so2_mass)
688 ! write(0,*)'now do so2-s '
689 read(92)so2_mass(ids:ide ,jds:jde )
691 endif ! config_flags%emiss_opt_vol == 2
693 IF (wrf_dm_on_monitor()) THEN
694 write(0,*)'now do ash mass '
695 read(92)ash_mass(ids:ide ,jds:jde )
697 DM_BCAST_MACRO(ash_mass)
699 read(92)ash_mass(ids:ide ,jds:jde )
702 IF (wrf_dm_on_monitor()) THEN
703 write(0,*)'now do ash heigt '
704 read(92)ash_height(ids:ide ,jds:jde )
706 DM_BCAST_MACRO(ash_height)
708 read(92)ash_height(ids:ide ,jds:jde )
711 IF (wrf_dm_on_monitor()) THEN
712 ! write(0,*)'now do volc vent '
713 read(92)volc_vent(ids:ide ,jds:jde )
715 DM_BCAST_MACRO(volc_vent)
716 ! write(0,*)maxval(volc_vent)
718 read(92)volc_vent(ids:ide ,jds:jde )
722 IF (wrf_dm_on_monitor()) THEN
723 write(0,*)'now do erup dt '
724 read(92)erup_dt(ids:ide ,jds:jde )
726 DM_BCAST_MACRO(erup_dt)
728 read(92)erup_dt(ids:ide ,jds:jde )
733 zlevel(i,k,j) = (grid%phb(i,k,j)+grid%ph_2(i,k,j))/9.81
737 percen_mass_umbrel=.75
738 base_umbrel=.25 ! fraction
742 if(ash_height(i,j).le.0.)CYCLE
744 area = config_flags%dx * config_flags%dy
745 ! so2_mass=1.5e4*3600.*1.e9/64./area
746 eh=2600.*(ash_height(i,j)*.0005)**4.1494
747 ash_mass(i,j)=eh*1.e9/area
749 ! if(erup_dt(i,j).le.0.)CYCLE
750 ashz_above_vent=ash_height(i,j)+volc_vent(i,j) !zlevel(i,kps,j)
751 ! ashz_above_vent=ash_height(i,j)+zlevel(i,kps,j)
753 ! write(0,*)'found active volcano at i,j,kps,kpe = ',i,j,kps,kpe
754 ! write(0,*)ash_height(i,j),ash_mass(i,j),erup_dt(i,j),ashz_above_vent
756 ! write(0,*)k,zlevel(i,k,j)
757 if(zlevel(i,k,j) < ashz_above_vent)then
762 ! write(0,*)'k_final = ',k_final
764 ! write(0,*)k,zlevel(i,k,j)
765 if(zlevel(i,k,j) < (1.-base_umbrel)*ashz_above_vent)then
770 ! write(0,*)'k_init = ',k_initial
773 !- parabolic vertical distribution between k_initial and k_final
774 kk4 = k_final-k_initial+2
777 vert_mass_dist(kl) = 6.*percen_mass_umbrel* float(ko)/float(kk4)**2 * (1. - float(ko)/float(kk4))
779 ! write(0,*)' mass=',sum(vert_mass_dist)*100.
780 if(sum(vert_mass_dist(kps:kpe)) .ne. percen_mass_umbrel) then
781 x1= ( percen_mass_umbrel- sum(vert_mass_dist(kps:kpe)) )/float(k_final-k_initial+1)
782 do ko=k_initial,k_final
783 vert_mass_dist(ko) = vert_mass_dist(ko)+ x1 !- values between 0 and 1.
785 ! print*,'new mass=',sum(vmd)*100.,x1
788 !k_final > 0 .and. k_initial >
790 !linear detrainment from vent to base of umbrella
792 vert_mass_dist(ko)=float(ko)/float(k_initial-1)
794 x1=sum(vert_mass_dist(1:k_initial-1))
797 vert_mass_dist(ko)=(1.-percen_mass_umbrel)*vert_mass_dist(ko)/x1
801 ! vert_mass_dist(ko) = vert_mass_dist(ko)+ x1 !- values between 0 and 1.
802 ! write(0,*)'k,vert_mass_dist = ',ko,vert_mass_dist(ko),zlevel(i,ko,j)
803 grid%emis_vol(i,ko,j,p_e_vash1)=size_dist(1)*vert_mass_dist(ko)*ash_mass(i,j)
804 grid%emis_vol(i,ko,j,p_e_vash2)=size_dist(2)*vert_mass_dist(ko)*ash_mass(i,j)
805 grid%emis_vol(i,ko,j,p_e_vash3)=size_dist(3)*vert_mass_dist(ko)*ash_mass(i,j)
806 grid%emis_vol(i,ko,j,p_e_vash4)=size_dist(4)*vert_mass_dist(ko)*ash_mass(i,j)
807 grid%emis_vol(i,ko,j,p_e_vash5)=size_dist(5)*vert_mass_dist(ko)*ash_mass(i,j)
808 grid%emis_vol(i,ko,j,p_e_vash6)=size_dist(6)*vert_mass_dist(ko)*ash_mass(i,j)
809 grid%emis_vol(i,ko,j,p_e_vash7)=size_dist(7)*vert_mass_dist(ko)*ash_mass(i,j)
810 grid%emis_vol(i,ko,j,p_e_vash8)=size_dist(8)*vert_mass_dist(ko)*ash_mass(i,j)
811 grid%emis_vol(i,ko,j,p_e_vash9)=size_dist(9)*vert_mass_dist(ko)*ash_mass(i,j)
812 grid%emis_vol(i,ko,j,p_e_vash10)=size_dist(10)*vert_mass_dist(ko)*ash_mass(i,j)
813 if(config_flags%emiss_opt_vol == 2)grid%emis_vol(i,ko,j,p_e_vso2)=vert_mass_dist(ko)*so2_mass(i,j)
815 ! Changes made to Julian day from the volc_d01 file
816 grid%erup_beg(i,j)=float(beg_jul)*1000.+float(beg_hour)
817 grid%erup_end(i,j)=grid%erup_beg(i,j)+erup_dt(i,j)
818 write(0,*)'new mass=',sum(vert_mass_dist)*100.,x1
824 ! simple file dump here....
826 write(message,FMT='(A)') ' OPEN EMISSIONS WRF file for emissions coming from volcano data set'
827 call wrf_message( TRIM( message ) )
828 write(message, FMT='(A)') ' NO TIME DEPENDENCE IN THIS DATASET'
829 ! emissions from volcanoes (prep_chem_sources)
831 CALL construct_filename1( inpname , 'wrfchemv' , grid%id , 2 )
832 CALL open_w_dataset ( id1, TRIM(inpname) , grid , config_flags , output_auxinput13, "DATASET=AUXINPUT13", ierr )
834 CALL output_auxinput13( id1 , grid , config_flags , ierr )
836 CALL close_dataset ( id1 , config_flags , "DATASET=AUXOUTPUT13" )
840 !!!!!!!!!!!!!!!!!!!! end volcanic stuff
842 if(config_flags%emiss_opt_vol == 1 .or. config_flags%emiss_opt_vol == 2) then
843 DEALLOCATE( ash_mass )
844 DEALLOCATE( so2_mass )
845 DEALLOCATE( volc_vent )
846 DEALLOCATE( ash_height )
849 DEALLOCATE( vert_mass_dist)
853 ! now do fire and/or global emissions
855 if(config_flags%emiss_opt == ecptec .or. config_flags%emiss_opt == gocart_ecptec ) then
856 write(message, FMT='(A,4I6)') ' I am reading global anthropogenic emissions, dims: =',ids, ide-1, jds, jde-1
857 call wrf_message( TRIM( message ) )
859 CALL construct_filename1 ( bdyname , 'emissopt3' , grid%id , 2 )
861 IF (wrf_dm_on_monitor()) THEN
862 open (92,file=bdyname,form='unformatted')
865 OPEN(92,FILE=bdyname,FORM='UNFORMATTED')
867 write(message, FMT='(A,A)') ' OPENED FILE: ',TRIM(bdyname)
868 call wrf_message( TRIM( message ) )
871 if(config_flags%emiss_opt == ecptec)itest=1
872 if(config_flags%emiss_opt == gocart_ecptec)then
874 write(message, FMT='(A)') ' I am reading emissions for gocart only (aerosols)'
875 call wrf_message( TRIM( message ) )
878 IF (wrf_dm_on_monitor()) THEN
883 CALL wrf_dm_bcast_bytes ( nv_g , rnum8 )
884 CALL wrf_dm_bcast_bytes ( dname , rnum8 )
885 CALL wrf_dm_bcast_bytes ( itime , rnum8 )
893 IF (wrf_dm_on_monitor()) THEN
894 read(92)dumc1(ids:ide ,jds:jde )
896 DM_BCAST_MACRO(dumc1)
898 read(92)dumc1(ids:ide ,jds:jde )
900 grid%emis_ant(ips:ipe ,kps,jps:jpe ,p_e_so2)=dumc1(ips:ipe ,jps:jpe )
903 IF (wrf_dm_on_monitor()) THEN
904 read(92)dumc1(ids:ide ,jds:jde )
906 DM_BCAST_MACRO(dumc1)
908 read(92)dumc1(ids:ide ,jds:jde )
910 if(itest.eq.1)grid%emis_ant(ips:ipe ,kps,jps:jpe ,p_e_no2)=dumc1(ips:ipe ,jps:jpe )
913 IF (wrf_dm_on_monitor()) THEN
914 read(92)dumc1(ids:ide ,jds:jde )
916 DM_BCAST_MACRO(dumc1)
918 read(92)dumc1(ids:ide ,jds:jde )
920 if(itest.eq.1)grid%emis_ant(ips:ipe ,kps,jps:jpe ,p_e_no)=dumc1(ips:ipe ,jps:jpe )
923 IF (wrf_dm_on_monitor()) THEN
924 read(92)dumc1(ids:ide ,jds:jde )
926 DM_BCAST_MACRO(dumc1)
928 read(92)dumc1(ids:ide ,jds:jde )
930 if(itest.eq.1)grid%emis_ant(ips:ipe ,kps,jps:jpe ,p_e_ald)=dumc1(ips:ipe ,jps:jpe )
933 IF (wrf_dm_on_monitor()) THEN
934 read(92)dumc1(ids:ide ,jds:jde )
936 DM_BCAST_MACRO(dumc1)
938 read(92)dumc1(ids:ide ,jds:jde )
940 if(itest.eq.1)grid%emis_ant(ips:ipe ,kps,jps:jpe ,p_e_hcho)=dumc1(ips:ipe ,jps:jpe )
943 IF (wrf_dm_on_monitor()) THEN
944 read(92)dumc1(ids:ide ,jds:jde )
946 DM_BCAST_MACRO(dumc1)
948 read(92)dumc1(ids:ide ,jds:jde )
950 if(itest.eq.1)grid%emis_ant(ips:ipe ,kps,jps:jpe ,p_e_ora2)=dumc1(ips:ipe ,jps:jpe )
953 IF (wrf_dm_on_monitor()) THEN
954 read(92)dumc1(ids:ide ,jds:jde )
956 DM_BCAST_MACRO(dumc1)
958 read(92)dumc1(ids:ide ,jds:jde )
960 if(itest.eq.1)grid%emis_ant(ips:ipe ,kps,jps:jpe ,p_e_nh3)=dumc1(ips:ipe ,jps:jpe )
963 IF (wrf_dm_on_monitor()) THEN
964 read(92)dumc1(ids:ide ,jds:jde )
966 DM_BCAST_MACRO(dumc1)
968 read(92)dumc1(ids:ide ,jds:jde )
970 if(itest.eq.1)grid%emis_ant(ips:ipe ,kps,jps:jpe ,p_e_hc3)=dumc1(ips:ipe ,jps:jpe )
973 IF (wrf_dm_on_monitor()) THEN
974 read(92)dumc1(ids:ide ,jds:jde )
976 DM_BCAST_MACRO(dumc1)
978 read(92)dumc1(ids:ide ,jds:jde )
980 if(itest.eq.1)grid%emis_ant(ips:ipe ,kps,jps:jpe ,p_e_hc5)=dumc1(ips:ipe ,jps:jpe )
983 IF (wrf_dm_on_monitor()) THEN
984 read(92)dumc1(ids:ide ,jds:jde )
986 DM_BCAST_MACRO(dumc1)
988 read(92)dumc1(ids:ide ,jds:jde )
990 if(itest.eq.1)grid%emis_ant(ips:ipe ,kps,jps:jpe ,p_e_hc8)=dumc1(ips:ipe ,jps:jpe )
993 IF (wrf_dm_on_monitor()) THEN
994 read(92)dumc1(ids:ide ,jds:jde )
996 DM_BCAST_MACRO(dumc1)
998 read(92)dumc1(ids:ide ,jds:jde )
1000 if(itest.eq.1)grid%emis_ant(ips:ipe ,kps,jps:jpe ,p_e_eth)=dumc1(ips:ipe ,jps:jpe )
1003 IF (wrf_dm_on_monitor()) THEN
1004 read(92)dumc1(ids:ide ,jds:jde )
1006 DM_BCAST_MACRO(dumc1)
1008 read(92)dumc1(ids:ide ,jds:jde )
1010 if(itest.eq.1)grid%emis_ant(ips:ipe ,kps,jps:jpe ,p_e_co)=dumc1(ips:ipe ,jps:jpe )
1013 IF (wrf_dm_on_monitor()) THEN
1014 read(92)dumc1(ids:ide ,jds:jde )
1016 DM_BCAST_MACRO(dumc1)
1018 read(92)dumc1(ids:ide ,jds:jde )
1020 if(itest.eq.1)grid%emis_ant(ips:ipe ,kps,jps:jpe ,p_e_ol2)=dumc1(ips:ipe ,jps:jpe )
1023 IF (wrf_dm_on_monitor()) THEN
1024 read(92)dumc1(ids:ide ,jds:jde )
1026 DM_BCAST_MACRO(dumc1)
1028 read(92)dumc1(ids:ide ,jds:jde )
1030 if(itest.eq.1)grid%emis_ant(ips:ipe ,kps,jps:jpe ,p_e_olt)=dumc1(ips:ipe ,jps:jpe )
1033 IF (wrf_dm_on_monitor()) THEN
1034 read(92)dumc1(ids:ide ,jds:jde )
1036 DM_BCAST_MACRO(dumc1)
1038 read(92)dumc1(ids:ide ,jds:jde )
1040 if(itest.eq.1)grid%emis_ant(ips:ipe ,kps,jps:jpe ,p_e_oli)=dumc1(ips:ipe ,jps:jpe )
1043 IF (wrf_dm_on_monitor()) THEN
1044 read(92)dumc1(ids:ide ,jds:jde )
1046 DM_BCAST_MACRO(dumc1)
1048 read(92)dumc1(ids:ide ,jds:jde )
1050 if(itest.eq.1)grid%emis_ant(ips:ipe ,kps,jps:jpe ,p_e_tol)=dumc1(ips:ipe ,jps:jpe )
1053 IF (wrf_dm_on_monitor()) THEN
1054 read(92)dumc1(ids:ide ,jds:jde )
1056 DM_BCAST_MACRO(dumc1)
1058 read(92)dumc1(ids:ide ,jds:jde )
1060 if(itest.eq.1)grid%emis_ant(ips:ipe ,kps,jps:jpe ,p_e_xyl)=dumc1(ips:ipe ,jps:jpe )
1063 IF (wrf_dm_on_monitor()) THEN
1064 read(92)dumc1(ids:ide ,jds:jde )
1066 DM_BCAST_MACRO(dumc1)
1068 read(92)dumc1(ids:ide ,jds:jde )
1070 if(itest.eq.1)grid%emis_ant(ips:ipe ,kps,jps:jpe ,p_e_ket)=dumc1(ips:ipe ,jps:jpe )
1073 IF (wrf_dm_on_monitor()) THEN
1074 read(92)dumc1(ids:ide ,jds:jde )
1076 DM_BCAST_MACRO(dumc1)
1078 read(92)dumc1(ids:ide ,jds:jde )
1080 if(itest.eq.1)grid%emis_ant(ips:ipe ,kps,jps:jpe ,p_e_csl)=dumc1(ips:ipe ,jps:jpe )
1083 IF (wrf_dm_on_monitor()) THEN
1084 read(92)dumc1(ids:ide ,jds:jde )
1086 DM_BCAST_MACRO(dumc1)
1088 read(92)dumc1(ids:ide ,jds:jde )
1090 if(itest.eq.1)grid%emis_ant(ips:ipe ,kps,jps:jpe ,p_e_iso)=dumc1(ips:ipe ,jps:jpe )
1093 IF (wrf_dm_on_monitor()) THEN
1094 read(92)dumc1(ids:ide ,jds:jde )
1096 DM_BCAST_MACRO(dumc1)
1098 read(92)dumc1(ids:ide ,jds:jde )
1100 grid%emis_ant(ips:ipe ,kps,jps:jpe ,p_e_pm_25)=dumc1(ips:ipe ,jps:jpe )
1103 IF (wrf_dm_on_monitor()) THEN
1104 read(92)dumc1(ids:ide ,jds:jde )
1106 DM_BCAST_MACRO(dumc1)
1108 read(92)dumc1(ids:ide ,jds:jde )
1110 grid%emis_ant(ips:ipe ,kps,jps:jpe ,p_e_pm_10)=dumc1(ips:ipe ,jps:jpe )
1113 IF (wrf_dm_on_monitor()) THEN
1114 read(92)dumc1(ids:ide ,jds:jde )
1116 DM_BCAST_MACRO(dumc1)
1118 read(92)dumc1(ids:ide ,jds:jde )
1120 grid%emis_ant(ips:ipe ,kps,jps:jpe ,p_e_oc)=dumc1(ips:ipe ,jps:jpe )
1123 IF (wrf_dm_on_monitor()) THEN
1124 read(92)dumc1(ids:ide ,jds:jde )
1126 DM_BCAST_MACRO(dumc1)
1128 read(92)dumc1(ids:ide ,jds:jde )
1130 grid%emis_ant(ips:ipe ,kps,jps:jpe ,p_e_bc)=dumc1(ips:ipe ,jps:jpe )
1133 IF (wrf_dm_on_monitor()) THEN
1134 read(92)dumc1(ids:ide ,jds:jde )
1136 DM_BCAST_MACRO(dumc1)
1138 read(92)dumc1(ids:ide ,jds:jde )
1140 ! grid%emis_ant(ips:ipe ,kps,jps:jpe ,p_e_dms)=dumc1(ips:ipe ,jps:jpe )
1143 IF (wrf_dm_on_monitor()) THEN
1144 read(92)dumc1(ids:ide ,jds:jde )
1146 DM_BCAST_MACRO(dumc1)
1148 read(92)dumc1(ids:ide ,jds:jde )
1150 grid%emis_ant(ips:ipe ,kps,jps:jpe ,p_e_sulf)=dumc1(ips:ipe ,jps:jpe )
1153 IF (wrf_dm_on_monitor()) THEN
1154 read(92)dumc1(ids:ide ,jds:jde )
1156 DM_BCAST_MACRO(dumc1)
1158 read(92)dumc1(ids:ide ,jds:jde )
1160 ! grid%emis_ant(ips:ipe ,kps,jps:jpe ,p_e_ash)=dumc1(ips:ipe ,jps:jpe )
1164 ! simple file dump here....
1166 write(message,FMT='(A)') ' OPEN EMISSIONS WRF files for emissions coming from global data set'
1167 call wrf_message( TRIM( message ) )
1168 write(message, FMT='(A)') ' NO TIME DEPENDENCE IN THIS DATASET'
1171 ! emissions from retro/edgar/gocart
1173 CALL construct_filename1( inpname , 'wrfchemi' , grid%id , 2 )
1174 CALL open_w_dataset ( id1, TRIM(inpname) , grid , config_flags , output_auxinput5 , "DATASET=AUXINPUT5", ierr )
1176 CALL output_auxinput5 ( id1 , grid , config_flags , ierr )
1178 CALL close_dataset ( id1 , config_flags , "DATASET=AUXOUTPUT5" )
1180 endif ! emiss_opt = ecptec or gocart_ecptec
1182 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
1184 if(config_flags%biomass_burn_opt == biomassb ) then
1186 CALL construct_filename1 ( bdyname2 , 'emissfire' , grid%id , 2 )
1187 write(message, FMT='(A,A)') ' TRY TO OPEN FILE: ',TRIM(bdyname2)
1188 call wrf_message( TRIM( message ) )
1189 CALL wrf_debug( 00 , 'calling fire emissions' )
1192 IF (wrf_dm_on_monitor()) THEN
1193 open (93,file=bdyname2,form='unformatted',status='old')
1196 OPEN(93,FILE=bdyname2,FORM='UNFORMATTED',status='old')
1200 IF (wrf_dm_on_monitor()) THEN
1205 CALL wrf_dm_bcast_bytes ( nv_f , rnum8 )
1206 CALL wrf_dm_bcast_bytes ( dname , rnum8 )
1207 CALL wrf_dm_bcast_bytes ( itime_f , rnum8 )
1213 write(message, FMT='(A,I10)') ' Number of fire emissions: ',nv_f
1214 call wrf_message( TRIM( message ) )
1215 write(message, '(A,I8,A,I8)') ' FIRE EMISSIONS INPUT FILE TIME PERIOD (GMT): ',itime_f-1,' TO ',itime_f
1216 call wrf_message( TRIM( message ) )
1219 IF (wrf_dm_on_monitor()) THEN
1220 read(93)dumc1(ids:ide ,jds:jde )
1222 DM_BCAST_MACRO(dumc1)
1224 read(93)dumc1(ids:ide ,jds:jde )
1227 ! write(*,*) 'MAXVAL2 ',MAXVAL(dumc1(:,:))
1228 ! write(*,*) 'MINVAL2 ',MINVAL(dumc1(:,:))
1230 write(message, FMT='(A)') ' put dumc1 into ebu_in_so2'
1231 call wrf_debug(100, TRIM( message ) )
1232 grid%ebu_in(ips:ipe,1, jps:jpe ,p_ebu_in_so2) =dumc1(ips:ipe ,jps:jpe )
1235 IF (wrf_dm_on_monitor()) THEN
1236 read(93)dumc1(ids:ide ,jds:jde )
1238 DM_BCAST_MACRO(dumc1)
1240 read(93)dumc1(ids:ide ,jds:jde )
1242 grid%ebu_in(ips:ipe,1, jps:jpe ,p_ebu_in_no2) =dumc1(ips:ipe ,jps:jpe )
1245 IF (wrf_dm_on_monitor()) THEN
1246 read(93)dumc1(ids:ide ,jds:jde )
1248 DM_BCAST_MACRO(dumc1)
1250 read(93)dumc1(ids:ide ,jds:jde )
1252 grid%ebu_in(ips:ipe,1, jps:jpe ,p_ebu_in_no) =dumc1(ips:ipe ,jps:jpe )
1255 IF (wrf_dm_on_monitor()) THEN
1256 read(93)dumc1(ids:ide ,jds:jde )
1258 DM_BCAST_MACRO(dumc1)
1260 read(93)dumc1(ids:ide ,jds:jde )
1262 grid%ebu_in(ips:ipe,1, jps:jpe ,p_ebu_in_ald) =dumc1(ips:ipe ,jps:jpe )
1265 IF (wrf_dm_on_monitor()) THEN
1266 read(93)dumc1(ids:ide ,jds:jde )
1268 DM_BCAST_MACRO(dumc1)
1270 read(93)dumc1(ids:ide ,jds:jde )
1272 grid%ebu_in(ips:ipe,1, jps:jpe ,p_ebu_in_hcho) =dumc1(ips:ipe ,jps:jpe )
1275 IF (wrf_dm_on_monitor()) THEN
1276 read(93)dumc1(ids:ide ,jds:jde )
1278 DM_BCAST_MACRO(dumc1)
1280 read(93)dumc1(ids:ide ,jds:jde )
1282 grid%ebu_in(ips:ipe,1, jps:jpe ,p_ebu_in_ora2) =dumc1(ips:ipe ,jps:jpe )
1285 IF (wrf_dm_on_monitor()) THEN
1286 read(93)dumc1(ids:ide ,jds:jde )
1288 DM_BCAST_MACRO(dumc1)
1290 read(93)dumc1(ids:ide ,jds:jde )
1292 ! grid%ebu_in(ips:ipe,1, jps:jpe ,p_ebu_in_nh3) =dumc1(ips:ipe ,jps:jpe )
1295 IF (wrf_dm_on_monitor()) THEN
1296 read(93)dumc1(ids:ide ,jds:jde )
1298 DM_BCAST_MACRO(dumc1)
1300 read(93)dumc1(ids:ide ,jds:jde )
1302 grid%ebu_in(ips:ipe,1, jps:jpe ,p_ebu_in_hc3) =dumc1(ips:ipe ,jps:jpe )
1305 IF (wrf_dm_on_monitor()) THEN
1306 read(93)dumc1(ids:ide ,jds:jde )
1308 DM_BCAST_MACRO(dumc1)
1310 read(93)dumc1(ids:ide ,jds:jde )
1312 grid%ebu_in(ips:ipe,1, jps:jpe ,p_ebu_in_hc5) =dumc1(ips:ipe ,jps:jpe )
1315 IF (wrf_dm_on_monitor()) THEN
1316 read(93)dumc1(ids:ide ,jds:jde )
1318 DM_BCAST_MACRO(dumc1)
1320 read(93)dumc1(ids:ide ,jds:jde )
1322 grid%ebu_in(ips:ipe,1, jps:jpe ,p_ebu_in_hc8) =dumc1(ips:ipe ,jps:jpe )
1325 IF (wrf_dm_on_monitor()) THEN
1326 read(93)dumc1(ids:ide ,jds:jde )
1328 DM_BCAST_MACRO(dumc1)
1330 read(93)dumc1(ids:ide ,jds:jde )
1332 grid%ebu_in(ips:ipe,1, jps:jpe ,p_ebu_in_eth) =dumc1(ips:ipe ,jps:jpe )
1335 IF (wrf_dm_on_monitor()) THEN
1336 read(93)dumc1(ids:ide ,jds:jde )
1338 DM_BCAST_MACRO(dumc1)
1340 read(93)dumc1(ids:ide ,jds:jde )
1342 grid%ebu_in(ips:ipe,1, jps:jpe ,p_ebu_in_co) =dumc1(ips:ipe ,jps:jpe )
1345 IF (wrf_dm_on_monitor()) THEN
1346 read(93)dumc1(ids:ide ,jds:jde )
1348 DM_BCAST_MACRO(dumc1)
1350 read(93)dumc1(ids:ide ,jds:jde )
1352 ! grid%ebu_in(ips:ipe,1, jps:jpe ,p_ebu_in_ol2) =dumc1(ips:ipe ,jps:jpe )
1355 IF (wrf_dm_on_monitor()) THEN
1356 read(93)dumc1(ids:ide ,jds:jde )
1358 DM_BCAST_MACRO(dumc1)
1360 read(93)dumc1(ids:ide ,jds:jde )
1362 grid%ebu_in(ips:ipe,1, jps:jpe ,p_ebu_in_olt) =dumc1(ips:ipe ,jps:jpe )
1365 IF (wrf_dm_on_monitor()) THEN
1366 read(93)dumc1(ids:ide ,jds:jde )
1368 DM_BCAST_MACRO(dumc1)
1370 read(93)dumc1(ids:ide ,jds:jde )
1372 grid%ebu_in(ips:ipe,1, jps:jpe ,p_ebu_in_oli) =dumc1(ips:ipe ,jps:jpe )
1375 IF (wrf_dm_on_monitor()) THEN
1376 read(93)dumc1(ids:ide ,jds:jde )
1378 DM_BCAST_MACRO(dumc1)
1380 read(93)dumc1(ids:ide ,jds:jde )
1382 grid%ebu_in(ips:ipe,1, jps:jpe ,p_ebu_in_tol) =dumc1(ips:ipe ,jps:jpe )
1385 IF (wrf_dm_on_monitor()) THEN
1386 read(93)dumc1(ids:ide ,jds:jde )
1388 DM_BCAST_MACRO(dumc1)
1390 read(93)dumc1(ids:ide ,jds:jde )
1392 grid%ebu_in(ips:ipe,1, jps:jpe ,p_ebu_in_xyl) =dumc1(ips:ipe ,jps:jpe )
1395 IF (wrf_dm_on_monitor()) THEN
1396 read(93)dumc1(ids:ide ,jds:jde )
1398 DM_BCAST_MACRO(dumc1)
1400 read(93)dumc1(ids:ide ,jds:jde )
1402 grid%ebu_in(ips:ipe,1, jps:jpe ,p_ebu_in_ket) =dumc1(ips:ipe ,jps:jpe )
1405 IF (wrf_dm_on_monitor()) THEN
1406 read(93)dumc1(ids:ide ,jds:jde )
1408 DM_BCAST_MACRO(dumc1)
1410 read(93)dumc1(ids:ide ,jds:jde )
1412 grid%ebu_in(ips:ipe,1, jps:jpe ,p_ebu_in_csl) =dumc1(ips:ipe ,jps:jpe )
1415 IF (wrf_dm_on_monitor()) THEN
1416 read(93)dumc1(ids:ide ,jds:jde )
1418 DM_BCAST_MACRO(dumc1)
1420 read(93)dumc1(ids:ide ,jds:jde )
1422 grid%ebu_in(ips:ipe,1, jps:jpe ,p_ebu_in_iso) =dumc1(ips:ipe ,jps:jpe )
1425 IF (wrf_dm_on_monitor()) THEN
1426 read(93)dumc1(ids:ide ,jds:jde )
1428 DM_BCAST_MACRO(dumc1)
1430 read(93)dumc1(ids:ide ,jds:jde )
1432 grid%ebu_in(ips:ipe,1, jps:jpe ,p_ebu_in_pm25) =dumc1(ips:ipe ,jps:jpe )
1435 IF (wrf_dm_on_monitor()) THEN
1436 read(93)dumc1(ids:ide ,jds:jde )
1438 DM_BCAST_MACRO(dumc1)
1440 read(93)dumc1(ids:ide ,jds:jde )
1442 grid%ebu_in(ips:ipe,1, jps:jpe ,p_ebu_in_pm10) =dumc1(ips:ipe ,jps:jpe )
1445 IF (wrf_dm_on_monitor()) THEN
1446 read(93)dumc1(ids:ide ,jds:jde )
1448 DM_BCAST_MACRO(dumc1)
1450 read(93)dumc1(ids:ide ,jds:jde )
1452 grid%ebu_in(ips:ipe,1, jps:jpe ,p_ebu_in_oc) =dumc1(ips:ipe ,jps:jpe )
1455 IF (wrf_dm_on_monitor()) THEN
1456 read(93)dumc1(ids:ide ,jds:jde )
1458 DM_BCAST_MACRO(dumc1)
1460 read(93)dumc1(ids:ide ,jds:jde )
1462 grid%ebu_in(ips:ipe,1, jps:jpe ,p_ebu_in_bc) =dumc1(ips:ipe ,jps:jpe )
1465 IF (wrf_dm_on_monitor()) THEN
1466 read(93)dumc1(ids:ide ,jds:jde )
1468 DM_BCAST_MACRO(dumc1)
1470 read(93)dumc1(ids:ide ,jds:jde )
1472 grid%ebu_in(ips:ipe,1, jps:jpe ,p_ebu_in_dms) =dumc1(ips:ipe ,jps:jpe )
1475 IF (wrf_dm_on_monitor()) THEN
1476 read(93)dumc1(ids:ide ,jds:jde )
1478 DM_BCAST_MACRO(dumc1)
1480 read(93)dumc1(ids:ide ,jds:jde )
1482 grid%ebu_in(ips:ipe,1, jps:jpe ,p_ebu_in_sulf) =dumc1(ips:ipe ,jps:jpe )
1485 IF (wrf_dm_on_monitor()) THEN
1486 read(93)dumc1(ids:ide ,jds:jde )
1488 DM_BCAST_MACRO(dumc1)
1490 read(93)dumc1(ids:ide ,jds:jde )
1492 grid%ebu_in(ips:ipe,1, jps:jpe ,p_ebu_in_ash) =dumc1(ips:ipe ,jps:jpe )
1495 IF (wrf_dm_on_monitor()) THEN
1496 read(93)dumc1(ids:ide ,jds:jde )
1498 DM_BCAST_MACRO(dumc1)
1500 read(93)dumc1(ids:ide ,jds:jde )
1502 grid%mean_fct_agtf(ips:ipe ,jps:jpe )=dumc1(ips:ipe ,jps:jpe )
1504 IF (wrf_dm_on_monitor()) THEN
1505 read(93)dumc1(ids:ide ,jds:jde )
1507 DM_BCAST_MACRO(dumc1)
1509 read(93)dumc1(ids:ide ,jds:jde )
1511 grid%mean_fct_agef(ips:ipe ,jps:jpe )=dumc1(ips:ipe ,jps:jpe )
1513 IF (wrf_dm_on_monitor()) THEN
1514 read(93)dumc1(ids:ide ,jds:jde )
1516 DM_BCAST_MACRO(dumc1)
1518 read(93)dumc1(ids:ide ,jds:jde )
1520 grid%mean_fct_agsv(ips:ipe ,jps:jpe )=dumc1(ips:ipe ,jps:jpe )
1522 IF (wrf_dm_on_monitor()) THEN
1523 read(93)dumc1(ids:ide ,jds:jde )
1525 DM_BCAST_MACRO(dumc1)
1527 read(93)dumc1(ids:ide ,jds:jde )
1529 grid%mean_fct_aggr(ips:ipe ,jps:jpe )=dumc1(ips:ipe ,jps:jpe )
1531 IF (wrf_dm_on_monitor()) THEN
1532 read(93)dumc1(ids:ide ,jds:jde )
1534 DM_BCAST_MACRO(dumc1)
1536 read(93)dumc1(ids:ide ,jds:jde )
1538 grid%firesize_agtf(ips:ipe ,jps:jpe )=dumc1(ips:ipe ,jps:jpe )
1540 IF (wrf_dm_on_monitor()) THEN
1541 read(93)dumc1(ids:ide ,jds:jde )
1543 DM_BCAST_MACRO(dumc1)
1545 read(93)dumc1(ids:ide ,jds:jde )
1547 grid%firesize_agef(ips:ipe ,jps:jpe )=dumc1(ips:ipe ,jps:jpe )
1549 IF (wrf_dm_on_monitor()) THEN
1550 read(93)dumc1(ids:ide ,jds:jde )
1552 DM_BCAST_MACRO(dumc1)
1554 read(93)dumc1(ids:ide ,jds:jde )
1556 grid%firesize_agsv(ips:ipe ,jps:jpe )=dumc1(ips:ipe ,jps:jpe )
1558 IF (wrf_dm_on_monitor()) THEN
1559 read(93)dumc1(ids:ide ,jds:jde )
1561 DM_BCAST_MACRO(dumc1)
1563 read(93)dumc1(ids:ide ,jds:jde )
1565 grid%firesize_aggr(ips:ipe ,jps:jpe )=dumc1(ips:ipe ,jps:jpe )
1571 CALL construct_filename1( inpname , 'wrffirechemi' , grid%id , 2 )
1572 write(message, FMT='(A,A)') ' NOW OPEN FILE FOR WRITE: ',TRIM(inpname)
1573 call wrf_message( TRIM( message ) )
1575 CALL open_w_dataset ( id1, TRIM(inpname) , grid , config_flags , output_auxinput7 , "DATASET=AUXINPUT7", ierr )
1576 write(message,FMT='(A,A)') ' FIRE EMISSIONS OUTPUT file name: ',TRIM(inpname)
1577 CALL wrf_message ( message )
1578 IF ( ierr .NE. 0 ) THEN
1579 write(message, FMT='(A,I10)') ' convert_emiss: error opening wrfchem fire emissions file for writing',ierr
1580 CALL wrf_error_fatal( TRIM( message ) )
1583 CALL output_auxinput7 ( id1 , grid , config_flags , ierr )
1585 CALL close_dataset ( id1 , config_flags , "DATASET=AUXOUTPUT7" )
1589 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
1590 ! NOW DO BIG TIMEDEPENDENT EMISSIONS FILE
1592 if(CONFIG_FLAGS%EMISS_OPT == ECBMZ_MOSAIC ) then
1593 write(message, FMT='(A,I10)') ' convert_emiss: error: conversion for all CBMZ emission arrays not available '
1594 CALL wrf_error_fatal( TRIM( message ) )
1596 if(CONFIG_FLAGS%EMISS_OPT == ERADM .or. CONFIG_FLAGS%EMISS_OPT == ERADMSORG .or. &
1597 CONFIG_FLAGS%EMISS_OPT == MOZEM .or. CONFIG_FLAGS%EMISS_OPT == MOZCEM .or. &
1598 CONFIG_FLAGS%EMISS_OPT == ECBMZ_MOSAIC ) then
1599 ! Figure out our loop count for the processing times.
1601 IF (wrf_dm_on_monitor()) THEN
1605 write(message,FMT='(A,I4,A,A)') 'Time period #',time_loop,' to process = ',start_date_char
1606 CALL wrf_message ( message )
1607 current_date_char = start_date_char
1609 CALL geth_newdate ( next_date_char , current_date_char , int_sec )
1610 IF ( next_date_char .LT. end_date_char ) THEN
1611 time_loop = time_loop + 1
1612 write(message,FMT='(A,I4,A,A)') 'Time period #',time_loop,' to process = ',next_date_char
1613 CALL wrf_message ( message )
1614 current_date_char = next_date_char
1615 ELSE IF ( next_date_char .EQ. end_date_char ) THEN
1616 time_loop = time_loop + 1
1617 write(message,FMT='(A,I4,A,A)') 'Time period #',time_loop,' to process = ',next_date_char
1618 CALL wrf_message ( message )
1619 write(message,FMT='(A,I4)') 'Total analysis times to input = ',time_loop
1620 CALL wrf_message ( message )
1621 time_loop_max = time_loop
1623 ELSE IF ( next_date_char .GT. end_date_char ) THEN
1624 write(message,FMT='(A,I4)') 'Total analysis times to input = ',time_loop
1625 CALL wrf_message ( message )
1626 time_loop_max = time_loop
1627 time_loop_max = time_loop
1631 write(message,FMT='(A,I4,A,I4)') 'Total number of times to input = ',time_loop,' ',time_loop_max
1632 CALL wrf_message ( message )
1635 CALL wrf_dm_bcast_bytes ( time_loop , rnum8 )
1636 CALL wrf_dm_bcast_bytes ( time_loop_max , rnum8 )
1639 ! Here we define the initial time to process, for later use by the code.
1641 current_date_char = start_date_char
1642 start_date = start_date_char // '.0000'
1643 current_date = start_date
1646 CALL wrf_dm_bcast_bytes ( start_hour , rnum8 )
1650 write(message,FMT='(A)') ' READ EMISSIONS 1'
1651 CALL wrf_debug ( 100, message )
1654 if(start_hour.eq.0)CALL construct_filename1 ( bdyname , 'wrfem_00to12z' , grid%id , 2 )
1655 if(start_hour.eq.12)CALL construct_filename1 ( bdyname , 'wrfem_12to24z' , grid%id , 2 )
1658 IF (wrf_dm_on_monitor()) THEN
1659 open (91,file=bdyname,form='unformatted',status='old')
1661 write(*,*) TRIM( bdyname )
1664 ! write(message, FMT='(A,A)') ' OPEN FILE: ',bdyname
1665 ! call wrf_message( TRIM( message ) )
1666 open (91,file=bdyname,form='unformatted',status='old')
1669 ! write(message, FMT='(A,A)') ' OPENED FILE: ',bdyname
1670 ! call wrf_message( TRIM( message ) )
1672 IF (wrf_dm_on_monitor()) THEN
1677 CALL wrf_dm_bcast_bytes ( nv , rnum8 )
1678 CALL wrf_dm_bcast_bytes ( dname , rnum8 )
1679 CALL wrf_dm_bcast_bytes ( itime , rnum8 )
1685 write(message, FMT='(A,I10)') ' Number of emissions: ',nv
1686 call wrf_message( TRIM( message ) )
1687 write(message, '(A,I8,A,I8)') ' EMISSIONS INPUT FILE TIME PERIOD (GMT): ',itime-1,' TO ',itime
1688 call wrf_message( TRIM( message ) )
1691 IF (wrf_dm_on_monitor()) THEN
1692 write(message, FMT='(A)') ' read dumc0 '
1693 call wrf_debug(100, TRIM( message ) )
1694 read(91)dumc0(ids:ide-1,kds:grid%kemit,jds:jde-1)
1696 DM_BCAST_MACRO(dumc0)
1698 read(91)dumc0(ids:ide-1,kds:grid%kemit,jds:jde-1)
1700 write(message, FMT='(A)') ' write dumc0 to emiss_ant'
1701 call wrf_debug(100, TRIM( message ) )
1702 write(message, FMT='(A,3I10)') ' dims:',ips ,kps,jps
1703 call wrf_message( TRIM( message ) )
1704 write(message, FMT='(A,4I10)') ' dims:',ipe-1,kpe,jpe-1,grid%kemit
1705 call wrf_message( TRIM( message ) )
1706 write(message, FMT='(A,3I10)') ' dims:',ids ,kds,jds
1707 call wrf_message( TRIM( message ) )
1708 write(message, FMT='(A,4I10)') ' dims:',ide-1,kde,jde-1
1709 call wrf_message( TRIM( message ) )
1710 write(message, FMT='(A,5I10)') ' dims:',size(grid%emis_ant,1),size(grid%emis_ant,2),size(grid%emis_ant,3),size(grid%emis_ant,4),p_e_so2
1711 call wrf_message( TRIM( message ) )
1712 write(message, FMT='(A,5I10)') ' dims:',size(dumc0,1),size(dumc0,2),size(dumc0,3)
1713 call wrf_message( TRIM( message ) )
1714 ! write(*,*) dumc0(ids:ide-1,1,7)
1715 grid%emis_ant(ips:ipe ,kps:grid%kemit,jps:jpe ,p_e_so2)=dumc0(ips:ipe ,kps:grid%kemit,jps:jpe )
1716 ! write(*,*) grid%emis_ant(ips:ipe-1,1,7,p_e_so2)
1718 IF (wrf_dm_on_monitor()) THEN
1719 read(91)dumc0(ids:ide-1,kds:grid%kemit,jds:jde-1)
1721 DM_BCAST_MACRO(dumc0)
1724 read(91)dumc0(ids:ide-1,kds:grid%kemit,jds:jde-1)
1726 grid%emis_ant(ips:ipe ,kps:grid%kemit,jps:jpe ,p_e_no)=dumc0(ips:ipe ,kps:grid%kemit,jps:jpe )
1728 IF (inew_nei .eq. 1) THEN
1730 IF (wrf_dm_on_monitor()) THEN
1731 read(91)dumc0(ids:ide-1,kds:grid%kemit,jds:jde-1)
1733 DM_BCAST_MACRO(dumc0)
1736 read(91)dumc0(ids:ide-1,kds:grid%kemit,jds:jde-1)
1738 grid%emis_ant(ips:ipe ,kps:grid%kemit,jps:jpe ,p_e_no2)=dumc0(ips:ipe ,kps:grid%kemit,jps:jpe )
1742 IF (wrf_dm_on_monitor()) THEN
1743 read(91)dumc0(ids:ide-1,kds:grid%kemit,jds:jde-1)
1745 DM_BCAST_MACRO(dumc0)
1747 read(91)dumc0(ids:ide-1,kds:grid%kemit,jds:jde-1)
1749 grid%emis_ant(ips:ipe ,kps:grid%kemit,jps:jpe ,p_e_ald)=dumc0(ips:ipe ,kps:grid%kemit,jps:jpe )
1751 IF (wrf_dm_on_monitor()) THEN
1752 read(91)dumc0(ids:ide-1,kds:grid%kemit,jds:jde-1)
1754 DM_BCAST_MACRO(dumc0)
1756 read(91)dumc0(ids:ide-1,kds:grid%kemit,jds:jde-1)
1758 grid%emis_ant(ips:ipe ,kps:grid%kemit,jps:jpe ,p_e_hcho)=dumc0(ips:ipe ,kps:grid%kemit,jps:jpe )
1760 IF (wrf_dm_on_monitor()) THEN
1761 read(91)dumc0(ids:ide-1,kds:grid%kemit,jds:jde-1)
1763 DM_BCAST_MACRO(dumc0)
1765 read(91)dumc0(ids:ide-1,kds:grid%kemit,jds:jde-1)
1767 grid%emis_ant(ips:ipe ,kps:grid%kemit,jps:jpe ,p_e_ora2)=dumc0(ips:ipe ,kps:grid%kemit,jps:jpe )
1769 IF (wrf_dm_on_monitor()) THEN
1770 read(91)dumc0(ids:ide-1,kds:grid%kemit,jds:jde-1)
1772 DM_BCAST_MACRO(dumc0)
1774 read(91)dumc0(ids:ide-1,kds:grid%kemit,jds:jde-1)
1776 grid%emis_ant(ips:ipe ,kps:grid%kemit,jps:jpe ,p_e_nh3)=dumc0(ips:ipe ,kps:grid%kemit,jps:jpe )
1778 IF (wrf_dm_on_monitor()) THEN
1779 read(91)dumc0(ids:ide-1,kds:grid%kemit,jds:jde-1)
1781 DM_BCAST_MACRO(dumc0)
1783 read(91)dumc0(ids:ide-1,kds:grid%kemit,jds:jde-1)
1785 grid%emis_ant(ips:ipe ,kps:grid%kemit,jps:jpe ,p_e_hc3)=dumc0(ips:ipe ,kps:grid%kemit,jps:jpe )
1787 IF (wrf_dm_on_monitor()) THEN
1788 read(91)dumc0(ids:ide-1,kds:grid%kemit,jds:jde-1)
1790 DM_BCAST_MACRO(dumc0)
1792 read(91)dumc0(ids:ide-1,kds:grid%kemit,jds:jde-1)
1794 grid%emis_ant(ips:ipe ,kps:grid%kemit,jps:jpe ,p_e_hc5)=dumc0(ips:ipe ,kps:grid%kemit,jps:jpe )
1796 IF (wrf_dm_on_monitor()) THEN
1797 read(91)dumc0(ids:ide-1,kds:grid%kemit,jds:jde-1)
1799 DM_BCAST_MACRO(dumc0)
1801 read(91)dumc0(ids:ide-1,kds:grid%kemit,jds:jde-1)
1803 grid%emis_ant(ips:ipe ,kps:grid%kemit,jps:jpe ,p_e_hc8)=dumc0(ips:ipe ,kps:grid%kemit,jps:jpe )
1805 IF (wrf_dm_on_monitor()) THEN
1806 read(91)dumc0(ids:ide-1,kds:grid%kemit,jds:jde-1)
1808 DM_BCAST_MACRO(dumc0)
1810 read(91)dumc0(ids:ide-1,kds:grid%kemit,jds:jde-1)
1812 grid%emis_ant(ips:ipe ,kps:grid%kemit,jps:jpe ,p_e_eth)=dumc0(ips:ipe ,kps:grid%kemit,jps:jpe )
1814 IF (wrf_dm_on_monitor()) THEN
1815 read(91)dumc0(ids:ide-1,kds:grid%kemit,jds:jde-1)
1817 DM_BCAST_MACRO(dumc0)
1819 read(91)dumc0(ids:ide-1,kds:grid%kemit,jds:jde-1)
1821 grid%emis_ant(ips:ipe ,kps:grid%kemit,jps:jpe ,p_e_co)=dumc0(ips:ipe ,kps:grid%kemit,jps:jpe )
1823 IF (wrf_dm_on_monitor()) THEN
1824 read(91)dumc0(ids:ide-1,kds:grid%kemit,jds:jde-1)
1826 DM_BCAST_MACRO(dumc0)
1828 read(91)dumc0(ids:ide-1,kds:grid%kemit,jds:jde-1)
1830 grid%emis_ant(ips:ipe ,kps:grid%kemit,jps:jpe ,p_e_ol2)=dumc0(ips:ipe ,kps:grid%kemit,jps:jpe )
1832 IF (wrf_dm_on_monitor()) THEN
1833 read(91)dumc0(ids:ide-1,kds:grid%kemit,jds:jde-1)
1835 DM_BCAST_MACRO(dumc0)
1837 read(91)dumc0(ids:ide-1,kds:grid%kemit,jds:jde-1)
1839 grid%emis_ant(ips:ipe ,kps:grid%kemit,jps:jpe ,p_e_olt)=dumc0(ips:ipe ,kps:grid%kemit,jps:jpe )
1841 IF (wrf_dm_on_monitor()) THEN
1842 read(91)dumc0(ids:ide-1,kds:grid%kemit,jds:jde-1)
1844 DM_BCAST_MACRO(dumc0)
1846 read(91)dumc0(ids:ide-1,kds:grid%kemit,jds:jde-1)
1848 grid%emis_ant(ips:ipe ,kps:grid%kemit,jps:jpe ,p_e_oli)=dumc0(ips:ipe ,kps:grid%kemit,jps:jpe )
1850 IF (wrf_dm_on_monitor()) THEN
1851 read(91)dumc0(ids:ide-1,kds:grid%kemit,jds:jde-1)
1853 DM_BCAST_MACRO(dumc0)
1855 read(91)dumc0(ids:ide-1,kds:grid%kemit,jds:jde-1)
1857 grid%emis_ant(ips:ipe ,kps:grid%kemit,jps:jpe ,p_e_tol)=dumc0(ips:ipe ,kps:grid%kemit,jps:jpe )
1859 IF (wrf_dm_on_monitor()) THEN
1860 read(91)dumc0(ids:ide-1,kds:grid%kemit,jds:jde-1)
1862 DM_BCAST_MACRO(dumc0)
1864 read(91)dumc0(ids:ide-1,kds:grid%kemit,jds:jde-1)
1866 grid%emis_ant(ips:ipe ,kps:grid%kemit,jps:jpe ,p_e_xyl)=dumc0(ips:ipe ,kps:grid%kemit,jps:jpe )
1868 IF (wrf_dm_on_monitor()) THEN
1869 read(91)dumc0(ids:ide-1,kds:grid%kemit,jds:jde-1)
1871 DM_BCAST_MACRO(dumc0)
1873 read(91)dumc0(ids:ide-1,kds:grid%kemit,jds:jde-1)
1875 grid%emis_ant(ips:ipe ,kps:grid%kemit,jps:jpe ,p_e_ket)=dumc0(ips:ipe ,kps:grid%kemit,jps:jpe )
1877 IF (wrf_dm_on_monitor()) THEN
1878 read(91)dumc0(ids:ide-1,kds:grid%kemit,jds:jde-1)
1880 DM_BCAST_MACRO(dumc0)
1882 read(91)dumc0(ids:ide-1,kds:grid%kemit,jds:jde-1)
1884 grid%emis_ant(ips:ipe ,kps:grid%kemit,jps:jpe ,p_e_csl)=dumc0(ips:ipe ,kps:grid%kemit,jps:jpe )
1886 IF (wrf_dm_on_monitor()) THEN
1887 read(91)dumc0(ids:ide-1,kds:grid%kemit,jds:jde-1)
1889 DM_BCAST_MACRO(dumc0)
1891 read(91)dumc0(ids:ide-1,kds:grid%kemit,jds:jde-1)
1893 grid%emis_ant(ips:ipe ,kps:grid%kemit,jps:jpe ,p_e_iso)=dumc0(ips:ipe ,kps:grid%kemit,jps:jpe )
1894 IF( inew_ch4 == 1 ) THEN
1896 IF (wrf_dm_on_monitor()) THEN
1897 read(91)dumc0(ids:ide-1,kds:grid%kemit,jds:jde-1)
1899 DM_BCAST_MACRO(dumc0)
1901 read(91)dumc0(ids:ide-1,kds:grid%kemit,jds:jde-1)
1903 grid%emis_ant(ips:ipe ,kps:grid%kemit,jps:jpe ,p_e_ch4)=dumc0(ips:ipe ,kps:grid%kemit,jps:jpe )
1906 IF (wrf_dm_on_monitor()) THEN
1907 read(91)dumc0(ids:ide-1,kds:grid%kemit,jds:jde-1)
1909 DM_BCAST_MACRO(dumc0)
1911 read(91)dumc0(ids:ide-1,kds:grid%kemit,jds:jde-1)
1913 grid%emis_ant(ips:ipe ,kps:grid%kemit,jps:jpe ,p_e_pm25i)=dumc0(ips:ipe ,kps:grid%kemit,jps:jpe )
1915 IF (wrf_dm_on_monitor()) THEN
1916 read(91)dumc0(ids:ide-1,kds:grid%kemit,jds:jde-1)
1918 DM_BCAST_MACRO(dumc0)
1920 read(91)dumc0(ids:ide-1,kds:grid%kemit,jds:jde-1)
1922 grid%emis_ant(ips:ipe ,kps:grid%kemit,jps:jpe ,p_e_pm25j)=dumc0(ips:ipe ,kps:grid%kemit,jps:jpe )
1924 IF (wrf_dm_on_monitor()) THEN
1925 read(91)dumc0(ids:ide-1,kds:grid%kemit,jds:jde-1)
1927 DM_BCAST_MACRO(dumc0)
1929 read(91)dumc0(ids:ide-1,kds:grid%kemit,jds:jde-1)
1931 grid%emis_ant(ips:ipe ,kps:grid%kemit,jps:jpe ,p_e_so4i)=dumc0(ips:ipe ,kps:grid%kemit,jps:jpe )
1933 IF (wrf_dm_on_monitor()) THEN
1934 read(91)dumc0(ids:ide-1,kds:grid%kemit,jds:jde-1)
1936 DM_BCAST_MACRO(dumc0)
1938 read(91)dumc0(ids:ide-1,kds:grid%kemit,jds:jde-1)
1940 grid%emis_ant(ips:ipe ,kps:grid%kemit,jps:jpe ,p_e_so4j)=dumc0(ips:ipe ,kps:grid%kemit,jps:jpe )
1942 IF (wrf_dm_on_monitor()) THEN
1943 read(91)dumc0(ids:ide-1,kds:grid%kemit,jds:jde-1)
1945 DM_BCAST_MACRO(dumc0)
1947 read(91)dumc0(ids:ide-1,kds:grid%kemit,jds:jde-1)
1949 grid%emis_ant(ips:ipe ,kps:grid%kemit,jps:jpe ,p_e_no3i)=dumc0(ips:ipe ,kps:grid%kemit,jps:jpe )
1951 IF (wrf_dm_on_monitor()) THEN
1952 read(91)dumc0(ids:ide-1,kds:grid%kemit,jds:jde-1)
1954 DM_BCAST_MACRO(dumc0)
1956 read(91)dumc0(ids:ide-1,kds:grid%kemit,jds:jde-1)
1958 grid%emis_ant(ips:ipe ,kps:grid%kemit,jps:jpe ,p_e_no3j)=dumc0(ips:ipe ,kps:grid%kemit,jps:jpe )
1960 IF (inew_nei .eq. 1) THEN
1961 !! naai and naaj for aqmeii
1963 IF (wrf_dm_on_monitor()) THEN
1964 read(91)dumc0(ids:ide-1,kds:grid%kemit,jds:jde-1)
1966 DM_BCAST_MACRO(dumc0)
1968 read(91)dumc0(ids:ide-1,kds:grid%kemit,jds:jde-1)
1970 grid%emis_ant(ips:ipe ,kps:grid%kemit,jps:jpe ,p_e_naai)=dumc0(ips:ipe ,kps:grid%kemit,jps:jpe )
1972 IF (wrf_dm_on_monitor()) THEN
1973 read(91)dumc0(ids:ide-1,kds:grid%kemit,jds:jde-1)
1975 DM_BCAST_MACRO(dumc0)
1977 read(91)dumc0(ids:ide-1,kds:grid%kemit,jds:jde-1)
1979 grid%emis_ant(ips:ipe ,kps:grid%kemit,jps:jpe ,p_e_naaj)=dumc0(ips:ipe ,kps:grid%kemit,jps:jpe )
1983 IF (wrf_dm_on_monitor()) THEN
1984 read(91)dumc0(ids:ide-1,kds:grid%kemit,jds:jde-1)
1986 DM_BCAST_MACRO(dumc0)
1988 read(91)dumc0(ids:ide-1,kds:grid%kemit,jds:jde-1)
1990 grid%emis_ant(ips:ipe ,kps:grid%kemit,jps:jpe ,p_e_orgi)=dumc0(ips:ipe ,kps:grid%kemit,jps:jpe )
1992 IF (wrf_dm_on_monitor()) THEN
1993 read(91)dumc0(ids:ide-1,kds:grid%kemit,jds:jde-1)
1995 DM_BCAST_MACRO(dumc0)
1997 read(91)dumc0(ids:ide-1,kds:grid%kemit,jds:jde-1)
1999 grid%emis_ant(ips:ipe ,kps:grid%kemit,jps:jpe ,p_e_orgj)=dumc0(ips:ipe ,kps:grid%kemit,jps:jpe )
2001 IF (wrf_dm_on_monitor()) THEN
2002 read(91)dumc0(ids:ide-1,kds:grid%kemit,jds:jde-1)
2004 DM_BCAST_MACRO(dumc0)
2006 read(91)dumc0(ids:ide-1,kds:grid%kemit,jds:jde-1)
2008 grid%emis_ant(ips:ipe ,kps:grid%kemit,jps:jpe ,p_e_eci)=dumc0(ips:ipe ,kps:grid%kemit,jps:jpe )
2010 IF (wrf_dm_on_monitor()) THEN
2011 read(91)dumc0(ids:ide-1,kds:grid%kemit,jds:jde-1)
2013 DM_BCAST_MACRO(dumc0)
2015 read(91)dumc0(ids:ide-1,kds:grid%kemit,jds:jde-1)
2017 grid%emis_ant(ips:ipe ,kps:grid%kemit,jps:jpe ,p_e_ecj)=dumc0(ips:ipe ,kps:grid%kemit,jps:jpe )
2019 IF (wrf_dm_on_monitor()) THEN
2020 read(91)dumc0(ids:ide-1,kds:grid%kemit,jds:jde-1)
2022 DM_BCAST_MACRO(dumc0)
2024 read(91)dumc0(ids:ide-1,kds:grid%kemit,jds:jde-1)
2026 grid%emis_ant(ips:ipe ,kps:grid%kemit,jps:jpe ,p_e_pm_10)=dumc0(ips:ipe ,kps:grid%kemit,jps:jpe )
2028 !liqy-add cl emission
2030 IF (wrf_dm_on_monitor()) THEN
2031 read(91)dumc0(ids:ide-1,kds:grid%kemit,jds:jde-1)
2033 DM_BCAST_MACRO(dumc0)
2035 read(91)dumc0(ids:ide-1,kds:grid%kemit,jds:jde-1)
2037 grid%emis_ant(ips:ipe ,kps:grid%kemit,jps:jpe,p_e_hcl)=dumc0(ips:ipe ,kps:grid%kemit,jps:jpe )
2040 IF (wrf_dm_on_monitor()) THEN
2041 read(91)dumc0(ids:ide-1,kds:grid%kemit,jds:jde-1)
2043 DM_BCAST_MACRO(dumc0)
2045 read(91)dumc0(ids:ide-1,kds:grid%kemit,jds:jde-1)
2047 grid%emis_ant(ips:ipe ,kps:grid%kemit,jps:jpe,p_e_ch3cl)=dumc0(ips:ipe ,kps:grid%kemit,jps:jpe )
2050 IF (wrf_dm_on_monitor()) THEN
2051 read(91)dumc0(ids:ide-1,kds:grid%kemit,jds:jde-1)
2053 DM_BCAST_MACRO(dumc0)
2055 read(91)dumc0(ids:ide-1,kds:grid%kemit,jds:jde-1)
2057 grid%emis_ant(ips:ipe ,kps:grid%kemit,jps:jpe,p_e_cli)=dumc0(ips:ipe ,kps:grid%kemit,jps:jpe )
2060 IF (wrf_dm_on_monitor()) THEN
2061 read(91)dumc0(ids:ide-1,kds:grid%kemit,jds:jde-1)
2063 DM_BCAST_MACRO(dumc0)
2065 read(91)dumc0(ids:ide-1,kds:grid%kemit,jds:jde-1)
2067 grid%emis_ant(ips:ipe ,kps:grid%kemit,jps:jpe,p_e_clj)=dumc0(ips:ipe ,kps:grid%kemit,jps:jpe )
2069 write(message,FMT='(A)') ' PAST READ EMISSIONS 1'
2070 CALL wrf_message ( message )
2072 ! grid%input_from_file = .false.
2074 if (config_flags%io_style_emissions.eq.1)then
2075 write(eminame,FMT='(A9,i2.2,a1)') 'wrfchemi_',ihour,'z'
2076 CALL construct_filename1 ( inpname ,TRIM(eminame), grid%id , 2 )
2078 CALL construct_filename1( inpname , 'wrfchemi' , grid%id , 2 )
2081 write(message,FMT='(A,A,I10)') ' OPEN FILE ',TRIM(inpname),config_flags%io_form_auxinput5
2082 CALL wrf_debug ( 100, message )
2083 CALL open_w_dataset ( id1, TRIM(inpname) , grid , config_flags , output_auxinput5 , "DATASET=AUXINPUT5", ierr )
2084 write(message,FMT='(A,A)') ' EMISSIONS OUTPUT file name: ',TRIM(inpname)
2085 CALL wrf_message ( message )
2086 IF ( ierr .NE. 0 ) THEN
2087 CALL wrf_error_fatal( 'convert_emiss: error opening wrfchem emissions file for writing' )
2090 CALL calc_current_date ( grid%id , 0. )
2091 CALL geth_newdate ( current_date_char, current_date, 3600 )
2092 current_date = current_date_char // '.0000'
2093 if( stand_lon == 0. ) then
2097 if( moad_cen_lat == 0. ) then
2098 moad_cen_lat = cen_lat
2101 write(message,FMT='(A)') ' WRITE EMISSIONS 1'
2102 CALL wrf_message ( message )
2103 CALL output_auxinput5 ( id1 , grid , config_flags, ierr )
2105 CALL wrf_dm_bcast_bytes ( time_loop , rnum8 )
2106 nemi_frames = time_loop
2108 write(message,FMT='(A,4I10)') 'FRAMES: ',int(nemi_frames),time_loop
2109 CALL wrf_message ( message )
2110 current_date_char = start_date_char
2111 current_date = current_date_char
2112 ! if( debug_level >= -100) print *,'NEMI_FRAMES ', nemi_frames,time_loop
2114 ! DO emi_frame = 2,1
2115 DO emi_frame = 2,nemi_frames
2116 write(message,FMT='(A,4I10)') 'LOOP: ',emi_frame,nemi_frames
2117 CALL wrf_message ( message )
2119 IF (wrf_dm_on_monitor()) THEN
2120 write(message,FMT='(A,I4)') 'emi_frame: ',emi_frame
2121 CALL wrf_debug ( 100, message )
2122 CALL domain_clock_get ( grid, current_timestr=timestr )
2123 write(message,FMT='(A,A)') ' Current time ',Trim(timestr)
2124 CALL wrf_debug ( 100, message )
2126 current_date_char = current_date(1:19)
2127 CALL geth_newdate ( next_date_char, current_date_char, int(int_sec) )
2128 current_date = next_date_char // '.0000'
2130 write(message,FMT='(A,A)') ' Date & time ',Trim(current_date)
2131 CALL wrf_message ( message )
2132 CALL domain_clockadvance( grid )
2134 write(message,FMT='(A,I4)') ' Read emissions ',emi_frame
2135 CALL wrf_debug ( 100, message )
2136 write(message,FMT='(A,I4)') ' Hour ',ihour
2137 CALL wrf_message ( message )
2138 ihour = mod(ihour + 1,24)
2140 ! Allow writing of both 12h files with 1 submission when io_style_emissions=1 (2 12h files)
2141 if(ihour.eq.0 .or. ihour.eq.12)then
2142 ! Read from next binary emissions file
2145 CALL construct_filename1 ( bdyname , 'wrfem_00to12z' , grid%id , 2 )
2146 elseif(ihour.eq.12) then
2147 CALL construct_filename1 ( bdyname , 'wrfem_12to24z' , grid%id , 2 )
2149 open (91,file=bdyname,form='unformatted')
2150 !Write a 2nd netcdf emiss file?
2151 if (config_flags%io_style_emissions .eq.1) then
2152 CALL close_dataset ( id1 , config_flags , "DATASET=AUXOUTPUT5" )
2153 write(eminame,FMT='(A9,i2.2,a1)') 'wrfchemi_',ihour,'z'
2154 CALL construct_filename1 ( inpname ,TRIM(eminame), grid%id , 2 )
2155 write(message,FMT='(A,A,I10)') ' OPEN FILE ',TRIM(inpname),config_flags%io_form_auxinput5
2156 CALL wrf_debug ( 0, message )
2157 CALL open_w_dataset ( id1, TRIM(inpname) , grid , config_flags , output_auxinput5 , "DATASET=AUXINPUT5", ierr )
2158 write(message,FMT='(A,A)') ' EMISSIONS OUTPUT file name: ',TRIM(inpname)
2159 CALL wrf_message ( message )
2160 IF ( ierr .NE. 0 ) THEN
2161 CALL wrf_error_fatal( 'Error opening wrfchem emissions file for writing' )
2167 CALL wrf_dm_bcast_bytes ( ihour , rnum8 )
2168 ! CALL wrf_dm_bcast_bytes ( bdyname , rnum8 )
2170 write(message,FMT='(A,I4)') 'emi_frame: ',emi_frame
2171 CALL wrf_debug ( 100, message )
2172 CALL domain_clock_get ( grid, current_timestr=timestr )
2173 write(message,FMT='(A,A)') ' Current time ',Trim(timestr)
2174 CALL wrf_debug ( 100, message )
2176 current_date_char = current_date(1:19)
2177 CALL geth_newdate ( next_date_char, current_date_char, int(int_sec) )
2178 current_date = next_date_char // '.0000'
2180 write(message,FMT='(A,A)') ' Date & time ',Trim(current_date)
2181 CALL wrf_message ( message )
2182 CALL domain_clockadvance( grid )
2183 write(message,FMT='(A,I4)') ' Read emissions ',emi_frame
2184 CALL wrf_debug ( 100, message )
2185 ihour = mod(ihour + 1,24)
2188 CALL construct_filename1 ( bdyname , 'wrfem_00to12z' , grid%id , 2 )
2189 open (91,file=bdyname,form='unformatted')
2191 if(ihour.eq.12) then
2193 CALL construct_filename1 ( bdyname , 'wrfem_12to24z' , grid%id , 2 )
2194 open (91,file=bdyname,form='unformatted')
2196 ! Allow writing of both 12h files with 1 submission when io_style_emissions=1 (2 12h files)
2197 if(ihour.eq.0 .or. ihour.eq.12)then
2198 ! Read from next emissions file
2201 CALL construct_filename1 ( bdyname , 'wrfem_00to12z' , grid%id , 2 )
2202 elseif(ihour.eq.12) then
2203 CALL construct_filename1 ( bdyname , 'wrfem_12to24z' , grid%id , 2 )
2205 open (91,file=bdyname,form='unformatted')
2206 !Write a 2nd netcdf emiss file?
2207 if (config_flags%io_style_emissions .eq.1) then
2208 CALL close_dataset ( id1 , config_flags , "DATASET=AUXOUTPUT5" )
2209 write(message,FMT='(A)') ' CLOSED FIRST FILE, OPENING SECOND FILE'
2210 CALL wrf_message ( message )
2211 write(eminame,FMT='(A9,i2.2,a1)') 'wrfchemi_',ihour,'z'
2212 CALL construct_filename1 ( inpname , TRIM(eminame) , grid%id , 2 )
2213 write(message,FMT='(A,A,I10)') ' OPEN FILE ',TRIM(inpname),config_flags%io_form_auxinput5
2214 CALL wrf_debug ( 0, message )
2215 CALL open_w_dataset ( id1, TRIM(inpname) , grid , config_flags , output_auxinput5 , "DATASET=AUXINPUT5", ierr )
2216 write(message,FMT='(A,A)') ' EMISSIONS OUTPUT file name: ',TRIM(inpname)
2217 CALL wrf_message ( message )
2218 IF ( ierr .NE. 0 ) THEN
2219 CALL wrf_error_fatal( 'Error opening wrfchem emissions file for writing' )
2225 write(message, '(A,A,I10)') ' USING FILE: ',TRIM(bdyname),ihour
2226 call wrf_message( TRIM( message ) )
2228 if(ihour.eq.0.or.ihour.eq.12)then
2230 IF (wrf_dm_on_monitor()) THEN
2234 CALL wrf_dm_bcast_bytes ( nv , rnum8 )
2235 CALL wrf_dm_bcast_bytes ( dname , rnum8 )
2240 write(message, '(A,I10)') ' Reading FILE header: ',nv
2241 call wrf_message( TRIM( message ) )
2246 IF (wrf_dm_on_monitor()) THEN
2249 CALL wrf_dm_bcast_bytes ( itime , rnum8 )
2254 write(message, '(A,I10)') ' Reading data from file: ',itime
2255 call wrf_message( TRIM( message ) )
2258 IF (wrf_dm_on_monitor()) THEN
2259 read(91)dumc0(ids:ide-1,kds:grid%kemit,jds:jde-1)
2261 DM_BCAST_MACRO(dumc0)
2263 read(91)dumc0(ids:ide-1,kds:grid%kemit,jds:jde-1)
2265 grid%emis_ant(ips:ipe ,kps:grid%kemit,jps:jpe ,p_e_so2)=dumc0(ips:ipe ,kps:grid%kemit,jps:jpe )
2268 IF (wrf_dm_on_monitor()) THEN
2269 read(91)dumc0(ids:ide-1,kds:grid%kemit,jds:jde-1)
2271 DM_BCAST_MACRO(dumc0)
2274 read(91)dumc0(ids:ide-1,kds:grid%kemit,jds:jde-1)
2276 grid%emis_ant(ips:ipe ,kps:grid%kemit,jps:jpe ,p_e_no)=dumc0(ips:ipe ,kps:grid%kemit,jps:jpe )
2278 IF (inew_nei .eq. 1) THEN
2280 IF (wrf_dm_on_monitor()) THEN
2281 read(91)dumc0(ids:ide-1,kds:grid%kemit,jds:jde-1)
2283 DM_BCAST_MACRO(dumc0)
2286 read(91)dumc0(ids:ide-1,kds:grid%kemit,jds:jde-1)
2288 grid%emis_ant(ips:ipe ,kps:grid%kemit,jps:jpe ,p_e_no2)=dumc0(ips:ipe ,kps:grid%kemit,jps:jpe )
2292 IF (wrf_dm_on_monitor()) THEN
2293 read(91)dumc0(ids:ide-1,kds:grid%kemit,jds:jde-1)
2295 DM_BCAST_MACRO(dumc0)
2297 read(91)dumc0(ids:ide-1,kds:grid%kemit,jds:jde-1)
2299 grid%emis_ant(ips:ipe ,kps:grid%kemit,jps:jpe ,p_e_ald)=dumc0(ips:ipe ,kps:grid%kemit,jps:jpe )
2301 IF (wrf_dm_on_monitor()) THEN
2302 read(91)dumc0(ids:ide-1,kds:grid%kemit,jds:jde-1)
2304 DM_BCAST_MACRO(dumc0)
2306 read(91)dumc0(ids:ide-1,kds:grid%kemit,jds:jde-1)
2308 grid%emis_ant(ips:ipe ,kps:grid%kemit,jps:jpe ,p_e_hcho)=dumc0(ips:ipe ,kps:grid%kemit,jps:jpe )
2310 IF (wrf_dm_on_monitor()) THEN
2311 read(91)dumc0(ids:ide-1,kds:grid%kemit,jds:jde-1)
2313 DM_BCAST_MACRO(dumc0)
2315 read(91)dumc0(ids:ide-1,kds:grid%kemit,jds:jde-1)
2317 grid%emis_ant(ips:ipe ,kps:grid%kemit,jps:jpe ,p_e_ora2)=dumc0(ips:ipe ,kps:grid%kemit,jps:jpe )
2319 IF (wrf_dm_on_monitor()) THEN
2320 read(91)dumc0(ids:ide-1,kds:grid%kemit,jds:jde-1)
2322 DM_BCAST_MACRO(dumc0)
2324 read(91)dumc0(ids:ide-1,kds:grid%kemit,jds:jde-1)
2326 grid%emis_ant(ips:ipe ,kps:grid%kemit,jps:jpe ,p_e_nh3)=dumc0(ips:ipe ,kps:grid%kemit,jps:jpe )
2328 IF (wrf_dm_on_monitor()) THEN
2329 read(91)dumc0(ids:ide-1,kds:grid%kemit,jds:jde-1)
2331 DM_BCAST_MACRO(dumc0)
2333 read(91)dumc0(ids:ide-1,kds:grid%kemit,jds:jde-1)
2335 grid%emis_ant(ips:ipe ,kps:grid%kemit,jps:jpe ,p_e_hc3)=dumc0(ips:ipe ,kps:grid%kemit,jps:jpe )
2337 IF (wrf_dm_on_monitor()) THEN
2338 read(91)dumc0(ids:ide-1,kds:grid%kemit,jds:jde-1)
2340 DM_BCAST_MACRO(dumc0)
2342 read(91)dumc0(ids:ide-1,kds:grid%kemit,jds:jde-1)
2344 grid%emis_ant(ips:ipe ,kps:grid%kemit,jps:jpe ,p_e_hc5)=dumc0(ips:ipe ,kps:grid%kemit,jps:jpe )
2346 IF (wrf_dm_on_monitor()) THEN
2347 read(91)dumc0(ids:ide-1,kds:grid%kemit,jds:jde-1)
2349 DM_BCAST_MACRO(dumc0)
2351 read(91)dumc0(ids:ide-1,kds:grid%kemit,jds:jde-1)
2353 grid%emis_ant(ips:ipe ,kps:grid%kemit,jps:jpe ,p_e_hc8)=dumc0(ips:ipe ,kps:grid%kemit,jps:jpe )
2355 IF (wrf_dm_on_monitor()) THEN
2356 read(91)dumc0(ids:ide-1,kds:grid%kemit,jds:jde-1)
2358 DM_BCAST_MACRO(dumc0)
2360 read(91)dumc0(ids:ide-1,kds:grid%kemit,jds:jde-1)
2362 grid%emis_ant(ips:ipe ,kps:grid%kemit,jps:jpe ,p_e_eth)=dumc0(ips:ipe ,kps:grid%kemit,jps:jpe )
2364 IF (wrf_dm_on_monitor()) THEN
2365 read(91)dumc0(ids:ide-1,kds:grid%kemit,jds:jde-1)
2367 DM_BCAST_MACRO(dumc0)
2369 read(91)dumc0(ids:ide-1,kds:grid%kemit,jds:jde-1)
2371 grid%emis_ant(ips:ipe ,kps:grid%kemit,jps:jpe ,p_e_co)=dumc0(ips:ipe ,kps:grid%kemit,jps:jpe )
2373 IF (wrf_dm_on_monitor()) THEN
2374 read(91)dumc0(ids:ide-1,kds:grid%kemit,jds:jde-1)
2376 DM_BCAST_MACRO(dumc0)
2378 read(91)dumc0(ids:ide-1,kds:grid%kemit,jds:jde-1)
2380 grid%emis_ant(ips:ipe ,kps:grid%kemit,jps:jpe ,p_e_ol2)=dumc0(ips:ipe ,kps:grid%kemit,jps:jpe )
2382 IF (wrf_dm_on_monitor()) THEN
2383 read(91)dumc0(ids:ide-1,kds:grid%kemit,jds:jde-1)
2385 DM_BCAST_MACRO(dumc0)
2387 read(91)dumc0(ids:ide-1,kds:grid%kemit,jds:jde-1)
2389 grid%emis_ant(ips:ipe ,kps:grid%kemit,jps:jpe ,p_e_olt)=dumc0(ips:ipe ,kps:grid%kemit,jps:jpe )
2391 IF (wrf_dm_on_monitor()) THEN
2392 read(91)dumc0(ids:ide-1,kds:grid%kemit,jds:jde-1)
2394 DM_BCAST_MACRO(dumc0)
2396 read(91)dumc0(ids:ide-1,kds:grid%kemit,jds:jde-1)
2398 grid%emis_ant(ips:ipe ,kps:grid%kemit,jps:jpe ,p_e_oli)=dumc0(ips:ipe ,kps:grid%kemit,jps:jpe )
2400 IF (wrf_dm_on_monitor()) THEN
2401 read(91)dumc0(ids:ide-1,kds:grid%kemit,jds:jde-1)
2403 DM_BCAST_MACRO(dumc0)
2405 read(91)dumc0(ids:ide-1,kds:grid%kemit,jds:jde-1)
2407 grid%emis_ant(ips:ipe ,kps:grid%kemit,jps:jpe ,p_e_tol)=dumc0(ips:ipe ,kps:grid%kemit,jps:jpe )
2409 IF (wrf_dm_on_monitor()) THEN
2410 read(91)dumc0(ids:ide-1,kds:grid%kemit,jds:jde-1)
2412 DM_BCAST_MACRO(dumc0)
2414 read(91)dumc0(ids:ide-1,kds:grid%kemit,jds:jde-1)
2416 grid%emis_ant(ips:ipe ,kps:grid%kemit,jps:jpe ,p_e_xyl)=dumc0(ips:ipe ,kps:grid%kemit,jps:jpe )
2418 IF (wrf_dm_on_monitor()) THEN
2419 read(91)dumc0(ids:ide-1,kds:grid%kemit,jds:jde-1)
2421 DM_BCAST_MACRO(dumc0)
2423 read(91)dumc0(ids:ide-1,kds:grid%kemit,jds:jde-1)
2425 grid%emis_ant(ips:ipe ,kps:grid%kemit,jps:jpe ,p_e_ket)=dumc0(ips:ipe ,kps:grid%kemit,jps:jpe )
2427 IF (wrf_dm_on_monitor()) THEN
2428 read(91)dumc0(ids:ide-1,kds:grid%kemit,jds:jde-1)
2430 DM_BCAST_MACRO(dumc0)
2432 read(91)dumc0(ids:ide-1,kds:grid%kemit,jds:jde-1)
2434 grid%emis_ant(ips:ipe ,kps:grid%kemit,jps:jpe ,p_e_csl)=dumc0(ips:ipe ,kps:grid%kemit,jps:jpe )
2436 IF (wrf_dm_on_monitor()) THEN
2437 read(91)dumc0(ids:ide-1,kds:grid%kemit,jds:jde-1)
2439 DM_BCAST_MACRO(dumc0)
2441 read(91)dumc0(ids:ide-1,kds:grid%kemit,jds:jde-1)
2443 grid%emis_ant(ips:ipe ,kps:grid%kemit,jps:jpe ,p_e_iso)=dumc0(ips:ipe ,kps:grid%kemit,jps:jpe )
2444 IF( inew_ch4 == 1 ) THEN
2446 IF (wrf_dm_on_monitor()) THEN
2447 read(91)dumc0(ids:ide-1,kds:grid%kemit,jds:jde-1)
2449 DM_BCAST_MACRO(dumc0)
2451 read(91)dumc0(ids:ide-1,kds:grid%kemit,jds:jde-1)
2453 grid%emis_ant(ips:ipe ,kps:grid%kemit,jps:jpe ,p_e_ch4)=dumc0(ips:ipe ,kps:grid%kemit,jps:jpe )
2456 IF (wrf_dm_on_monitor()) THEN
2457 read(91)dumc0(ids:ide-1,kds:grid%kemit,jds:jde-1)
2459 DM_BCAST_MACRO(dumc0)
2461 read(91)dumc0(ids:ide-1,kds:grid%kemit,jds:jde-1)
2463 grid%emis_ant(ips:ipe ,kps:grid%kemit,jps:jpe ,p_e_pm25i)=dumc0(ips:ipe ,kps:grid%kemit,jps:jpe )
2465 IF (wrf_dm_on_monitor()) THEN
2466 read(91)dumc0(ids:ide-1,kds:grid%kemit,jds:jde-1)
2468 DM_BCAST_MACRO(dumc0)
2470 read(91)dumc0(ids:ide-1,kds:grid%kemit,jds:jde-1)
2472 grid%emis_ant(ips:ipe ,kps:grid%kemit,jps:jpe ,p_e_pm25j)=dumc0(ips:ipe ,kps:grid%kemit,jps:jpe )
2474 IF (wrf_dm_on_monitor()) THEN
2475 read(91)dumc0(ids:ide-1,kds:grid%kemit,jds:jde-1)
2477 DM_BCAST_MACRO(dumc0)
2479 read(91)dumc0(ids:ide-1,kds:grid%kemit,jds:jde-1)
2481 grid%emis_ant(ips:ipe ,kps:grid%kemit,jps:jpe ,p_e_so4i)=dumc0(ips:ipe ,kps:grid%kemit,jps:jpe )
2483 IF (wrf_dm_on_monitor()) THEN
2484 read(91)dumc0(ids:ide-1,kds:grid%kemit,jds:jde-1)
2486 DM_BCAST_MACRO(dumc0)
2488 read(91)dumc0(ids:ide-1,kds:grid%kemit,jds:jde-1)
2490 grid%emis_ant(ips:ipe ,kps:grid%kemit,jps:jpe ,p_e_so4j)=dumc0(ips:ipe ,kps:grid%kemit,jps:jpe )
2492 IF (wrf_dm_on_monitor()) THEN
2493 read(91)dumc0(ids:ide-1,kds:grid%kemit,jds:jde-1)
2495 DM_BCAST_MACRO(dumc0)
2497 read(91)dumc0(ids:ide-1,kds:grid%kemit,jds:jde-1)
2499 grid%emis_ant(ips:ipe ,kps:grid%kemit,jps:jpe ,p_e_no3i)=dumc0(ips:ipe ,kps:grid%kemit,jps:jpe )
2501 IF (wrf_dm_on_monitor()) THEN
2502 read(91)dumc0(ids:ide-1,kds:grid%kemit,jds:jde-1)
2504 DM_BCAST_MACRO(dumc0)
2506 read(91)dumc0(ids:ide-1,kds:grid%kemit,jds:jde-1)
2508 grid%emis_ant(ips:ipe ,kps:grid%kemit,jps:jpe ,p_e_no3j)=dumc0(ips:ipe ,kps:grid%kemit,jps:jpe )
2511 IF (inew_nei .eq. 1) THEN
2513 IF (wrf_dm_on_monitor()) THEN
2514 read(91)dumc0(ids:ide-1,kds:grid%kemit,jds:jde-1)
2516 DM_BCAST_MACRO(dumc0)
2518 read(91)dumc0(ids:ide-1,kds:grid%kemit,jds:jde-1)
2520 grid%emis_ant(ips:ipe ,kps:grid%kemit,jps:jpe ,p_e_naai)=dumc0(ips:ipe ,kps:grid%kemit,jps:jpe )
2523 IF (wrf_dm_on_monitor()) THEN
2524 read(91)dumc0(ids:ide-1,kds:grid%kemit,jds:jde-1)
2526 DM_BCAST_MACRO(dumc0)
2528 read(91)dumc0(ids:ide-1,kds:grid%kemit,jds:jde-1)
2530 grid%emis_ant(ips:ipe ,kps:grid%kemit,jps:jpe ,p_e_naaj)=dumc0(ips:ipe ,kps:grid%kemit,jps:jpe )
2534 IF (wrf_dm_on_monitor()) THEN
2535 read(91)dumc0(ids:ide-1,kds:grid%kemit,jds:jde-1)
2537 DM_BCAST_MACRO(dumc0)
2539 read(91)dumc0(ids:ide-1,kds:grid%kemit,jds:jde-1)
2541 grid%emis_ant(ips:ipe ,kps:grid%kemit,jps:jpe ,p_e_orgi)=dumc0(ips:ipe ,kps:grid%kemit,jps:jpe )
2543 IF (wrf_dm_on_monitor()) THEN
2544 read(91)dumc0(ids:ide-1,kds:grid%kemit,jds:jde-1)
2546 DM_BCAST_MACRO(dumc0)
2548 read(91)dumc0(ids:ide-1,kds:grid%kemit,jds:jde-1)
2550 grid%emis_ant(ips:ipe ,kps:grid%kemit,jps:jpe ,p_e_orgj)=dumc0(ips:ipe ,kps:grid%kemit,jps:jpe )
2552 IF (wrf_dm_on_monitor()) THEN
2553 read(91)dumc0(ids:ide-1,kds:grid%kemit,jds:jde-1)
2555 DM_BCAST_MACRO(dumc0)
2557 read(91)dumc0(ids:ide-1,kds:grid%kemit,jds:jde-1)
2559 grid%emis_ant(ips:ipe ,kps:grid%kemit,jps:jpe ,p_e_eci)=dumc0(ips:ipe ,kps:grid%kemit,jps:jpe )
2562 IF (wrf_dm_on_monitor()) THEN
2563 read(91)dumc0(ids:ide-1,kds:grid%kemit,jds:jde-1)
2565 DM_BCAST_MACRO(dumc0)
2567 read(91)dumc0(ids:ide-1,kds:grid%kemit,jds:jde-1)
2569 grid%emis_ant(ips:ipe ,kps:grid%kemit,jps:jpe ,p_e_ecj)=dumc0(ips:ipe ,kps:grid%kemit,jps:jpe )
2572 IF (wrf_dm_on_monitor()) THEN
2573 read(91)dumc0(ids:ide-1,kds:grid%kemit,jds:jde-1)
2575 DM_BCAST_MACRO(dumc0)
2577 read(91)dumc0(ids:ide-1,kds:grid%kemit,jds:jde-1)
2579 grid%emis_ant(ips:ipe ,kps:grid%kemit,jps:jpe ,p_e_pm_10)=dumc0(ips:ipe ,kps:grid%kemit,jps:jpe )
2580 !liqy-add cl emission
2582 IF (wrf_dm_on_monitor()) THEN
2583 read(91)dumc0(ids:ide-1,kds:grid%kemit,jds:jde-1)
2585 DM_BCAST_MACRO(dumc0)
2587 read(91)dumc0(ids:ide-1,kds:grid%kemit,jds:jde-1)
2589 grid%emis_ant(ips:ipe ,kps:grid%kemit,jps:jpe,p_e_hcl)=dumc0(ips:ipe ,kps:grid%kemit,jps:jpe )
2592 IF (wrf_dm_on_monitor()) THEN
2593 read(91)dumc0(ids:ide-1,kds:grid%kemit,jds:jde-1)
2595 DM_BCAST_MACRO(dumc0)
2597 read(91)dumc0(ids:ide-1,kds:grid%kemit,jds:jde-1)
2599 grid%emis_ant(ips:ipe ,kps:grid%kemit,jps:jpe,p_e_ch3cl)=dumc0(ips:ipe ,kps:grid%kemit,jps:jpe )
2602 IF (wrf_dm_on_monitor()) THEN
2603 read(91)dumc0(ids:ide-1,kds:grid%kemit,jds:jde-1)
2605 DM_BCAST_MACRO(dumc0)
2607 read(91)dumc0(ids:ide-1,kds:grid%kemit,jds:jde-1)
2610 grid%emis_ant(ips:ipe ,kps:grid%kemit,jps:jpe,p_e_cli)=dumc0(ips:ipe ,kps:grid%kemit,jps:jpe )
2613 IF (wrf_dm_on_monitor()) THEN
2614 read(91)dumc0(ids:ide-1,kds:grid%kemit,jds:jde-1)
2616 DM_BCAST_MACRO(dumc0)
2618 read(91)dumc0(ids:ide-1,kds:grid%kemit,jds:jde-1)
2620 grid%emis_ant(ips:ipe ,kps:grid%kemit,jps:jpe,p_e_clj)=dumc0(ips:ipe ,kps:grid%kemit,jps:jpe )
2623 write(message,FMT='(A)') ' Past reading emissions '
2624 CALL wrf_debug ( 100, message )
2626 ! write global atributes into wrf emissions file
2628 write(message,FMT='(A)') ' Output emissions '
2629 CALL wrf_debug ( 100, message )
2630 CALL output_auxinput5 ( id1 , grid , config_flags , ierr )
2633 END DO ! NEMI_FRAMES loop
2637 CALL close_dataset ( id1 , config_flags , "DATASET=AUXOUTPUT5" )
2639 write(message,FMT='(A)') ' DONE WRITING TIME DEPENDENT EMISSIONS FILE'
2640 CALL wrf_message ( message )
2642 endif ! ERADM .or.ERADMSORG .or. ECBMZ
2644 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
2645 ! NOW DO BIOGENIC EMISSIONS FILE
2647 if(CONFIG_FLAGS%BIO_EMISS_OPT == BEIS314 ) then
2649 write(message,FMT='(A)') ' READ BIOGENIC EMISSIONS '
2650 CALL wrf_debug ( 100, message )
2652 !!!!!-------------------------------------------------------------------
2654 ! Loop over the file names
2657 ! Remove scratch unzipped file
2658 status=system('rm -f scratem*')
2660 ! All reference emissions except NO
2662 onefil='BIOREF_'// &
2663 TRIM(ADJUSTL(emfil(i)))//'.gz'
2664 ! NO reference emissions
2665 ELSE IF(i.GE.18.AND.i.LE.20)THEN
2667 TRIM(ADJUSTL(emfil(i)))//'.gz'
2671 TRIM(ADJUSTL(emfil(i)))//'S.gz'
2674 ! Copy selected file to scratch
2675 status=system('cp '//TRIM(ADJUSTL(onefil))//' scratem.gz')
2678 status=system('gunzip scratem')
2680 ! Open scratch and read into appropriate array
2681 OPEN(26,FILE='scratem',FORM='FORMATTED')
2684 IF (wrf_dm_on_monitor()) THEN
2685 READ(26,'(12E9.2)') dumc1(ids:ide-1,jds:jde-1)
2687 DM_BCAST_MACRO(dumc1)
2689 READ(26,'(12E9.2)') dumc1(ids:ide-1,jds:jde-1)
2691 grid%sebio_iso(ips:ipe ,jps:jpe ) = dumc1(ips:ipe ,jps:jpe )
2695 IF (wrf_dm_on_monitor()) THEN
2696 READ(26,'(12E9.2)') dumc1(ids:ide-1,jds:jde-1)
2698 DM_BCAST_MACRO(dumc1)
2700 READ(26,'(12E9.2)') dumc1(ids:ide-1,jds:jde-1)
2702 grid%sebio_oli(ips:ipe ,jps:jpe ) = dumc1(ips:ipe ,jps:jpe )
2706 IF (wrf_dm_on_monitor()) THEN
2707 READ(26,'(12E9.2)') dumc1(ids:ide-1,jds:jde-1)
2709 DM_BCAST_MACRO(dumc1)
2711 READ(26,'(12E9.2)') dumc1(ids:ide-1,jds:jde-1)
2713 grid%sebio_api(ips:ipe ,jps:jpe ) = dumc1(ips:ipe ,jps:jpe )
2717 IF (wrf_dm_on_monitor()) THEN
2718 READ(26,'(12E9.2)') dumc1(ids:ide-1,jds:jde-1)
2720 DM_BCAST_MACRO(dumc1)
2722 READ(26,'(12E9.2)') dumc1(ids:ide-1,jds:jde-1)
2724 grid%sebio_lim(ips:ipe ,jps:jpe ) = dumc1(ips:ipe ,jps:jpe )
2728 IF (wrf_dm_on_monitor()) THEN
2729 READ(26,'(12E9.2)') dumc1(ids:ide-1,jds:jde-1)
2731 DM_BCAST_MACRO(dumc1)
2733 READ(26,'(12E9.2)') dumc1(ids:ide-1,jds:jde-1)
2735 grid%sebio_xyl(ips:ipe ,jps:jpe ) = dumc1(ips:ipe ,jps:jpe )
2739 IF (wrf_dm_on_monitor()) THEN
2740 READ(26,'(12E9.2)') dumc1(ids:ide-1,jds:jde-1)
2742 DM_BCAST_MACRO(dumc1)
2744 READ(26,'(12E9.2)') dumc1(ids:ide-1,jds:jde-1)
2746 grid%sebio_hc3(ips:ipe ,jps:jpe ) = dumc1(ips:ipe ,jps:jpe )
2750 IF (wrf_dm_on_monitor()) THEN
2751 READ(26,'(12E9.2)') dumc1(ids:ide-1,jds:jde-1)
2753 DM_BCAST_MACRO(dumc1)
2755 READ(26,'(12E9.2)') dumc1(ids:ide-1,jds:jde-1)
2757 grid%sebio_ete(ips:ipe ,jps:jpe ) = dumc1(ips:ipe ,jps:jpe )
2761 IF (wrf_dm_on_monitor()) THEN
2762 READ(26,'(12E9.2)') dumc1(ids:ide-1,jds:jde-1)
2764 DM_BCAST_MACRO(dumc1)
2766 READ(26,'(12E9.2)') dumc1(ids:ide-1,jds:jde-1)
2768 grid%sebio_olt(ips:ipe ,jps:jpe ) = dumc1(ips:ipe ,jps:jpe )
2772 IF (wrf_dm_on_monitor()) THEN
2773 READ(26,'(12E9.2)') dumc1(ids:ide-1,jds:jde-1)
2775 DM_BCAST_MACRO(dumc1)
2777 READ(26,'(12E9.2)') dumc1(ids:ide-1,jds:jde-1)
2779 grid%sebio_ket(ips:ipe ,jps:jpe ) = dumc1(ips:ipe ,jps:jpe )
2783 IF (wrf_dm_on_monitor()) THEN
2784 READ(26,'(12E9.2)') dumc1(ids:ide-1,jds:jde-1)
2786 DM_BCAST_MACRO(dumc1)
2788 READ(26,'(12E9.2)') dumc1(ids:ide-1,jds:jde-1)
2790 grid%sebio_ald(ips:ipe ,jps:jpe ) = dumc1(ips:ipe ,jps:jpe )
2794 IF (wrf_dm_on_monitor()) THEN
2795 READ(26,'(12E9.2)') dumc1(ids:ide-1,jds:jde-1)
2797 DM_BCAST_MACRO(dumc1)
2799 READ(26,'(12E9.2)') dumc1(ids:ide-1,jds:jde-1)
2801 grid%sebio_hcho(ips:ipe ,jps:jpe ) = dumc1(ips:ipe ,jps:jpe )
2805 IF (wrf_dm_on_monitor()) THEN
2806 READ(26,'(12E9.2)') dumc1(ids:ide-1,jds:jde-1)
2808 DM_BCAST_MACRO(dumc1)
2810 READ(26,'(12E9.2)') dumc1(ids:ide-1,jds:jde-1)
2812 grid%sebio_eth(ips:ipe ,jps:jpe ) = dumc1(ips:ipe ,jps:jpe )
2816 IF (wrf_dm_on_monitor()) THEN
2817 READ(26,'(12E9.2)') dumc1(ids:ide-1,jds:jde-1)
2819 DM_BCAST_MACRO(dumc1)
2821 READ(26,'(12E9.2)') dumc1(ids:ide-1,jds:jde-1)
2823 grid%sebio_ora2(ips:ipe ,jps:jpe ) = dumc1(ips:ipe ,jps:jpe )
2827 IF (wrf_dm_on_monitor()) THEN
2828 READ(26,'(12E9.2)') dumc1(ids:ide-1,jds:jde-1)
2830 DM_BCAST_MACRO(dumc1)
2832 READ(26,'(12E9.2)') dumc1(ids:ide-1,jds:jde-1)
2834 grid%sebio_co(ips:ipe ,jps:jpe ) = dumc1(ips:ipe ,jps:jpe )
2839 IF (wrf_dm_on_monitor()) THEN
2840 READ(26,'(12E9.2)') dumc1(ids:ide-1,jds:jde-1)
2842 DM_BCAST_MACRO(dumc1)
2844 READ(26,'(12E9.2)') dumc1(ids:ide-1,jds:jde-1)
2846 grid%sebio_nr(ips:ipe ,jps:jpe ) = dumc1(ips:ipe ,jps:jpe )
2849 ! SESQ and MBO are added
2852 IF (wrf_dm_on_monitor()) THEN
2853 READ(26,'(12E9.2)') dumc1(ids:ide-1,jds:jde-1)
2855 DM_BCAST_MACRO(dumc1)
2857 READ(26,'(12E9.2)') dumc1(ids:ide-1,jds:jde-1)
2859 grid%sebio_sesq(ips:ipe ,jps:jpe ) = dumc1(ips:ipe ,jps:jpe )
2864 IF (wrf_dm_on_monitor()) THEN
2865 READ(26,'(12E9.2)') dumc1(ids:ide-1,jds:jde-1)
2867 DM_BCAST_MACRO(dumc1)
2869 READ(26,'(12E9.2)') dumc1(ids:ide-1,jds:jde-1)
2871 grid%sebio_mbo(ips:ipe ,jps:jpe ) = dumc1(ips:ipe ,jps:jpe )
2876 IF (wrf_dm_on_monitor()) THEN
2877 READ(26,'(12E9.2)') dumc1(ids:ide-1,jds:jde-1)
2879 DM_BCAST_MACRO(dumc1)
2881 READ(26,'(12E9.2)') dumc1(ids:ide-1,jds:jde-1)
2883 grid%noag_grow(ips:ipe ,jps:jpe ) = dumc1(ips:ipe ,jps:jpe )
2888 IF (wrf_dm_on_monitor()) THEN
2889 READ(26,'(12E9.2)') dumc1(ids:ide-1,jds:jde-1)
2891 DM_BCAST_MACRO(dumc1)
2893 READ(26,'(12E9.2)') dumc1(ids:ide-1,jds:jde-1)
2895 grid%noag_nongrow(ips:ipe ,jps:jpe ) = dumc1(ips:ipe ,jps:jpe )
2900 IF (wrf_dm_on_monitor()) THEN
2901 READ(26,'(12E9.2)') dumc1(ids:ide-1,jds:jde-1)
2903 DM_BCAST_MACRO(dumc1)
2905 READ(26,'(12E9.2)') dumc1(ids:ide-1,jds:jde-1)
2907 grid%nononag(ips:ipe ,jps:jpe ) = dumc1(ips:ipe ,jps:jpe )
2912 IF (wrf_dm_on_monitor()) THEN
2913 READ(26,'(12E9.2)') dumc1(ids:ide-1,jds:jde-1)
2915 DM_BCAST_MACRO(dumc1)
2917 READ(26,'(12E9.2)') dumc1(ids:ide-1,jds:jde-1)
2919 grid%slai(ips:ipe ,jps:jpe ) = dumc1(ips:ipe ,jps:jpe )
2925 write(message,FMT='(A)') ' PAST READ BIOGENIC EMISSIONS '
2926 CALL wrf_debug ( 100, message )
2928 write(message,FMT='(A)') ' OPEN BIOGENIC EMISSIONS WRF file'
2929 CALL wrf_debug ( 100, message )
2931 CALL construct_filename1( inpname , 'wrfbiochemi' , grid%id , 2 )
2932 CALL open_w_dataset ( id1, TRIM(inpname) , grid , config_flags , output_auxinput6 , "DATASET=AUXINPUT6", ierr )
2933 write(message,FMT='(A,A)') ' BIOGENIC EMISSIONS file name: ',TRIM(inpname)
2934 CALL wrf_message ( message )
2936 IF ( ierr .NE. 0 ) THEN
2937 CALL wrf_error_fatal( 'convert_emiss: error opening wrfchem emissions file for writing' )
2940 write(message,FMT='(A)') ' WRITE BIOGENIC EMISSIONS WRF file '
2941 CALL wrf_debug ( 100, message )
2943 CALL output_auxinput6 ( id1 , grid , config_flags , ierr )
2945 CALL close_dataset ( id1 , config_flags , "DATASET=AUXOUTPUT6" )
2947 endif ! BIO_EMIS_OPT = BEIS314
2948 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
2950 DEALLOCATE ( dumc0 )
2951 DEALLOCATE ( dumc1 )
2953 CALL med_shutdown_io ( grid , config_flags )
2955 CALL wrf_debug ( 0 , ' EMISSIONS CONVERSION : end of program ')
2959 CALL WRFU_Finalize( rc=rc )
2961 END PROGRAM convert_emissions