2 !dis Open Source License/Disclaimer, Forecast Systems Laboratory
3 !dis NOAA/OAR/FSL, 325 Broadway Boulder, CO 80305
5 !dis This software is distributed under the Open Source Definition,
6 !dis which may be found at http://www.opensource.org/osd.html.
8 !dis In particular, redistribution and use in source and binary forms,
9 !dis with or without modification, are permitted provided that the
10 !dis following conditions are met:
12 !dis - Redistributions of source code must retain this notice, this
13 !dis list of conditions and the following disclaimer.
15 !dis - Redistributions in binary form must provide access to this
16 !dis notice, this list of conditions and the following disclaimer, and
17 !dis the underlying source code.
19 !dis - All modifications to this software must be clearly documented,
20 !dis and are solely the responsibility of the agent making the
23 !dis - If significant modifications or enhancements are made to this
24 !dis software, the FSL Software Policy Manager
25 !dis (softwaremgr@fsl.noaa.gov) should be notified.
27 !dis THIS SOFTWARE AND ITS DOCUMENTATION ARE IN THE PUBLIC DOMAIN
28 !dis AND ARE FURNISHED "AS IS." THE AUTHORS, THE UNITED STATES
29 !dis GOVERNMENT, ITS INSTRUMENTALITIES, OFFICERS, EMPLOYEES, AND
30 !dis AGENTS MAKE NO WARRANTY, EXPRESS OR IMPLIED, AS TO THE USEFULNESS
31 !dis OF THE SOFTWARE AND DOCUMENTATION FOR ANY PURPOSE. THEY ASSUME
32 !dis NO RESPONSIBILITY (1) FOR THE USE OF THE SOFTWARE AND
33 !dis DOCUMENTATION; OR (2) TO PROVIDE TECHNICAL SUPPORT TO USERS.
39 MODULE module_input_chem_bioemiss
43 USE module_driver_constants
44 USE module_state_description
50 USE module_aerosols_sorgam
51 USE module_get_file_names
55 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
57 SUBROUTINE input_ext_chem_beis3_file (grid)
58 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
64 INTEGER :: i,j,n,numfil,status,system
66 INTEGER :: ids, ide, jds, jde, kds, kde, &
67 ims, ime, jms, jme, kms, kme, &
68 ips, ipe, jps, jpe, kps, kpe
70 REAL, ALLOCATABLE, DIMENSION(:,:) :: emiss
74 ! Number of reference emission and LAI files to open
77 CHARACTER (LEN=80) :: message
79 TYPE (grid_config_rec_type) :: config_flags
81 ! Normalized biogenic emissions for standard conditions (moles compound/km^2/hr)
82 ! REAL, DIMENSION(i,j) :: &
83 ! sebio_iso,sebio_oli,sebio_api,sebio_lim,sebio_xyl, &
84 ! sebio_hc3,sebio_ete,sebio_olt,sebio_ket,sebio_ald, &
85 ! sebio_hcho,sebio_eth,sebio_ora2,sebio_co,sebio_nr, &
86 ! noag_grow,noag_nongrow,nononag
88 ! Leaf area index for isoprene
89 ! REAL, DIMENSION(i,j) :: slai
91 ! Filenames of reference emissions and LAI
93 CHARACTER*12 emfil(numfil)
94 DATA emfil/'ISO','OLI','API','LIM','XYL','HC3','ETE','OLT', &
95 'KET','ALD','HCHO','ETH','ORA2','CO','NR', &
96 'NOAG_GROW','NOAG_NONGROW','NONONAG','ISOP'/
98 !!!!!-------------------------------------------------------------------
100 ! Get grid dimensions
101 CALL get_ijk_from_grid ( grid , &
102 ids, ide, jds, jde, kds, kde, &
103 ims, ime, jms, jme, kms, kme, &
104 ips, ipe, jps, jpe, kps, kpe )
106 WRITE( message , FMT='(A,4I5)' ) ' DIMS: ',ids,ide-1,jds,jde-1
107 CALL wrf_message ( message )
109 ALLOCATE( emiss(ids:ide-1,jds:jde-1) )
112 ! Loop over the file names
115 ! Remove scratch unzipped file
116 status=system('rm -f scratem*')
118 ! All reference emissions except NO
120 onefil='../../run/BIOREF_'// &
121 TRIM(ADJUSTL(emfil(n)))//'.gz'
122 ! NO reference emissions
123 ELSE IF(n.GE.16.AND.n.LE.18)THEN
124 onefil='../../run/AVG_'// &
125 TRIM(ADJUSTL(emfil(n)))//'.gz'
128 onefil='../../run/LAI_'// &
129 TRIM(ADJUSTL(emfil(n)))//'S.gz'
132 ! Copy selected file to scratch
133 status=system('cp '//TRIM(ADJUSTL(onefil))//' scratem.gz')
136 status=system('gunzip scratem')
138 ! Open scratch and read into appropriate array
139 OPEN(26,FILE='scratem',FORM='FORMATTED')
141 READ(26,'(12E9.2)') emiss
142 grid%sebio_iso(ids:ide-1,jds:jde-1) = emiss
145 READ(26,'(12E9.2)') emiss
146 grid%sebio_oli(ids:ide-1,jds:jde-1) = emiss
149 READ(26,'(12E9.2)') emiss
150 grid%sebio_api(ids:ide-1,jds:jde-1) = emiss
153 READ(26,'(12E9.2)') emiss
154 grid%sebio_lim(ids:ide-1,jds:jde-1) = emiss
157 READ(26,'(12E9.2)') emiss
158 grid%sebio_xyl(ids:ide-1,jds:jde-1) = emiss
161 READ(26,'(12E9.2)') emiss
162 grid%sebio_hc3(ids:ide-1,jds:jde-1) = emiss
165 READ(26,'(12E9.2)') emiss
166 grid%sebio_ete(ids:ide-1,jds:jde-1) = emiss
169 READ(26,'(12E9.2)') emiss
170 grid%sebio_olt(ids:ide-1,jds:jde-1) = emiss
173 READ(26,'(12E9.2)') emiss
174 grid%sebio_ket(ids:ide-1,jds:jde-1) = emiss
177 READ(26,'(12E9.2)') emiss
178 grid%sebio_ald(ids:ide-1,jds:jde-1) = emiss
181 READ(26,'(12E9.2)') emiss
182 grid%sebio_hcho(ids:ide-1,jds:jde-1) = emiss
185 READ(26,'(12E9.2)') emiss
186 grid%sebio_eth(ids:ide-1,jds:jde-1) = emiss
189 READ(26,'(12E9.2)') emiss
190 grid%sebio_ora2(ids:ide-1,jds:jde-1) = emiss
193 READ(26,'(12E9.2)') emiss
194 grid%sebio_co(ids:ide-1,jds:jde-1) = emiss
197 READ(26,'(12E9.2)') emiss
198 grid%sebio_nr(ids:ide-1,jds:jde-1) = emiss
201 READ(26,'(12E9.2)') emiss
202 grid%noag_grow(ids:ide-1,jds:jde-1) = emiss
205 READ(26,'(12E9.2)') emiss
206 grid%noag_nongrow(ids:ide-1,jds:jde-1) = emiss
209 READ(26,'(12E9.2)') emiss
210 grid%nononag(ids:ide-1,jds:jde-1) = emiss
213 READ(26,'(12E9.2)') emiss
214 grid%slai(ids:ide-1,jds:jde-1) = emiss
219 ! End of loop over file names
223 END SUBROUTINE input_ext_chem_beis3_file
224 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
226 END MODULE module_input_chem_bioemiss