39 USE yomhook
,ONLY : lhook, dr_hook
40 USE parkind1
,ONLY : jprb
56 CHARACTER(LEN=6),
INTENT(IN) :: hprogram
64 CHARACTER(LEN=12) :: yrecfm
65 CHARACTER(LEN=100):: ycomment
66 CHARACTER(LEN=80) :: yname
71 CHARACTER(LEN=40),
DIMENSION(CHE%NEMIS_NBR) :: yemispec_names
72 INTEGER,
DIMENSION(CHE%NEMIS_NBR) :: inbtimes
73 INTEGER,
DIMENSION(CHE%NEMIS_NBR) :: ifirst,ilast,inext
74 INTEGER :: intimesmax,itmp
75 INTEGER :: iemispec_nbr
76 REAL(KIND=JPRB) :: zhook_handle
83 IF (lhook) CALL dr_hook(
'WRITESURF_CH_EMIS_N',0,zhook_handle)
85 ycomment=
'Total number of 2D emission files.'
87 hprogram,yrecfm,che%NEMIS_NBR,iresp,hcomment=ycomment)
92 yname = trim(adjustl(che%CEMIS_NAME(ji)))
94 DO jspec = 1,iemispec_nbr
95 IF (yemispec_names(jspec) == yname)
THEN
100 IF (.NOT. gfound)
THEN
101 iemispec_nbr = iemispec_nbr+1
102 yemispec_names(iemispec_nbr) = yname
103 inbtimes(iemispec_nbr) = 1
104 ifirst(iemispec_nbr) = ji
105 ilast(iemispec_nbr) = ji
108 inext(ilast(jspec)) = ji
111 inbtimes(jspec) = inbtimes(jspec)+1
115 yrecfm=
'EMISPEC_NBR '
116 ycomment=
'Number of emitted chemical species.'
118 hprogram,yrecfm,iemispec_nbr,iresp,hcomment=ycomment)
120 IF (iemispec_nbr > 0)
THEN
122 DO jspec = 1,iemispec_nbr
128 IF (lhook) CALL dr_hook(
'WRITESURF_CH_EMIS_N',1,zhook_handle)
135 INTEGER,
INTENT(IN) :: ksize
136 INTEGER,
DIMENSION(KSIZE) :: itime
137 INTEGER,
DIMENSION(KSIZE) :: iindex
138 REAL,
DIMENSION(SIZE(CHE%XEMIS_FIELDS,1),KSIZE) :: zwork2d
139 REAL(KIND=JPRB) :: zhook_handle
141 IF (lhook) CALL dr_hook(
'WRITESURF_CH_EMIS_N:WRITE_EMIS_SPEC',0,zhook_handle)
150 itime(jt) = che%NEMIS_TIME(ji)
154 IF (jt /= ksize)
THEN
155 CALL
abor1_sfx(
'WRITESURF_CH_EMISN: ABNORMAL ERROR')
162 IF (itime(ji-1) > itime(ji))
THEN
165 itime(ji-1) = itime(ji)
168 iindex(ji-1) = iindex(ji)
174 zwork2d(:,:) = che%XEMIS_FIELDS(:,iindex(:))
178 WRITE(yrecfm,
'("EMISNAME",I3.3)') jspec
179 WRITE(ycomment,
'(A3,", emission times number:",I5)') che%CEMIS_AREA(iindex(1)),ksize
181 hprogram,yrecfm,yemispec_names(jspec),iresp,hcomment=ycomment)
183 WRITE(yrecfm,
'("EMISAREA",I3.3)') jspec
184 ycomment =
"Emission area"
186 hprogram,yrecfm,che%CEMIS_AREA(iindex(1)),iresp,hcomment=ycomment)
188 WRITE(yrecfm,
'("EMISNBT",I3.3)') jspec
189 ycomment =
"Emission times number"
191 hprogram,yrecfm,ksize,iresp,hcomment=ycomment)
194 WRITE(yrecfm,
'("EMISTIMES",I3.3)') jspec
195 ycomment =
"Emission times in second"
197 hprogram,yrecfm,itime(:),iresp,hcomment=ycomment,hdir=
'-',hnam_dim=
"Temporal_emiss ")
200 yrecfm =
"E_"//trim(yemispec_names(jspec))
201 ycomment =
"Emission data (x,y,t),"//trim(che%CEMIS_COMMENT(iindex(1)))
203 hprogram,yrecfm,zwork2d(:,:),iresp,hcomment=ycomment,hnam_dim=
"Temporal_emiss ")
205 IF (lhook) CALL dr_hook(
'WRITESURF_CH_EMIS_N:WRITE_EMIS_SPEC',1,zhook_handle)
subroutine writesurf_ch_emis_n(DGU, U, CHE, HPROGRAM)
subroutine abor1_sfx(YTEXT)
subroutine write_emis_spec(KSIZE)