user_output__co2.F90 40 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196
  1. !
  2. #define TRACEBACK write (gol,'("in ",a," (",a,", line",i5,")")') rname, __FILE__, __LINE__; call goErr
  3. #define IF_NOTOK_RETURN(action) if (status/=0) then; TRACEBACK; action; return; end if
  4. #define IF_ERROR_RETURN(action) if (status> 0) then; TRACEBACK; action; return; end if
  5. !
  6. #include "tm5.inc"
  7. !
  8. !-----------------------------------------------------------------------------
  9. ! TM5 !
  10. !-----------------------------------------------------------------------------
  11. !BOP
  12. !
  13. ! !MODULE: USER_OUTPUT
  14. !
  15. ! !DESCRIPTION: Contains calls to user-specific output routines, e.g.
  16. ! instantaneous mix files, station output, output of flight
  17. ! tracks etc.
  18. !\\
  19. !\\
  20. ! !INTERFACE:
  21. !
  22. MODULE USER_OUTPUT
  23. use GO, only : gol, goErr, goPr
  24. use GO, ONLY : GO_Timer_Def, GO_Timer_End, GO_Timer_Start
  25. #ifdef with_hdf4
  26. use user_output_noaa, only : noaa_data
  27. #endif
  28. use user_output_c4mip, only : c4mip_experiment,c4mip_experiment_id, c4mip_realm,c4mip_source_type,c4mip_dhour
  29. #ifdef with_m7
  30. use user_output_aerocom, only : aerocom_freq, aerocom_exper, aerocom_dhour
  31. use user_output_aerchemmip, only : experiment,experiment_id, realm,source_type,aerchemmip_dhour, crescendo_out
  32. use user_output_general, only : gen_freq, gen_exper, all_chemistry
  33. use user_output_general, only : nCCNdiag, nSat, SuperSat
  34. #endif
  35. implicit none
  36. private
  37. !
  38. ! !PUBLIC MEMBER FUNCTIONS:
  39. !
  40. public :: user_output_init
  41. public :: user_output_step
  42. public :: user_output_mean
  43. public :: user_output_done
  44. !
  45. ! !PRIVATE DATA MEMBERS:
  46. !
  47. logical :: settings_data = .false. ! signal for model settings output
  48. logical :: flight_data = .false. ! signal for flight output
  49. logical :: station_data = .true. ! signal for station output
  50. logical :: mix_data = .false. ! signal for mix output
  51. integer :: mix_data_dhour ! ... and its output period
  52. logical :: c4mip_data = .true. ! signal for c4mip output
  53. logical :: c4mip_1h = .false. ! signal for c4mip diagnostics
  54. logical :: mmix_data = .false. ! signal for mean mix output
  55. logical :: aerchemmip = .false. ! signal for AERCHEMMIP diagnostics
  56. logical :: aerchemmip_1h = .true. ! signal for AERCHEMMIP diagnostics
  57. logical :: aerocom_data = .false. ! signal for AEROCOM diagnostics
  58. !integer :: aerocom_dhour ! ... and its calling period
  59. logical :: aerocom_stat = .false. ! signal for AEROCOM station diagnostics
  60. logical :: output_pdump = .false. ! signal for chemistry time series output
  61. integer :: output_pdump_dsec ! ... and its lowest output period
  62. logical :: column_data ! signal for column output
  63. integer :: column_data_dtsec ! ... and its output period (in seconds)
  64. logical :: flask_data = .false. ! signal for flask output
  65. logical :: gen_data = .false. ! signal for GEN diagnostics
  66. integer :: gen_dhour ! ... and its calling period
  67. logical :: gen_2d = .false. ! signal for GEN surface and budget
  68. logical :: gen_3d = .false. ! signal for GEN 3D tracer output
  69. #ifdef with_cf_output
  70. logical :: output_cf = .false.
  71. integer :: output_cf_dhour ! every dhour hour
  72. #endif
  73. character(len=*), parameter :: mname = 'user_output'
  74. !Timers:
  75. integer :: itim_aero_init, itim_aero_step, itim_aero_write
  76. integer :: itim_gen_init, itim_gen_step, itim_gen_write
  77. !, itim_nh3, itim_sox, itim_dms, itim_ch4, itim_isop, itim_rn222
  78. !
  79. ! !REVISION HISTORY:
  80. ! 6 Feb 2011 - Achim Strunk - Added aerocom-2 diagnostics output.
  81. ! 9 Jul 2012 - Ph. Le Sager - merged (1) with version in proj/chem/base (to
  82. ! account for optics data for
  83. ! user_output_station) and (2) with version in
  84. ! the base/trunk (to account for output_common)
  85. ! and (3) with version in Climaqs proj to
  86. ! incorporate pdump as replacement for retro output
  87. ! 3 Jul 2013 - Andy Jacobson
  88. ! - Updated modules to use dynamic time-step weighting
  89. ! - Added flask, column,mmix output to trunk
  90. ! - Revised mix to used netCDF4 output
  91. !
  92. ! 25 Aug 2015 - T. van Noije - Added switch for monthly AeroCom output
  93. !
  94. ! !REMARKS:
  95. !
  96. !EOP
  97. !------------------------------------------------------------------------
  98. CONTAINS
  99. !--------------------------------------------------------------------------
  100. ! TM5 !
  101. !--------------------------------------------------------------------------
  102. !BOP
  103. !
  104. ! !IROUTINE: USER_OUTPUT_INIT
  105. !
  106. ! !DESCRIPTION: Initialise user-specified model output (all regions)
  107. !\\
  108. !\\
  109. ! !INTERFACE:
  110. !
  111. subroutine user_output_init( status )
  112. !
  113. ! !USES:
  114. !
  115. use GO, only : TrcFile, Init, Done, ReadRc
  116. use dims, only : ndyn_max, nregions
  117. use MeteoData, only : Set, temper_dat
  118. use global_data, only : rcfile
  119. use User_Output_Common, only : User_Output_Common_Init
  120. use User_Output_Settings, only : User_Output_Settings_Init
  121. use user_output_mmix, only : mmix_init
  122. #ifdef with_hdf4
  123. use user_output_station, only : read_stationlist, init_station_output
  124. use user_output_noaa, only : init_noaa_events
  125. #endif
  126. use user_output_mix, only : user_output_mix_init, mix_netcdf_attributes
  127. use user_output_column, only : user_output_column_init
  128. use user_output_pdump, only : output_pdump_init
  129. use user_output_flask, only : user_output_flask_init
  130. #ifdef with_cf_output
  131. use user_output_cf, only : output_cf_init
  132. #endif
  133. ! #ifdef with_optics
  134. ! Use Optics , only : Optics_Init, Optics_RcInit
  135. ! #endif
  136. ! #ifdef with_pm
  137. ! Use PM , only : PM_Init
  138. ! #endif
  139. !
  140. ! !INPUT/OUTPUT PARAMETERS:
  141. !
  142. integer, intent(inout) :: status
  143. !
  144. ! !REVISION HISTORY:
  145. ! 6 Feb 2011 - Achim Strunk - modified for aerocom-2 diagnostics.
  146. !
  147. ! !REMARKS:
  148. !
  149. !EOP
  150. !------------------------------------------------------------------------
  151. !BOC
  152. character(len=*), parameter :: rname = mname//'/user_output_init'
  153. ! --- local -------------------------------
  154. type(TrcFile) :: rcF
  155. Character (len=200) :: wavelengthsstring
  156. Character (len=200) :: pmsizelimits
  157. Character (len=300) :: alphastring
  158. integer :: n
  159. ! --- begin -------------------------------
  160. ! init common stuff:
  161. call User_Output_Common_Init( status )
  162. IF_NOTOK_RETURN(status=1)
  163. call Init( rcF, rcfile, status )
  164. IF_NOTOK_RETURN(status=1)
  165. ! ------------
  166. ! S E T T I N G S
  167. ! ------------
  168. ! put out settings ?
  169. call ReadRc( rcF, 'settings.output', settings_data, status, default=.false. )
  170. IF_ERROR_RETURN(status=1)
  171. ! apply ?
  172. if ( settings_data ) then
  173. write (gol,'(a,": user output settings ...")') rname; call goPr
  174. call User_Output_Settings_Init( rcF, status )
  175. IF_NOTOK_RETURN(status=1)
  176. end if
  177. ! ------------
  178. ! S T A T I O N S
  179. ! ------------
  180. call ReadRc( rcF, 'output.station', station_data, status, default=.false. )
  181. IF_ERROR_RETURN(status=1)
  182. if ( station_data ) then
  183. #ifdef with_hdf4
  184. call read_stationlist(status)
  185. IF_NOTOK_RETURN(status=1)
  186. call init_station_output(status)
  187. IF_NOTOK_RETURN(status=1)
  188. #else
  189. status=1
  190. write (gol,'(a,": USER_OUTPUT_STATION not available without HDF4")') rname; call goErr
  191. IF_NOTOK_RETURN(status=1)
  192. #endif
  193. end if
  194. ! ------------
  195. ! N O A A
  196. ! ------------
  197. #ifdef with_hdf4
  198. call ReadRc( rcF, 'output.noaa', noaa_data, status, default=.false. )
  199. IF_ERROR_RETURN(status=1)
  200. if ( noaa_data ) then
  201. call init_noaa_events(status)
  202. IF_NOTOK_RETURN(status=1)
  203. end if
  204. #endif
  205. ! ------------
  206. ! F L I G H T
  207. ! ------------
  208. call ReadRc( rcF, 'output.flight', flight_data, status, default=.false. )
  209. IF_ERROR_RETURN(status=1)
  210. ! ------------
  211. ! F L A S K
  212. ! ------------
  213. call ReadRc( rcF, 'output.flask', flask_data, status, default=.false.)
  214. IF_ERROR_RETURN(status=1)
  215. if(flask_data) then
  216. call user_output_flask_init(rcF,status)
  217. IF_NOTOK_RETURN(status=1)
  218. endif
  219. ! ------------
  220. ! M I X
  221. ! ------------
  222. call ReadRc( rcF, 'output.mix', mix_data, status )
  223. IF_NOTOK_RETURN(status=1)
  224. if ( mix_data ) then
  225. call ReadRc( rcF, 'output.mix.dhour', mix_data_dhour, status )
  226. IF_NOTOK_RETURN(status=1)
  227. call ReadRc( rcF, 'output.mix.attributes.notes', mix_netcdf_attributes%notes, status, default="")
  228. IF_ERROR_RETURN(status=1)
  229. call ReadRc( rcF, 'output.mix.attributes.disclaimer', mix_netcdf_attributes%disclaimer, status, default="")
  230. IF_ERROR_RETURN(status=1)
  231. call ReadRc( rcF, 'output.mix.attributes.email', mix_netcdf_attributes%email, status, default="")
  232. IF_ERROR_RETURN(status=1)
  233. call ReadRc( rcF, 'output.mix.attributes.url', mix_netcdf_attributes%url, status, default="")
  234. IF_ERROR_RETURN(status=1)
  235. call ReadRc( rcF, 'output.mix.attributes.institution', mix_netcdf_attributes%institution, status, default="")
  236. IF_ERROR_RETURN(status=1)
  237. call ReadRc( rcF, 'output.mix.attributes.conventions', mix_netcdf_attributes%conventions, status, default="CF-1.5")
  238. IF_ERROR_RETURN(status=1)
  239. call ReadRc( rcF, 'output.mix.attributes.source', mix_netcdf_attributes%source, status, default="")
  240. IF_ERROR_RETURN(status=1)
  241. call user_output_mix_init(status)
  242. IF_NOTOK_RETURN(status=1)
  243. end if
  244. ! ------------
  245. ! M M I X
  246. ! ------------
  247. ! initialise accumulation of the mean mixing ratio fields
  248. call ReadRc( rcF, 'output.mmix', mmix_data, status )
  249. IF_NOTOK_RETURN(status=1)
  250. if ( mmix_data ) then
  251. call mmix_init(status)
  252. IF_NOTOK_RETURN(status=1)
  253. ! require temperature then
  254. do n = 1, nregions
  255. call Set( temper_dat(n), status, used=.true. )
  256. end do
  257. end if
  258. ! ------------
  259. ! A E R O C O M
  260. ! ------------
  261. #ifdef with_m7
  262. ! initialise AEROCOM Diagnostics (hourly, daily or monthly)
  263. call ReadRc( rcF, 'output.aerocom', aerocom_data, status )
  264. IF_NOTOK_RETURN(status=1)
  265. if( aerocom_data ) then
  266. call ReadRc( rcF, 'output.aerocom.freq', aerocom_freq, status, default='monthly' )
  267. IF_NOTOK_RETURN(status=1)
  268. call ReadRc( rcF, 'output.aerocom.exper', aerocom_exper, status, default='AP3' )
  269. IF_NOTOK_RETURN(status=1)
  270. call ReadRc( rcF, 'output.aerocom.dhour', aerocom_dhour, status )
  271. IF_NOTOK_RETURN(status=1)
  272. call ReadRc( rcF, 'output.aerocom.stations', aerocom_stat, status )
  273. IF_NOTOK_RETURN(status=1)
  274. end if
  275. call ReadRc( rcF, 'output.general', gen_data, status )
  276. IF_NOTOK_RETURN(status=1)
  277. if( gen_data ) then
  278. call ReadRc( rcF, 'output.general.freq', gen_freq, status, default='hourly' )
  279. IF_NOTOK_RETURN(status=1)
  280. call ReadRc( rcF, 'output.general.exper', gen_exper, status, default='AP3' )
  281. IF_NOTOK_RETURN(status=1)
  282. !output frequency
  283. call ReadRc( rcF, 'output.general.dhour', gen_dhour, status )
  284. IF_NOTOK_RETURN(status=1)
  285. ! output all chemistry species or predefined smaller set (see user_output_general: variable gas_output
  286. call ReadRc( rcF, 'output.general.all_chemistry', all_chemistry, status, default=.false.)
  287. IF_NOTOK_RETURN(status=1)
  288. ! output 2D-fields: emi,load,surfconc,wetdep,drydep,sed,optics
  289. call ReadRc( rcF, 'output.general.2d', gen_2d, status )
  290. IF_NOTOK_RETURN(status=1)
  291. ! output 3D-fields: particle number/mass concentrations and diameters, chemistry species,
  292. call ReadRc( rcF, 'output.general.3d', gen_3d, status )
  293. IF_NOTOK_RETURN(status=1)
  294. !call ReadRc( rcF, 'output.general.author', gen_author, status )
  295. !IF_NOTOK_RETURN(status=1)
  296. !call ReadRc( rcF, 'output.general.institute', gen_institute, status )
  297. !IF_NOTOK_RETURN(status=1)
  298. !call ReadRc( rcF, 'output.general.', gen_, status )
  299. !IF_NOTOK_RETURN(status=1)
  300. call ReadRc( rcF, 'input.diagnostic.CCN', nCCNdiag, status)
  301. IF_NOTOK_RETURN(status=1)
  302. IF (nCCNdiag) THEN
  303. call ReadRc( rcF, 'input.supersat', nSat, status)
  304. IF_NOTOK_RETURN(status=1)
  305. ALLOCATE(SuperSat(nSat))
  306. call ReadRc( rcF, 'supersat.values', SuperSat, status)
  307. SuperSat(:) = SuperSat(:) / 100.e0 ! convert from %RH
  308. IF_NOTOK_RETURN(status=1)
  309. ENDIF
  310. end if
  311. #endif
  312. ! ------------
  313. ! A E R C H E M M I P
  314. ! ------------
  315. #ifdef with_m7
  316. ! initialise AERCHEMMIP Diagnostics (hourly, daily or monthly)
  317. call ReadRc( rcF, 'output.aerchemmip', aerchemmip, status )
  318. IF_NOTOK_RETURN(status=1)
  319. if( aerchemmip ) then
  320. call ReadRc( rcF, 'output.aerchemmip.1h', aerchemmip_1h, status )
  321. IF_NOTOK_RETURN(status=1)
  322. ! NOT IMPLEMENTED - 6hr- ouput is harcoded in aerchem_output.F90
  323. ! call ReadRc( rcF, 'output.aerchemmip.dhour', aerchemmip_dhour, status )
  324. ! IF_NOTOK_RETURN(status=1)
  325. aerchemmip_dhour=1
  326. call ReadRc( rcF, 'output.aerchemmip.experiment', experiment, status, default='AerChemMIP' )
  327. IF_ERROR_RETURN(status=1)
  328. call ReadRc( rcF, 'output.aerchemmip.realm', realm, status, default='atmosChem' )
  329. IF_ERROR_RETURN(status=1)
  330. call ReadRc( rcF, 'output.aerchemmip.sourcetype', source_type, status, default='AP3' )
  331. IF_ERROR_RETURN(status=1)
  332. call ReadRc( rcF, 'output.aerchemmip.experimentid', experiment_id, status )
  333. IF_NOTOK_RETURN(status=1)
  334. call ReadRc( rcF, 'output.crescendo', crescendo_out, status )
  335. IF_NOTOK_RETURN(status=1)
  336. end if
  337. #endif
  338. ! initialise C4MIP Diagnostics (hourly, daily or monthly)
  339. call ReadRc( rcF, 'output.c4mip', c4mip_data, status )
  340. IF_NOTOK_RETURN(status=1)
  341. if( c4mip_data ) then
  342. call ReadRc( rcF, 'output.c4mip.1h', c4mip_1h, status )
  343. IF_NOTOK_RETURN(status=1)
  344. ! NOT IMPLEMENTED - 6hr- ouput is harcoded in aerchem_output.F90
  345. ! call ReadRc( rcF, 'output.c4mip.dhour', c4mip_dhour, status )
  346. ! IF_NOTOK_RETURN(status=1)
  347. c4mip_dhour=1
  348. call ReadRc( rcF, 'output.c4mip.experiment', c4mip_experiment, status, default='C4mip' )
  349. IF_ERROR_RETURN(status=1)
  350. call ReadRc( rcF, 'output.c4mip.realm', c4mip_realm, status, default='atmosChem' )
  351. IF_ERROR_RETURN(status=1)
  352. call ReadRc( rcF, 'output.c4mip.sourcetype', c4mip_source_type, status, default='AP3' )
  353. IF_ERROR_RETURN(status=1)
  354. call ReadRc( rcF, 'output.c4mip.experimentid', c4mip_experiment_id, status )
  355. IF_NOTOK_RETURN(status=1)
  356. end if
  357. ! ------------
  358. ! P D U M P
  359. ! ------------
  360. ! put out in pdump format ?
  361. call ReadRc( rcF, 'output.pdump', output_pdump, status, default=.false. )
  362. IF_ERROR_RETURN(status=1)
  363. ! init if necessary:
  364. if ( output_pdump ) then
  365. ! init output; return ouptut time step
  366. call Output_PDUMP_Init( rcF, output_pdump_dsec, status )
  367. IF_NOTOK_RETURN(status=1)
  368. end if
  369. #ifdef with_cf_output
  370. ! ------------
  371. ! C F
  372. ! ------------
  373. ! put out in retro format ?
  374. call ReadRc( rcF, 'output.cf', output_cf, status, default=.false. )
  375. IF_ERROR_RETURN(status=1)
  376. ! init if necessary:
  377. if ( output_cf ) then
  378. ! init output; return ouptut time step
  379. call Output_CF_Init( rcF, output_cf_dhour, status )
  380. IF_NOTOK_RETURN(status=1)
  381. end if
  382. #endif
  383. ! ------------
  384. ! O P T I C S
  385. ! ------------
  386. ! Optics. I just need one thing of the rc-file before closing it.
  387. ! We could remove the compiler flags with_optics and with_pm if we want to
  388. ! We just do with_optics if you include at least one wavelength
  389. ! We just do with_pm if you include at least one sizelimit
  390. ! Now, we simply use the compiler flags.
  391. ! #ifdef with_optics
  392. ! call ReadRc( rcF, 'optics.lookup.table', lookuptable,status) ! the only line in climaqs proj. FIXME: others needed?
  393. ! IF_NOTOK_RETURN(status=1)
  394. ! call ReadRc( rcF, 'optics.wavelengths', wavelengthsstring,status)
  395. ! IF_NOTOK_RETURN(status=1)
  396. ! call ReadRc( rcF, 'optics.alphas', alphastring,status,default="")
  397. ! IF_ERROR_RETURN(status=1)
  398. ! Call Optics_RCInit(wavelengthsstring,alphastring,status) ! This code is so ugly, I do not want to pollute Optics_Init with this.
  399. ! IF_NOTOK_RETURN(status=1)
  400. ! Call Optics_Init(lookuptable,station_data,status)
  401. ! IF_NOTOK_RETURN(status=1)
  402. ! #endif
  403. ! PM output.
  404. ! #ifdef with_pm
  405. ! Call ReadRc( rcF, 'pm.sizelimits', pmsizelimits,status)
  406. ! IF_NOTOK_RETURN(status=1)
  407. ! ! Do not do anything if we have no stations
  408. ! if (station_data) then
  409. ! Call PM_Init(pmsizelimits,status)
  410. ! IF_NOTOK_RETURN(status=1)
  411. ! end if
  412. ! #endif
  413. ! ------------
  414. ! C O L U M N
  415. ! ------------
  416. ! output column data?
  417. call ReadRc( rcF, 'output.column', column_data, status, default = .false. )
  418. IF_ERROR_RETURN( status=1 )
  419. ! apply?
  420. if ( column_data ) then
  421. call ReadRc( rcF, 'output.column.dtsec', column_data_dtsec, status , default = ndyn_max)
  422. IF_ERROR_RETURN(status=1)
  423. write (gol,*) trim(mname)//'/column_data_dtsec:', column_data_dtsec; call goPr
  424. call user_output_column_init( status )
  425. IF_NOTOK_RETURN( status=1 )
  426. end if
  427. call GO_Timer_Def( itim_aero_init, 'user_output_aerocom_init', status )
  428. IF_NOTOK_RETURN(status=1)
  429. call GO_Timer_Def( itim_aero_step, 'user_output_aerocom_step', status )
  430. IF_NOTOK_RETURN(status=1)
  431. call GO_Timer_Def( itim_aero_write, 'user_output_aerocom_write', status )
  432. IF_NOTOK_RETURN(status=1)
  433. call GO_Timer_Def( itim_gen_init, 'user_output_general_init', status )
  434. IF_NOTOK_RETURN(status=1)
  435. call GO_Timer_Def( itim_gen_step, 'user_output_general_step', status )
  436. IF_NOTOK_RETURN(status=1)
  437. call GO_Timer_Def( itim_gen_write, 'user_output_general_write', status )
  438. IF_NOTOK_RETURN(status=1)
  439. ! close rcfile:
  440. call Done( rcF, status )
  441. IF_NOTOK_RETURN(status=1)
  442. ! ok
  443. status = 0
  444. END SUBROUTINE USER_OUTPUT_INIT
  445. !EOC
  446. !--------------------------------------------------------------------------
  447. ! TM5 !
  448. !--------------------------------------------------------------------------
  449. !BOP
  450. !
  451. ! !IROUTINE: USER_OUTPUT_DONE
  452. !
  453. ! !DESCRIPTION: Finalise user-specified model output for the region given
  454. !\\
  455. !\\
  456. ! !INTERFACE:
  457. !
  458. subroutine user_output_done( status )
  459. !
  460. ! !USES:
  461. !
  462. use dims, only : nregions,newhour,newday,newmonth
  463. use User_Output_Settings, only : User_Output_Settings_Done
  464. use User_Output_Common, only : User_Output_Common_Done
  465. use user_output_mmix, only : write_mmix, mmix_Done
  466. #ifdef with_hdf4
  467. use user_output_station, only : free_stationfields
  468. use user_output_noaa, only : write_noaa_events
  469. #endif
  470. use user_output_mix , only : user_output_mix_done
  471. use user_output_column , only : user_output_column_done
  472. use user_output_flask , only : user_output_flask_done
  473. use user_output_c4mip, only : output_c4mip_done, output_c4mip_write_monthly, output_c4mip_write_hourly, output_c4mip_write_daily, accumulate_c4mip_data, output_c4mip_write_6hourly
  474. #ifdef with_m7
  475. use user_output_aerocom, only : output_aerocom_done, output_aerocom_write,output_aerocom_step
  476. use user_output_aerchemmip, only : output_aerchemmip_done, output_aerchemmip_write, output_aerchemmip_write_hourly, output_aerchemmip_write_daily, crescendo_out, accumulate_data, output_aerchemmip_write_6hourly
  477. use user_output_general, only : output_general_done, output_general_write
  478. use user_output_general, only : nCCNdiag, SuperSat
  479. #endif
  480. use user_output_pdump, only : output_pdump_done
  481. #ifdef with_cf_output
  482. use user_output_cf, only : output_cf_done
  483. #endif
  484. !
  485. ! !OUTPUT PARAMETERS:
  486. !
  487. integer, intent(out) :: status
  488. !
  489. ! !REVISION HISTORY:
  490. ! 6 Feb 2011 - Achim Strunk - Added aerocom-2 case.
  491. !
  492. ! !REMARKS:
  493. !
  494. !EOP
  495. !------------------------------------------------------------------------
  496. !BOC
  497. character(len=*), parameter :: rname = mname//'/user_output_done'
  498. integer :: region
  499. ! --- begin -----------------------------
  500. ! settings output enabled ?
  501. if ( settings_data ) then
  502. ! done with module:
  503. call User_Output_Settings_Done( status )
  504. IF_NOTOK_RETURN(status=1)
  505. end if
  506. ! I do the done of Optics first, since it borrows the station's hdf.
  507. ! I will give user_output_station the honor to finalize the station's hdf.
  508. ! Maybe not necessary, but it looks nicer first to finalize the sds's
  509. ! and then finalize the hdf.
  510. ! #ifdef with_optics
  511. ! Call Optics_Done(station_data,status)
  512. ! IF_NOTOK_RETURN(status=1)
  513. ! #endif
  514. ! #ifdef with_pm
  515. ! if (station_data) then
  516. ! Call PM_Done(status)
  517. ! IF_NOTOK_RETURN(status=1)
  518. ! end if
  519. ! #endif
  520. if ( column_data ) then
  521. call user_output_column_done( status )
  522. IF_NOTOK_RETURN( status=1 )
  523. endif
  524. ! write the mean mixing ratio fields to file
  525. if ( mmix_data ) then
  526. call write_mmix(status)
  527. IF_NOTOK_RETURN(status=1)
  528. call mmix_Done(status)
  529. IF_NOTOK_RETURN(status=1)
  530. end if
  531. #ifdef with_hdf4
  532. if ( station_data) then
  533. call free_stationfields(status)
  534. IF_NOTOK_RETURN(status=1)
  535. endif
  536. #endif
  537. #ifdef with_m7
  538. if( aerocom_data ) then
  539. ! start timing:
  540. call GO_Timer_Start( itim_aero_write, status )
  541. IF_NOTOK_RETURN(status=1)
  542. ! write last data set before done
  543. do region = 1, nregions
  544. call output_aerocom_write(region, aerocom_stat, status)
  545. IF_NOTOK_RETURN(status=1)
  546. end do
  547. call GO_Timer_End( itim_aero_write, status )
  548. IF_NOTOK_RETURN(status=1)
  549. call output_aerocom_done(aerocom_stat, status)
  550. IF_NOTOK_RETURN(status=1)
  551. end if
  552. if( gen_data ) then
  553. ! start timing:
  554. call GO_Timer_Start( itim_gen_write, status )
  555. IF_NOTOK_RETURN(status=1)
  556. ! write last data set before done
  557. do region = 1, nregions
  558. call output_general_write(region, status)
  559. IF_NOTOK_RETURN(status=1)
  560. end do
  561. call GO_Timer_End( itim_gen_write, status )
  562. IF_NOTOK_RETURN(status=1)
  563. call output_general_done( status)
  564. IF_NOTOK_RETURN(status=1)
  565. endif
  566. if ( nCCNdiag ) then
  567. deallocate(SuperSat)
  568. endif
  569. if( aerchemmip ) then
  570. region=1
  571. if (newhour(1))then
  572. call accumulate_data(aerchemmip_dhour,.false.,status)
  573. end if
  574. !if (.not. newday)then
  575. call output_aerchemmip_write(region, .true.,status)
  576. ! write last data set before done
  577. IF_NOTOK_RETURN(status=1)
  578. !end if
  579. !if (.not. newday)then
  580. call output_aerchemmip_write_daily(region, .true.,status)
  581. ! write last data set before done
  582. IF_NOTOK_RETURN(status=1)
  583. !end if
  584. ! There should be no unfinished hours to write out
  585. ! so the run will end at the end of 1h time step, when
  586. ! output is already written out
  587. if (.not. newhour(1))then
  588. call output_aerchemmip_write_6hourly(region, .true.,status)
  589. IF_NOTOK_RETURN(status=1)
  590. end if
  591. if (newhour(1))then
  592. call output_aerchemmip_write_hourly(region, .true.,status)
  593. IF_NOTOK_RETURN(status=1)
  594. end if
  595. call output_aerchemmip_done(status)
  596. IF_NOTOK_RETURN(status=1)
  597. end if
  598. #endif
  599. if( c4mip_data ) then
  600. region=1
  601. if (newhour(1))then
  602. write (gol,'(a,": Accumulate data")') rname; call goPr
  603. call accumulate_c4mip_data(c4mip_dhour,status)
  604. end if
  605. !if (.not. newday)then
  606. call output_c4mip_write_monthly(region, .true.,status)
  607. ! write last data set before done
  608. IF_NOTOK_RETURN(status=1)
  609. !end if
  610. !if (.not. newday)then
  611. call output_c4mip_write_daily(region, .true.,status)
  612. ! write last data set before done
  613. IF_NOTOK_RETURN(status=1)
  614. !end if
  615. ! There should be no unfinished hours to write out
  616. ! so the run will end at the end of 1h time step, when
  617. ! output is already written out
  618. if (.not. newhour(1))then
  619. call output_c4mip_write_6hourly(region, .true.,status)
  620. IF_NOTOK_RETURN(status=1)
  621. end if
  622. if (newhour(1))then
  623. call output_c4mip_write_hourly(region, .true.,status)
  624. IF_NOTOK_RETURN(status=1)
  625. end if
  626. !write (gol,'(a,": output_c4mip_done")') 'l691'; call goPr
  627. call output_c4mip_done(status)
  628. IF_NOTOK_RETURN(status=1)
  629. end if
  630. #ifdef with_hdf4
  631. if ( noaa_data) then
  632. call write_noaa_events(status)
  633. IF_NOTOK_RETURN(status=1)
  634. endif
  635. #endif
  636. if(flask_data) then
  637. call user_output_flask_done(status)
  638. IF_NOTOK_RETURN(status=1)
  639. endif
  640. if ( mix_data ) then
  641. call user_output_mix_done( status )
  642. IF_NOTOK_RETURN(status=1)
  643. endif
  644. if ( output_pdump ) then
  645. call Output_Pdump_Done( status )
  646. IF_NOTOK_RETURN(status=1)
  647. end if
  648. #ifdef with_cf_output
  649. if ( output_cf ) then
  650. call Output_cf_Done( status )
  651. IF_NOTOK_RETURN(status=1)
  652. end if
  653. #endif
  654. ! done with common stuff:
  655. call User_Output_Common_Done( status )
  656. IF_NOTOK_RETURN(status=1)
  657. ! ok
  658. status = 0
  659. END SUBROUTINE USER_OUTPUT_DONE
  660. !EOC
  661. !--------------------------------------------------------------------------
  662. ! TM5 !
  663. !--------------------------------------------------------------------------
  664. !BOP
  665. !
  666. ! !IROUTINE: USER_OUTPUT_STEP
  667. !
  668. ! !DESCRIPTION: Define user-specified model output for the region given
  669. ! Called every time step
  670. !\\
  671. !\\
  672. ! !INTERFACE:
  673. !
  674. subroutine user_output_step( region, status )
  675. !
  676. ! !USES:
  677. !
  678. use dims, only : itaur, newsrun, itaui, newday
  679. !>>> TvN
  680. !#ifdef with_m7
  681. use dims, only : newmonth, newhour,newday
  682. !#endif
  683. !<<< TvN
  684. use datetime, only : tau2date
  685. #ifdef with_hdf4
  686. use user_output_station, only : output_stationconc
  687. use user_output_noaa, only : get_noaa
  688. #endif
  689. use user_output_flight, only : get_flightdata
  690. use user_output_column, only : user_output_column_accum,user_output_column_evaluate,user_output_column_write,user_output_column_reset
  691. use user_output_mix, only : user_output_mix_accum,user_output_mix_write
  692. use user_output_mmix, only : accumulate_mmix
  693. use user_output_flask, only : user_output_flask_sample
  694. use user_output_pdump , only : Output_Pdump_Step
  695. use user_output_c4mip, only : output_c4mip_init,output_c4mip_write_monthly,accumulate_c4mip_data, output_c4mip_done,output_c4mip_write_hourly,output_c4mip_write_daily, output_c4mip_write_6hourly
  696. #ifdef with_m7
  697. use user_output_aerocom, only : output_aerocom_step, output_aerocom_init
  698. use user_output_aerocom, only : output_aerocom_write
  699. use user_output_aerchemmip, only : output_aerchemmip_init,output_aerchemmip_write,accumulate_data, output_aerchemmip_done,output_aerchemmip_write_hourly,output_aerchemmip_write_daily, output_aerchemmip_write_6hourly
  700. use user_output_general, only : output_general_step, output_general_init
  701. use user_output_general, only : output_general_write
  702. #endif
  703. ! #ifdef with_optics
  704. ! Use Optics, only : Optics_Step
  705. ! #endif
  706. ! #ifdef with_pm
  707. ! Use PM, only : PM_Step
  708. ! #endif
  709. #ifdef with_cf_output
  710. use user_output_cf , only : Output_cf_Step
  711. #endif
  712. !
  713. ! !INPUT PARAMETERS:
  714. !
  715. integer, intent(in) :: region
  716. !
  717. ! !OUTPUT PARAMETERS:
  718. !
  719. integer, intent(out) :: status
  720. !
  721. ! !REVISION HISTORY:
  722. ! 6 Feb 2011 - Achim Strunk - modified for aerocom-2 diagnostics.
  723. !
  724. ! !REMARKS:
  725. !
  726. !EOP
  727. !------------------------------------------------------------------------
  728. !BOC
  729. character(len=*), parameter :: rname = mname//'/user_output_step'
  730. ! --- local ------------------------------
  731. integer :: total_sec
  732. integer, dimension(6) :: idate_f
  733. #ifdef with_m7
  734. logical :: newaer
  735. #endif
  736. ! --- begin ------------------------------
  737. call tau2date(itaur(region),idate_f)
  738. if ( mmix_data ) then
  739. call accumulate_mmix( region,status )
  740. IF_NOTOK_RETURN(status=1)
  741. endif
  742. ! #ifdef with_optics
  743. ! Call Optics_Step(region,status)
  744. ! IF_NOTOK_RETURN(status=1)
  745. ! #endif
  746. #ifdef with_hdf4
  747. if ( station_data ) then
  748. call output_stationconc(region, status)
  749. IF_NOTOK_RETURN(status=1)
  750. ! #ifdef with_pm
  751. ! Call PM_Step(region,status)
  752. ! IF_NOTOK_RETURN(status=1)
  753. ! #endif
  754. endif
  755. ! The third keyword here ("force") is for instantaneous sampling. Default
  756. ! value of .false. yields a four-hour window centered on sample time.
  757. !
  758. if ( noaa_data ) call get_noaa(region,itaur(region),.false.)
  759. #endif
  760. if ( flight_data ) then
  761. call get_flightdata(region, idate_f, status)
  762. IF_NOTOK_RETURN(status=1)
  763. endif
  764. if(flask_data) then
  765. call user_output_flask_sample(region,itaur(region),status)
  766. IF_NOTOK_RETURN(status=1)
  767. endif
  768. if ( mix_data ) then
  769. if ( modulo(itaur(region)-itaui,mix_data_dhour*3600) == 0 ) then
  770. call user_output_mix_write(region, status )
  771. IF_NOTOK_RETURN(status=1)
  772. endif
  773. call user_output_mix_accum(region, status)
  774. IF_NOTOK_RETURN(status=1)
  775. end if
  776. if (column_data) then
  777. call user_output_column_accum( region, status )
  778. IF_NOTOK_RETURN( status=1 )
  779. if ( (itaur(region)-itaui .gt. 0) .and. (modulo(itaur(region)-itaui,column_data_dtsec) == 0 )) then
  780. call user_output_column_evaluate( status )
  781. IF_NOTOK_RETURN(status=1)
  782. call user_output_column_write( region, status )
  783. IF_NOTOK_RETURN(status=1)
  784. call user_output_column_reset( status )
  785. IF_NOTOK_RETURN(status=1)
  786. endif
  787. endif
  788. #ifdef with_m7
  789. ! -------------------
  790. ! AEROCOM DIAGNOSTICS
  791. ! -------------------
  792. IF( aerocom_data ) then
  793. ! write (for previous hour, day or month) in case we reach a new hour, day or month
  794. select case (trim(aerocom_freq))
  795. case ('hourly')
  796. if (modulo(idate_f(4),aerocom_dhour)==0)then
  797. newaer = newhour(region)
  798. else
  799. newaer = .false.
  800. end if
  801. case ('daily')
  802. newaer = newday
  803. case ('monthly')
  804. newaer = newmonth
  805. end select
  806. ! start timing:
  807. call GO_Timer_Start( itim_aero_write, status )
  808. IF_NOTOK_RETURN(status=1)
  809. if ( newaer .and. .NOT. newsrun ) then
  810. call output_aerocom_write(region, aerocom_stat, status)
  811. IF_NOTOK_RETURN(status=1)
  812. end if
  813. call GO_Timer_End( itim_aero_write, status )
  814. IF_NOTOK_RETURN(status=1)
  815. ! start timing:
  816. call GO_Timer_Start( itim_aero_init, status )
  817. IF_NOTOK_RETURN(status=1)
  818. ! initialise for each new hour, day or month
  819. if ( newaer ) then
  820. call output_aerocom_init( aerocom_stat, status )
  821. IF_NOTOK_RETURN(status=1)
  822. end if
  823. ! stop timing
  824. call GO_Timer_End( itim_aero_init, status )
  825. IF_NOTOK_RETURN(status=1)
  826. ! start timing:
  827. call GO_Timer_Start( itim_aero_step, status )
  828. IF_NOTOK_RETURN(status=1)
  829. ! do an accumulation step
  830. if ( (modulo(idate_f(4),aerocom_dhour)==0) .and. all(idate_f(5:6)==0) ) then
  831. call output_aerocom_step( region, aerocom_dhour, aerocom_stat, status )
  832. IF_NOTOK_RETURN(status=1)
  833. end if
  834. !stop timing
  835. call GO_Timer_End( itim_aero_step, status )
  836. IF_NOTOK_RETURN(status=1)
  837. end IF
  838. if (gen_data) then
  839. ! write (for previous hour, day or month) in case we reach a new hour, day or month
  840. select case (trim(gen_freq))
  841. case ('hourly')
  842. newaer = newhour(region)
  843. case ('daily')
  844. newaer = newday
  845. case ('monthly')
  846. newaer = newmonth
  847. end select
  848. ! start timing:
  849. call GO_Timer_Start( itim_gen_write, status )
  850. IF_NOTOK_RETURN(status=1)
  851. if ( newaer .and. .NOT. newsrun ) then
  852. call output_general_write(region, status)
  853. IF_NOTOK_RETURN(status=1)
  854. end if
  855. call GO_Timer_End( itim_gen_write, status )
  856. IF_NOTOK_RETURN(status=1)
  857. call GO_Timer_Start( itim_gen_init, status )
  858. IF_NOTOK_RETURN(status=1)
  859. ! initialise for each new hour, day or month
  860. if ( newaer ) then
  861. call output_general_init( status )
  862. IF_NOTOK_RETURN(status=1)
  863. end if
  864. ! stop timing
  865. call GO_Timer_End( itim_gen_init, status )
  866. IF_NOTOK_RETURN(status=1)
  867. call GO_Timer_Start( itim_gen_step, status )
  868. IF_NOTOK_RETURN(status=1)
  869. ! do an accumulation step
  870. if ( (modulo(idate_f(4),gen_dhour)==0) .and. all(idate_f(5:6)==0) ) then
  871. call output_general_step( region, gen_dhour, status )
  872. IF_NOTOK_RETURN(status=1)
  873. end if
  874. !stop timing
  875. call GO_Timer_End( itim_gen_step, status )
  876. IF_NOTOK_RETURN(status=1)
  877. end IF
  878. ! -------------------
  879. !
  880. if (aerchemmip) then
  881. if (newsrun) then
  882. call output_aerchemmip_init( status )
  883. IF_NOTOK_RETURN(status=1)
  884. end if
  885. !accumulate every hour
  886. !if ( newhour(1) .and. .not. newsrun ) then
  887. if ( newhour(1) ) then
  888. !(modulo(idate_f(4),aerchemmip_dhour)==0) .and. all(idate_f(5:6)==0) ) then
  889. if (newsrun) then
  890. ! First step of the year, do instantaneous output from restarts
  891. ! so do only ec550aer -> .true.
  892. call accumulate_data(aerchemmip_dhour,.true.,status)
  893. else
  894. call accumulate_data(aerchemmip_dhour,.false.,status)
  895. end if
  896. IF_NOTOK_RETURN(status=1)
  897. end if
  898. !monthly
  899. if (newmonth .and. .NOT. newsrun ) then
  900. !if (newhour .and. .NOT. newsrun ) then
  901. call output_aerchemmip_write(region, newhour(1), status)
  902. IF_NOTOK_RETURN(status=1)
  903. end if
  904. !hourly
  905. !newhour(1) means newhour at region 1 (global, now zooming expected in AERCHEMMIP)
  906. ! aerchemmip hourly output is a mean over 1 hour, so no writing out
  907. ! initial values
  908. if (newhour(1) .and. .NOT. newsrun .and. aerchemmip_1h) then
  909. call output_aerchemmip_write_hourly(region, newhour(1),status)
  910. IF_NOTOK_RETURN(status=1)
  911. end if
  912. !6hourly
  913. !newhour(1) means newhour at region 1 (global, now zooming expected in AERCHEMMIP)
  914. ! Since 6 hourly output is instantaneous and we want to have output for hour 0 of the new year
  915. ! we output even on the first hour, for the new year this will be the last
  916. ! value of the previous year which is read from a restart file but seems to check out
  917. ! see #xxx-note-x in ec-earth portal
  918. if (newhour(1) .and. modulo(idate_f(4),6)==0) then
  919. call output_aerchemmip_write_6hourly(region, newhour(1),status)
  920. IF_NOTOK_RETURN(status=1)
  921. end if
  922. !daily
  923. if (newday .and. .NOT. newsrun ) then
  924. call output_aerchemmip_write_daily(region, newhour(1),status)
  925. IF_NOTOK_RETURN(status=1)
  926. end if
  927. end if
  928. #endif
  929. !-------
  930. ! co2 output
  931. !----------
  932. if ( c4mip_data ) then
  933. if (newsrun) then
  934. call output_c4mip_init(status)
  935. IF_NOTOK_RETURN(status=1)
  936. end if
  937. if (newhour(1)) then
  938. call accumulate_c4mip_data(c4mip_dhour,status)
  939. end if
  940. if (newhour(1) .and. .NOT. newsrun .and. c4mip_1h) then
  941. call output_c4mip_write_hourly(region, newhour(1),status)
  942. IF_NOTOK_RETURN(status=1)
  943. end if
  944. if (newmonth .and. .NOT. newsrun ) then
  945. call output_c4mip_write_monthly(region, newhour(1),status)
  946. IF_NOTOK_RETURN(status=1)
  947. end if
  948. if (newday .and. .NOT. newsrun ) then
  949. call output_c4mip_write_daily(region, newhour(1),status)
  950. IF_NOTOK_RETURN(status=1)
  951. end if
  952. end if
  953. !
  954. if ( output_pdump ) then
  955. total_sec = idate_f(4)*3600 + idate_f(5)*60 + idate_f(6)
  956. if ( modulo(total_sec,output_pdump_dsec) == 0 ) then
  957. call Output_Pdump_Step( region, idate_f, status )
  958. IF_NOTOK_RETURN(status=1)
  959. end if
  960. end if
  961. #ifdef with_cf_output
  962. if ( output_cf ) then
  963. if ( (modulo(idate_f(4),output_cf_dhour)==0) .and. all(idate_f(5:6)==0) ) then
  964. call Output_CF_Step( region, idate_f, status )
  965. IF_NOTOK_RETURN(status=1)
  966. end if
  967. end if
  968. #endif
  969. ! ok
  970. status = 0
  971. END SUBROUTINE USER_OUTPUT_STEP
  972. !EOC
  973. !--------------------------------------------------------------------------
  974. ! TM5 !
  975. !--------------------------------------------------------------------------
  976. !BOP
  977. !
  978. ! !IROUTINE: USER_OUTPUT_MEAN
  979. !
  980. ! !DESCRIPTION: Calculate and write means at stations.
  981. !\\
  982. !\\
  983. ! !INTERFACE:
  984. !
  985. subroutine user_output_mean(status)
  986. !
  987. ! !USES:
  988. !
  989. use dims, only : itau, ndyn_max
  990. #ifdef with_hdf4
  991. use user_output_station, only : evaluate_stationconc, reset_stationconc_accumulator, write_stationconc
  992. #endif
  993. ! #ifdef with_optics
  994. ! Use Optics , only : Optics_Write
  995. ! #endif
  996. ! #ifdef with_pm
  997. ! Use PM, only : PM_Write
  998. ! #endif
  999. !
  1000. ! !INPUT/OUTPUT PARAMETERS:
  1001. !
  1002. integer, intent(inout) :: status
  1003. !
  1004. ! !REVISION HISTORY:
  1005. ! 6 Feb 2011 - Achim Strunk -
  1006. !
  1007. ! !REMARKS:
  1008. !
  1009. !EOP
  1010. !------------------------------------------------------------------------
  1011. !BOC
  1012. character(len=*), parameter :: rname = mname//'/user_output_mean'
  1013. #ifdef with_hdf4
  1014. IF(station_data)THEN
  1015. IF(mod(itau, ndyn_max) == 0) THEN
  1016. CALL evaluate_stationconc(status)
  1017. IF_NOTOK_RETURN(status=1)
  1018. CALL write_stationconc(status)
  1019. IF_NOTOK_RETURN(status=1)
  1020. CALL reset_stationconc_accumulator
  1021. ENDIF
  1022. ENDIF
  1023. #endif
  1024. ! #ifdef with_optics
  1025. ! ! Write Optics as if it is a station file, so at the end of one whole time step.
  1026. ! ! We might have a parallellization problem, since we are parallel in levels or tracers,
  1027. ! ! and I do not know what is what. However, the AOD is already integrated over levels
  1028. ! ! and tracers, so it may not make a difference after all.
  1029. ! Call Optics_Write (station_data,status)
  1030. ! IF_NOTOK_RETURN(status=1)
  1031. ! #endif
  1032. ! #ifdef with_pm
  1033. ! ! Write particulate matter like the optics data into the station files
  1034. ! If (station_data) Then
  1035. ! Call PM_Write (status)
  1036. ! IF_NOTOK_RETURN(status=1)
  1037. ! End If
  1038. ! #endif
  1039. ! ok
  1040. status = 0
  1041. end subroutine user_output_mean
  1042. END MODULE USER_OUTPUT