emission_read.F90 217 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734
  1. #define TRACEBACK write (gol,'("in ",a," (",a,i6,")")') rname, __FILE__, __LINE__ ; call goErr
  2. #define IF_NOTOK_RETURN(action) if (status/=0) then; TRACEBACK; action; return; end if
  3. #define IF_ERROR_RETURN(action) if (status> 0) then; TRACEBACK; action; return; end if
  4. !
  5. #include "tm5.inc"
  6. !
  7. !-----------------------------------------------------------------------------
  8. ! TM5 !
  9. !-----------------------------------------------------------------------------
  10. !BOP
  11. !
  12. ! !MODULE: EMISSION_READ
  13. !
  14. ! !DESCRIPTION: This module provides objects and methods related to
  15. ! CMIP6, IPCC-AR5, EDGAR-4, RETRO_FIRES, LPJ and MACC emissions.
  16. !
  17. ! AR5 netCDF files are provided by FZ-Juelich and IIASA:
  18. ! ftp://ftp-ipcc.fz-juelich.de/pub/emissions/gridded_netcdf/
  19. ! http://www.iiasa.ac.at/web-apps/tnt/RcpDb/
  20. !
  21. ! These data sets are not covering natural emissions. For these
  22. ! sources additional data from the MACC project are used (sectors
  23. ! ocean, soil, biogenic and natural, see below).
  24. !
  25. ! There are a few keys in the rc-file which control the behaviour of
  26. ! this module and the data used:
  27. ! # specify the (main) provider of emission sets
  28. ! input.emis.provider : AR5
  29. ! # where to find the emissions (this will be used by install-emis-ar5)
  30. ! input.emis.dir : ${TEMP}/EMIS/AR5
  31. ! # year of emissions (AR5 emissions will be linearly interpolated)
  32. ! input.emis.year : 2000
  33. ! # choose RCP out of RCP26, RCP45, RCP60, RCP85
  34. ! input.emis.AR5.RCP : RCP45
  35. !
  36. !\\
  37. !\\
  38. ! !INTERFACE:
  39. !
  40. MODULE EMISSION_READ
  41. !
  42. ! !USES:
  43. !
  44. use GO, only : gol, goErr, goPr, goLabel
  45. use emission_data, only : emis_input_dir_cmip6
  46. use emission_data, only : emis_input_dir_ar5
  47. use emission_data, only : emis_input_dir_ed4, emis_input_dir_mac
  48. use emission_data, only : vd_class_name_len
  49. use dims, only : nlon360, nlat180, iglbsfc
  50. use chem_param, only : ncb5
  51. use chem_param, only : xmc, xmh, xmch2o, xmeth, xmgly, xmhcooh, xmmcooh, xmacet
  52. use chem_param, only : xmole, xmald2, xmpar, xmo
  53. use Dims, only : okdebug
  54. USE MDF, ONLY : MDF_Open, MDF_NETCDF, MDF_HDF4, MDF_READ
  55. USE MDF, ONLY : MDF_Inq_VarID, MDF_Get_Var, MDF_Close
  56. implicit none
  57. private
  58. !
  59. ! !PUBLIC MEMBER FUNCTIONS:
  60. !
  61. public :: emission_read_init, emission_read_done
  62. !!$ public :: emission_ar5_readcategory
  63. public :: emission_ar5_regrid_aircraft
  64. public :: numb_2dsec, numb_3dsec
  65. public :: numb_sectors, sectors_def
  66. public :: numb_providers, providers_def
  67. public :: sector_name_len
  68. public :: read_cmip6_zch4
  69. public :: emis_cmip6_voc_name
  70. public :: emission_cmip6_readsector
  71. public :: emission_cmip6bmb_readsector
  72. public :: emission_ar5_readsector
  73. public :: emission_macc_readsector
  74. public :: emission_ed4_readsector
  75. public :: emission_gfed_readsector
  76. public :: emission_retro_readsector
  77. public :: emission_lpj_readsector
  78. public :: emission_hymn_readsector
  79. public :: emission_megan_readsector
  80. public :: ar5_dim_3ddata
  81. public :: emis_ar5_voc2cbm5_default
  82. public :: emis_ar5_voc2cbm5_biomassb
  83. public :: emis_ar5_voc2cbm5_biogenic
  84. public :: emis_ar5_voc_name, emis_ar5_nvoc
  85. public :: ar5_cat_ant, ar5_cat_shp, ar5_cat_air, ar5_cat_bmb
  86. ! CMIP6 aircraft
  87. public :: emis_cmip6_aircraft_tot2voc
  88. public :: emis_cmip6_aircraft_tl_tot2voc
  89. ! CMIP6BMB
  90. public :: emis_cmip6bmb_voc2cbm5
  91. public :: emis_cmip6bmb_voc_name, emis_cmip6bmb_nvoc
  92. ! MACC
  93. public :: emis_macc_voc2cbm5_default
  94. public :: emis_macc_voc2cbm5_biogenic
  95. public :: emis_macc_voc2cbm5_biomassb
  96. public :: emis_macc_voc_name, emis_macc_nvoc
  97. ! MEGAN
  98. public :: emis_megan_voc2cbm5_biogenic
  99. public :: emis_megan_nvoc, emis_megan_voc_name
  100. public :: emis_gfed_voc_name, emis_gfed_nvoc
  101. public :: emis_voc2cbm5_gfed
  102. public :: emis_retro_voc_name
  103. public :: sector_type, provider_type
  104. ! EDGAR 4.2
  105. public :: ed42_nsect_co, ed42_nsect_ch4
  106. public :: ed42_nsect_nox, ed42_nsect_hc
  107. public :: ed42_nsect_nh3, ed42_nsect_so2
  108. public :: ed42_co_sectors, ed42_ch4_sectors
  109. public :: ed42_nox_sectors, ed42_hc_sectors
  110. public :: ed42_nh3_sectors, ed42_so2_sectors
  111. !
  112. ! !PRIVATE DATA MEMBERS:
  113. !
  114. character(len=*), parameter :: mname = 'emission_read'
  115. ! ------------------------------
  116. ! global characteristics
  117. ! ------------------------------
  118. integer, parameter :: nlat360 = 360 ! number of latitudes for CMIP6, AR5, MACC, EDGAR, GFED, RETRO data (0.5deg)
  119. integer, parameter :: nlon720 = 720 ! number of longitudes for CMIP6, AR5, MACC, EDGAR, GFED, RETRO data (0.5deg)
  120. integer, parameter :: nlat720 = 720 ! number of latitudes for CMIP6BMB (0.25deg)
  121. integer, parameter :: nlon1440 = 1440 ! number of longitudes for CMIP6BMB (0.25deg)
  122. integer, parameter :: lpj_dim_nlat = 150 ! number of latitudes (1deg), no emissions 60S-90S
  123. integer, parameter :: lpj_dim_nlon = 360 ! number of longitudes (1deg)
  124. integer, parameter :: sector_name_len = 18 ! length of sector descriptor
  125. integer, parameter :: categ_name_len = 14 ! length of category descriptor
  126. integer, parameter :: numb_sectors = 82 ! number of sectors (All providers!)
  127. integer, parameter :: numb_2dsec = 67 ! number of 2d sectors (all except aircraft)
  128. integer, parameter :: numb_3dsec = 2 ! number of 3d sectors (aircraft)
  129. ! In contrast to AR5, CMIP6 and CMIP6BMB are counted as separate providers
  130. integer, parameter :: numb_providers = 11 ! CMIP6, CMIP6BMB, AR5, MACC, ED41, ED42, LPJ, HYMN, GFEDv3, RETRO, MEGAN
  131. ! Since CMIP6 emissions from aviation are provided on the same vertical grid
  132. ! as for AR5, this variable is also used for CMIP6:
  133. integer, parameter :: ar5_dim_3ddata = 25 ! number of layers for aircraft data
  134. ! full list of providers
  135. character(10), dimension(numb_providers), parameter :: all_providers = &
  136. & (/ 'CMIP6 ', 'CMIP6BMB ', 'RETRO ', 'AR5 ', 'MACC ', &
  137. 'ED41 ', 'ED42 ', 'LPJ ', 'HYMN ', 'GFEDv3 ','MEGAN '/)
  138. ! List of providers effectively used
  139. character(10), PUBLIC, allocatable :: used_providers(:) ! general: CO, NMVOC, NOX, SOx, NH3
  140. character(10), PUBLIC, allocatable :: used_providers_isop(:) ! ISOP
  141. character(10), PUBLIC, allocatable :: used_providers_terp(:) ! TERP
  142. character(10), PUBLIC, allocatable :: used_providers_ch4(:) ! CH4
  143. character(10), PUBLIC, allocatable :: used_providers_aer(:) ! BC and POM
  144. ! flag for degenerated cases
  145. logical, PUBLIC :: has_aer_emis = .true.
  146. logical, PUBLIC :: has_ch4_emis = .true.
  147. logical, PUBLIC :: has_isop_emis = .true.
  148. logical, PUBLIC :: has_terp_emis = .true.
  149. logical, PUBLIC :: has_emis = .true.
  150. ! extra params EDGAR 4.2: sectors used per species (here we already take out BMB and transport)
  151. integer, parameter :: ed42_nsect_co = 8 ! (all=11) number of sectors for CO
  152. integer, parameter :: ed42_nsect_ch4 = 13 ! (all=16) number of sectors for CH4
  153. integer, parameter :: ed42_nsect_nox = 10 ! (all=13) number of sectors for NOx
  154. integer, parameter :: ed42_nsect_hc = 9 ! (all=12) number of sectors for NMVOC
  155. integer, parameter :: ed42_nsect_nh3 = 9 ! (all=11) number of sectors for NH3
  156. integer, parameter :: ed42_nsect_so2 = 8 ! (all=11) number of sectors for SO2
  157. character(len=sector_name_len), dimension(ed42_nsect_co) :: ed42_co_sectors ! CO sectors in EDGAR 4.2
  158. character(len=sector_name_len), dimension(ed42_nsect_ch4) :: ed42_ch4_sectors ! CH4 sectors in EDGAR 4.2
  159. character(len=sector_name_len), dimension(ed42_nsect_nox) :: ed42_nox_sectors ! NOx sectors in EDGAR 4.2
  160. character(len=sector_name_len), dimension(ed42_nsect_hc) :: ed42_hc_sectors ! NMVOC sectors in EDGAR 4.2
  161. character(len=sector_name_len), dimension(ed42_nsect_nh3) :: ed42_nh3_sectors ! NH3 sectors in EDGAR 4.2
  162. character(len=sector_name_len), dimension(ed42_nsect_so2) :: ed42_so2_sectors ! SO2 sectors in EDGAR 4.2
  163. ! ------------------------------
  164. ! data used to construct filenames
  165. ! ------------------------------
  166. character(len=15), parameter :: filestr_common_pre = 'IPCC_emissions'
  167. character(len=25), parameter :: filestr_common_post = '0.5x0.5.nc'
  168. ! ------------------------------
  169. ! identifier of RCPs (RCP26, RCP45,...)
  170. ! ------------------------------
  171. character(len=5) :: filestr_rcpiden
  172. ! ------------------------------
  173. ! available years and related parameters/variables
  174. ! ------------------------------
  175. ! availability (min, max years) - Limit MACC and MEGAN to one year for EC-Earth
  176. integer, dimension(2), parameter :: cmip6_avail = (/1850, 2100/)
  177. integer, dimension(2), parameter :: retro_avail = (/1960, 2000/)
  178. integer, dimension(2), parameter :: ar5_avail = (/1850, 2100/)
  179. integer, dimension(2), parameter :: macc_avail = (/1998, 1998/)
  180. integer, dimension(2), parameter :: ed41_avail = (/2005, 2005/)
  181. integer, dimension(2), parameter :: ed42_avail = (/1970, 2008/)
  182. integer, dimension(2), parameter :: lpj_avail = (/1990, 2008/)
  183. integer, dimension(2), parameter :: hymn_avail = (/ 999, 999/) ! not used
  184. integer, dimension(2), parameter :: gfed3_avail = (/1997, 2010/)
  185. integer, dimension(2), parameter :: megan_avail = (/2000, 2000/)
  186. integer, parameter :: ar5_nr_avail_yrs = 27
  187. integer, dimension(ar5_nr_avail_yrs), parameter :: &
  188. ar5_avail_yrs = (/ 1850, 1860, 1870, 1880, 1890, 1900, &
  189. 1910, 1920, 1930, 1940, 1950, 1960, &
  190. 1970, 1980, 1990, &
  191. 2000, 2005, 2010, 2020, 2030, 2040, &
  192. 2050, 2060, 2070, 2080, 2090, 2100 /)
  193. integer, parameter :: ed41_nr_avail_yrs = 12
  194. integer, dimension(ed41_nr_avail_yrs), parameter :: &
  195. ed41_avail_yrs = (/ 1970, 1975, 1980, 1985, 1990, 1995, 2000, &
  196. 2001, 2002, 2003, 2004, 2005 /)
  197. logical, dimension(:), allocatable :: ltimeind
  198. logical, save :: lpj_fractions_found
  199. real, dimension(:,:,:), allocatable :: lpj_frac_wetlands
  200. real, dimension(:,:,:), allocatable :: lpj_frac_rice
  201. real, dimension(:,:), allocatable :: lpj_frac_peatlands
  202. character(len=7) :: ar5_coverage = 'monthly'
  203. character(len=7) :: ed4_coverage = 'yearly '
  204. character(len=7) :: lpj_coverage = 'monthly'
  205. ! AR5 list of species available for each category
  206. character(len=26), target, dimension(31) :: ar5_cat_ant=(/ &
  207. 'Acids ', 'alcohols ', 'BC ', &
  208. 'benzene ', 'butanes ', 'CH4 ', &
  209. 'chlorinated_HC ', 'CO ', 'esters ', &
  210. 'ethane ', 'ethene ', 'ethers ', &
  211. 'ethyne ', 'formaldehyde ', 'hexanes_and_higher_alkanes', &
  212. 'ketones ', 'NH3 ', 'NMVOC ', &
  213. 'NO ', 'OC ', 'other_alkanals ', &
  214. 'other_alkenes_and_alkynes ', 'other_aromatics ', 'other_VOC ', &
  215. 'pentanes ', 'propane ', 'propene ', &
  216. 'SO2 ', 'toluene ', 'trimethyl_benzenes ', &
  217. 'xylene '/)
  218. character(len=26), target, dimension(3) :: ar5_cat_air=(/ &
  219. 'BC ', 'NO2 ', 'NO '/)
  220. character(len=26), target, dimension(22) :: ar5_cat_shp=(/ &
  221. 'BC ', 'benzene ', 'butanes ', &
  222. 'CH4 ', 'CO ', 'ethane ', &
  223. 'ethene ', 'ethyne ', 'hexanes_and_higher_alkanes', &
  224. 'NH3 ', 'NMVOC ', 'NO ', &
  225. 'OC ', 'other_alkenes_and_alkynes ', 'other_aromatics ', &
  226. 'pentanes ', 'propane ', 'propene ', &
  227. 'SO2 ', 'toluene ', 'trimethyl_benzenes ', &
  228. 'xylene '/)
  229. character(len=26), target, dimension(31) :: ar5_cat_bmb=(/ &
  230. 'acids ', 'alcohols ', 'BC ', &
  231. 'benzene ', 'butanes ', 'CH4 ', &
  232. 'chlorinated_HC ', 'CO ', 'ethane ', &
  233. 'ethene ', 'ethers ', 'ethyne ', &
  234. 'formaldehyde ', 'hexanes_and_higher_alkanes', 'isoprene ', &
  235. 'ketones ', 'NH3 ', 'NMVOC ', &
  236. 'NO ', 'OC ', 'other_alkanals ', &
  237. 'other_alkenes_and_alkynes ', 'other_aromatics ', 'other_VOC ', &
  238. 'pentanes ', 'propane ', 'propene ', &
  239. 'SO2 ', 'terpenes ', 'toluene ', &
  240. 'xylene '/)
  241. ! and number of sectors in each category
  242. integer, public :: n_ar5_ant_sec, n_ar5_shp_sec, n_ar5_air_sec, n_ar5_bmb_sec
  243. ! reduced ar5 species available per anthro-sector (to screen out unavailable VOC)
  244. character(len=26), target, dimension(28) :: ar5_cat_ant_ene_ind=(/ &
  245. 'acids ', 'alcohols ', 'BC ', &
  246. 'benzene ', 'butanes ', 'CH4 ', &
  247. 'CO ', 'ethane ', 'ethene ', &
  248. 'ethyne ', 'formaldehyde ', 'hexanes_and_higher_alkanes', &
  249. 'ketones ', 'NH3 ', 'NMVOC ', &
  250. 'NO ', 'OC ', 'other_alkanals ', &
  251. 'other_alkenes_and_alkynes ', 'other_aromatics ', 'other_VOC ', &
  252. 'pentanes ', 'propane ', 'propene ', &
  253. 'SO2 ', 'toluene ', 'trimethyl_benzenes ', &
  254. 'xylene '/)
  255. character(len=26), target, dimension(29) :: ar5_cat_ant_dom=(/&
  256. 'acids ', 'alcohols ', 'BC ', &
  257. 'benzene ', 'butanes ', 'CH4 ', &
  258. 'CO ', 'ethane ', 'ethene ', &
  259. 'ethers ', 'ethyne ', 'formaldehyde ', &
  260. 'hexanes_and_higher_alkanes', 'ketones ', 'NH3 ', &
  261. 'NMVOC ', 'NO ', 'OC ', &
  262. 'other_alkanals ', 'other_alkenes_and_alkynes ', 'other_aromatics ', &
  263. 'other_VOC ', 'pentanes ', 'propane ', &
  264. 'propene ', 'SO2 ', 'toluene ', &
  265. 'trimethyl_benzenes ', 'xylene '/)
  266. character(len=26), target, dimension(27) :: ar5_cat_ant_agr=(/ &
  267. 'acids ', 'alcohols ', 'BC ', &
  268. 'benzene ', 'butanes ', 'CH4 ', &
  269. 'CO ', 'ethane ', 'ethene ', &
  270. 'ethers ', 'ethyne ', 'formaldehyde ', &
  271. 'hexanes_and_higher_alkanes', 'ketones ', 'NH3 ', &
  272. 'NMVOC ', 'NO ', 'OC ', &
  273. 'other_alkanals ', 'other_alkenes_and_alkynes ', 'other_aromatics ', &
  274. 'pentanes ', 'propane ', 'propene ', &
  275. 'SO2 ', 'toluene ', 'xylene '/)
  276. character(len=26), target, dimension(25) :: ar5_cat_ant_awb=(/&
  277. 'acids ', 'alcohols ', 'BC ', &
  278. 'benzene ', 'butanes ', 'CH4 ', &
  279. 'CO ', 'ethane ', 'ethene ', &
  280. 'ethyne ', 'formaldehyde ', 'hexanes_and_higher_alkanes', &
  281. 'ketones ', 'NH3 ', 'NMVOC ', &
  282. 'NO ', 'OC ', 'other_alkanals ', &
  283. 'other_alkenes_and_alkynes ', 'pentanes ', 'propane ', &
  284. 'propene ', 'SO2 ', 'toluene ', &
  285. 'xylene '/)
  286. character(len=26), target, dimension(18) :: ar5_cat_ant_slv=(/&
  287. 'alcohols ', 'BC ', 'CH4 ', &
  288. 'chlorinated_HC ', 'CO ', 'esters ', &
  289. 'ethers ', 'hexanes_and_higher_alkanes', 'ketones ', &
  290. 'NH3 ', 'NMVOC ', 'NO ', &
  291. 'OC ', 'other_aromatics ', 'other_VOC ', &
  292. 'SO2 ', 'toluene ', 'xylene '/)
  293. character(len=26), target, dimension(29) :: ar5_cat_ant_tra=(/&
  294. 'BC ', 'benzene ', 'butanes ', &
  295. 'CH4 ', 'chlorinated_HC ', 'CO ', &
  296. 'esters ', 'ethane ', 'ethene ', &
  297. 'ethers ', 'ethyne ', 'formaldehyde ', &
  298. 'hexanes_and_higher_alkanes', 'ketones ', 'NH3 ', &
  299. 'NMVOC ', 'NO ', 'OC ', &
  300. 'other_alkanals ', 'other_alkenes_and_alkynes ', 'other_aromatics ', &
  301. 'other_VOC ', 'pentanes ', 'propane ', &
  302. 'propene ', 'SO2 ', 'toluene ', &
  303. 'trimethyl_benzenes ', 'xylene '/)
  304. ! ------------------------------
  305. ! gridbox area (to be read only once per proc)
  306. ! ------------------------------
  307. character(len=25),parameter :: cmip6_filestr_gridboxarea = 'gridbox_area.nc '
  308. character(len=25),parameter :: ar5_filestr_gridboxarea = 'gridbox_area.nc '
  309. character(len=25),parameter :: ed4_filestr_gridboxarea = 'gridbox_area.nc '
  310. character(len=25),parameter :: lpj_filestr_gridboxarea = 'maps/lpj_gridcell_area.nc'
  311. logical, save :: area_found_025, area_found_05
  312. logical, save :: lpj_area_found
  313. real, dimension(:,:), allocatable :: gridbox_area_025 ! gridbox area on 0.25x0.25 deg - used for MACCBMB
  314. real, dimension(:,:), allocatable :: gridbox_area_05 ! gridbox area on 0.5x0.5 deg - used for AR5, MACC, EDGAR, GFED, RETRO, MEGAN
  315. real, dimension(:,:), allocatable :: lpj_gridbox_area ! stored as double in file
  316. ! -----------------------
  317. ! data type for sectors
  318. ! -----------------------
  319. type sector_type
  320. sequence
  321. character(len=sector_name_len) :: name ! name of sector
  322. character(len=categ_name_len) :: catname ! name of category to be found in
  323. logical :: f3d ! 3d-data y/n
  324. character(len=vd_class_name_len) :: vdisttype ! vertical distribution type (equal to "classes" still to be defined)
  325. character(len=8) :: prov ! provider of information (AR5, MACC, ED4)
  326. character(len=26), dimension(:), pointer :: species ! list of species available for that sector (use for AR5 only)
  327. end type sector_type
  328. type provider_type
  329. character(len=8) :: name
  330. integer :: nsect2d, nsect3d
  331. end type provider_type
  332. type(sector_type), dimension(numb_sectors) :: sectors_def
  333. type(provider_type), dimension(numb_providers) :: providers_def
  334. ! ----------------------------------------------------------------------------------
  335. ! NMVOC settings
  336. ! ----------------------------------------------------------------------------------
  337. ! ----------------------------------------------------------------------------------
  338. ! A R 5 ( following GEMS setup ) - also used for CMIP6 anthropogenic and EDGAR
  339. ! ----------------------------------------------------------------------------------
  340. !
  341. ! Quotation of emission_tools_gems.F90:
  342. ! -------------------------------------
  343. ! Distribution of NMV over the CBM-4 components (kg C/kg NMV) .
  344. ! VOC numbering according to TNO/RETRO speciation.
  345. ! Anthropogenic emissions of isoprene (ivoc=10), monoterpenes(ivoc=11) and others(ivoc=25)
  346. ! are not used (set to zero in voc2c_tno and voc2c_fires) .
  347. ! The speciation is slightly different for biomass burning emissions, where:
  348. ! voc_1 is methanol (which does not contribute) instead of alcohols,
  349. ! voc_23 is acetone instead of ketones and
  350. ! acetaldehyde is given instead of 'other aldehydes' (voc_22)
  351. ! For biomass burning isoprene (ivoc_10) and monoterpene (ivoc_11) are nonzero
  352. ! and need to be included separately.
  353. !
  354. integer, parameter :: emis_ar5_nvoc = 25
  355. !
  356. ! AR5 components TM4-RETRO Available EDGAR41 UNavailable EDGAR42 from ED42_HC_SECTORS
  357. ! Transport sectors (1A3*) (ignoring 1A3* transport, and 5A_C_D_F_4E fires)
  358. ! --------------------------------------------------------------------------------------------------------------------------
  359. ! alcohols 1) alcohols 1A3b_c_e (2005 only) 1A4
  360. ! ethane 2) ethane 1A3b_c_e 1A3d1 1A3d_SHIP = id. 3
  361. ! propane 3) propane id. 3
  362. ! butanes 4) butanes id. 3
  363. ! pentanes 5) pentanes id. 3
  364. ! hexanes and higher alkanes 6) hexanes and higher alkanes id.
  365. ! ethene 7) ethene id. 3
  366. ! propene 8) propene id. 3
  367. ! ethyne 9) ethyne id. 3
  368. ! isoprene 10) isoprene --none-- all
  369. ! terpenes 11) terpenes --none-- all
  370. ! other alkenes and alkynes 12) lumped alkenes id. 3
  371. ! benzene 13) benzene id. 3
  372. ! toluene 14) toluene id.
  373. ! xylene 15) xylene id.
  374. ! trimethyl benzenes 16) trimethylbenzene id. 3; 4F
  375. ! other aromatics 17) other_aromatics id. 4F
  376. ! esters 18) esters 1A3b_c_e 1A1a, 1A1b_c_1B_2C1_2C2, 1A2, 2A_B_D_E_F_G, 4F; 7A
  377. ! ethers 19) ethers 1A3b_c_e 1A1a, 1A1b_c_1B_2C1_2C2, 1A2, 2A_B_D_E_F_G, 4F; 7A
  378. ! chlorinated HC 20) Cl HC 1A3b_c_e 1A1a, 1A1b_c_1B_2C1_2C2, 1A2, 2A_B_D_E_F_G, 4F; 7A
  379. ! formaldehyde 21) formaldehyde 1A3b_c_e 3
  380. ! other alkanal 22) acetaldehyde 1A3b_c_e 3
  381. ! ketones 23) acetone/ketones 1A3b_c_e
  382. ! acids 24) acids 1A3b_c_e (2005 only) 1A4; 3
  383. ! other VOC 25) othervoc 1A3b_c_e 4F
  384. !
  385. character(len=26), parameter :: emis_ar5_voc_name(emis_ar5_nvoc) = (/ &
  386. 'alcohols ', & ! 1
  387. 'ethane ', & ! 2
  388. 'propane ', & ! 3
  389. 'butanes ', & ! 4
  390. 'pentanes ', & ! 5
  391. 'hexanes_and_higher_alkanes', & ! 6
  392. 'ethene ', & ! 7
  393. 'propene ', & ! 8
  394. 'ethyne ', & ! 9
  395. 'isoprene ', & ! 10
  396. 'terpenes ', & ! 11
  397. 'other_alkenes_and_alkynes ', & ! 12
  398. 'benzene ', & ! 13
  399. 'toluene ', & ! 14
  400. 'xylene ', & ! 15
  401. 'trimethyl_benzenes ', & ! 16
  402. 'other_aromatics ', & ! 17
  403. 'esters ', & ! 18
  404. 'ethers ', & ! 19
  405. 'chlorinated_HC ', & ! 20
  406. 'formaldehyde ', & ! 21
  407. 'other_alkanals ', & ! 22
  408. 'ketones ', & ! 23
  409. 'acids ', & ! 24
  410. 'other_VOC ' /) ! 25
  411. ! For CMIP6, use same species as for AR5
  412. ! but with different names
  413. character(len=26), parameter :: emis_cmip6_voc_name(emis_ar5_nvoc) = (/ &
  414. 'VOC01-alcohols ', &
  415. 'VOC02-ethane ', &
  416. 'VOC03-propane ', &
  417. 'VOC04-butanes ', &
  418. 'VOC05-pentanes ', &
  419. 'VOC06-hexanes-pl ', &
  420. 'VOC07-ethene ', &
  421. 'VOC08-propene ', &
  422. 'VOC09-ethyne ', &
  423. 'VOC10-isoprene ', &
  424. 'VOC11-terpenes ', &
  425. 'VOC12-other-alke ', &
  426. 'VOC13-benzene ', &
  427. 'VOC14-toluene ', &
  428. 'VOC15-xylene ', &
  429. 'VOC16-trimethylb ', &
  430. 'VOC17-other-arom ', &
  431. 'VOC18-esters ', &
  432. 'VOC19-ethers ', &
  433. 'VOC20-chlorinate ', &
  434. 'VOC21-methanal ', &
  435. 'VOC22-other-alka ', &
  436. 'VOC23-ketones ', &
  437. 'VOC24-acids ', &
  438. 'VOC25-other-voc ' /)
  439. !
  440. ! voc_to_cbm5: Table to convert kg(nmvoc) to 'kg(cbm5) for variable cbm5
  441. ! JEW: the addition of some components is reassessd for eg butanes/pentanes
  442. ! JEW: see xl file : TAR_VOC_emissions_speciation-TM-2010
  443. ! JEW: for other voc species 20% of total C is assumed to be PAR
  444. real, parameter :: emis_ar5_voc2cbm5_default(emis_ar5_nvoc*ncb5) = (/ &
  445. ! PAR
  446. 0.0 , 0.0 , 0.0 , 8.2685E-01 , 8.3264E-01 , &
  447. 8.4049E-01 , 0.0 , 0.0 , 4.6157E-01 , 0.0 , &
  448. 0.0 , 4.9970E-01 , 1.5386E-01 , 0.0 , 1.2451E-01 , &
  449. 2.0997E-01 , 2.5229E-01 , 3.6635E-01 , 3.8643E-01 , 2.6354E-01 , &
  450. 0.0 , 3.0081E-01 , 0.0 , 0.0 , 1.85E-01 , &
  451. ! ETH
  452. 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , &
  453. 0.0 , xmeth/(xmc*2+xmh*4), 0.0 , 0.0 , 0.0 , &
  454. 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , &
  455. 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , &
  456. 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , &
  457. ! OLE
  458. 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , &
  459. 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , &
  460. 0.0 , 3.5668E-01 , 0.0 , 0.0 , 0.0 , &
  461. 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , &
  462. 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , &
  463. ! ALD2
  464. 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , &
  465. 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , &
  466. 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , &
  467. 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , &
  468. 0.0 , 3.5389E-01 , 0.0 , 0.0 , 0.0 , &
  469. ! MGLY
  470. 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , &
  471. 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , &
  472. 0.0 , 0.0 , 0.0 , 0.0 , 2.7167E-01 , &
  473. 2.3978E-01 , 2.2409E-01 , 0.0 , 0.0 , 0.0 , &
  474. 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , &
  475. ! CH2O
  476. 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , &
  477. 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , &
  478. 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , &
  479. 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , &
  480. 1.0 , 0.0 , 0.0 , 0.0 , 0.0 , &
  481. !CH3OH (how to attribute alcohols to CH3OH? distribute over CH3OH (90%) and ETHOH (10%))
  482. 0.9 , 0.0 , 0.0 , 0.0 , 0.0 , &
  483. 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , &
  484. 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , &
  485. 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , &
  486. 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , &
  487. !HCOOH
  488. 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , &
  489. 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , &
  490. 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , &
  491. 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , &
  492. 0.0 , 0.0 , 0.0 , 0.5 , 0.0 , &
  493. !MCOOH
  494. 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , &
  495. 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , &
  496. 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , &
  497. 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , &
  498. 0.0 , 0.0 , 0.0 , 0.5 , 0.0 , &
  499. !C2H6
  500. 0.0 , 1.0 , 0.0 , 0.0 , 0.0 , &
  501. 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , &
  502. 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , &
  503. 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , &
  504. 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , &
  505. !ETHOH (attribute 10% alcohol emisions to ETHOH! )
  506. 0.1 , 0.0 , 0.0 , 0.0 , 0.0 , &
  507. 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , &
  508. 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , &
  509. 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , &
  510. 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , &
  511. !C3H8
  512. 0.0 , 0.0 , 1.0 , 0.0 , 0.0 , &
  513. 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , &
  514. 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , &
  515. 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , &
  516. 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , &
  517. !C3H6
  518. 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , &
  519. 0.0 , 0.0 , 1.0 , 0.0 , 0.0 , &
  520. 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , &
  521. 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , &
  522. 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , &
  523. ! Acetone
  524. 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , &
  525. 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , &
  526. 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , &
  527. 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , &
  528. 0.0 , 0.0 , 1.0 , 0.0 , 0.0 /)
  529. !
  530. ! The table below is used for the RETRO FIRES inventory only.
  531. ! It differs from the default AR5 table above in that
  532. ! methanol and acetaldehyde are provided directly.
  533. ! Remaining differences are either small or
  534. ! occur for species that are not provided.
  535. real, parameter :: emis_ar5_voc2cbm5_biomassb(emis_ar5_nvoc*ncb5) = (/ &
  536. ! PAR
  537. 0.0 , 0.0 , 0.0 , 8.2685E-01 , 8.3264E-01 , &
  538. 8.4049E-01 , 0.0 , 0.0 , 4.6157E-01 , 0.0 , &
  539. 0.0 , 4.9970E-01 , 1.5386E-01 , 0.0 , 1.2451E-01 , &
  540. 2.0997E-01 , 2.5229E-01 , 3.6635E-01 , 3.8643E-01 , 2.6354E-01 , &
  541. 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , &
  542. ! ETH
  543. 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , &
  544. 0.0 , 8.5663E-01 , 0.0 , 0.0 , 0.0 , &
  545. 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , &
  546. 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , &
  547. 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , &
  548. ! OLE
  549. 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , &
  550. 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , &
  551. 0.0 , 3.5693E-01 , 0.0 , 0.0 , 0.0 , &
  552. 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , &
  553. 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , &
  554. ! ALD2 (RETRO FIRES inventory provides acetaldehyde directly)
  555. 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , &
  556. 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , &
  557. 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , &
  558. 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , &
  559. 0.0 , 5.4541E-01 , 0.0 , 0.0 , 0.0 , &
  560. ! MGLY
  561. 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , &
  562. 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , &
  563. 0.0 , 0.0 , 0.0 , 0.0 , 2.7167E-01 , &
  564. 2.3996E-01 , 2.2426E-01 , 0.0 , 0.0 , 0.0 , &
  565. 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , &
  566. ! CH2O
  567. 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , &
  568. 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , &
  569. 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , &
  570. 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , &
  571. 1.0 , 0.0 , 0.0 , 0.0 , 0.0 , &
  572. ! CH3OH (RETRO FIRES inventory provides methanol directly)
  573. 1.0 , 0.0 , 0.0 , 0.0 , 0.0 , &
  574. 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , &
  575. 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , &
  576. 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , &
  577. 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , &
  578. ! HCOOH
  579. 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , &
  580. 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , &
  581. 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , &
  582. 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , &
  583. 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , &
  584. ! MCOOH
  585. 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , &
  586. 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , &
  587. 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , &
  588. 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , &
  589. 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , &
  590. ! C2H6
  591. 0.0 , 1.0 , 0.0 , 0.0 , 0.0 , &
  592. 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , &
  593. 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , &
  594. 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , &
  595. 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , &
  596. ! ETHOH
  597. 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , &
  598. 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , &
  599. 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , &
  600. 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , &
  601. 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , &
  602. ! C3H8
  603. 0.0 , 0.0 , 1.0 , 0.0 , 0.0 , &
  604. 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , &
  605. 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , &
  606. 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , &
  607. 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , &
  608. ! C3H6
  609. 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , &
  610. 0.0 , 0.0 , 1.0 , 0.0 , 0.0 , &
  611. 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , &
  612. 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , &
  613. 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , &
  614. ! Acetone
  615. 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , &
  616. 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , &
  617. 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , &
  618. 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , &
  619. 0.0 , 0.0 , 1.0 , 0.0 , 0.0 /)
  620. ! voc_to_cbm5: Table to convert kg(nmvoc) to kg(cbm5) for variable cbm5
  621. ! specific for biogenic emissions
  622. ! For alcohols methanol is used to account for ethanol. Therefore
  623. ! use 0.1 scaling factor. For other species the ratio of xmpar/xmspecies is adopted,
  624. ! using molecular weights for each species given in Schultz and Stein (2004)
  625. ! For species that have no biogenic contribution we adopt a value of 0.
  626. real, parameter :: emis_ar5_voc2cbm5_biogenic(emis_ar5_nvoc*ncb5) = (/ &
  627. ! PAR
  628. 0.0 , 0.0 , 0.0 , 0.206897 , 8.3264E-01 , &
  629. 8.4049E-01 , 0.0 , 0.0 , 0.0 , 0.0 , &
  630. 0.0 , 4.9970E-01 , 0.0 , 0.0 , 0.0 , &
  631. 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , &
  632. 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , &
  633. ! ETH
  634. 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , &
  635. 0.0 , xmeth/(xmc*2+xmh*4), 0.0 , 0.0 , 0.0 , &
  636. 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , &
  637. 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , &
  638. 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , &
  639. ! OLE
  640. 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , &
  641. 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , &
  642. 0.0 , 3.5668E-01 , 0.0 , 0.0 , 0.0 , &
  643. 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , &
  644. 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , &
  645. ! ALD2
  646. 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , &
  647. 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , &
  648. 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , &
  649. 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , &
  650. 0.0 , 5.4541E-01 , 0.0 , 0.0 , 0.0 , &
  651. ! MGLY
  652. 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , &
  653. 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , &
  654. 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , &
  655. 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , &
  656. 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , &
  657. ! CH2O
  658. 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , &
  659. 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , &
  660. 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , &
  661. 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , &
  662. 1.0 , 0.0 , 0.0 , 0.0 , 0.0 , &
  663. ! CH3OH (how to attribute alcohols to CH3OH? distribute over CH3OH (90%) and ETHOH (10%))
  664. 0.9 , 0.0 , 0.0 , 0.0 , 0.0 , &
  665. 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , &
  666. 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , &
  667. 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , &
  668. 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , &
  669. ! HCOOH
  670. 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , &
  671. 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , &
  672. 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , &
  673. 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , &
  674. 0.0 , 0.0 , 0.0 , 1.0 , 0.0 , &
  675. ! MCOOH
  676. 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , &
  677. 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , &
  678. 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , &
  679. 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , &
  680. 0.0 , 0.0 , 0.0 , 1.0 , 0.0 , &
  681. ! C2H6
  682. 0.0 , 1.0 , 0.0 , 0.0 , 0.0 , &
  683. 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , &
  684. 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , &
  685. 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , &
  686. 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , &
  687. ! ETHOH (attribute 10% alcohol emisions to ETHOH! )
  688. 0.1 , 0.0 , 0.0 , 0.0 , 0.0 , &
  689. 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , &
  690. 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , &
  691. 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , &
  692. 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , &
  693. ! C3H8
  694. 0.0 , 0.0 , 1.0 , 0.0 , 0.0 , &
  695. 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , &
  696. 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , &
  697. 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , &
  698. 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , &
  699. ! C3H6
  700. 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , &
  701. 0.0 , 0.0 , 1.0 , 0.0 , 0.0 , &
  702. 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , &
  703. 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , &
  704. 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , &
  705. ! Acetone
  706. 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , &
  707. 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , &
  708. 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , &
  709. 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , &
  710. 0.0 , 0.0 , 1.0 , 0.0 , 0.0/)
  711. ! -------------------------------------------------------------------
  712. ! M A C C
  713. ! -------------------------------------------------------------------
  714. !
  715. ! Distribution of NMV over the CBM-4 components (kg C/kg NMV) .
  716. ! VOC numbering according to TNO/RETRO speciation.
  717. ! Anthropogenic emissions of isoprene (ivoc=10), monoterpenes(ivoc=11) and others(ivoc=25)
  718. ! are not used (set to zero in voc2c_tno and voc2c_fires) .
  719. ! The speciation is slightly different for biomass burning emissions, where:
  720. ! voc_1 is methanol (which does not contribute) instead of alcohols,
  721. ! voc_23 is acetone instead of ketones and
  722. ! acetaldehyde is given instead of 'other aldehydes' (voc_22)
  723. ! For biomass burning isoprene (ivoc_10) and monoterpene (ivoc_11) are nonzero
  724. ! and need to be included separately.
  725. !
  726. integer, parameter :: emis_macc_nvoc = 15
  727. !
  728. ! TM4-RETRO names MACC/grg names
  729. ! ---------------------------------- ------------------------
  730. ! 2.1 CO
  731. ! 2.2 NO
  732. ! 1 alcohols 2.x CH3OH <- no C-C bond: not included TM5
  733. ! 2.4 C2H5OH <-1 PAR
  734. ! 2 ethane 2.5 C2H6
  735. ! 3 propane 2.6 C3H8
  736. ! 2.7 BIGALK: lumped_alkanes: (58 g/mole = butane)
  737. ! 4 butanes incl- c4h10
  738. ! 5 pentanes
  739. ! 6 hexanes_plus_higher_alkanes
  740. ! 7 ethene 2.8 C2H4
  741. ! 8 propene 2.9 C3H6
  742. ! 9
  743. ! 10 2.10 ISOPRENE
  744. ! 11 2.11 TERPENES
  745. ! 12 other_alkenes_and_alkynes 2.12 BIKENE: lumped_alkenes (56 g/mole -> CBM-5 speciation gives one OLE. (1 double bond)
  746. ! 2.13 TOLUENE: lumped_aromatics:
  747. ! 13 incl?- benzene
  748. ! 14 - toluene
  749. ! 15 xylene - xylene
  750. ! 16 trimethylbenzenes
  751. ! 17 other_aromatics
  752. ! 18 esters
  753. ! 19 ethers
  754. ! 20 chlorinated_hydrocarbons
  755. ! 21 methanal 2.14 CH2O (formaldehyde,methanal)
  756. ! 22 alkanals 2.15 CH3CHO (acetaldehyde,acetal)
  757. ! 23 ketones 2.16 CH3COCH3: acetone
  758. ! 24 acids
  759. ! 2.17 h2
  760. !
  761. ! vh. According to Angelika Heil (FZ Juelich) the mol. weights for lumped species in biomass burning are
  762. ! vh different from the anthropogenic emissions, as follows:
  763. ! vh Ankelika Heil:
  764. ! We updated these molecular weights for biomass burning for the MOZART
  765. ! lumped groups as follows:
  766. ! Higher_Alkanes: 58 g/mole ==> 78.8 g/mole
  767. ! Higher_Alkenes: 56 g/mole ==> 64.0 g/mole
  768. ! Toluene_lump: 92 g/mole ==> 85.7 g/mole
  769. ! The MOZART lumped groups were formed as follows:
  770. ! Toluene_lump (C7H8+ C6H6 + C8H10): MOZART lumped toluene species,
  771. ! incorporating benzene, toluene, xylene
  772. ! Higher Alkenes (CnH2n, C>=4): all alkenes (C>=4) specified in Andreae
  773. ! and Merlet (2001) which are not contained in the Toluene_lump group.
  774. ! These are: Butenes (1-butene + i-butene + tr-2-butene + cis-2-butene)
  775. ! (C4H8), Pentenes (1-pentene + 2-pentene) (C5H10), Hexene (C6H12),
  776. ! Octene (C8H16)
  777. ! Higher Alkanes (CnH2n+2, C>=4): all alkanes (C>=4) specified in Andreae
  778. ! and Merlet (2001). These are: Butanes (n-butane + i-butane) (C4H10),
  779. ! Pentanes (n-pentane + i-pentane) (C5H12), Hexane (n-hexane + i-hexane)
  780. ! (C6H14), Heptane (C7H16)
  781. ! We calculated the molecular weight of these lumped groups from weighting
  782. ! the molecular mass of the individual species with their relative mass
  783. ! contribution to the total fire emissions of each group during 2001-2006
  784. ! (calculated from GFEDv2 data).
  785. ! JEW: looking at the decomposition of TOL reveals ther is a product yield of 0.2MGLY
  786. ! which should be added analogous to the xylene > MGLY link in Houweling et al. (1998)
  787. character(len=26), parameter :: emis_macc_voc_name(emis_macc_nvoc) = (/ &
  788. 'C2H5OH ', & ! 1
  789. 'C2H6 ', & ! 2
  790. 'C3H8 ', & ! 3
  791. 'BIGALK ', & ! 4
  792. 'C2H4 ', & ! 5
  793. 'C3H6 ', & ! 6
  794. 'ISOPRENE ', & ! 7
  795. 'TERPENES ', & ! 8
  796. 'BIGENE ', & ! 9
  797. 'TOLUENE ', & ! 10
  798. 'CH2O ', & ! 11
  799. 'CH3CHO ', & ! 12
  800. 'CH3COCH3 ', & ! 13
  801. 'MEK ', & ! 14
  802. 'CH3OH '/) ! 15
  803. ! voc_to_cbm5: Table to convert kg(nmvoc) to 'kg(cbm5) for variable cbm5
  804. real, parameter :: emis_macc_voc2cbm5_default(emis_macc_nvoc*ncb5) = (/ &
  805. ! PAR
  806. 0.0 , 0.0 , 0.0 , 4.0*xmpar/(4*xmc+10*xmh), &
  807. 0.0 , 0.0 , 0.0 , 0.0 , &
  808. 2*xmpar/(4*xmc+8*xmh) , xmpar/92. , 0.0 , 0.0 , &
  809. 0.0 , 4*xmpar/72. , 0.0 , &
  810. ! ETH
  811. 0.0 , 0.0 , 0.0 , 0.0 , &
  812. xmeth/(xmc*2+xmh*4) , 0.0 , 0.0 , 0.0 , &
  813. 0.0 , 0.0 , 0.0 , 0.0 , &
  814. 0.0 , 0.0 , 0.0 , &
  815. ! OLE
  816. 0.0 , 0.0 , 0.0 , 0.0 , &
  817. 0.0 , 0.0 , 0.0 , 0.0 , &
  818. xmole/(4*xmc+8*xmh) , 0.0 , 0.0 , 0.0 , &
  819. 0.0 , 0.0 , 0.0 , &
  820. ! ALD2
  821. 0.0 , 0.0 , 0.0 , 0.0 , &
  822. 0.0 , 0.0 , 0.0 , 0.0 , &
  823. 0.0 , 0.0 , 0.0 , xmald2/44. , &
  824. 0.0 , 0.0 , 0.0 , &
  825. ! MGLY
  826. 0.0 , 0.0 , 0.0 , 0.0 , &
  827. 0.0 , 0.0 , 0.0 , 0.0 , &
  828. 0.0 , 0.2*xmgly/(92.0) , 0.0 , 0.0 , &
  829. 0.0 , 0.0 , 0.0 , &
  830. ! CH2O
  831. 0.0 , 0.0 , 0.0 , 0.0 , &
  832. 0.0 , 0.0 , 0.0 , 0.0 , &
  833. 0.0 , 0.0 , 1.0 , 0.0 , &
  834. 0.0 , 0.0 , 0.0 , &
  835. ! CH3OH
  836. 0.0 , 0.0 , 0.0 , 0.0 , &
  837. 0.0 , 0.0 , 0.0 , 0.0 , &
  838. 0.0 , 0.0 , 0.0 , 0.0 , &
  839. 0.0 , 0.0 , 1.0 , &
  840. ! HCOOH
  841. 0.0 , 0.0 , 0.0 , 0.0 , &
  842. 0.0 , 0.0 , 0.0 , 0.0 , &
  843. 0.0 , 0.0 , 0.0 , 0.0 , &
  844. 0.0 , 0.0 , 0.0 , &
  845. ! MCOOH
  846. 0.0 , 0.0 , 0.0 , 0.0 , &
  847. 0.0 , 0.0 , 0.0 , 0.0 , &
  848. 0.0 , 0.0 , 0.0 , 0.0 , &
  849. 0.0 , 0.0 , 0.0 , &
  850. !C2H6
  851. 0.0 , 1.0 , 0.0 , 0.0 , &
  852. 0.0 , 0.0 , 0.0 , 0.0 , &
  853. 0.0 , 0.0 , 0.0 , 0.0 , &
  854. 0.0 , 0.0 , 0.0 , &
  855. !ETHOH
  856. 1.0 , 0.0 , 0.0 , 0.0 , &
  857. 0.0 , 0.0 , 0.0 , 0.0 , &
  858. 0.0 , 0.0 , 0.0 , 0.0 , &
  859. 0.0 , 0.0 , 0.0 , &
  860. !C3H8
  861. 0.0 , 0.0 , 1.0 , 0.0 , &
  862. 0.0 , 0.0 , 0.0 , 0.0 , &
  863. 0.0 , 0.0 , 0.0 , 0.0 , &
  864. 0.0 , 0.0 , 0.0 , &
  865. !C3H6
  866. 0.0 , 0.0 , 0.0 , 0.0 , &
  867. 0.0 , 1.0 , 0.0 , 0.0 , &
  868. 0.0 , 0.0 , 0.0 , 0.0 , &
  869. 0.0 , 0.0 , 0.0 , &
  870. ! Acetone
  871. 0.0 , 0.0 , 0.0 , 0.0 , &
  872. 0.0 , 0.0 , 0.0 , 0.0 , &
  873. 0.0 , 0.0 , 0.0 , 0.0 , &
  874. 1.0 , 0.0 , 0.0/)
  875. ! For Biomass burning, use a the same table
  876. real, parameter :: emis_macc_voc2cbm5_biomassb(emis_macc_nvoc*ncb5) = (/ &
  877. ! PAR
  878. 0.0 , 0.0 , 0.0 , 4.0*xmpar/(4*xmc+10*xmh) , &
  879. 0.0 , 0.0 , 0.0 , 0.0 , &
  880. 2*xmpar/(4*xmc+8*xmh) , xmpar/92. , 0.0 , 0.0 , &
  881. 0.0 , 4*xmpar/72. , 0.0 , &
  882. ! ETH
  883. 0.0 , 0.0 , 0.0 , 0.0 , &
  884. xmeth/(xmc*2+xmh*4) , 0.0 , 0.0 , 0.0 , &
  885. 0.0 , 0.0 , 0.0 , 0.0 , &
  886. 0.0 , 0.0 , 0.0 , &
  887. ! OLE
  888. 0.0 , 0.0 , 0.0 , 0.0 , &
  889. 0.0 , 0.0 , 0.0 , 0.0 , &
  890. xmole/(4*xmc+8*xmh) , 0.0 , 0.0 , 0.0 , &
  891. 0.0 , 0.0 , 0.0 , &
  892. ! ALD2
  893. 0.0 , 0.0 , 0.0 , 0.0 , &
  894. 0.0 , 0.0 , 0.0 , 0.0 , &
  895. 0.0 , 0.0 , 0.0 , xmald2/44. , &
  896. 0.0 , 0.0 , 0.0 , &
  897. ! MGLY
  898. 0.0 , 0.0 , 0.0 , 0.0 , &
  899. 0.0 , 0.0 , 0.0 , 0.0 , &
  900. 0.0 , 0.2*xmgly/(92.0) , 0.0 , 0.0 , &
  901. 0.0 , 0.0 , 0.0 , &
  902. ! CH2O
  903. 0.0 , 0.0 , 0.0 , 0.0 , &
  904. 0.0 , 0.0 , 0.0 , 0.0 , &
  905. 0.0 , 0.0 , 1.0 , 0.0 , &
  906. 0.0 , 0.0 , 0.0 , &
  907. ! CH3OH
  908. 0.0 , 0.0 , 0.0 , 0.0 , &
  909. 0.0 , 0.0 , 0.0 , 0.0 , &
  910. 0.0 , 0.0 , 0.0 , 0.0 , &
  911. 0.0 , 0.0 , 1.0 , &
  912. ! HCOOH
  913. 0.0 , 0.0 , 0.0 , 0.0 , &
  914. 0.0 , 0.0 , 0.0 , 0.0 , &
  915. 0.0 , 0.0 , 0.0 , 0.0 , &
  916. 0.0 , 0.0 , 0.0 , &
  917. ! MCOOH
  918. 0.0 , 0.0 , 0.0 , 0.0 , &
  919. 0.0 , 0.0 , 0.0 , 0.0 , &
  920. 0.0 , 0.0 , 0.0 , 0.0 , &
  921. 0.0 , 0.0 , 0.0 , &
  922. !C2H6
  923. 0.0 , 1.0 , 0.0 , 0.0 , &
  924. 0.0 , 0.0 , 0.0 , 0.0 , &
  925. 0.0 , 0.0 , 0.0 , 0.0 , &
  926. 0.0 , 0.0 , 0.0 , &
  927. !ETHOH
  928. 1.0 , 0.0 , 0.0 , 0.0 , &
  929. 0.0 , 0.0 , 0.0 , 0.0 , &
  930. 0.0 , 0.0 , 0.0 , 0.0 , &
  931. 0.0 , 0.0 , 0.0 , &
  932. !C3H8
  933. 0.0 , 0.0 , 1.0 , 0.0 , &
  934. 0.0 , 0.0 , 0.0 , 0.0 , &
  935. 0.0 , 0.0 , 0.0 , 0.0 , &
  936. 0.0 , 0.0 , 0.0 , &
  937. !C3H6
  938. 0.0 , 0.0 , 0.0 , 0.0 , &
  939. 0.0 , 1.0 , 0.0 , 0.0 , &
  940. 0.0 , 0.0 , 0.0 , 0.0 , &
  941. 0.0 , 0.0 , 0.0 , &
  942. ! Acetone
  943. 0.0 , 0.0 , 0.0 , 0.0 , &
  944. 0.0 , 0.0 , 0.0 , 0.0 , &
  945. 0.0 , 0.0 , 0.0 , 0.0 , &
  946. 1.0 , 0.0 , 0.0/)
  947. ! specific for biogenic emissions
  948. real, parameter :: emis_macc_voc2cbm5_biogenic(emis_macc_nvoc*ncb5) = (/ &
  949. ! PAR
  950. 0.0 , 0.0 , 0.0 , 4.0*xmpar/(4*xmc+10*xmh), &
  951. 0.0 , 0.0 , 0.0 , 0.0 , &
  952. 2*xmpar/(4*xmc+8*xmh) , xmpar/92. , 0.0 , 0.0 , &
  953. 0.0 , 4*xmpar/72. , 0.0 , &
  954. ! ETH
  955. 0.0 , 0.0 , 0.0 , 0.0 , &
  956. xmeth/(xmc*2+xmh*4) , 0.0 , 0.0 , 0.0 , &
  957. 0.0 , 0.0 , 0.0 , 0.0 , &
  958. 0.0 , 0.0 , 0.0 , &
  959. ! OLE
  960. 0.0 , 0.0 , 0.0 , 0.0 , &
  961. 0.0 , 0.0 , 0.0 , 0.0 , &
  962. xmole/(4*xmc+8*xmh) , 0.0 , 0.0 , 0.0 , &
  963. 0.0 , 0.0 , 0.0 , &
  964. ! ALD2
  965. 0.0 , 0.0 , 0.0 , 0.0 , &
  966. 0.0 , 0.0 , 0.0 , 0.0 , &
  967. 0.0 , 0.0 , 0.0 , xmald2/44. , &
  968. 0.0 , 0.0 , 0.0 , &
  969. ! MGLY
  970. 0.0 , 0.0 , 0.0 , 0.0 , &
  971. 0.0 , 0.0 , 0.0 , 0.0 , &
  972. 0.0 , 0.2*xmgly/(92.0) , 0.0 , 0.0 , &
  973. 0.0 , 0.0 , 0.0 , &
  974. ! CH2O
  975. 0.0 , 0.0 , 0.0 , 0.0 , &
  976. 0.0 , 0.0 , 0.0 , 0.0 , &
  977. 0.0 , 0.0 , 1.0 , 0.0 , &
  978. 0.0 , 0.0 , 0.0 , &
  979. ! CH3OH
  980. 0.0 , 0.0 , 0.0 , 0.0 , &
  981. 0.0 , 0.0 , 0.0 , 0.0 , &
  982. 0.0 , 0.0 , 0.0 , 0.0 , &
  983. 0.0 , 0.0 , 1.0 , &
  984. ! HCOOH
  985. 0.0 , 0.0 , 0.0 , 0.0 , &
  986. 0.0 , 0.0 , 0.0 , 0.0 , &
  987. 0.0 , 0.0 , 0.0 , 0.0 , &
  988. 0.0 , 0.0 , 0.0 , &
  989. ! MCOOH
  990. 0.0 , 0.0 , 0.0 , 0.0 , &
  991. 0.0 , 0.0 , 0.0 , 0.0 , &
  992. 0.0 , 0.0 , 0.0 , 0.0 , &
  993. 0.0 , 0.0 , 0.0 , &
  994. !C2H6
  995. 0.0 , 1.0 , 0.0 , 0.0 , &
  996. 0.0 , 0.0 , 0.0 , 0.0 , &
  997. 0.0 , 0.0 , 0.0 , 0.0 , &
  998. 0.0 , 0.0 , 0.0 , &
  999. !ETHOH
  1000. 1.0 , 0.0 , 0.0 , 0.0 , &
  1001. 0.0 , 0.0 , 0.0 , 0.0 , &
  1002. 0.0 , 0.0 , 0.0 , 0.0 , &
  1003. 0.0 , 0.0 , 0.0 , &
  1004. !C3H8
  1005. 0.0 , 0.0 , 1.0 , 0.0 , &
  1006. 0.0 , 0.0 , 0.0 , 0.0 , &
  1007. 0.0 , 0.0 , 0.0 , 0.0 , &
  1008. 0.0 , 0.0 , 0.0 , &
  1009. !C3H6
  1010. 0.0 , 0.0 , 0.0 , 0.0 , &
  1011. 0.0 , 1.0 , 0.0 , 0.0 , &
  1012. 0.0 , 0.0 , 0.0 , 0.0 , &
  1013. 0.0 , 0.0 , 0.0 , &
  1014. ! Acetone
  1015. 0.0 , 0.0 , 0.0 , 0.0 , &
  1016. 0.0 , 0.0 , 0.0 , 0.0 , &
  1017. 0.0 , 0.0 , 0.0 , 0.0 , &
  1018. 1.0 , 0.0 , 0.0/)
  1019. ! -------------------------------------------------------------------
  1020. ! M A C C - M E G A N
  1021. ! -------------------------------------------------------------------
  1022. !
  1023. ! Distribution of NMV over the CBM-4 components (kg C/kg NMV) .
  1024. ! VOC numbering according to TNO/RETRO speciation.
  1025. ! The speciation is slightly different for biomass burning emissions, where:
  1026. ! voc_1 is methanol (which does not contribute) instead of alcohols,
  1027. ! voc_23 is acetone instead of ketones and
  1028. ! acetaldehyde is given instead of 'other aldehydes' (voc_22)
  1029. ! For biomass burning isoprene (ivoc_10) and monoterpene (ivoc_11) are nonzero
  1030. ! and need to be included separately.
  1031. !
  1032. !
  1033. ! TM4-RETRO names MEGAN/grg names
  1034. ! ---------------------------------- ------------------------
  1035. ! 2.1 CO
  1036. ! 1 alcohols 2.2 methanol <- no C-C bond: not included TM5
  1037. ! 2.3 ethanol <-1 PAR
  1038. ! 2 ethane 2.4 ethane
  1039. ! 3 propane 2.5 propane
  1040. ! 4 butanes 2.6 butanes_and_higher_alkanes (58 g/mole = butane)
  1041. ! incl- c4h10
  1042. ! 5 pentanes
  1043. ! 6 hexanes_plus_higher_alkanes
  1044. ! 7 ethene 2.7 ethene
  1045. ! 8 propene 2.8 propene
  1046. ! 9
  1047. ! 10 2.10 ISOPRENE
  1048. ! 11 2.11 monoterpenes
  1049. ! 12 other_alkenes_and_alkynes 2.12 butenes_and_higher_alkenes -> (56g/mole = butene)
  1050. ! 13 2.13 toluene (92g/mole=toluene) <- 0.2 MGLY
  1051. ! 14
  1052. ! 15 xylene
  1053. ! 16 trimethylbenzenes
  1054. ! 17 other_aromatics
  1055. ! 18 esters
  1056. ! 19 ethers
  1057. ! 20 chlorinated_hydrocarbons
  1058. ! 21 methanal 2.14 formaldehyde
  1059. ! 22 alkanals 2.15 acetaldehyde
  1060. ! 2.16 other_aldehydes (44g/mole=C2 and above aldehydes): ignore other double count
  1061. ! 23 ketones 2.17 acetone
  1062. ! 2.18 other_ketones (72g/mole=other ketones except acetone): <-4*PAR as lower limit
  1063. ! 24 acids 2.19 formic acid <- no C-C bond: not included TM5
  1064. ! 2.20 acetic acid <-1 PAR
  1065. !
  1066. integer, parameter :: emis_megan_nvoc = 18
  1067. ! the same as MACC, except no MEK
  1068. character(len=26), parameter :: emis_megan_voc_name(emis_megan_nvoc) = (/ &
  1069. 'methanol ', & ! 1
  1070. 'ethanol ', & ! 2
  1071. 'ethane ', & ! 3
  1072. 'propane ', & ! 4
  1073. 'butanes_and_higher_alkanes', & ! 5
  1074. 'ethene ', & ! 6
  1075. 'propene ', & ! 7
  1076. 'isoprene ', & ! 8
  1077. 'monoterpenes ', & ! 9
  1078. 'butenes_and_higher_alkenes', & ! 10
  1079. 'toluene ', & ! 11
  1080. 'formaldehyde ', & ! 12
  1081. 'acetaldehyde ', & ! 13
  1082. 'other_aldehydes ', & ! 14
  1083. 'acetone ', & ! 15
  1084. 'other_ketones ', & ! 16
  1085. 'formic_acid ', & ! 17
  1086. 'acetic_acid '/) ! 18
  1087. ! specific for MEGAN biogenic emissions
  1088. real, parameter :: emis_megan_voc2cbm5_biogenic(emis_megan_nvoc*ncb5) = (/ &
  1089. ! PAR
  1090. 0.0 , 0.0 , 0.0 , 0.0 , &
  1091. 4.0*xmpar/(4*xmc+10*xmh), 0.0 , 0.0 , 0.0 , 0.0 , &
  1092. 2*xmpar/(4*xmc+8*xmh) , xmpar/(92.0) , 0.0 , 0.0 , 0.0 , &
  1093. 0.0 , 4.0*xmpar/(72.0) , 0.0 , 0.0 , &
  1094. ! ETH
  1095. 0.0 , 0.0 , 0.0 , 0.0 , &
  1096. 0.0 , xmeth/(2*xmc+4*xmh) , 0.0 , 0.0 , 0.0 , &
  1097. 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , &
  1098. 0.0 , 0.0 , 0.0 , 0.0 , &
  1099. ! OLE
  1100. 0.0 , 0.0 , 0.0 , 0.0 , &
  1101. 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , &
  1102. xmole/(4*xmc+8*xmh) , 0.0 , 0.0 , 0.0 , 0.0 , &
  1103. 0.0 , 0.0 , 0.0 , 0.0 , &
  1104. ! ALD2
  1105. 0.0 , 0.0 , 0.0 , 0.0 , &
  1106. 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , &
  1107. 0.0 , 0.0 , 0.0 , xmald2/44. , 0.0 , &
  1108. 0.0 , 0.0 , 0.0 , 0.0 , &
  1109. ! MGLY
  1110. 0.0 , 0.0 , 0.0 , 0.0 , &
  1111. 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , &
  1112. 0.0 , 0.2*xmgly/(92.0) , 0.0 , 0.0 , 0.0 , &
  1113. 0.0 , 0.0 , 0.0 , 0.0 , &
  1114. ! CH2O
  1115. 0.0 , 0.0 , 0.0 , 0.0 , &
  1116. 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , &
  1117. 0.0 , 0.0 , 1.0 , 0.0 , 0.0 , &
  1118. 0.0 , 0.0 , 0.0 , 0.0 , &
  1119. ! CH3OH
  1120. 1.0 , 0.0 , 0.0 , 0.0 , &
  1121. 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , &
  1122. 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , &
  1123. 0.0 , 0.0 , 0.0 , 0.0 , &
  1124. ! HCOOH
  1125. 0.0 , 0.0 , 0.0 , 0.0 , &
  1126. 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , &
  1127. 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , &
  1128. 0.0 , 0.0 , 1.0 , 0.0 , &
  1129. ! MCOOH
  1130. 0.0 , 0.0 , 0.0 , 0.0 , &
  1131. 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , &
  1132. 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , &
  1133. 0.0 , 0.0 , 0.0 , 1.0 , &
  1134. !C2H6
  1135. 0.0 , 0.0 , 1.0 , 0.0 , &
  1136. 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , &
  1137. 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , &
  1138. 0.0 , 0.0 , 0.0 , 0.0 , &
  1139. !ETHOH
  1140. 0.0 , 1.0 , 0.0 , 0.0 , &
  1141. 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , &
  1142. 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , &
  1143. 0.0 , 0.0 , 0.0 , 0.0 , &
  1144. !C3H8
  1145. 0.0 , 0.0 , 0.0 , 1.0 , &
  1146. 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , &
  1147. 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , &
  1148. 0.0 , 0.0 , 0.0 , 0.0 , &
  1149. !C3H6
  1150. 0.0 , 0.0 , 0.0 , 0.0 , &
  1151. 0.0 , 0.0 , 1.0 , 0.0 , 0.0 , &
  1152. 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , &
  1153. 0.0 , 0.0 , 0.0 , 0.0 , &
  1154. ! Acetone
  1155. 0.0 , 0.0 , 0.0 , 0.0 , &
  1156. 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , &
  1157. 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , &
  1158. 1.0 , 0.0 , 0.0 , 0.0/)
  1159. !--------------------------------------------------------------------
  1160. ! CMIP6 - Aircraft emissions
  1161. !--------------------------------------------------------------------
  1162. ! For the aviation sector only the total NMVOC emissions are provided
  1163. ! due to the relatively low rate of emissions
  1164. ! and the large size of the files that would result
  1165. ! in case speciated emissions were provided.
  1166. ! In order to include these, we follow the recommendations
  1167. ! from README-CEDS-VOC-speciation_06_30_2016.txt:
  1168. ! "A suggested speciation for aircraft emissions is provided below
  1169. ! as used in EDGAR (thanks to Greet Maenhout).
  1170. ! Two profiles are provided, Takeoff_landing, and Aircraft_Exhaust.
  1171. ! We suggest, for simplicity, applying the Takeoff_landing profile
  1172. ! to the lowest two layers (0.305 km and 0.915 km) in the aircraft emissions file."
  1173. ! It is assumed here that the species in the profiles given below
  1174. ! have a one-to-one correspondence with the species
  1175. ! used for the other anthropogenic sectors for AR5/CMIP6.
  1176. ! Profiles for aircraft emissions
  1177. ! data source: USEPA SPECIATE 4.4 database
  1178. ! http://cfpub.epa.gov/si/speciate/
  1179. ! This profile can be used for aircraft exhausts
  1180. ! VOC_species weight (%)
  1181. ! Pentanes 0.19801
  1182. ! Trimethylbenzenes 0.510026
  1183. ! Methylbenzene 0.642032
  1184. ! Ethane 0.521026
  1185. ! Dimethylbenzenes 0.448022
  1186. ! Benzene 1.681084
  1187. ! Alkanones 0.369018
  1188. ! Alkanols 1.80509
  1189. ! Other alk(adi)enes/alkynes 13.35667
  1190. ! Other alkanals 21.9461
  1191. ! Ethene 15.46177
  1192. ! Propane 0.078004
  1193. ! Propene 4.534227
  1194. ! Ethyne 3.939197
  1195. ! Hexanes and higher 18.11991
  1196. ! Other aromatics 4.079204
  1197. ! Methanal 12.31062
  1198. real, parameter :: emis_cmip6_aircraft_tot2voc(emis_ar5_nvoc) = (/ &
  1199. 1.80509 , 0.521026 , 0.078004 , 0.0 , 0.19801 , &
  1200. 18.11991 , 15.46177 , 4.534227 , 3.939197 , 0.0 , &
  1201. 0.0 , 13.35667 , 1.681084 , 0.642032 , 0.448022 , &
  1202. 0.510026 , 4.079204 , 0.0 , 0.0 , 0.0 , &
  1203. 12.31062 , 21.9461 , 0.369018 , 0.0 , 0.0/) / 100.
  1204. ! This profile can be used for Aircraft Landing/Takeoff
  1205. ! VOC_species weight (%)
  1206. ! Methanal 15.87872
  1207. ! Methylbenzene 0.550253
  1208. ! Propene 5.154408
  1209. ! Propane 0.224593
  1210. ! Pentanes 0.213363
  1211. ! Other aromatics 2.930938
  1212. ! Other alkanals 12.5772
  1213. ! Ethyne 4.143739
  1214. ! Other 13.21729
  1215. ! Ethane 1.033127
  1216. ! Hexanes and higher 10.66816
  1217. ! Ethene 17.40595
  1218. ! Dimethylbenzenes 0.494104
  1219. ! Alkanones 3.290286
  1220. ! Alkanols 2.032566
  1221. ! Other alk(adi)enes/alkynes 8.175182
  1222. ! Benzene 2.010107
  1223. real, parameter :: emis_cmip6_aircraft_tl_tot2voc(emis_ar5_nvoc) = (/ &
  1224. 2.032566 , 1.033127 , 0.224593 , 0.0 , 0.213363 , &
  1225. 10.66816 , 17.40595 , 5.154408 , 4.143739 , 0.0 , &
  1226. 0.0 , 8.175182 , 2.010107 , 0.550253 , 0.494104 , &
  1227. 0.0 , 2.930938 , 0.0 , 0.0 , 0.0 , &
  1228. 15.87872 , 12.5772 , 3.290286 , 0.0 , 13.21729/) / 100.
  1229. !--------------------------------------------------------------------
  1230. ! CMIP6 - Biomass Burning
  1231. ! -------------------------------------------------------------------
  1232. ! Copied from MACC-MEGAN VOC split, but with some modifications:
  1233. ! - Ketones replaced by MEK with contribution factor from MACC (same as for ketones).
  1234. ! - Lumped toluene replaced by benzene (C6H6), toluene (C7H8) and xylene (C8H10)
  1235. ! with contribution factors from AR5.
  1236. ! - CH3COCHO (MGLY) added
  1237. ! - 'other_aldehydes' doesn't contribute and is not provided,
  1238. ! therefore replaced by 'not provided'
  1239. ! - Molar mass of higher alkanes and higher alkenes is 12 g/mol.
  1240. !
  1241. ! Also provided are ethyne (C2H2), hydroxyacetaldehyde (HOCH2CHO),
  1242. ! and hydrogen cyanide (HCN):
  1243. ! but these are not included:
  1244. ! - C2H2 assumed not to contribute (in contrast to split applied to AR5)
  1245. ! - HOCH2CHO assumed not to contribute (like 'other_aldehydes')
  1246. ! - HCN assumed not to contribute
  1247. integer, parameter :: emis_cmip6bmb_nvoc = 21
  1248. character(len=26), parameter :: emis_cmip6bmb_voc_name(emis_cmip6bmb_nvoc) = (/ &
  1249. 'CH3OH ', & ! 1
  1250. 'C2H5OH ', & ! 2
  1251. 'C2H6 ', & ! 3
  1252. 'C3H8 ', & ! 4
  1253. 'Higher-Alkanes ', & ! 5
  1254. 'C2H4 ', & ! 6
  1255. 'C3H6 ', & ! 7
  1256. 'C5H8 ', & ! 8
  1257. 'C10H16 ', & ! 9
  1258. 'Higher-Alkenes ', & ! 10
  1259. 'C6H6 ', & ! 11
  1260. 'C7H8 ', & ! 12
  1261. 'C8H10 ', & ! 13
  1262. 'CH2O ', & ! 14
  1263. 'C2H4O ', & ! 15
  1264. 'not provided ', & ! 16
  1265. 'C3H6O ', & ! 17
  1266. 'MEK ', & ! 18
  1267. 'HCOOH ', & ! 19
  1268. 'CH3COOH ', & ! 20
  1269. 'CH3COCHO '/) ! 21
  1270. real, parameter :: emis_cmip6bmb_voc2cbm5(emis_cmip6bmb_nvoc*ncb5) = (/ &
  1271. ! PAR
  1272. 0.0 , 0.0 , 0.0 , 0.0 , 4.0*xmpar/(4*xmc), &
  1273. 0.0 , 0.0 , 0.0 , 0.0 , 2.*xmpar/(4*xmc), &
  1274. 1.5386E-01 , 0.0 , 1.2451E-01 , 0.0 , 0.0 , &
  1275. 0.0 , 0.0 , 4.0*xmpar/(72.0) , 0.0 , 0.0 , &
  1276. 0.0 , &
  1277. ! ETH
  1278. 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , &
  1279. xmeth/(xmc*2+xmh*4) , 0.0 , 0.0 , 0.0 , 0.0 , &
  1280. 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , &
  1281. 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , &
  1282. 0.0 , &
  1283. ! OLE
  1284. 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , &
  1285. 0.0 , 0.0 , 0.0 , 0.0 , xmole/(4*xmc) , &
  1286. 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , &
  1287. 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , &
  1288. 0.0 , &
  1289. ! ALD2
  1290. 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , &
  1291. 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , &
  1292. 0.0 , 0.0 , 0.0 , 0.0 , xmald2/44. , &
  1293. 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , &
  1294. 0.0 , &
  1295. ! MGLY
  1296. 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , &
  1297. 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , &
  1298. 0.0 , 0.0 , 2.7167E-01 , 0.0 , 0.0 , &
  1299. 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , &
  1300. 1.0 , &
  1301. ! CH2O
  1302. 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , &
  1303. 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , &
  1304. 0.0 , 0.0 , 0.0 , 1.0 , 0.0 , &
  1305. 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , &
  1306. 0.0 , &
  1307. ! CH3OH
  1308. 1.0 , 0.0 , 0.0 , 0.0 , 0.0 , &
  1309. 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , &
  1310. 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , &
  1311. 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , &
  1312. 0.0 , &
  1313. ! HCOOH
  1314. 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , &
  1315. 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , &
  1316. 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , &
  1317. 0.0 , 0.0 , 0.0 , 1.0 , 0.0 , &
  1318. 0.0 , &
  1319. ! MCOOH
  1320. 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , &
  1321. 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , &
  1322. 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , &
  1323. 0.0 , 0.0 , 0.0 , 0.0 , 1.0 , &
  1324. 0.0 , &
  1325. !C2H6
  1326. 0.0 , 0.0 , 1.0 , 0.0 , 0.0 , &
  1327. 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , &
  1328. 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , &
  1329. 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , &
  1330. 0.0 , &
  1331. !ETHOH
  1332. 0.0 , 1.0 , 0.0 , 0.0 , 0.0 , &
  1333. 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , &
  1334. 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , &
  1335. 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , &
  1336. 0.0 , &
  1337. !C3H8
  1338. 0.0 , 0.0 , 0.0 , 1.0 , 0.0 , &
  1339. 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , &
  1340. 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , &
  1341. 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , &
  1342. 0.0 , &
  1343. !C3H6
  1344. 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , &
  1345. 0.0 , 1.0 , 0.0 , 0.0 , 0.0 , &
  1346. 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , &
  1347. 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , &
  1348. 0.0 , &
  1349. ! Acetone
  1350. 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , &
  1351. 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , &
  1352. 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , &
  1353. 0.0 , 1.0 , 0.0 , 0.0 , 0.0 , &
  1354. 0.0/)
  1355. ! -------------------------------------------------------------------
  1356. ! GFED biomass burning
  1357. ! -------------------------------------------------------------------
  1358. integer, parameter :: emis_gfed_nvoc = 13
  1359. ! the same as MACC, except CH3CHO, CH3COCH3, and MEK !
  1360. character(len=26), parameter :: emis_gfed_voc_name(emis_gfed_nvoc) = (/ &
  1361. 'ch3oh ', & ! 1
  1362. 'c2h5oh ', & ! 2
  1363. 'c2h6 ', & ! 3
  1364. 'c3h8 ', & ! 4
  1365. 'higher_alkanes ', & ! 5
  1366. 'c2h4 ', & ! 6
  1367. 'c3h6 ', & ! 7
  1368. 'isoprene ', & ! 8
  1369. 'terpenes ', & ! 9
  1370. 'higher_alkenes ', & ! 10
  1371. 'toluenes ', & ! 11
  1372. 'ch2o ', & ! 12
  1373. 'nmhc '/) ! 13
  1374. ! For Biomass burning, use a the same table
  1375. ! The conversion to CBM5 species is defined using the speciation given in Hoor et al, ACP, 2009
  1376. ! species explicily accounted for : CH3OH, CH2O, C2H4, C2H6, C2H5OH, C3H8 and C3H6
  1377. ! MGLY is released from BB for toluene
  1378. ! In Hoor et al. there is a 13% fraction of any organics from burning which are unspeciated (i.e.) lost
  1379. ! species accounted for : HCOOH (4.04954E-2), CH3CHO(4.83586E-2), CH3COOH(1.13623E-01) and Acetone (5.1278E-02)
  1380. ! JEW 2014 : Assume the higher alkanes are butanes, higher alkenes are iso-butene (1 CH2O, 1OLE)
  1381. !
  1382. real, parameter :: emis_voc2cbm5_gfed(emis_gfed_nvoc*ncb5) = (/ &
  1383. ! PAR
  1384. 0.0 , 0.0 , 0.0 , 0.0 , &
  1385. 4.0*xmpar/(xmc*4+xmh*10), 0.0 , 0.0 , 0.0 , &
  1386. 0.0 , 2.0*xmpar/(xmc*4+xmh*8), xmc/92. , 0.0 , &
  1387. 0.0 , &
  1388. ! ETH
  1389. 0.0 , 0.0 , 0.0 , 0.0 , &
  1390. 0.0 , 0.0 , xmeth/(xmc*2+xmh*4) , 0.0 , &
  1391. 0.0 , 0.0 , 0.0 , 0.0 , &
  1392. 0.0 , &
  1393. ! OLE
  1394. 0.0 , 0.0 , 0.0 , 0.0 , &
  1395. 0.0 , 0.0 , 0.0 , 0.0 , &
  1396. 0.0 , xmole/(xmc*4+xmh*8) , 0.0 , 0.0 , &
  1397. 0.0 , &
  1398. ! ALD
  1399. 0.0 , 0.0 , 0.0 , 0.0 , &
  1400. 0.0 , 0.0 , 0.0 , 0.0 , &
  1401. 0.0 , 0.0 , 0.0 , 0.0 , &
  1402. (xmald2/xmc)*4.83586E-2 , &
  1403. ! MGLY
  1404. 0.0 , 0.0 , 0.0 , 0.0 , &
  1405. 0.0 , 0.0 , 0.0 , 0.0 , &
  1406. 0.0 , 0.0 , 0.2*xmgly/(92.0) , 0.0 , &
  1407. 0.0 , &
  1408. ! CH2O
  1409. 0.0 , 0.0 , 0.0 , 0.0 , &
  1410. 0.0 , 0.0 , 0.0 , 0.0 , &
  1411. 0.0 , 0.0 , 0.0 , 1.0 , &
  1412. 0.0 , &
  1413. ! CH3OH
  1414. 1.0 , 0.0 , 0.0 , 0.0 , &
  1415. 0.0 , 0.0 , 0.0 , 0.0 , &
  1416. 0.0 , 0.0 , 0.0 , 0.0 , &
  1417. 0.0 , &
  1418. ! HCOOH
  1419. 0.0 , 0.0 , 0.0 , 0.0 , &
  1420. 0.0 , 0.0 , 0.0 , 0.0 , &
  1421. 0.0 , 0.0 , 0.0 , 0.0 , &
  1422. (xmhcooh/xmc)*4.04954E-2, &
  1423. ! MCOOH
  1424. 0.0 , 0.0 , 0.0 , 0.0 , &
  1425. 0.0 , 0.0 , 0.0 , 0.0 , &
  1426. 0.0 , 0.0 , 0.0 , 0.0 , &
  1427. (xmmcooh/xmc)*1.13623E-01, &
  1428. ! C2H6
  1429. 0.0 , 0.0 , 1.0 , 0.0 , &
  1430. 0.0 , 0.0 , 0.0 , 0.0 , &
  1431. 0.0 , 0.0 , 0.0 , 0.0 , &
  1432. 0.0 , &
  1433. ! ETHOH
  1434. 0.0 , 1.0 , 0.0 , 0.0 , &
  1435. 0.0 , 0.0 , 0.0 , 0.0 , &
  1436. 0.0 , 0.0 , 0.0 , 0.0 , &
  1437. 0.0 , &
  1438. ! C3H8
  1439. 0.0 , 0.0 , 0.0 , 1.0 , &
  1440. 0.0 , 0.0 , 0.0 , 0.0 , &
  1441. 0.0 , 0.0 , 0.0 , 0.0 , &
  1442. 0.0 , &
  1443. ! C3H6
  1444. 0.0 , 0.0 , 0.0 , 0.0 , &
  1445. 0.0 , 0.0 , 1.0 , 0.0 , &
  1446. 0.0 , 0.0 , 0.0 , 0.0 , &
  1447. 0.0 , &
  1448. ! Acetone
  1449. 0.0 , 0.0 , 0.0 , 0.0 , &
  1450. 0.0 , 0.0 , 0.0 , 0.0 , &
  1451. 0.0 , 0.0 , 0.0 , 0.0 , &
  1452. (xmacet/xmc)*5.01278E-2 /)
  1453. ! NB: base the RETRO voc speciation on AR5 (retro species are a subset of AR5)
  1454. character(len=26), parameter :: emis_retro_voc_name(emis_ar5_nvoc) = (/ &
  1455. 'CH3OH ', & ! 1 ! only methanol provided, we do not include it
  1456. 'ETHANE ', & ! 2
  1457. 'PROPANE ', & ! 3
  1458. 'not provided ', & ! 4
  1459. 'not provided ', & ! 5
  1460. 'not provided ', & ! 6
  1461. 'ETHENE ', & ! 7
  1462. 'PROPENE ', & ! 8
  1463. 'ETHYNE ', & ! 9
  1464. 'ISOPRENE ', & ! 10
  1465. 'MONOTERPENES ', & ! 11
  1466. 'not provided ', & ! 12
  1467. 'BENZENE ', & ! 13
  1468. 'TOLUENE ', & ! 14
  1469. 'XYLENE ', & ! 15
  1470. 'not provided ', & ! 16
  1471. 'not provided ', & ! 17
  1472. 'not provided ', & ! 18
  1473. 'not provided ', & ! 19
  1474. 'not provided ', & ! 20
  1475. 'CH2O ', & ! 21
  1476. 'CH3CHO ', & ! 22
  1477. 'ACETONE ', & ! 23
  1478. 'not provided ', & ! 24
  1479. 'not provided ' /) ! 25
  1480. !
  1481. ! !REVISION HISTORY:
  1482. ! 1 Oct 2010 - Achim Strunk - v0 for AR5, MACC
  1483. ! 1 Dec 2011 - Narcisa Banda - added EDGAR 4.1 and 4.2
  1484. ! 19 Jun 2012 - P. Le Sager - cosmetic for lon-lat MPI domain decomposition
  1485. ! (all reading/regridding on root for now)
  1486. ! 20 Nov 2012 - Ph. Le Sager - defined and build lists of used providers
  1487. ! - deal with inventories years availability
  1488. ! - switch to MDF interface to read data
  1489. !
  1490. ! !TODO:
  1491. ! - should be renamed something like "emission_inventories" or "emiss_providers"
  1492. ! - and need to get a **SEPARATE** module for each inventories, before it
  1493. ! becomes unmanageable again
  1494. !
  1495. !EOP
  1496. !------------------------------------------------------------------------
  1497. CONTAINS
  1498. !--------------------------------------------------------------------------
  1499. ! TM5 !
  1500. !--------------------------------------------------------------------------
  1501. !BOP
  1502. !
  1503. ! !IROUTINE: EMISSION_READ_INIT
  1504. !
  1505. ! !DESCRIPTION: Initialise reading related parameters and
  1506. ! allocate needed arrays
  1507. !
  1508. !\\
  1509. ! !INTERFACE:
  1510. !
  1511. SUBROUTINE EMISSION_READ_INIT( rcF, status )
  1512. !
  1513. ! !USES:
  1514. !
  1515. use GO, only : TrcFile, ReadRc
  1516. use partools, only : isRoot
  1517. use emission_data, only : LCMIP6, LCMIP6BMB
  1518. use emission_data, only : LAR5, LEDGAR4, LRETROF, LGFED3, LMACC, LLPJ, LHYMN, LAR5BMB, LMACCITY, LMEGAN
  1519. use meteodata, only : set, gph_dat
  1520. use dims, only : im, jm, lm, nregions
  1521. !
  1522. ! !INPUT PARAMETERS:
  1523. !
  1524. type(TrcFile) :: rcF
  1525. !
  1526. ! !OUTPUT PARAMETERS:
  1527. !
  1528. integer, intent(out) :: status
  1529. !
  1530. ! !REVISION HISTORY:
  1531. ! 1 Oct 2010 - Achim Strunk - v0 for AR5
  1532. ! 1 Dec 2011 - Narcisa Banda - added EDGAR 4.1 and 4.2
  1533. ! 20 Nov 2012 - Ph. Le Sager - build lists of used providers
  1534. ! 29 Nov 2014 - Jason Williams - Introduced yearly specific biogenic emissions
  1535. !
  1536. ! !REMARKS:
  1537. !
  1538. !EOP
  1539. !------------------------------------------------------------------------
  1540. !BOC
  1541. character(len=*), parameter :: rname=mname//'/emission_read_init'
  1542. integer :: isect, iprov, nused, region
  1543. logical :: mask(numb_providers), LEDGARCH4
  1544. ! --- begin --------------------------------------
  1545. if (LCMIP6) then
  1546. !call ReadRc( rcF, 'input.emis.CMIP6.SSP', filestr_rcpiden, status )
  1547. !IF_ERROR_RETURN(status=1)
  1548. ! For the time being anthropogenic CH4 emissions are used from AR5
  1549. ! For this reason the following statement should be left in
  1550. ! until these are available from CMIP6:
  1551. call ReadRc( rcF, 'input.emis.AR5.RCP', filestr_rcpiden, status )
  1552. IF_ERROR_RETURN(status=1)
  1553. else if (LAR5) then
  1554. call ReadRc( rcF, 'input.emis.AR5.RCP', filestr_rcpiden, status )
  1555. IF_ERROR_RETURN(status=1)
  1556. endif
  1557. ! ------------------
  1558. ! build list of used providers
  1559. ! ------------------
  1560. ! LMACCITY does not provide anthropogenic CH4, then use EDGAR instead
  1561. if (LMACCITY) then
  1562. LEDGARCH4=.true.
  1563. else
  1564. LEDGARCH4=LEDGAR4
  1565. end if
  1566. ! CH4 (any inventory, but skip MACC and MEGAN since they have no CH4)
  1567. mask = (/ LCMIP6, LCMIP6BMB, LRETROF, LAR5, .false., LEDGARCH4, LEDGARCH4, LLPJ, LHYMN, LGFED3, .false. /)
  1568. nused = count(mask)
  1569. if (nused /= 0) then
  1570. allocate( used_providers_ch4(nused) )
  1571. used_providers_ch4 = pack( all_providers, mask)
  1572. else
  1573. has_ch4_emis = .false.
  1574. end if
  1575. ! ISOPRENE/TERPENES (anything except EDGAR, LPJ and HYMN; CMIP6/AR5 : only if fires requested)
  1576. mask = (/ .false., LCMIP6BMB, LRETROF, LAR5BMB, LMACC, .false., .false., .false., .false., LGFED3, LMEGAN /)
  1577. nused = count(mask)
  1578. if (nused /= 0) then
  1579. allocate( used_providers_isop(nused) )
  1580. used_providers_isop = pack( all_providers, mask)
  1581. allocate( used_providers_terp(nused) )
  1582. used_providers_terp = pack( all_providers, mask)
  1583. else
  1584. has_isop_emis = .false.
  1585. has_terp_emis = .false.
  1586. end if
  1587. ! Others gases (anything except LPJ and HYMN)
  1588. mask = (/ LCMIP6, LCMIP6BMB, LRETROF, LAR5, LMACC, LEDGAR4, LEDGAR4, .false., .false., LGFED3, LMEGAN /)
  1589. nused = count(mask)
  1590. if (nused /= 0) then
  1591. allocate( used_providers(nused) )
  1592. used_providers = pack( all_providers, mask)
  1593. else
  1594. has_emis = .false.
  1595. end if
  1596. ! BC and POM (anything except EDGAR, LPJ, HYMN and MEGAN)
  1597. mask = (/ LCMIP6, LCMIP6BMB, LRETROF, LAR5, LMACC, .false., .false., .false., .false., LGFED3, .false. /)
  1598. nused = count(mask)
  1599. if (nused /= 0) then
  1600. allocate( used_providers_aer(nused) )
  1601. used_providers_aer = pack( all_providers, mask)
  1602. else
  1603. has_aer_emis = .false.
  1604. end if
  1605. ! info
  1606. if (has_isop_emis) then
  1607. write(gol,*) 'EMISS-INFO - Emissions providers used for ISOP : ', used_providers_isop ; call goPr
  1608. else
  1609. write(gol,*) 'EMISS-INFO - Emissions providers used for ISOP : NONE' ; call goPr
  1610. end if
  1611. if (has_terp_emis) then
  1612. write(gol,*) 'EMISS-INFO - Emissions providers used for TERP : ', used_providers_terp ; call goPr
  1613. else
  1614. write(gol,*) 'EMISS-INFO - Emissions providers used for TERP : NONE' ; call goPr
  1615. end if
  1616. if ( has_ch4_emis ) then
  1617. write(gol,*) 'EMISS-INFO - Emissions providers used for CH4 : ', used_providers_ch4 ; call goPr
  1618. else
  1619. write(gol,*) 'EMISS-INFO - Emissions providers used for CH4 : NONE' ; call goPr
  1620. end if
  1621. if ( has_aer_emis ) then
  1622. write(gol,*) 'EMISS-INFO - Emissions providers used for BC/POM : ', used_providers_aer ; call goPr
  1623. else
  1624. write(gol,*) 'EMISS-INFO - Emissions providers used for BC/POM : NONE' ; call goPr
  1625. end if
  1626. if ( has_emis ) then
  1627. write(gol,*) 'EMISS-INFO - Emissions providers used for others : ', used_providers ; call goPr
  1628. else
  1629. write(gol,*) 'EMISS-INFO - Emissions providers used for others : NONE' ; call goPr
  1630. end if
  1631. ! ------------------
  1632. ! initialise sectors
  1633. ! ------------------
  1634. ! Type sequence is (name, category, is_3D_data, vdisttype, providers)
  1635. sectors_def( 1) = sector_type('emiss_ene ', 'anthropogenic ', .false., 'combenergy ', 'AR5 ', NULL() ) ! Energy production & distribution
  1636. sectors_def( 2) = sector_type('emiss_dom ', 'anthropogenic ', .false., 'combrescom ', 'AR5 ', NULL() ) ! Residential and commercial combustion
  1637. sectors_def( 3) = sector_type('emiss_ind ', 'anthropogenic ', .false., 'industry ', 'AR5 ', NULL() ) ! Industrial processes and combustion
  1638. sectors_def( 4) = sector_type('emiss_wst ', 'anthropogenic ', .false., 'waste ', 'AR5 ', NULL() ) ! Waste treatment and disposal
  1639. sectors_def( 5) = sector_type('emiss_agr ', 'anthropogenic ', .false., 'surface ', 'AR5 ', NULL() ) ! Agriculture
  1640. sectors_def( 6) = sector_type('emiss_awb ', 'anthropogenic ', .false., 'nearsurface ', 'AR5 ', NULL() ) ! Agricultural waste burning
  1641. sectors_def( 7) = sector_type('emiss_slv ', 'anthropogenic ', .false., 'nearsurface ', 'AR5 ', NULL() ) ! Solvent production and use
  1642. sectors_def( 8) = sector_type('emiss_tra ', 'anthropogenic ', .false., 'surface ', 'AR5 ', NULL() ) ! Land transport
  1643. sectors_def( 9) = sector_type('emiss_shp ', 'ships ', .false., 'nearsurface ', 'AR5 ', NULL() ) ! Ships
  1644. sectors_def(10) = sector_type('emiss_air ', 'aircraft ', .true. , 'aircraft ', 'AR5 ', NULL() ) ! Aircraft
  1645. sectors_def(11) = sector_type('grassfire ', 'biomassburning', .false., 'nearsurface ', 'AR5 ', NULL() ) ! Grassland Fire
  1646. sectors_def(12) = sector_type('forestfire', 'biomassburning', .false., 'forestfire ', 'AR5 ', NULL() ) ! Forest Fire
  1647. ! macc sectors (-> natural, missing in AR5 and EDGAR )
  1648. sectors_def(13) = sector_type('emiss_soil', 'natural ', .false., 'surface ', 'MACC ', NULL() ) ! Natural sources (soil) - only for NO and NH3
  1649. sectors_def(14) = sector_type('emiss_oc ', 'natural ', .false., 'surface ', 'MACC ', NULL() ) ! Natural sources (ocean)
  1650. sectors_def(15) = sector_type('emiss_bio ', 'natural ', .false., 'surface ', 'MACC ', NULL() ) ! Natural sources (biogenic)
  1651. sectors_def(16) = sector_type('emiss_nat ', 'natural ', .false., 'volcanic ', 'MACC ', NULL() ) ! Natural sources (volcanic)
  1652. if (LMACCITY) then
  1653. sectors_def(70) = sector_type('emiss_anthro', 'anthropogenic ', .false., 'combrescom ', 'MACC ', NULL() ) ! Anthropogenic (MACCITY only)
  1654. sectors_def(71) = sector_type('emiss_air ', 'aircraft ', .true. , 'aircraft ', 'MACC ', NULL() ) ! Aircraft (MACCITY only)
  1655. else
  1656. sectors_def(70) = sector_type('emiss_anthro', 'anthropogenic ', .false., 'combrescom ', 'DUMMY ', NULL() ) ! Off if MACC only to provide natural emissions
  1657. sectors_def(71) = sector_type('emiss_air ', 'aircraft ', .true. , 'aircraft ', 'DUMMY ', NULL() ) !
  1658. end if
  1659. ! MEGAN emissions from MACC
  1660. sectors_def(72) = sector_type('MEGAN_MACC ', 'natural ', .false., 'surface ', 'MEGAN ', NULL())! Natural sources (soil)
  1661. ! edgar 4.1 sectors
  1662. sectors_def(17) = sector_type('1A1_ENE ', 'anthropogenic ', .false., 'combenergy ', 'ED41 ', NULL()) ! Energy production & distribution
  1663. sectors_def(18) = sector_type('1A2_2 ', 'anthropogenic ', .false., 'industry ', 'ED41 ', NULL()) ! Industrial processes and combustion
  1664. sectors_def(19) = sector_type('1A3b_c_e ', 'anthropogenic ', .false., 'surface ', 'ED41 ', NULL()) ! Land transport
  1665. sectors_def(20) = sector_type('1A3a ', 'aircraft ', .true. , 'aircraft ', 'ED41 ', NULL()) ! Aircraft
  1666. sectors_def(21) = sector_type('1A3d_SHIP ', 'ships ', .false., 'nearsurface ', 'ED41 ', NULL()) ! Ships domestic
  1667. sectors_def(22) = sector_type('1A3d1 ', 'ships ', .false., 'nearsurface ', 'ED41 ', NULL()) ! Ships international
  1668. sectors_def(23) = sector_type('1A4_5 ', 'anthropogenic ', .false., 'combrescom ', 'ED41 ', NULL()) ! Residential and commercial combustion
  1669. sectors_def(24) = sector_type('1B ', 'anthropogenic ', .false., 'combenergy ', 'ED41 ', NULL()) ! Fugitive emissions
  1670. sectors_def(25) = sector_type('3 ', 'anthropogenic ', .false., 'nearsurface ', 'ED41 ', NULL()) ! Solvent emissions
  1671. sectors_def(26) = sector_type('4_but_4E ', 'anthropogenic ', .false., 'surface ', 'ED41 ', NULL()) ! Agriculture (soils, waste burning, livestock)
  1672. sectors_def(27) = sector_type('6A_6C ', 'anthropogenic ', .false., 'waste ', 'ED41 ', NULL()) ! Waste disposal and incineration
  1673. sectors_def(28) = sector_type('7 ', 'anthropogenic ', .false., 'waste ', 'ED41 ', NULL()) ! Fossil fuel fires
  1674. ! edgar 4.2 sectors
  1675. sectors_def(29) = sector_type('1A1a ', 'anthropogenic ', .false., 'combenergy ', 'ED42 ', NULL()) ! Energy production
  1676. sectors_def(30) = sector_type('1A1a_6 ', 'anthropogenic ', .false., 'combenergy ', 'ED42 ', NULL()) ! Energy production and waste (CO & NH3 sector; waste part is small compared to energy, so use energy vdist)
  1677. sectors_def(31) = sector_type('1A1a_6C ', 'anthropogenic ', .false., 'combenergy ', 'ED42 ', NULL()) ! Energy production and waste (SO2 sector; waste part is small compared to energy, so use energy vdist)
  1678. sectors_def(32) = sector_type('1A1_1A2 ', 'anthropogenic ', .false., 'industry ', 'ED42 ', NULL()) ! Energy and manufacturing industry (CH4 sector; energy part is small compared to industry, so use industry vdist)
  1679. sectors_def(33) = sector_type('1A1b_c ', 'anthropogenic ', .false., 'combenergy ', 'ED42 ', NULL()) ! Energy production
  1680. sectors_def(34) = sector_type('1A1b_c_1B_2C1_2C2', 'anthropogenic ', .false., 'combenergy ', 'ED42 ', NULL()) ! Energy, fugitive and metal industry (NMVOC sector; metal part is small, so use energy vdist)
  1681. sectors_def(35) = sector_type('1A2 ', 'anthropogenic ', .false., 'industry ', 'ED42 ', NULL()) ! Combustion in manufacturing industry
  1682. sectors_def(36) = sector_type('1A3 ', 'anthropogenic ', .false. , 'nearsurface', 'ED42 ', NULL()) ! Transport (including ships, aircraft!)
  1683. sectors_def(37) = sector_type('1A3a_c_d_e', 'anthropogenic ', .false. , 'nearsurface', 'ED42 ', NULL()) ! Non-road transport (including ships, aircraft!)
  1684. sectors_def(38) = sector_type('1A3b ', 'anthropogenic ', .false., 'surface ', 'ED42 ', NULL()) ! Road transport
  1685. sectors_def(39) = sector_type('1A4 ', 'anthropogenic ', .false., 'combrescom ', 'ED42 ', NULL()) ! Residential
  1686. sectors_def(40) = sector_type('1B1 ', 'anthropogenic ', .false., 'combenergy ', 'ED42 ', NULL()) ! Fugitive emissions
  1687. sectors_def(41) = sector_type('1B1_1B2_1A1b_c', 'anthropogenic ', .false., 'combenergy ', 'ED42 ', NULL()) ! Fugitive and energy emissions
  1688. sectors_def(42) = sector_type('1B2a ', 'anthropogenic ', .false., 'combenergy ', 'ED42 ', NULL()) ! Fugitive emissions
  1689. sectors_def(43) = sector_type('1B2b ', 'anthropogenic ', .false., 'combenergy ', 'ED42 ', NULL()) ! Fugitive emissions
  1690. sectors_def(44) = sector_type('1B2a_c_1A1b_c', 'anthropogenic ', .false., 'combenergy ', 'ED42 ', NULL()) ! Fugitive and energy emissions
  1691. sectors_def(45) = sector_type('2A_B_D_E_F_G', 'anthropogenic ', .false., 'industry ', 'ED42 ', NULL()) ! Industry emissions
  1692. sectors_def(46) = sector_type('2 ', 'anthropogenic ', .false., 'industry ', 'ED42 ', NULL()) ! Industry emissions
  1693. sectors_def(47) = sector_type('2A ', 'anthropogenic ', .false., 'industry ', 'ED42 ', NULL()) ! Industry emissions
  1694. sectors_def(48) = sector_type('2A_2B_2D ', 'anthropogenic ', .false., 'industry ', 'ED42 ', NULL()) ! Industry emissions
  1695. sectors_def(49) = sector_type('2B ', 'anthropogenic ', .false., 'industry ', 'ED42 ', NULL()) ! Industry emissions
  1696. sectors_def(50) = sector_type('2C ', 'anthropogenic ', .false., 'industry ', 'ED42 ', NULL()) ! Industry emissions
  1697. sectors_def(51) = sector_type('3 ', 'anthropogenic ', .false., 'nearsurface ', 'ED42 ', NULL()) ! Solvent emissions
  1698. sectors_def(52) = sector_type('4A ', 'anthropogenic ', .false., 'surface ', 'ED42 ', NULL()) ! Agriculture
  1699. sectors_def(53) = sector_type('4B ', 'anthropogenic ', .false., 'surface ', 'ED42 ', NULL()) ! Agriculture
  1700. sectors_def(54) = sector_type('4C_4D ', 'anthropogenic ', .false., 'surface ', 'ED42 ', NULL()) ! Agriculture
  1701. sectors_def(55) = sector_type('4F ', 'anthropogenic ', .false., 'surface ', 'ED42 ', NULL()) ! Agricultural waste burning
  1702. sectors_def(56) = sector_type('6A_6C ', 'anthropogenic ', .false., 'waste ', 'ED42 ', NULL()) ! Waste disposal and incineration
  1703. sectors_def(57) = sector_type('6B ', 'anthropogenic ', .false., 'waste ', 'ED42 ', NULL()) ! Waste disposal and incineration
  1704. sectors_def(58) = sector_type('7 ', 'anthropogenic ', .false., 'waste ', 'ED42 ', NULL()) ! Fossil fuel fires
  1705. sectors_def(59) = sector_type('7A ', 'anthropogenic ', .false., 'waste ', 'ED42 ', NULL()) ! Fossil fuel fires
  1706. sectors_def(60) = sector_type('5A_C_D_F_4E', 'biomassburning', .false., 'forestfire ', 'ED42 ', NULL()) ! Large scale biomass burning
  1707. ! natural methane emissions LPJ and HYMN project
  1708. sectors_def(61) = sector_type('wetlands ', 'natural ', .false., 'surface ', 'LPJ ',NULL()) ! Methane from wetlands
  1709. sectors_def(62) = sector_type('peatlands ', 'natural ', .false., 'surface ', 'LPJ ',NULL()) ! Methane from peatlands
  1710. sectors_def(63) = sector_type('wetsoils ', 'natural ', .false., 'surface ', 'LPJ ',NULL()) ! Methane from wet soils
  1711. sectors_def(64) = sector_type('soilconsumption', 'natural ', .false., 'surface ', 'LPJ ',NULL()) ! Methane soil uptake
  1712. sectors_def(65) = sector_type('oceans ', 'natural ', .false., 'surface ', 'HYMN ',NULL()) ! Methane ocean emissions
  1713. sectors_def(66) = sector_type('wildanimals', 'natural ', .false., 'surface ', 'HYMN ',NULL()) ! Methane emissions from wild animals
  1714. sectors_def(67) = sector_type('termites ', 'natural ', .false., 'surface ', 'HYMN ',NULL()) ! Methane ternite emissions
  1715. ! Biomass burning GFEDv3 monthly
  1716. sectors_def(68) = sector_type('wildfires ', 'biomassburning', .false., 'forestfire ', 'GFEDv3 ', NULL())
  1717. ! Biomass burning RETRO
  1718. sectors_def(69) = sector_type('fire_emis ', 'biomassburning', .false., 'forestfire ', 'RETRO ',NULL())
  1719. ! CMIP6
  1720. sectors_def(73) = sector_type('ENE ', 'anthropogenic ', .false., 'combenergy ', 'CMIP6 ', NULL() ) ! Energy sector
  1721. sectors_def(74) = sector_type('RCO ', 'anthropogenic ', .false., 'combrescom ', 'CMIP6 ', NULL() ) ! Residential, commercial and other
  1722. sectors_def(75) = sector_type('IND ', 'anthropogenic ', .false., 'industry ', 'CMIP6 ', NULL() ) ! Industrial sector
  1723. sectors_def(76) = sector_type('WST ', 'anthropogenic ', .false., 'waste ', 'CMIP6 ', NULL() ) ! Waste treatment and disposal
  1724. sectors_def(77) = sector_type('AGR ', 'anthropogenic ', .false., 'surface ', 'CMIP6 ', NULL() ) ! Agriculture (incl. agricultural waste burning, which was assumed 'nearsurface' in AR5)
  1725. sectors_def(78) = sector_type('SLV ', 'anthropogenic ', .false., 'nearsurface ', 'CMIP6 ', NULL() ) ! Solvents production and application
  1726. sectors_def(79) = sector_type('TRA ', 'anthropogenic ', .false., 'surface ', 'CMIP6 ', NULL() ) ! Transportation sector (land)
  1727. sectors_def(80) = sector_type('SHP ', 'ships ', .false., 'nearsurface ', 'CMIP6 ', NULL() ) ! International shipping
  1728. sectors_def(81) = sector_type('AIR ', 'aircraft ', .true. , 'aircraft ', 'CMIP6 ', NULL() ) ! Aircraft
  1729. ! CMIP6BMB
  1730. sectors_def(82) = sector_type('wildfires ', 'biomassburning', .false., 'forestfire ', 'CMIP6BMB', NULL() ) ! Forest and grassland fires; the latter were assumed 'nearsurface' in AR5
  1731. ! -------------------------
  1732. ! info per species
  1733. ! ------------------------
  1734. ! ED42 sectors are not available for all species, so we define a sectors list per species.
  1735. !! These are the "ALL AVAILABLE". Kept for reference.
  1736. !ed42_co_sectors = (/'1A1a_6 ', '1A2 ', '1A3a_c_d_e ', '1A3b ', '1A4 ', &
  1737. ! '1B2a_c_1A1b_c', '2A_2B_2D ', '2C ', '4F ', '5A_C_D_F_4E ', '7A ' /)
  1738. !
  1739. !ed42_ch4_sectors = (/'1A1_1A2 ', '1A3a_c_d_e ', '1A3b ', '1A4 ', '1B1 ', '1B2a ', &
  1740. ! '1B2b ', '2 ', '4A ', '4B ', '4C_4D ', '4F ', &
  1741. ! '5A_C_D_F_4E', '6A_6C ', '6B ', '7A '/)
  1742. !
  1743. !ed42_nox_sectors = (/'1A1a ', '1A2 ', '1A3a_c_d_e ', '1A3b ', '1A4 ',&
  1744. ! '1B2a_c_1A1b_c', '2 ', '4B ', '4C_4D ', '4F ',&
  1745. ! '5A_C_D_F_4E ', '6A_6C ', '7A ' /)
  1746. !
  1747. !ed42_hc_sectors = (/'1A1a ', '1A1b_c_1B_2C1_2C2', '1A2 ', '1A3a_c_d_e ', &
  1748. ! '1A3b ', '1A4 ', '2A_B_D_E_F_G ', '3 ', &
  1749. ! '4F ', '5A_C_D_F_4E ', '6A_6C ', '7A ' /)
  1750. !
  1751. !ed42_nh3_sectors = (/'1A1a_6 ', '1A1b_c ', '1A2 ', '1A3 ', '1A4 ', '2A ',&
  1752. ! '2B ', '4B ', '4C_4D ', '4F ', '5A_C_D_F_4E' /)
  1753. !
  1754. !ed42_so2_sectors = (/'1A1a_6C ', '1A2 ', '1A3a_c_d_e ', '1A3b ', '1A4 ',&
  1755. ! '1B1_1B2_1A1b_c', '2B_2D ', '2C ', '4F ', '5A_C_D_F_4E ', '7A '/)
  1756. ! Use only non-transport sectors (they are provided by ED41), and remove biomassburning:
  1757. ed42_co_sectors = (/ '1A1a_6 ', '1A2 ', '1A4 ', '1B2a_c_1A1b_c ', &
  1758. '2A_2B_2D ', '2C ', '4F ', '7A ' /)
  1759. ed42_ch4_sectors = (/'1A1_1A2 ', '1A4 ', '1B1 ', '1B2a ', &
  1760. '1B2b ', '2 ', '4A ', '4B ', &
  1761. '4C_4D ', '4F ', '6A_6C ', '6B ', &
  1762. '7A '/)
  1763. ed42_nox_sectors = (/'1A1a ', '1A2 ', '1A4 ', '1B2a_c_1A1b_c ', &
  1764. '2 ', '4B ', '4C_4D ', '4F ', &
  1765. '6A_6C ', '7A ' /)
  1766. ! Note that '5A_C_D_F_4E' is not only fire, but it is available only for the NMVOC species
  1767. ! which we do not use (instead we loop through emis_ar5_nvoc constituents) anyway
  1768. ed42_hc_sectors = (/'1A1a ', '1A1b_c_1B_2C1_2C2 ', '1A2 ', '1A4 ', &
  1769. '2A_B_D_E_F_G ', '3 ', '4F ', '6A_6C ', &
  1770. '7A ' /)
  1771. ed42_nh3_sectors = (/'1A1a_6 ', '1A1b_c ', '1A2 ', '1A4 ', &
  1772. '2A ', '2B ', '4B ', '4C_4D ', &
  1773. '4F ' /)
  1774. ed42_so2_sectors = (/'1A1a_6C ', '1A2 ', '1A4 ', '1B1_1B2_1A1b_c ', &
  1775. '2B_2D ', '2C ', '4F ', '7A '/)
  1776. ! ED41 sectors are used only for the transport sector - the screening is
  1777. ! coded in the *declare routines of each emission_*.F90 according to
  1778. ! sector name. It boils down to four cases:
  1779. !
  1780. ! (/'1A3a', '1A3b_c_e', '1A3d1', '1A3d_SHIP'/) : NOx
  1781. ! (/'1A3b_c_e', '1A3d1', '1A3d_SHIP'/) : some NMVOC, CO, CH4, SOx
  1782. ! (/'1A3b_c_e'/) : some NMVOC, NH3
  1783. ! NONE : some NMVOC
  1784. ! AR5
  1785. sectors_def( 1)%species => ar5_cat_ant_ene_ind
  1786. sectors_def( 2)%species => ar5_cat_ant_dom
  1787. sectors_def( 3)%species => ar5_cat_ant_ene_ind
  1788. sectors_def( 4)%species => ar5_cat_ant
  1789. sectors_def( 5)%species => ar5_cat_ant_agr
  1790. sectors_def( 6)%species => ar5_cat_ant_awb
  1791. sectors_def( 7)%species => ar5_cat_ant_slv
  1792. sectors_def( 8)%species => ar5_cat_ant_tra
  1793. sectors_def( 9)%species => ar5_cat_shp
  1794. sectors_def(10)%species => ar5_cat_air
  1795. sectors_def(11)%species => ar5_cat_bmb
  1796. sectors_def(12)%species => ar5_cat_bmb
  1797. n_ar5_ant_sec=8 ! hardcoded but could be counted
  1798. n_ar5_shp_sec=1
  1799. n_ar5_air_sec=1
  1800. n_ar5_bmb_sec=2
  1801. ! -------------------------
  1802. ! initialise providers info
  1803. ! ------------------------
  1804. do iprov = 1, numb_providers
  1805. providers_def(iprov)%name = all_providers(iprov)
  1806. providers_def(iprov)%nsect2d = count( (sectors_def%prov == all_providers(iprov)) .and. (sectors_def%f3d .eqv. .false.))
  1807. providers_def(iprov)%nsect3d = count( (sectors_def%prov == all_providers(iprov)) .and. (sectors_def%f3d .eqv. .true.))
  1808. if(okdebug) then
  1809. write(gol,'("EMISS-INFO - Inventory ",a," has ",i3, " 2d-sectors, and ",i3," 3d-sectors")')&
  1810. & all_providers(iprov), providers_def(iprov)%nsect2d, providers_def(iprov)%nsect3d ; call goPr
  1811. endif
  1812. end do
  1813. ! -------------------------
  1814. ! initialise GeopPotential Height on 1x1
  1815. ! ------------------------
  1816. do region=1, nregions
  1817. call Set( gph_dat(region), status, used=.true. )
  1818. end do
  1819. ! ----------------------------------------
  1820. ! allocate gridbox_area arrays
  1821. ! ----------------------------------------
  1822. allocate( gridbox_area_025( nlon1440, nlat720 ) )
  1823. allocate( gridbox_area_05 ( nlon720 , nlat360 ) )
  1824. #ifdef with_ch4_emis
  1825. allocate( lpj_gridbox_area ( lpj_dim_nlon, lpj_dim_nlat ) )
  1826. allocate( lpj_frac_wetlands ( lpj_dim_nlon, lpj_dim_nlat, 12 ) )
  1827. allocate( lpj_frac_rice ( lpj_dim_nlon, lpj_dim_nlat, 12 ) )
  1828. allocate( lpj_frac_peatlands ( lpj_dim_nlon, lpj_dim_nlat ) )
  1829. #endif
  1830. ! OK
  1831. status = 0
  1832. END SUBROUTINE EMISSION_READ_INIT
  1833. !EOC
  1834. !--------------------------------------------------------------------------
  1835. ! TM5 !
  1836. !--------------------------------------------------------------------------
  1837. !BOP
  1838. !
  1839. ! !IROUTINE: EMISSION_READ_DONE
  1840. !
  1841. ! !DESCRIPTION: Free allocated arrays.
  1842. !\\
  1843. !\\
  1844. ! !INTERFACE:
  1845. !
  1846. subroutine emission_read_done( status )
  1847. !
  1848. ! !OUTPUT PARAMETERS:
  1849. !
  1850. integer, intent(out) :: status
  1851. !
  1852. ! !REVISION HISTORY:
  1853. ! 1 Oct 2010 - Achim Strunk - v0
  1854. !
  1855. !EOP
  1856. !------------------------------------------------------------------------
  1857. !BOC
  1858. character(len=*), parameter :: rname=mname//'/emission_read_done'
  1859. deallocate( gridbox_area_025 )
  1860. deallocate( gridbox_area_05 )
  1861. #ifdef with_ch4_emis
  1862. deallocate( lpj_gridbox_area )
  1863. deallocate( lpj_frac_wetlands )
  1864. deallocate( lpj_frac_rice )
  1865. deallocate( lpj_frac_peatlands )
  1866. #endif
  1867. if (allocated( used_providers )) deallocate( used_providers )
  1868. if (allocated( used_providers_ch4 )) deallocate( used_providers_ch4 )
  1869. if (allocated( used_providers_isop)) deallocate( used_providers_isop )
  1870. if (allocated( used_providers_terp)) deallocate( used_providers_terp )
  1871. if (allocated( used_providers_aer )) deallocate( used_providers_aer )
  1872. ! OK
  1873. status = 0
  1874. END SUBROUTINE EMISSION_READ_DONE
  1875. !EOC
  1876. !--------------------------------------------------------------------------
  1877. ! TM5 !
  1878. !--------------------------------------------------------------------------
  1879. !BOP
  1880. !
  1881. ! !FUNCTION: EMISSION_COARSEN_TO_1X1
  1882. !
  1883. ! !DESCRIPTION: Coarsen the gridded information to 1x1 deg.
  1884. ! (taken from GEMS/MACC repository)
  1885. !\\
  1886. !\\
  1887. ! !INTERFACE:
  1888. !
  1889. function emission_coarsen_to_1x1( emis_in, dim_nlon, dim_nlat, shift_lon, status )
  1890. !
  1891. ! !RETURN VALUE:
  1892. !
  1893. real, dimension(360,180) :: emission_coarsen_to_1x1
  1894. !
  1895. ! !INPUT PARAMETERS:
  1896. !
  1897. integer, intent(in) :: dim_nlon
  1898. integer, intent(in) :: dim_nlat
  1899. real, intent(in) :: emis_in(dim_nlon, dim_nlat)
  1900. logical, intent(in) :: shift_lon
  1901. !
  1902. ! OUTPUT PARAMETERS:
  1903. !
  1904. integer , intent(out) :: status
  1905. !
  1906. ! !REVISION HISTORY:
  1907. ! 1 Oct 2010 - Achim Strunk - v0 for AR5
  1908. ! 1 Dec 2011 - Narcisa Banda - works for any input resolution lower than 1x1
  1909. ! if 1x1 can be divided into exact number of gridcells (no interpolation)
  1910. ! 1 Jul 2012 - Narcisa Banda - added the shift_lon logical flag:
  1911. ! true if the data is read on longitudes [0,360] (then they need to be shifted on [-180,180])
  1912. ! false if the data is read already on [-180,180]
  1913. !
  1914. !EOP
  1915. !------------------------------------------------------------------------
  1916. !BOC
  1917. integer :: i, j
  1918. integer :: nri, nrj
  1919. ! --- begin -----------------------------------
  1920. ! combine grid cells :
  1921. ! from [ 0,360]x[-90,90] 001:360,361:720 001:360
  1922. ! to [-180,180]x[-90,90] 001:180,181:360 001:180
  1923. if ((mod(dim_nlon, 360) /= 0 ) .or. (mod(dim_nlat, 180) /= 0)) then
  1924. write(gol,*) 'coarsening of emissions to 1x1 does not work for this resolution' ; call goErr
  1925. status = 1
  1926. return
  1927. endif
  1928. nri = dim_nlon/360
  1929. nrj = dim_nlat/180
  1930. if (shift_lon) then
  1931. ! combine grid cells :
  1932. ! from [ 0,360]x[-90,90] 001:360,361:720 001:360
  1933. ! to [-180,180]x[-90,90] 001:180,181:360 001:180
  1934. do j = 1, 180
  1935. ! west half
  1936. do i = 1, 180
  1937. emission_coarsen_to_1x1(i,j) = sum(emis_in(nri*180+nri*i-nri+1:nri*180+nri*i,nrj*j-nrj+1:nrj*j))
  1938. end do
  1939. ! east half
  1940. do i = 1, 180
  1941. emission_coarsen_to_1x1(180+i,j) = sum(emis_in(nri*i-nri+1:nri*i,nrj*j-nrj+1:nrj*j))
  1942. end do
  1943. end do
  1944. else
  1945. do j=1, 180
  1946. do i=1, 360
  1947. emission_coarsen_to_1x1(i,j) = sum(emis_in(nri*i-nri+1:nri*i,nrj*j-nrj+1:nrj*j))
  1948. end do
  1949. end do
  1950. endif
  1951. ! ok
  1952. status = 0
  1953. end function emission_coarsen_to_1x1
  1954. !EOC
  1955. !--------------------------------------------------------------------------
  1956. ! TM5 !
  1957. !--------------------------------------------------------------------------
  1958. !BOP
  1959. !
  1960. ! !FUNCTION: VALID_YEAR
  1961. !
  1962. ! !DESCRIPTION: return a valid year for an emission inventory, based on
  1963. ! requested year.
  1964. !\\
  1965. !\\
  1966. ! !INTERFACE:
  1967. !
  1968. FUNCTION VALID_YEAR( iyear, iminmax, provider_name, verbose)
  1969. !
  1970. ! !RETURN VALUE:
  1971. !
  1972. integer :: valid_year
  1973. !
  1974. ! !INPUT PARAMETERS:
  1975. !
  1976. integer, intent(in) :: iyear, iminmax(2)
  1977. character(len=*), intent(in) :: provider_name
  1978. logical, intent(in) :: verbose
  1979. !
  1980. ! !REVISION HISTORY:
  1981. ! 26 Nov 2012 - Ph. Le Sager - v0
  1982. !
  1983. !EOP
  1984. !------------------------------------------------------------------------
  1985. !BOC
  1986. valid_year = MIN(iminmax(2),MAX(iyear,iminmax(1)))
  1987. ! info only once a year, and per inventory
  1988. if (verbose) then
  1989. write(gol,'(a,i4," (avail: ",i4,"-",i4,")")') ' EMISS-INFO - EMISS YEAR for '//trim(provider_name)//' : ', &
  1990. valid_year, iminmax ; call goPr
  1991. end if
  1992. END FUNCTION VALID_YEAR
  1993. !EOC
  1994. !--------------------------------------------------------------------------
  1995. ! TM5 !
  1996. !--------------------------------------------------------------------------
  1997. !BOP
  1998. !
  1999. ! !IROUTINE: EMISSION_CMIP6_READSECTOR
  2000. !
  2001. ! !DESCRIPTION: Reading one sector of the files for the requested month and
  2002. ! returning an interpolated 3d emission field (d3data)
  2003. ! and, for the CMIP6 2-D sectors, an interpolated 2d field
  2004. ! containing emissions from solid biofuel combustion (d2data_bf).
  2005. !\\
  2006. !\\
  2007. ! !INTERFACE:
  2008. !
  2009. subroutine emission_cmip6_ReadSector( comp, iyear, imonth, sector, d3data, status, d2data_bf )
  2010. !
  2011. use dims , only : icalendo
  2012. !
  2013. ! !INPUT PARAMETERS:
  2014. !
  2015. character(len=*) , intent(in) :: comp
  2016. integer , intent(in) :: iyear
  2017. integer , intent(in) :: imonth
  2018. integer , intent(in) :: sector
  2019. !
  2020. ! !OUTPUT PARAMETERS:
  2021. !
  2022. integer , intent(out) :: status
  2023. real, dimension(nlon360,nlat180,ar5_dim_3ddata), intent(out) :: d3data
  2024. real, dimension(nlon360,nlat180), intent(out), optional :: d2data_bf
  2025. !
  2026. !EOP
  2027. !------------------------------------------------------------------------
  2028. !BOC
  2029. character(len=*), parameter :: rname = mname//'/emission_cmip6_readsector'
  2030. character(len=256) :: fname
  2031. character(len=256) :: fname_gridboxarea
  2032. character(len=256) :: varfilename, varname, secname
  2033. integer :: lt, year, startyear
  2034. integer, parameter :: year_handshake=2014
  2035. character(len=25) :: sec_str, sec_str2
  2036. character(len=13) :: time_str
  2037. character(len=30), parameter :: source_str='input4MIPs_emissions_CMIP_CEDS'
  2038. character(len=256) :: version_str, extra_str
  2039. logical :: existfile
  2040. character(len=4) :: cyear
  2041. logical :: first=.true.
  2042. logical :: is_leap
  2043. real, parameter :: leap_corr=28./29.
  2044. ! --- begin -----------------------------------
  2045. ! initialise target array
  2046. d3data = 0.0
  2047. if (present(d2data_bf)) d2data_bf = 0.0
  2048. ! read in gridbox-area; once per CPU
  2049. if( .not. area_found_05 ) then
  2050. fname_gridboxarea = trim(emis_input_dir_cmip6)//'/'//trim(cmip6_filestr_gridboxarea)
  2051. call emission_ReadGridboxArea(fname_gridboxarea, 'gridbox_area', gridbox_area_05, &
  2052. & nlon720, nlat360, status )
  2053. IF_NOTOK_RETURN(status=1)
  2054. area_found_05=.true.
  2055. endif
  2056. ! deal with out-of-bounds requested years
  2057. year = valid_year( iyear, cmip6_avail, 'CMIP6', first)
  2058. first=.false.
  2059. if ( trim(sectors_def(sector)%catname) == 'aircraft' .and. year < 1920 ) then
  2060. ! CMIP6 aircraft emissions before 1920 are zero and not read anymore
  2061. d3data(:,:,:) = 0.
  2062. else
  2063. ! cyear will contain strings with the years
  2064. write(cyear,'(I4.4)') year
  2065. ! Correct fluxes for February in case the emission year is a leap year
  2066. ! From the CEDS README file:
  2067. ! "Note that total monthly emissions were converted to fluxes using a 365 day calendar.
  2068. ! If your model uses a different calendar,
  2069. ! you should ideally adjust fluxes such that the integrated annual fluxes are maintained."
  2070. if (year < 2015) then
  2071. is_leap = (mod(year, 4) == 0 .and. .not. mod(year, 100) == 0) .or. (mod(year, 400) == 0)
  2072. else
  2073. ! no correction for the scenarios (to be checked)
  2074. is_leap = .false.
  2075. endif
  2076. ! ------------------------
  2077. ! construct filename
  2078. ! e.g.: <emisdir>/NOx-em-AIR-anthro_input4MIPs_emissions_CMIP_CEDS-v2016-06-18_gr_175001-179912.nc
  2079. ! ------------------------
  2080. if ( index(comp,'CH4') /= 1 ) then
  2081. if (year >= 1750 .and. year < 1800) then
  2082. time_str='175001-179912'
  2083. startyear=1750
  2084. else if (year >= 1800 .and. year < 1850) then
  2085. time_str='180001-184912'
  2086. startyear=1800
  2087. else if (year >= 1850 .and. year < 1851) then
  2088. time_str='185001-185012'
  2089. startyear=1850
  2090. else if (year >= 1851 .and. year < 1900) then
  2091. time_str='185101-189912'
  2092. startyear=1851
  2093. else if (year >= 1900 .and. year < 1950) then
  2094. time_str='190001-194912'
  2095. startyear=1900
  2096. else if (year >= 1950 .and. year < 2000) then
  2097. time_str='195001-199912'
  2098. startyear=1950
  2099. else if (year >= 2000 .and. year < 2015) then
  2100. time_str='200001-201412'
  2101. startyear=2000
  2102. else
  2103. write (gol,'("CMIP6 emissions beyond 2014 not available yet")') ; call goErr
  2104. status=1; TRACEBACK; return
  2105. endif
  2106. if (year >= 1750 .and. year < 2015) then
  2107. if (trim(sectors_def(sector)%catname) == 'aircraft') then
  2108. if ( index(comp,'SO2') /= 1 ) then
  2109. version_str='2017-08-30'
  2110. else
  2111. ! SO2 aicraft emissions have had another update in Oct. 2017
  2112. version_str='2017-10-05'
  2113. endif
  2114. else
  2115. version_str='2017-05-18'
  2116. endif
  2117. else
  2118. write (gol,'("CMIP6 emissions beyond 2014 not available yet")') ; call goErr
  2119. status=1; TRACEBACK; return
  2120. endif
  2121. else
  2122. ! CH4
  2123. if (year >= 1750 .and. year < 1850) then
  2124. write (gol,'("WARNING - Anthropogenic emissions of CH4 not available prior to 1850")') ; call goPr
  2125. write (gol,'("WARNING - 1850 values are used")') ; call goPr
  2126. year = 1850
  2127. endif
  2128. if (year >= 1850 .and. year < 1970) then
  2129. time_str='185001-196012'
  2130. startyear=1850
  2131. version_str='2017-05-18-supplemental-data'
  2132. else if (year >= 1970 .and. year < 2015) then
  2133. time_str='197001-201412'
  2134. startyear=1970
  2135. version_str='2017-05-18'
  2136. else
  2137. write (gol,'("CMIP6 emissions beyond 2014 not available yet")') ; call goErr
  2138. status=1; TRACEBACK; return
  2139. endif
  2140. endif
  2141. if ( trim(sectors_def(sector)%catname) == 'anthropogenic' .or. &
  2142. trim(sectors_def(sector)%catname) == 'ships' ) then
  2143. if ( index(comp,'VOC') == 1 ) then
  2144. ! individual VOC species
  2145. sec_str='em-speciated-VOC-anthro'
  2146. sec_str2='em_speciated_VOC_anthro'
  2147. version_str=trim(version_str)//'-supplemental-data'
  2148. else
  2149. sec_str='em-anthro'
  2150. sec_str2='em_anthro'
  2151. endif
  2152. varname=trim(comp)//'_'//trim(sec_str2)
  2153. ! change dash to underscore in few cases
  2154. if ( index(varname, 'VOC') == 1 ) varname(6:6)= '_'
  2155. if ( index(varname, 'hexanes-pl') == 7 ) varname(7:16) = 'hexanes_pl'
  2156. if ( index(varname, 'other-') == 7 ) varname(7:12) = 'other_'
  2157. else if ( trim(sectors_def(sector)%catname) == 'aircraft' ) then
  2158. sec_str='em-AIR-anthro'
  2159. sec_str2='em_AIR_anthro'
  2160. varname=trim(comp)//'_'//trim(sec_str2)
  2161. else
  2162. write (gol,'("Invalid CMIP6 sector")') ; call goErr
  2163. status=1; TRACEBACK; return
  2164. endif
  2165. varfilename=trim(comp)//'-'//trim(sec_str)
  2166. ! For NO, the species name in the file name has to be set to NOx
  2167. if (year .le. year_handshake) then
  2168. fname = trim(emis_input_dir_cmip6) //'/'// &
  2169. trim(varfilename) //'_'// &
  2170. trim(source_str) //'-'// &
  2171. trim(version_str) //'_'// &
  2172. 'gn' //'_'// &
  2173. trim(time_str) // &
  2174. '.nc'
  2175. else
  2176. write (gol,'("Code for CMIP6 scenario file names not implemented yet")') ; call goErr
  2177. status=1; TRACEBACK; return
  2178. endif
  2179. ! test existence of file
  2180. inquire( file=trim(fname), exist=existfile)
  2181. if( .not. existfile ) then
  2182. write (gol,'(" CMIP6 file `",a,"` not found ")') trim(fname); call goErr
  2183. status = 1; TRACEBACK; return
  2184. end if
  2185. ! ------------------------------------------------
  2186. ! data record is read by emission_cmip6_Read2/3DRecord
  2187. secname = sectors_def(sector)%name
  2188. ! distinguish 2d/3d sectors
  2189. if( sectors_def(sector)%f3d ) then
  2190. d3data(:,:,:) = emission_cmip6_Read3DRecord( fname, varname, secname, imonth, year, startyear, status )
  2191. if (is_leap .and. imonth == 2) then
  2192. d3data(:,:,:) = d3data(:,:,:) * leap_corr
  2193. endif
  2194. else
  2195. d3data(:,:,1) = emission_cmip6_Read2DRecord( fname, varname, secname, imonth, year, startyear, status )
  2196. if (is_leap .and. imonth == 2) then
  2197. d3data(:,:,1) = d3data(:,:,1) * leap_corr
  2198. endif
  2199. ! Read mass emitted by solid biofuel burning
  2200. ! for carbonaceous aerosol.
  2201. ! Reading of biofuel emissions is done for all 2-D sectors,
  2202. ! even though in CMIP6 there are only contributions for RCO, IND, ENE and TRA.
  2203. if (present(d2data_bf)) then
  2204. if ( (index(comp,'BC') /= 1) .and. (index(comp,'OC') /= 1) ) then
  2205. write (gol,'("Reading solid biofuel emissions only implemented for BC and OC")'); call goErr
  2206. status = 1; TRACEBACK; return
  2207. endif
  2208. sec_str='em-SOLID-BIOFUEL-anthro'
  2209. sec_str2='em_SOLID_BIOFUEL_anthro'
  2210. varname=trim(comp)//'_'//trim(sec_str2)
  2211. varfilename=trim(comp)//'-'//trim(sec_str)
  2212. if (year .le. year_handshake) then
  2213. fname = trim(emis_input_dir_cmip6) //'/'// &
  2214. trim(varfilename) //'_'// &
  2215. trim(source_str) //'-'// &
  2216. trim(version_str) //'-'// &
  2217. 'supplemental-data' //'_'// &
  2218. 'gn' //'_'// &
  2219. trim(time_str) // &
  2220. '.nc'
  2221. else
  2222. write (gol,'("Code for CMIP6 scenario file names not implemented yet")') ; call goErr
  2223. status=1; TRACEBACK; return
  2224. endif
  2225. ! test existence of file
  2226. inquire( file=trim(fname), exist=existfile)
  2227. if( .not. existfile ) then
  2228. write (gol,'(" CMIP6 file `",a,"` not found ")') trim(fname); call goErr
  2229. status = 1; TRACEBACK; return
  2230. end if
  2231. d2data_bf(:,:) = emission_cmip6_Read2DRecord( fname, varname, secname, imonth, year, startyear, status )
  2232. if (is_leap .and. imonth == 2) then
  2233. d2data_bf(:,:) = d2data_bf(:,:) * leap_corr
  2234. endif
  2235. endif
  2236. end if
  2237. endif
  2238. IF_NOTOK_RETURN(status=1)
  2239. end subroutine emission_cmip6_ReadSector
  2240. !EOC
  2241. !--------------------------------------------------------------------------
  2242. ! TM5 !
  2243. !--------------------------------------------------------------------------
  2244. !BOP
  2245. !
  2246. ! !IROUTINE: EMISSION_CMIP6BMB_READSECTOR
  2247. !
  2248. ! !DESCRIPTION: Reading one sector of the files for the requested month and
  2249. ! returning an interpolated 3d emission field (d3data)
  2250. !\\
  2251. !\\
  2252. ! !INTERFACE:
  2253. !
  2254. subroutine emission_cmip6bmb_ReadSector( comp, iyear, imonth, sector, d3data, status )
  2255. !
  2256. ! !INPUT PARAMETERS:
  2257. !
  2258. character(len=*) , intent(in) :: comp
  2259. integer , intent(in) :: iyear
  2260. integer , intent(in) :: imonth
  2261. integer , intent(in) :: sector
  2262. !
  2263. ! !OUTPUT PARAMETERS:
  2264. !
  2265. integer , intent(out) :: status
  2266. real, dimension(nlon360,nlat180) :: d3data_help
  2267. real, dimension(nlon360,nlat180,ar5_dim_3ddata), intent(out) :: d3data
  2268. !
  2269. !EOP
  2270. !------------------------------------------------------------------------
  2271. !BOC
  2272. character(len=*), parameter :: rname = mname//'/emission_cmip6bmb_readsector'
  2273. character(len=256) :: fname
  2274. character(len=256) :: fname_gridboxarea
  2275. character(len=256) :: varfilename, varname
  2276. integer :: lt, year, startyear
  2277. integer :: j
  2278. integer, parameter :: year_handshake=2014
  2279. character(len=17) :: sec_str
  2280. character(len=13) :: time_str
  2281. character(len=30), parameter :: source_str='input4MIPs_emissions_CMIP_VUA'
  2282. character(len=17), parameter :: version_str='CMIP-BB4CMIP6-1-2'
  2283. logical :: existfile
  2284. character(len=4) :: cyear
  2285. logical :: first=.true.
  2286. ! --- begin -----------------------------------
  2287. ! initialise target array
  2288. d3data = 0.0
  2289. if ( trim(sectors_def(sector)%catname) == 'biomassburning' ) then
  2290. sec_str='em-biomassburning'
  2291. else
  2292. write (gol,'("Invalid CMIP6 sector")') ; call goErr
  2293. status=1; TRACEBACK; return
  2294. endif
  2295. ! read in gridbox-area; once per CPU
  2296. if( .not. area_found_025 ) then
  2297. fname_gridboxarea = trim(emis_input_dir_cmip6) //'/'// &
  2298. 'gridcellarea' //'-'// &
  2299. trim(sec_str) //'_'// &
  2300. trim(source_str) //'-'// &
  2301. trim(version_str) //'_'// &
  2302. 'gn.nc'
  2303. ! no need to swap the latitude order here
  2304. call emission_ReadGridboxArea(fname_gridboxarea, 'gridcellarea', gridbox_area_025, &
  2305. & nlon1440, nlat720, status )
  2306. IF_NOTOK_RETURN(status=1)
  2307. area_found_025=.true.
  2308. endif
  2309. ! deal with out-of-bounds requested years
  2310. year = valid_year( iyear, cmip6_avail, 'CMIP6BMB', first)
  2311. first=.false.
  2312. ! cyear will contain strings with the years
  2313. write(cyear,'(I4.4)') year
  2314. ! ------------------------
  2315. ! construct filename
  2316. ! e.g.: <emisdir>/NOx-em-biomassburning_input4MIPs_emissions_CMIP_VUA-CMIP-BB4CMIP6-1-2_gn_175001-184912.nc
  2317. ! ------------------------
  2318. varfilename=trim(comp)//'-'//trim(sec_str)
  2319. if (index(comp,'NMVOC-') == 1) then
  2320. varname = trim(comp(7:))
  2321. ! change dash to underscore in few cases
  2322. if (varname(1:7) == 'Higher-') varname(1:7) = 'Higher_'
  2323. else
  2324. varname=trim(comp)
  2325. endif
  2326. if (year >= 1750 .and. year < 1850) then
  2327. time_str='175001-184912'
  2328. startyear=1750
  2329. else if (year >= 1850 .and. year < 2016) then
  2330. time_str='185001-201512'
  2331. startyear=1850
  2332. else
  2333. write (gol,'("CMIP6 emissions beyond 2015 not available yet")') ; call goErr
  2334. status=1; TRACEBACK; return
  2335. endif
  2336. if (year .le. year_handshake) then
  2337. fname = trim(emis_input_dir_cmip6) //'/'// &
  2338. trim(varfilename) //'_'// &
  2339. trim(source_str) //'-'// &
  2340. trim(version_str) //'_'// &
  2341. 'gn' //'_'// &
  2342. trim(time_str) // &
  2343. '.nc'
  2344. else
  2345. write (gol,'("Code for CMIP6 scenario file names not implemented yet")') ; call goErr
  2346. status=1; TRACEBACK; return
  2347. endif
  2348. ! test existence of file
  2349. inquire( file=trim(fname), exist=existfile)
  2350. if( .not. existfile ) then
  2351. write (gol,'(" CMIP6 file `",a,"` not found ")') trim(fname); call goErr
  2352. status = 1; TRACEBACK; return
  2353. end if
  2354. ! ------------------------------------------------
  2355. ! data record is read by emission_cmip6bmb_Read2DRecord
  2356. d3data_help(:,:) = emission_cmip6bmb_Read2DRecord( fname, varname, imonth, year, startyear, status )
  2357. ! reverse latitudes
  2358. do j=1,nlat180
  2359. d3data(:,j,1) = d3data_help(:,nlat180-j+1)
  2360. enddo
  2361. IF_NOTOK_RETURN(status=1)
  2362. end subroutine emission_cmip6bmb_ReadSector
  2363. !EOC
  2364. !--------------------------------------------------------------------------
  2365. ! TM5 !
  2366. !--------------------------------------------------------------------------
  2367. !BOP
  2368. !
  2369. ! !FUNCTION: EMISSION_CMIP6_READ2DRECORD
  2370. !
  2371. ! !DESCRIPTION: Read a single 2d record of a given file and
  2372. ! return a 2d emission field interpolated on 1x1 grid.
  2373. !\\
  2374. !\\
  2375. ! !INTERFACE:
  2376. !
  2377. function emission_cmip6_Read2DRecord( fname, varname, secname, imonth, year, startyear, status )
  2378. !
  2379. ! !RETURN VALUE:
  2380. !
  2381. real :: emission_cmip6_Read2DRecord(nlon360,nlat180)
  2382. !
  2383. ! !INPUT PARAMETERS:
  2384. !
  2385. character(len=*), intent(in) :: fname, varname
  2386. character(len=sector_name_len), intent(in) :: secname
  2387. integer, intent(in) :: imonth, year, startyear
  2388. !
  2389. ! !OUTPUT PARAMETERS:
  2390. !
  2391. integer, intent(out) :: status
  2392. !
  2393. !EOP
  2394. !------------------------------------------------------------------------
  2395. !BOC
  2396. character(len=*), parameter :: rname = mname//'/emission_cmip6_Read2DRecord'
  2397. character(len=256) :: fname2
  2398. integer :: fid, varid, isec
  2399. integer :: fid2, varid2, year_first, year_second
  2400. !real :: emis_in(nlon720, nlat360, 1)
  2401. real :: emis_in(nlon720, nlat360, 1, 1)
  2402. real, allocatable :: emis_help(:,:,:,:)
  2403. real :: x
  2404. ! --- begin -----------------------------------
  2405. select case( trim(secname) )
  2406. case ('AGR')
  2407. isec=0
  2408. case ('ENE')
  2409. isec=1
  2410. case ('IND')
  2411. isec=2
  2412. case ('TRA')
  2413. isec=3
  2414. case ('RCO')
  2415. isec=4
  2416. case ('SLV')
  2417. isec=5
  2418. case ('WST')
  2419. isec=6
  2420. case ('SHP')
  2421. isec=7
  2422. case default
  2423. write (gol,'("EMISS - CMIP6 - no `",a,"` emissions in file ",a)') &
  2424. secname, trim(fname) ; call goErr
  2425. status=1; TRACEBACK; return
  2426. end select
  2427. ! initialise
  2428. emission_cmip6_Read2DRecord = 0.0
  2429. CALL MDF_Open( TRIM(fname), MDF_NETCDF, MDF_READ, fid, status )
  2430. IF_NOTOK_RETURN(status=1)
  2431. CALL MDF_Inq_VarID( fid, TRIM(varname), varid, status )
  2432. IF_ERROR_RETURN(status=1)
  2433. if ( varid < 0 ) then
  2434. write (gol,'("EMISS - CMIP6 - no `",a,"` emissions in file ",a)') &
  2435. varname, trim(fname) ; call goErr
  2436. status=1; TRACEBACK; return
  2437. else
  2438. if( okdebug ) then
  2439. write (gol,'("EMISS-INFO - CMIP6 - found `",a,"` emissions in file ",a)') &
  2440. varname, trim(fname) ; call goErr
  2441. endif
  2442. if (index(varname,'CH4') /= 1 .or. year >= 1970) then
  2443. CALL MDF_Get_Var( fid, varid, emis_in, status, start=(/1,1,isec+1,imonth+12*(year-startyear)/) )
  2444. IF_NOTOK_RETURN(status=1)
  2445. else
  2446. ! Special case for methane emissions prior to 1970
  2447. ! which are provided at 10-year intervals,
  2448. ! starting at 1850.
  2449. ! First year of the decade:
  2450. year_first = int(year/10) * 10
  2451. CALL MDF_Get_Var( fid, varid, emis_in, status, start=(/1,1,isec+1,imonth+12*(year_first-startyear)/10/) )
  2452. IF_NOTOK_RETURN(status=1)
  2453. if (year /= year_first) then
  2454. ! Also read data for the first year of the next decade
  2455. ! and apply a linear interpolation between the two years
  2456. allocate(emis_help(nlon720, nlat360, 1, 1))
  2457. year_second = year_first + 10
  2458. if (year_second == 1970) then
  2459. ! Read 1970 data from the regular 1970-2014 file
  2460. fname2 = trim(emis_input_dir_cmip6)//'/'// &
  2461. 'CH4-em-anthro_input4MIPs_emissions_CMIP_CEDS-2017-05-18_gn_197001-201412.nc'
  2462. CALL MDF_Open( TRIM(fname2), MDF_NETCDF, MDF_READ, fid2, status )
  2463. IF_NOTOK_RETURN(status=1)
  2464. CALL MDF_Inq_VarID( fid2, TRIM(varname), varid2, status )
  2465. IF_ERROR_RETURN(status=1)
  2466. if ( varid2 < 0 ) then
  2467. write (gol,'("EMISS - CMIP6 - no `",a,"` emissions in file ",a)') &
  2468. varname, trim(fname2) ; call goErr
  2469. status=1; TRACEBACK; return
  2470. else
  2471. if ( okdebug ) then
  2472. write (gol,'("EMISS-INFO - CMIP6 - found `",a,"` emissions in file ",a)') &
  2473. varname, trim(fname2) ; call goErr
  2474. endif
  2475. CALL MDF_Get_Var( fid2, varid2, emis_help, status, start=(/1,1,isec+1,imonth/) )
  2476. IF_NOTOK_RETURN(status=1)
  2477. endif
  2478. CALL MDF_Close( fid2, status )
  2479. IF_NOTOK_RETURN(status=1)
  2480. else
  2481. ! Read from the file containing the data prior to 1970,
  2482. ! which is already open
  2483. CALL MDF_Get_Var( fid, varid, emis_help, status, start=(/1,1,isec+1,imonth+12*(year_second-startyear)/10/) )
  2484. endif
  2485. ! Interpolate montly data between the two provided years
  2486. x = float(year-year_first)/10.
  2487. emis_in(:,:,1,1) = (1.-x) * emis_in(:,:,1,1) + x * emis_help(:,:,1,1)
  2488. deallocate(emis_help)
  2489. endif
  2490. endif
  2491. ! convert from kg(species)/m^2/s to kg(species)/gridbox/s
  2492. emis_in(:,:,1,1) = emis_in(:,:,1,1) * gridbox_area_05
  2493. ! now coarsen to nlon360,nlat180
  2494. emission_cmip6_Read2DRecord = emission_coarsen_to_1x1( emis_in(:,:,1,1), nlon720, nlat360,.false., status )
  2495. IF_NOTOK_RETURN(status=1)
  2496. end if
  2497. CALL MDF_Close( fid, status )
  2498. IF_NOTOK_RETURN(status=1)
  2499. status = 0
  2500. return
  2501. end function emission_cmip6_Read2DRecord
  2502. !EOC
  2503. !--------------------------------------------------------------------------
  2504. ! TM5 !
  2505. !--------------------------------------------------------------------------
  2506. !BOP
  2507. !
  2508. ! !FUNCTION: EMISSION_CMIP6_READ3DRECORD
  2509. !
  2510. ! !DESCRIPTION: read one 3D sector
  2511. !
  2512. !\\
  2513. !\\
  2514. ! !INTERFACE:
  2515. !
  2516. function emission_cmip6_Read3DRecord( fname, varname, secname, imonth, year, startyear, status )
  2517. !
  2518. ! !RETURN VALUE:
  2519. !
  2520. real :: emission_cmip6_Read3DRecord(nlon360,nlat180,ar5_dim_3ddata)
  2521. !
  2522. ! !INPUT/OUTPUT PARAMETERS:
  2523. !
  2524. character(len=*), intent(in) :: fname, varname
  2525. character(32), intent(in) :: secname
  2526. !
  2527. ! !INPUT PARAMETERS:
  2528. !
  2529. integer, intent(in) :: imonth, year, startyear
  2530. !
  2531. ! !OUTPUT PARAMETERS:
  2532. !
  2533. integer, intent(out) :: status
  2534. !
  2535. ! !REVISION HISTORY:
  2536. ! 1 Oct 2010 - Achim Strunk -
  2537. !
  2538. ! !REMARKS:
  2539. !
  2540. !EOP
  2541. !------------------------------------------------------------------------
  2542. !BOC
  2543. character(len=*), parameter :: rname = mname//'/emission_cmip6_Read3DRecord'
  2544. integer :: fid, varid, lk
  2545. real, dimension(nlon720,nlat360,ar5_dim_3ddata,1) :: emis_in
  2546. real, parameter :: layer_depth = 610. ! fixed height (m) of the vertical levels
  2547. ! on which the CMIP6 aircraft emissions
  2548. ! are provided.
  2549. ! --- begin -----------------------------------
  2550. ! initialise
  2551. emission_cmip6_Read3DRecord = 0.0
  2552. CALL MDF_Open( TRIM(fname), MDF_NETCDF, MDF_READ, fid, status )
  2553. IF_NOTOK_RETURN(status=1)
  2554. CALL MDF_Inq_VarID( fid, TRIM(varname), varid, status )
  2555. IF_ERROR_RETURN(status=1)
  2556. if ( varid < 0 ) then
  2557. write (gol,'("EMISS - CMIP6 - no `",a,"` emissions in file ",a)') &
  2558. secname, trim(fname) ; call goErr
  2559. status=1; TRACEBACK; return
  2560. else
  2561. if( okdebug ) then
  2562. write (gol,'("EMISS-INFO - CMIP6 - found `",a,"` emissions in file ",a)') &
  2563. secname, trim(fname) ; call goPr
  2564. endif
  2565. CALL MDF_Get_Var( fid, varid, emis_in, status, start=(/1,1,1,imonth+12*(year-startyear)/) )
  2566. IF_NOTOK_RETURN(status=1)
  2567. do lk = 1, ar5_dim_3ddata
  2568. ! convert from kg(species)/m^2/s to kg(species)/m/s;
  2569. ! Note that CMIP6 aircraft emissions are given in kg(species)/m^2/s,
  2570. ! while AR5 aircraft emissions are given in kg(species)/m^3/s.
  2571. ! In order to be able to use the same vertical regridding routine lateron,
  2572. ! we convert to the same unit and include a division by the layer depth.
  2573. emis_in(:,:,lk,1) = emis_in(:,:,lk,1) * gridbox_area_05 / layer_depth
  2574. ! now coarsen to nlon360,nlat180
  2575. emission_cmip6_Read3DRecord(:,:,lk) = emission_coarsen_to_1x1( emis_in(:,:,lk,1) ,&
  2576. & nlon720, nlat360, .false., status )
  2577. IF_NOTOK_RETURN(status=1)
  2578. end do
  2579. end if
  2580. CALL MDF_Close( fid, status )
  2581. IF_NOTOK_RETURN(status=1)
  2582. status = 0
  2583. return
  2584. end function emission_cmip6_Read3DRecord
  2585. !EOC
  2586. !--------------------------------------------------------------------------
  2587. ! TM5 !
  2588. !--------------------------------------------------------------------------
  2589. !BOP
  2590. !
  2591. ! !FUNCTION: EMISSION_CMIP6BMB_READ2DRECORD
  2592. !
  2593. ! !DESCRIPTION: Read a single 2d record of a given file and
  2594. ! return a 2d emission field interpolated on 1x1 grid.
  2595. !\\
  2596. !\\
  2597. ! !INTERFACE:
  2598. !
  2599. function emission_cmip6bmb_Read2DRecord( fname, varname, imonth, year, startyear, status )
  2600. !
  2601. ! !RETURN VALUE:
  2602. !
  2603. real :: emission_cmip6bmb_Read2DRecord(nlon360,nlat180)
  2604. !
  2605. ! !INPUT PARAMETERS:
  2606. !
  2607. character(len=*), intent(in) :: fname
  2608. character(len=*), intent(in) :: varname
  2609. integer, intent(in) :: imonth, year, startyear
  2610. !
  2611. ! !OUTPUT PARAMETERS:
  2612. !
  2613. integer, intent(out) :: status
  2614. !
  2615. !EOP
  2616. !------------------------------------------------------------------------
  2617. !BOC
  2618. character(len=*), parameter :: rname = mname//'/emission_cmip6bmb_Read2DRecord'
  2619. integer :: fid, varid, isec
  2620. real :: emis_in(nlon1440, nlat720, 1)
  2621. ! --- begin -----------------------------------
  2622. ! initialise
  2623. emission_cmip6bmb_Read2DRecord = 0.0
  2624. CALL MDF_Open( TRIM(fname), MDF_NETCDF, MDF_READ, fid, status )
  2625. IF_NOTOK_RETURN(status=1)
  2626. CALL MDF_Inq_VarID( fid, TRIM(varname), varid, status )
  2627. IF_ERROR_RETURN(status=1)
  2628. if ( varid < 0 ) then
  2629. write (gol,'("EMISS - CMIP6 - no `",a,"` emissions in file ",a)') &
  2630. varname, trim(fname) ; call goErr
  2631. status=1; TRACEBACK; return
  2632. else
  2633. if( okdebug ) then
  2634. write (gol,'("EMISS-INFO - CMIP6 - found `",a,"` emissions in file ",a)') &
  2635. varname, trim(fname) ; call goErr
  2636. endif
  2637. CALL MDF_Get_Var( fid, varid, emis_in, status, start=(/1,1,imonth+12*(year-startyear)/) )
  2638. IF_NOTOK_RETURN(status=1)
  2639. ! over the oceans emissions are set to 1.e20 instead of 0.
  2640. where ( emis_in > 1.e19 ) emis_in = 0.0
  2641. ! convert from kg(species)/m^2/s to kg(species)/gridbox/s
  2642. emis_in(:,:,1) = emis_in(:,:,1) * gridbox_area_025
  2643. ! now coarsen to nlon360,nlat180
  2644. emission_cmip6bmb_Read2DRecord = emission_coarsen_to_1x1( emis_in(:,:,1), nlon1440, nlat720,.false., status )
  2645. IF_NOTOK_RETURN(status=1)
  2646. end if
  2647. CALL MDF_Close( fid, status )
  2648. IF_NOTOK_RETURN(status=1)
  2649. status = 0
  2650. return
  2651. end function emission_cmip6bmb_Read2DRecord
  2652. !--------------------------------------------------------------------------
  2653. ! TM5 !
  2654. !--------------------------------------------------------------------------
  2655. !BOP
  2656. !
  2657. ! !IROUTINE: READ_CMIP6_ZCH4
  2658. !
  2659. ! !DESCRIPTION: Read CMIP6 zonal mean CH4 for specified year/month
  2660. ! and convert from 0.5 to 1 degree latitude bands
  2661. !\\
  2662. !\\
  2663. ! !INTERFACE:
  2664. !
  2665. SUBROUTINE READ_CMIP6_ZCH4(field, year, month, status)
  2666. !
  2667. ! !USES:
  2668. !
  2669. use emission_data, only : cmip6_ch4_dirname
  2670. !
  2671. ! !OUTPUT PARAMETERS:
  2672. !
  2673. integer, intent(out) :: status
  2674. ! output zonal mean field in 1 degree latitude bands:
  2675. real, dimension(nlat180), intent(out) :: field
  2676. !
  2677. ! !INPUT PARAMETERS:
  2678. !
  2679. integer, intent(in) :: year, month
  2680. !
  2681. ! !REMARKS:
  2682. !
  2683. !EOP
  2684. !------------------------------------------------------------------------
  2685. !BOC
  2686. character(len=*), parameter :: rname = mname//'/Read_CMIP6_CH4'
  2687. character(len=256) :: fname_gridboxarea
  2688. character(len=512) :: zch4_fname
  2689. integer :: startyear
  2690. integer :: fid, varid
  2691. ! zonal mean field in CMIP6 file:
  2692. integer :: j_coarse, j_fine, j_int
  2693. real :: area_norm
  2694. real*4, dimension(nlat360) :: field05
  2695. ! read in gridbox-area; once per CPU
  2696. if( .not. area_found_05 ) then
  2697. fname_gridboxarea = trim(emis_input_dir_ar5)//'/'//trim(ar5_filestr_gridboxarea)
  2698. call emission_ReadGridboxArea(fname_gridboxarea, 'gridbox_area', gridbox_area_05, &
  2699. & nlon720, nlat360, status )
  2700. IF_NOTOK_RETURN(status=1)
  2701. area_found_05=.true.
  2702. endif
  2703. if (year .le. 2014) then
  2704. zch4_fname='mole_fraction_of_methane_in_air_input4MIPs_GHGConcentrations_CMIP_UoM-CMIP-1-2-0_gr-0p5x360deg_000001-201412.nc'
  2705. startyear=0
  2706. else
  2707. zch4_fname='xxxxx'
  2708. startyear=2015
  2709. write (gol,'("ERROR - Scenarios of surface CH4 concentrations not available yet")') ; call goErr
  2710. status=1; TRACEBACK; return
  2711. endif
  2712. zch4_fname=trim(cmip6_ch4_dirname)//trim(zch4_fname)
  2713. CALL MDF_Open( TRIM(zch4_fname), MDF_NETCDF, MDF_READ, fid, status )
  2714. IF_NOTOK_RETURN(status=1)
  2715. CALL MDF_Inq_VarID( fid, 'mole_fraction_of_methane_in_air', varid, status )
  2716. IF_ERROR_RETURN(status=1)
  2717. CALL MDF_Get_Var( fid, varid, field05, status, start = (/1,month+12*(year-startyear)/) )
  2718. IF_NOTOK_RETURN(status=1)
  2719. CALL MDF_Close( fid, status )
  2720. IF_NOTOK_RETURN(status=1)
  2721. ! convert from 0.5 to 1 degree latitude bands:
  2722. field(:)=0.
  2723. do j_coarse = 1,nlat180
  2724. area_norm=0.
  2725. do j_int=1,2
  2726. ! Set longitude index to 1 (arbitrary)
  2727. j_fine=2*(j_coarse-1)+j_int
  2728. field(j_coarse)=field(j_coarse)+field05(j_fine)*gridbox_area_05(1,j_fine)
  2729. area_norm=area_norm+gridbox_area_05(1,j_fine)
  2730. enddo
  2731. field(j_coarse)=field(j_coarse)/area_norm
  2732. enddo
  2733. status = 0
  2734. END SUBROUTINE READ_CMIP6_ZCH4
  2735. !EOC
  2736. !--------------------------------------------------------------------------
  2737. ! TM5 !
  2738. !--------------------------------------------------------------------------
  2739. !BOP
  2740. !
  2741. ! !IROUTINE: EMISSION_AR5_READSECTOR
  2742. !
  2743. ! !DESCRIPTION: Reading one sector of the files to be interpolated and
  2744. ! returning an interpolated 3d emission field (d3data)
  2745. !\\
  2746. !\\
  2747. ! !INTERFACE:
  2748. !
  2749. subroutine emission_ar5_ReadSector( comp, iyear, imonth, sector, d3data, status )
  2750. !
  2751. ! !INPUT PARAMETERS:
  2752. !
  2753. character(len=*) , intent(in) :: comp
  2754. integer , intent(in) :: iyear
  2755. integer , intent(in) :: imonth
  2756. integer , intent(in) :: sector
  2757. !
  2758. ! !OUTPUT PARAMETERS:
  2759. !
  2760. integer , intent(out) :: status
  2761. real, dimension(nlon360,nlat180,ar5_dim_3ddata), intent(out) :: d3data
  2762. !
  2763. ! !REVISION HISTORY:
  2764. ! 1 Oct 2010 - Achim Strunk - v0
  2765. !
  2766. !EOP
  2767. !------------------------------------------------------------------------
  2768. !BOC
  2769. character(len=*), parameter :: rname = mname//'/emission_ar5_read2dsector'
  2770. character(len=256) :: fname
  2771. character(len=256) :: fname_gridboxarea
  2772. character(32) :: secname
  2773. integer :: lt, year
  2774. logical :: existfile
  2775. integer, dimension(2) :: ltimes
  2776. character(len=4), dimension(2) :: ar5_cyears
  2777. real, dimension(2) :: ar5_ipcoef_years
  2778. logical :: first=.true.
  2779. real, dimension(nlon360,nlat180) :: d2data
  2780. ! --- begin -----------------------------------
  2781. ! initialise target array
  2782. d3data = 0.0
  2783. ! read in gridbox-area; once per CPU
  2784. if( .not. area_found_05 ) then
  2785. fname_gridboxarea = trim(emis_input_dir_ar5)//'/'//trim(ar5_filestr_gridboxarea)
  2786. call emission_ReadGridboxArea(fname_gridboxarea, 'gridbox_area', gridbox_area_05, &
  2787. & nlon720, nlat360, status )
  2788. IF_NOTOK_RETURN(status=1)
  2789. area_found_05=.true.
  2790. endif
  2791. ! ----------------------------------------
  2792. ! get the right times to interpolate and related coefficients
  2793. ! (ar5_avail_yrs(ltimes))
  2794. !
  2795. ! --> result will be a linear interpolation between neighbouring files
  2796. !
  2797. ! ----------------------------------------
  2798. allocate( ltimeind( ar5_nr_avail_yrs ) )
  2799. ltimeind = .false.
  2800. ! deal with out-of-bounds requested years
  2801. year = valid_year( iyear, ar5_avail, 'AR5', first)
  2802. first=.false.
  2803. where( ar5_avail_yrs < year ) ltimeind = .true.
  2804. ! times(1): index representing time instance earlier than current year
  2805. ! times(2): -"- -"- later than current year
  2806. ltimes(2) = count( ltimeind ) + 1
  2807. ltimes(1) = max( ltimes(2) - 1, 1 )
  2808. ! check a match with repository
  2809. ! (in order to copy only one file instead of two)
  2810. if( ar5_avail_yrs(ltimes(2)) == year ) &
  2811. ltimes(1) = ltimes(2)
  2812. deallocate( ltimeind )
  2813. ! ar5_cyears will contain strings with the years
  2814. write(ar5_cyears(1),'(I4.4)') ar5_avail_yrs(ltimes(1))
  2815. write(ar5_cyears(2),'(I4.4)') ar5_avail_yrs(ltimes(2))
  2816. ! ar5_ipcoef_years will contain interpolation coefficients
  2817. ! default: factors 1.0/0.0
  2818. ar5_ipcoef_years(1) = 1.0
  2819. ar5_ipcoef_years(2) = 0.0
  2820. if( ltimes(2) /= ltimes(1) ) then
  2821. ar5_ipcoef_years(1) = (ar5_avail_yrs(ltimes(2)) - year) / &
  2822. real( ar5_avail_yrs(ltimes(2)) - ar5_avail_yrs(ltimes(1)) )
  2823. ar5_ipcoef_years(2) = 1.0 - ar5_ipcoef_years(1)
  2824. end if
  2825. ! ------------------------
  2826. ! read files (index=1: earlier file; index=2: later file)
  2827. ! ------------------------
  2828. do lt = 1, 2
  2829. if (ar5_ipcoef_years(lt) == 0.) cycle
  2830. ! ------------------------
  2831. ! construct filename
  2832. ! e.g.: <emisdir>/IPCC_emissions_RCP45_CO_biomassburning_2010_0.5x0.5.nc
  2833. ! ------------------------
  2834. if (trim(filestr_rcpiden)=='hist') then
  2835. fname = trim(emis_input_dir_ar5) //'/'// &
  2836. trim(filestr_common_pre) //'_'// &
  2837. trim(comp) //'_'// &
  2838. trim(sectors_def(sector)%catname) //'_'// &
  2839. ar5_cyears(lt) //'_'// &
  2840. trim(filestr_common_post)
  2841. else
  2842. fname = trim(emis_input_dir_ar5) //'/'// &
  2843. trim(filestr_common_pre) //'_'// &
  2844. trim(filestr_rcpiden) //'_'// &
  2845. trim(comp) //'_'// &
  2846. trim(sectors_def(sector)%catname) //'_'// &
  2847. ar5_cyears(lt) //'_'// &
  2848. trim(filestr_common_post)
  2849. endif
  2850. ! test existence of file
  2851. inquire( file=trim(fname), exist=existfile)
  2852. if( .not. existfile ) then
  2853. write (gol,'(" AR5 file `",a,"` not found ")') trim(fname); call goErr
  2854. status = 1; TRACEBACK; return
  2855. end if
  2856. ! ------------------------------------------------
  2857. ! data record is read by emission_ar5_Read2/3DRecord
  2858. ! add data scaled by interpolation factor ar5_ipcoef_years
  2859. secname = sectors_def(sector)%name
  2860. ! temporary fix as CMIP6 CH4 emissions are not available yet
  2861. ! change sector names to be able to use AR5 reading routine
  2862. if ( trim(sectors_def(sector)%prov) == 'CMIP6' ) then
  2863. select case( trim(secname) )
  2864. case ('AGR')
  2865. secname='emiss_agr'
  2866. case ('ENE')
  2867. secname='emiss_ene'
  2868. case ('IND')
  2869. secname='emiss_ind'
  2870. case ('TRA')
  2871. secname='emiss_tra'
  2872. case ('RCO')
  2873. secname='emiss_dom'
  2874. case ('WST')
  2875. secname='emiss_wst'
  2876. case ('SHP')
  2877. secname='emiss_shp'
  2878. case default
  2879. write (gol,'("EMISS - CMIP6 - no `",a,"` emissions in file ",a)') &
  2880. secname, trim(fname) ; call goErr
  2881. status=1; TRACEBACK; return
  2882. end select
  2883. endif
  2884. ! distinguish 2d/3d sectors
  2885. if( sectors_def(sector)%f3d ) then
  2886. d3data(:,:,:) = d3data(:,:,:) + ar5_ipcoef_years(lt) * &
  2887. emission_ar5_Read3DRecord( fname, secname, imonth, status )
  2888. else
  2889. !>>> TvN
  2890. ! Set sectoral emissions not provided in the historical AR5 files to zero
  2891. ! for years before 2000.
  2892. ! Note these emissions are non-zero in the RCPs.
  2893. ! It is assumed below that the data for 2000 (and 2005) are taken from the RCP files.
  2894. if ( ar5_avail_yrs(ltimes(lt)) .lt. 2000 .and. &
  2895. ( ( trim(secname) .eq. 'emiss_slv' .and. (trim(comp) .eq. 'CO') ) .or. &
  2896. ( trim(secname) .eq. 'emiss_agr' .and. &
  2897. ( trim(comp) .eq. 'acids' .or. &
  2898. trim(comp) .eq. 'alcohols' .or. &
  2899. trim(comp) .eq. 'benzene' .or. &
  2900. trim(comp) .eq. 'butanes' .or. &
  2901. trim(comp) .eq. 'ethane' .or. &
  2902. trim(comp) .eq. 'ethene' .or. &
  2903. trim(comp) .eq. 'ethers' .or. &
  2904. trim(comp) .eq. 'ethyne' .or. &
  2905. trim(comp) .eq. 'formaldehyde' .or. &
  2906. trim(comp) .eq. 'hexanes_and_higher_alkanes' .or. &
  2907. trim(comp) .eq. 'ketones' .or. &
  2908. trim(comp) .eq. 'other_alkanals' .or. &
  2909. trim(comp) .eq. 'other_alkenes_and_alkynes' .or. &
  2910. trim(comp) .eq. 'other_aromatics' .or. &
  2911. trim(comp) .eq. 'pentanes' .or. &
  2912. trim(comp) .eq. 'propane' .or. &
  2913. trim(comp) .eq. 'propene' .or. &
  2914. trim(comp) .eq. 'toluene' .or. &
  2915. trim(comp) .eq. 'xylene' ) ) ) ) then
  2916. d2data(:,:) = 0.
  2917. else
  2918. d2data(:,:) = emission_ar5_Read2DRecord( fname, secname, imonth, status )
  2919. endif
  2920. !d3data(:,:,1) = d3data(:,:,1) + ar5_ipcoef_years(lt) * &
  2921. ! emission_ar5_Read2DRecord( fname, secname, imonth, status )
  2922. d3data(:,:,1) = d3data(:,:,1) + ar5_ipcoef_years(lt) * d2data(:,:)
  2923. !<<< TvN
  2924. end if
  2925. IF_NOTOK_RETURN(status=1)
  2926. end do ! lt
  2927. end subroutine emission_ar5_ReadSector
  2928. !EOC
  2929. !--------------------------------------------------------------------------
  2930. ! TM5 !
  2931. !--------------------------------------------------------------------------
  2932. !BOP
  2933. !
  2934. ! !FUNCTION: EMISSION_AR5_READ2DRECORD
  2935. !
  2936. ! !DESCRIPTION: Read a single 2d record of a given file and
  2937. ! return a 2d emission field interpolated on 1x1 grid.
  2938. !\\
  2939. !\\
  2940. ! !INTERFACE:
  2941. !
  2942. function emission_ar5_Read2DRecord( fname, secname, imonth, status )
  2943. !
  2944. ! !RETURN VALUE:
  2945. !
  2946. real :: emission_ar5_Read2DRecord(nlon360,nlat180)
  2947. !
  2948. ! !INPUT PARAMETERS:
  2949. !
  2950. character(len=*), intent(in) :: fname
  2951. character(len=sector_name_len), intent(in) :: secname
  2952. integer, intent(in) :: imonth
  2953. !
  2954. ! !OUTPUT PARAMETERS:
  2955. !
  2956. integer, intent(out) :: status
  2957. !
  2958. ! !REVISION HISTORY:
  2959. ! 1 Oct 2010 - Achim Strunk - v0
  2960. !
  2961. !EOP
  2962. !------------------------------------------------------------------------
  2963. !BOC
  2964. character(len=*), parameter :: rname = mname//'/emission_ar5_Read2DRecord'
  2965. integer :: fid, varid
  2966. real :: emis_in(nlon720, nlat360, 1)
  2967. ! --- begin -----------------------------------
  2968. ! initialise
  2969. emission_ar5_Read2DRecord = 0.0
  2970. CALL MDF_Open( TRIM(fname), MDF_NETCDF, MDF_READ, fid, status )
  2971. IF_NOTOK_RETURN(status=1)
  2972. CALL MDF_Inq_VarID( fid, TRIM(secname), varid, status )
  2973. IF_ERROR_RETURN(status=1)
  2974. if ( varid < 0 ) then
  2975. write (gol,'("EMISS - AR5 - no `",a,"` emissions in file ",a)') &
  2976. secname, trim(fname) ; call goErr
  2977. status=1; TRACEBACK; return
  2978. else
  2979. if( okdebug ) then
  2980. write (gol,'("EMISS-INFO - AR5 - found `",a,"` emissions in file ",a)') &
  2981. secname, trim(fname) ; call goPr
  2982. endif
  2983. CALL MDF_Get_Var( fid, varid, emis_in, status, start=(/1,1,imonth/) )
  2984. IF_NOTOK_RETURN(status=1)
  2985. ! convert from kg(species)/m^2/s to kg(species)/gridbox/s
  2986. emis_in(:,:,1) = emis_in(:,:,1) * gridbox_area_05
  2987. ! now coarsen to nlon360,nlat180
  2988. emission_ar5_Read2DRecord = emission_coarsen_to_1x1( emis_in(:,:,1), nlon720, nlat360,.true., status )
  2989. IF_NOTOK_RETURN(status=1)
  2990. end if
  2991. CALL MDF_Close( fid, status )
  2992. IF_NOTOK_RETURN(status=1)
  2993. status = 0
  2994. return
  2995. end function emission_ar5_Read2DRecord
  2996. !EOC
  2997. !--------------------------------------------------------------------------
  2998. ! TM5 !
  2999. !--------------------------------------------------------------------------
  3000. !BOP
  3001. !
  3002. ! !FUNCTION: EMISSION_AR5_READ3DRECORD
  3003. !
  3004. ! !DESCRIPTION: read one 3D sector
  3005. !
  3006. !\\
  3007. !\\
  3008. ! !INTERFACE:
  3009. !
  3010. function emission_ar5_Read3DRecord( fname, secname, imonth, status )
  3011. !
  3012. ! !RETURN VALUE:
  3013. !
  3014. real :: emission_ar5_Read3DRecord(nlon360,nlat180,ar5_dim_3ddata)
  3015. !
  3016. ! !INPUT/OUTPUT PARAMETERS:
  3017. !
  3018. character(len=*), intent(in) :: fname
  3019. character(32), intent(inout) :: secname
  3020. !
  3021. ! !INPUT PARAMETERS:
  3022. !
  3023. integer, intent(in) :: imonth
  3024. !
  3025. ! !OUTPUT PARAMETERS:
  3026. !
  3027. integer, intent(out) :: status
  3028. !
  3029. ! !REVISION HISTORY:
  3030. ! 1 Oct 2010 - Achim Strunk -
  3031. !
  3032. ! !REMARKS:
  3033. !
  3034. !EOP
  3035. !------------------------------------------------------------------------
  3036. !BOC
  3037. character(len=*), parameter :: rname = mname//'/emission_ar5_Read3DRecord'
  3038. integer :: fid, varid, lk
  3039. real, dimension(nlon720,nlat360,ar5_dim_3ddata,1) :: emis_in
  3040. ! --- begin -----------------------------------
  3041. ! initialise
  3042. emission_ar5_Read3DRecord = 0.0
  3043. CALL MDF_Open( TRIM(fname), MDF_NETCDF, MDF_READ, fid, status )
  3044. IF_NOTOK_RETURN(status=1)
  3045. CALL MDF_Inq_VarID( fid, TRIM(secname), varid, status )
  3046. IF_ERROR_RETURN(status=1)
  3047. if ( varid < 0 ) then
  3048. write (gol,'("EMISS - AR5 - no `",a,"` emissions in file ",a)') &
  3049. secname, trim(fname) ; call goErr
  3050. status=1; TRACEBACK; return
  3051. else
  3052. if( okdebug ) then
  3053. write (gol,'("EMISS-INFO - AR5 - found `",a,"` emissions in file ",a)') &
  3054. secname, trim(fname) ; call goPr
  3055. endif
  3056. CALL MDF_Get_Var( fid, varid, emis_in, status, start=(/1,1,1,imonth/) )
  3057. IF_NOTOK_RETURN(status=1)
  3058. do lk = 1, ar5_dim_3ddata
  3059. ! convert from kg(species)/m^3/s to kg(species)/m/s :
  3060. emis_in(:,:,lk,1) = emis_in(:,:,lk,1) * gridbox_area_05
  3061. ! now coarsen to nlon360,nlat180
  3062. emission_ar5_Read3DRecord(:,:,lk) = emission_coarsen_to_1x1( emis_in(:,:,lk,1) ,&
  3063. & nlon720, nlat360, .true., status )
  3064. IF_NOTOK_RETURN(status=1)
  3065. end do
  3066. end if
  3067. CALL MDF_Close( fid, status )
  3068. IF_NOTOK_RETURN(status=1)
  3069. status = 0
  3070. return
  3071. end function emission_ar5_Read3DRecord
  3072. !EOC
  3073. !--------------------------------------------------------------------------
  3074. ! TM5 !
  3075. !--------------------------------------------------------------------------
  3076. !BOP
  3077. !
  3078. ! !IROUTINE: EMISSION_READGRIDBOXAREA
  3079. !
  3080. ! !DESCRIPTION:
  3081. ! reading gridbox surface areas for 0.5 x 0.5 Edgar 4
  3082. ! needed to scale the emissions from mass/m^2 to mass/grid
  3083. !\\
  3084. !\\
  3085. ! !INTERFACE:
  3086. !
  3087. subroutine emission_ReadGridboxArea(fname, recname, gridbox_area, dim_nlon, dim_nlat, status )
  3088. !
  3089. ! !INPUT PARAMETERS:
  3090. !
  3091. character(len=*), intent(in) :: fname
  3092. character(len=*), intent(in) :: recname
  3093. integer, intent(in) :: dim_nlon
  3094. integer, intent(in) :: dim_nlat
  3095. !
  3096. ! !OUTPUT PARAMETERS:
  3097. !
  3098. integer, intent(out) :: status
  3099. real, dimension(dim_nlon, dim_nlat), intent(out) :: gridbox_area
  3100. !
  3101. ! !REVISION HISTORY:
  3102. !
  3103. ! 1 Oct 2010 - Achim Strunk - v0
  3104. ! 1 Dec 2011 - Narcisa Banda - generalized it for any gridbox area size
  3105. !
  3106. ! !REMARKS:
  3107. !
  3108. !EOP
  3109. !------------------------------------------------------------------------
  3110. !BOC
  3111. character(len=*), parameter :: rname = mname//'/emission_ReadGridboxArea'
  3112. integer :: fid, varid
  3113. ! --- begin -----------------------------------
  3114. CALL MDF_Open( TRIM(fname), MDF_NETCDF, MDF_READ, fid, status )
  3115. IF_NOTOK_RETURN(status=1)
  3116. CALL MDF_Inq_VarID( fid, TRIM(recname), varid, status )
  3117. IF_ERROR_RETURN(status=1)
  3118. CALL MDF_Get_Var( fid, varid, gridbox_area, status )
  3119. IF_NOTOK_RETURN(status=1)
  3120. CALL MDF_Close( fid, status )
  3121. IF_NOTOK_RETURN(status=1)
  3122. status = 0
  3123. end subroutine emission_ReadGridboxArea
  3124. !EOC
  3125. !--------------------------------------------------------------------------
  3126. ! TM5 !
  3127. !--------------------------------------------------------------------------
  3128. !BOP
  3129. !
  3130. ! !IROUTINE: EMISSION_AR5_REGRID_AIRCRAFT
  3131. !
  3132. ! !DESCRIPTION: Vertical regridding of the AR5 aircraft data.
  3133. ! The vertical levels of the input data are hard coded.
  3134. ! (Taken from GFED_daily_AR5 (VH) and left as is)
  3135. !\\
  3136. !\\
  3137. ! !INTERFACE:
  3138. !
  3139. subroutine emission_ar5_regrid_aircraft(region, i0, j0, field_in, field_out, status )
  3140. !
  3141. ! !USES:
  3142. !
  3143. use meteodata, only : gph_dat
  3144. use tm5_distgrid, only : dgrid, get_distgrid
  3145. use dims, only : lm
  3146. !
  3147. ! !OUTPUT PARAMETERS:
  3148. !
  3149. integer, intent(out) :: status
  3150. !
  3151. ! !INPUT PARAMETERS:
  3152. !
  3153. integer, intent(in) :: region, i0, j0
  3154. real, dimension(i0:, j0:, 1:), intent(in) :: field_in
  3155. real, dimension(i0:, j0:, 1:), intent(out) :: field_out
  3156. !
  3157. ! !REVISION HISTORY:
  3158. ! 1 Oct 2010 - Achim Strunk - Taken from GFED_daily_AR5 (VH) and left as is
  3159. ! 3 Dec 2012 - Ph. Le Sager - modified for lat-lon mpi decomposition
  3160. ! - work with zoom regions
  3161. ! - mass conservation per column
  3162. !
  3163. ! !REMARKS:
  3164. !
  3165. !EOP
  3166. !------------------------------------------------------------------------
  3167. !BOC
  3168. character(len=*), parameter :: rname = mname//'/emission_ar5_regrid_aircraft'
  3169. integer, parameter :: lm_in=25
  3170. real, dimension(:,:,:), pointer :: gph ! geopotential height (m)
  3171. integer :: i,j,l
  3172. real, dimension(lm_in) :: height_in_min, height_in_max
  3173. real, allocatable :: dz(:), height(:)
  3174. real :: height_min,height_max
  3175. real :: height_out_min,height_out_max
  3176. real, dimension(lm_in), parameter :: height_in=(/ & ! Height in meter
  3177. 305., 915., 1525., 2135., 2745., 3355., 3965., 4575., 5185., 5795., &
  3178. 6405., 7015., 7625., 8235., 8845., 9455.,10065.,10675.,11285., &
  3179. 11895.,12505.,13115.,13725.,14335.,14945./)
  3180. real :: dz_in(25)
  3181. integer :: l_in, i1, i2, j1, j2, lmr
  3182. real :: total_in, total_out, total_ratio
  3183. ! --- begin --------------------------------------
  3184. call golabel()
  3185. gph => gph_dat(region)%data
  3186. CALL GET_DISTGRID( dgrid(region), I_STRT=i1, I_STOP=i2, J_STRT=j1, J_STOP=j2 )
  3187. lmr = lm(region)
  3188. allocate(dz(lmr), height(lmr+1))
  3189. ! sanity check
  3190. if (okdebug) then
  3191. if (i1/=i0 .or. j1/=j0) then
  3192. status = 1 ; TRACEBACK
  3193. return
  3194. end if
  3195. if (lm_in /= ubound(field_in,3) ) then
  3196. write(gol,*)'wrong vertical input resolution'; call goErr
  3197. status = 1
  3198. TRACEBACK; return
  3199. endif
  3200. if ((ubound(field_out,3)+1) /= ubound(gph,3)) then
  3201. write(gol,*)'wrong vertical output resolution'; call goErr
  3202. status = 1
  3203. TRACEBACK; return
  3204. endif
  3205. end if
  3206. ! locally flat atmosphere assumed
  3207. ! area linear in i,j
  3208. ! height above sea level
  3209. height_in_min(1)=0.
  3210. do l_in = 2,lm_in
  3211. height_in_min(l_in)=(height_in(l_in-1)+height_in(l_in))/2.
  3212. enddo
  3213. height_in_max(lm_in)=15555.
  3214. do l_in = 1,lm_in-1
  3215. height_in_max(l_in)=(height_in(l_in)+height_in(l_in+1))/2.
  3216. enddo
  3217. ! init
  3218. field_out = 0.0
  3219. ! regrid
  3220. do i=i1, i2
  3221. do j=j1, j2
  3222. total_in = 0.0
  3223. ! calculate total input emissions
  3224. do l_in=1, lm_in
  3225. dz_in(l_in) = height_in_max(l_in)-height_in_min(l_in)
  3226. total_in =total_in + field_in(i,j,l_in)*dz_in(l_in)
  3227. enddo
  3228. ! zero based height:
  3229. height(1) = 0.0
  3230. do l=1, lmr
  3231. dz(l) = gph(i,j,l+1) - gph(i,j,l)
  3232. height(l+1) = height(l) + dz(l)
  3233. enddo
  3234. do l=1,lmr-1
  3235. height_out_min=height(l)
  3236. height_out_max=height(l+1)
  3237. ! write(*,*)'DO AR5- regrid - C2',i,j,l,height_out_min,height_out_max
  3238. do l_in=1,lm_in
  3239. if (height_out_max .le. height_in_min(l_in)) exit
  3240. if (height_out_min .lt. height_in_max(l_in)) then
  3241. height_max=min(height_out_max,height_in_max(l_in))
  3242. height_min=max(height_out_min,height_in_min(l_in))
  3243. ! helpfield as field_in is ordered from high to low
  3244. ! field_out(i,j,l) = field_out(i,j,l) + helpfield2(i,j,lm_in-l_in+1)* &
  3245. ! (height_max-height_min)/(height_in_max(l_in)-height_in_min(l_in))
  3246. ! helpfield as field_in is ordered from low to high
  3247. ! write(*,*)'DO AR5- regrid - C',i,j,l,l_in,height_max-height_min
  3248. field_out(i,j,l) = field_out(i,j,l) + field_in(i,j,l_in)* &
  3249. (height_max-height_min) ! kg/m -> kg / gridbox
  3250. endif
  3251. enddo
  3252. enddo
  3253. ! conserve total exactly: not possible because units are in kg/m...
  3254. total_out = sum(field_out(i,j,:))
  3255. if (total_out /= 0) then
  3256. total_ratio = total_in/total_out
  3257. field_out(i,j,:) = field_out(i,j,:)*total_ratio
  3258. end if
  3259. enddo
  3260. enddo
  3261. deallocate(dz, height)
  3262. call golabel()
  3263. ! ok
  3264. status = 0
  3265. end subroutine emission_ar5_regrid_aircraft
  3266. !EOC
  3267. !--------------------------------------------------------------------------
  3268. ! TM5 !
  3269. !--------------------------------------------------------------------------
  3270. !BOP
  3271. !
  3272. ! !IROUTINE: EMISSION_MACC_READSECTOR
  3273. !
  3274. ! !DESCRIPTION: Read an MACC sector field out of an open file.
  3275. !\\
  3276. !\\
  3277. ! !INTERFACE:
  3278. !
  3279. subroutine emission_macc_ReadSector( fpath, comp, iyear, imonth, fext, recname, unit, emis, status )
  3280. !
  3281. ! !USES:
  3282. !
  3283. use chem_param, only : xmn, xmno2
  3284. !
  3285. ! !INPUT PARAMETERS:
  3286. !
  3287. character(len=*), intent(in) :: fpath ! dir
  3288. character(len=*), intent(in) :: comp ! species name (as in filename)
  3289. integer, intent(in) :: iyear
  3290. integer, intent(in) :: imonth
  3291. character(len=*), intent(in) :: fext ! tail of filename
  3292. character(len=*), intent(in) :: recname ! sector name
  3293. character(len=*), intent(in) :: unit
  3294. !
  3295. ! !OUTPUT PARAMETERS:
  3296. !
  3297. real, intent(out) :: emis(nlon360,nlat180,ar5_dim_3ddata)
  3298. integer, intent(out) :: status
  3299. !
  3300. ! !REVISION HISTORY:
  3301. ! 1 Oct 2010 - Achim Strunk -
  3302. ! 28 Nov 2012 - Ph. Le Sager - switch to MDF interface
  3303. ! 6 Jan 2014 - Ph. Le Sager - code for MACCity: 3D emission field to deal with IPCC aircraft file
  3304. !
  3305. ! !REMARKS:
  3306. !
  3307. !EOP
  3308. !------------------------------------------------------------------------
  3309. !BOC
  3310. character(len=*), parameter :: rname = mname//'/emission_macc_ReadSector'
  3311. character(len=256) :: fname
  3312. character(len=256) :: fname_gridboxarea
  3313. character(len=32) :: fcomp
  3314. integer :: fid, varid, year, lk
  3315. real :: emis_in( nlon720, nlat360, ar5_dim_3ddata, 1)
  3316. logical :: first=.true.
  3317. ! --- begin -----------------------------------
  3318. ! read in gridbox-area; same name as ar5 gridbox area file
  3319. if( .not. area_found_05 ) then
  3320. fname_gridboxarea = trim(emis_input_dir_mac)//'/'//trim(ar5_filestr_gridboxarea)
  3321. call emission_ReadGridboxArea(fname_gridboxarea, 'gridbox_area', gridbox_area_05, &
  3322. & nlon720, nlat360, status )
  3323. IF_NOTOK_RETURN(status=1)
  3324. area_found_05 = .true.
  3325. endif
  3326. ! file name component:
  3327. fcomp = comp
  3328. year = valid_year( iyear, macc_avail, 'MACC', first)
  3329. first = .false.
  3330. ! zero field
  3331. emis = 0.0
  3332. !=== FILENAME
  3333. if (trim(recname) == "emiss_air") then ! If MACC-CITY, specific handling of aircraft emissions
  3334. ! available only for NO or BC
  3335. if ( (trim(fcomp) /= "NO").and.(trim(fcomp) /= "BC") ) return
  3336. write (fname,'(a,"/IPCC_emissions_",a,"_aircraft_",i4.4,"_0.5x0.5.nc")') trim(fpath), trim(fcomp), year
  3337. else
  3338. write (fname,'(a,"/JUELICH_MACC_reanalysis_",a,"_",i4.4,"_",a)') trim(fpath), trim(fcomp), year, trim(fext)
  3339. end if
  3340. !=== SCREEN OUT cases without data (There are more cases, but they are already handled in calling routines.)
  3341. ! ***************************************************************************
  3342. ! ****** THIS IS MESSY. IT NEEDS CONSOLIDATION: SHOULD BUILD LIST OF ********
  3343. ! ****** SECTORS PER SPECIES, LIKE ED42 ********
  3344. ! ***************************************************************************
  3345. if (trim(recname) == "emiss_oc") then
  3346. ! no "emiss_oc" for : C2H5OH, BIGALK, ISOPRENE, TERPENES, BIGENE, TOLUENE, CH2O, CH3CHO, CH3COCH3, MEK
  3347. ! only for : C2H6, C3H8, C2H4, C3H6, NH3, and CO
  3348. if ( (trim(fcomp) /= "C2H6").and.(trim(fcomp) /= "C3H8").and.(trim(fcomp) /= "C2H4").and.&
  3349. (trim(fcomp) /= "C3H6").and.(trim(fcomp) /= "NH3").and.(trim(fcomp) /= "CO") ) return
  3350. else if (trim(recname) == "emiss_anthro") then
  3351. ! there is no "emiss_anthro" for : ISOPRENE, TERPENES
  3352. if ( (trim(fcomp) == "ISOPRENE").or.(trim(fcomp) == "TERPENES") ) return
  3353. end if
  3354. if (trim(recname) == "emiss_bio") then
  3355. ! We arrive here if we are not using MEGAN. No "emiss_bio" for C2H5OH, BIGALK, BIGENE:
  3356. if ( (trim(fcomp) == "C2H5OH").or.(trim(fcomp) == "BIGALK").or.(trim(fcomp) == "BIGENE") ) return
  3357. endif
  3358. if (trim(fcomp) == "BC") then
  3359. if ((trim(recname) /= "emiss_anthro").and.(trim(recname) /= "emiss_air") ) return
  3360. endif
  3361. if ((trim(fcomp) == "OC").and.(trim(recname) /= "emiss_anthro")) return
  3362. !=== READ
  3363. CALL MDF_Open( TRIM(fname), MDF_NETCDF, MDF_READ, fid, status )
  3364. IF_NOTOK_RETURN(status=1)
  3365. CALL MDF_Inq_VarID( fid, trim(recname), varid, status )
  3366. IF_NOTOK_RETURN(status=1)
  3367. if( okdebug ) then
  3368. write (gol,'("EMISS-INFO - MACC - found `",a,"` emissions category in file `",a,"`")') trim(recname), trim(fname); call goPr
  3369. endif
  3370. ! 3D
  3371. if (trim(recname) == "emiss_air") then
  3372. CALL MDF_Get_Var( fid, varid, emis_in, status, start=(/1,1,1,imonth/) )
  3373. IF_NOTOK_RETURN(status=1)
  3374. do lk = 1, ar5_dim_3ddata
  3375. ! convert from kg(species)/m^2/s to kg(species)/gridbox/s :
  3376. emis_in(:,:,lk,1) = emis_in(:,:,lk,1) * gridbox_area_05
  3377. ! now coarsen to nlon360,nlat180
  3378. emis(:,:,lk) = emission_coarsen_to_1x1( emis_in(:,:,lk,1) , nlon720, nlat360, .true., status )
  3379. IF_NOTOK_RETURN(status=1)
  3380. end do
  3381. else !2D
  3382. CALL MDF_Get_Var( fid, varid, emis_in(:,:,1,1), status, start=(/1,1,imonth/) )
  3383. IF_NOTOK_RETURN(status=1)
  3384. ! convert from kg(species)/m^2/s to kg(species)/s
  3385. emis_in(:,:,1,1) = emis_in(:,:,1,1) * gridbox_area_05
  3386. ! combine grid cells
  3387. emis(:,:,1) = emission_coarsen_to_1x1( emis_in(:,:,1,1), nlon720, nlat360, .true., status )
  3388. IF_NOTOK_RETURN(status=1)
  3389. endif
  3390. CALL MDF_Close( fid, status )
  3391. IF_NOTOK_RETURN(status=1)
  3392. status = 0
  3393. end subroutine Emission_macc_ReadSector
  3394. !EOC
  3395. !--------------------------------------------------------------------------
  3396. ! TM5 !
  3397. !--------------------------------------------------------------------------
  3398. !BOP
  3399. !
  3400. ! !IROUTINE: EMISSION_ED4_READSECTOR
  3401. !
  3402. ! !DESCRIPTION: Read an EDAGR-4 sector field out of an open file.
  3403. !
  3404. !\\
  3405. !\\
  3406. ! !INTERFACE:
  3407. !
  3408. function emission_ed4_Read2DRecord( fname, secname, status )
  3409. !
  3410. ! !RETURN VALUE:
  3411. !
  3412. real :: emission_ed4_Read2DRecord(nlon360,nlat180)
  3413. !
  3414. ! !INPUT PARAMETERS:
  3415. !
  3416. character(len=*), intent(in) :: fname
  3417. character(32), intent(in) :: secname
  3418. !
  3419. ! !OUTPUT PARAMETERS:
  3420. !
  3421. integer, intent(out) :: status
  3422. !
  3423. ! !REVISION HISTORY:
  3424. ! 1 Apr 2012 - Narcisa Banda - v0
  3425. !
  3426. ! !REMARKS:
  3427. !
  3428. !EOP
  3429. !------------------------------------------------------------------------
  3430. !BOC
  3431. character(len=*), parameter :: rname = mname//'/emission_ed4_Read2DRecord'
  3432. integer :: fid, varid
  3433. real, dimension(nlon720,nlat360) :: emis_in
  3434. ! initialise
  3435. emission_ed4_Read2DRecord = 0.0
  3436. ! search for the record
  3437. CALL MDF_Open( TRIM(fname), MDF_NETCDF, MDF_READ, fid, status )
  3438. IF_NOTOK_RETURN(status=1)
  3439. CALL MDF_Inq_VarID( fid, secname, varid, status )
  3440. IF_ERROR_RETURN(status=1)
  3441. if ( varid < 0 ) then
  3442. write (gol,'("EMISS-INFO - ED41 - no `",a,"` emissions in file", a)') &
  3443. trim(secname), trim(fname); call goPr
  3444. status=1; TRACEBACK; return
  3445. else
  3446. if( okdebug ) then
  3447. write (gol,'("EMISS-INFO - ED41 - found `",a,"` emissions in file", a)') &
  3448. trim(secname), trim(fname); call goPr
  3449. endif
  3450. CALL MDF_Get_Var( fid, varid, emis_in, status )
  3451. IF_NOTOK_RETURN(status=1)
  3452. ! convert from kg(species)/m^2/s to kg(species)/s
  3453. emis_in = emis_in * gridbox_area_05
  3454. ! combine grid cells
  3455. emission_ed4_Read2DRecord = emission_coarsen_to_1x1( emis_in , nlon720, nlat360, .true., status )
  3456. IF_NOTOK_RETURN(status=1)
  3457. end if
  3458. CALL MDF_Close( fid, status )
  3459. IF_NOTOK_RETURN(status=1)
  3460. status = 0
  3461. return
  3462. end function Emission_ed4_Read2DRecord
  3463. !EOC
  3464. !--------------------------------------------------------------------------
  3465. ! TM5 !
  3466. !--------------------------------------------------------------------------
  3467. !BOP
  3468. !
  3469. ! !IROUTINE: EMISSION_ED4_READSECTOR
  3470. !
  3471. ! !DESCRIPTION: Reading one sector of the files to be interpolated and
  3472. ! returning an interpolated 3d emission field (d3data)
  3473. !\\
  3474. !\\
  3475. ! !INTERFACE:
  3476. !
  3477. subroutine emission_ed4_ReadSector( fpath, comp, compl, iyear, imonth, sector, version, unit, d3data, status)
  3478. !
  3479. ! !INPUT PARAMETERS:
  3480. !
  3481. character(len=*), intent(in) :: fpath
  3482. character(len=*), intent(in) :: comp
  3483. character(len=*), intent(in) :: compl
  3484. integer, intent(in) :: iyear
  3485. integer, intent(in) :: sector
  3486. character(len=*), intent(in) :: version
  3487. character(len=*), intent(in) :: unit
  3488. integer, intent(in) :: imonth
  3489. !
  3490. ! !OUTPUT PARAMETERS:
  3491. !
  3492. integer, intent(out) :: status
  3493. real, intent(out) :: d3data( nlon360, nlat180, ar5_dim_3ddata)
  3494. !
  3495. ! !REVISION HISTORY:
  3496. ! 1 Apr 2012 - Narcisa Banda - v0
  3497. !
  3498. ! !REMARKS:
  3499. !
  3500. !EOP
  3501. !------------------------------------------------------------------------
  3502. !BOC
  3503. character(len=*), parameter :: rname = mname//'/emission_ed4_readsector'
  3504. character(len=256) :: fname
  3505. character(len=256) :: fname_gridboxarea
  3506. character(len=sector_name_len) :: secname
  3507. character(len=32) :: recname
  3508. character(len=4) :: ver
  3509. integer :: lt, year
  3510. logical :: existfile
  3511. logical :: first41=.true., first42=.true.
  3512. integer, dimension(2) :: ltimes
  3513. character(len=4), dimension(2) :: ed41_cyears
  3514. real, dimension(2) :: ed41_ipcoef_years
  3515. ! --- begin -----------------------------------
  3516. ! initialise target array
  3517. d3data = 0.0
  3518. ! read in gridbox-area; once per CPU
  3519. if( .not. area_found_05 ) then
  3520. fname_gridboxarea = trim(emis_input_dir_ar5)//'/'//trim(ed4_filestr_gridboxarea)
  3521. call emission_ReadGridboxArea(fname_gridboxarea, 'cell_area', gridbox_area_05, &
  3522. & nlon720, nlat360, status )
  3523. IF_NOTOK_RETURN(status=1)
  3524. area_found_05 = .true.
  3525. endif
  3526. ! ------------------------
  3527. ! target year(s)
  3528. ! ------------------------
  3529. if (version == 'ED41') then
  3530. ver='41'
  3531. year = valid_year( iyear, ed41_avail, 'EDGAR 4.1', first41)
  3532. first41=.false.
  3533. allocate( ltimeind( ed41_nr_avail_yrs ) )
  3534. ltimeind = .false.
  3535. where( ed41_avail_yrs < year ) ltimeind = .true.
  3536. ! times(1): index representing time instance earlier than current year
  3537. ! times(2): -"- -"- later than current year
  3538. ltimes(2) = count( ltimeind ) + 1
  3539. ltimes(1) = max( ltimes(2) - 1, 1 )
  3540. ! check a match with repository (in order to copy only one file instead of two)
  3541. if( ed41_avail_yrs(ltimes(2)) == year ) ltimes(1) = ltimes(2)
  3542. deallocate( ltimeind )
  3543. ! ed41_cyears will contain strings with the years
  3544. write(ed41_cyears(1),'(I4.4)') ed41_avail_yrs(ltimes(1))
  3545. write(ed41_cyears(2),'(I4.4)') ed41_avail_yrs(ltimes(2))
  3546. ! ed41_ipcoef_years will contain interpolation coefficients
  3547. ! default: factors 1.0/0.0
  3548. ed41_ipcoef_years(1) = 1.0
  3549. ed41_ipcoef_years(2) = 0.0
  3550. if( ltimes(2) /= ltimes(1) ) then
  3551. ed41_ipcoef_years(1) = (ed41_avail_yrs(ltimes(2)) - year) / &
  3552. real( ed41_avail_yrs(ltimes(2)) - ed41_avail_yrs(ltimes(1)) )
  3553. ed41_ipcoef_years(2) = 1.0 - ed41_ipcoef_years(1)
  3554. end if
  3555. else if (version == 'ED42') then
  3556. ver='42'
  3557. year = valid_year( iyear, ed42_avail, 'EDGAR 4.2', first42)
  3558. first42=.false.
  3559. else
  3560. write (gol,'("ERROR - This version of EDGAR has not been implemented ")'); call goErr
  3561. status=1; TRACEBACK; return
  3562. endif
  3563. ! ------------------------
  3564. ! read files (EDv4.1 - index=1: earlier file; index=2: later file)
  3565. ! ------------------------
  3566. recname = 'emi_'//trim(compl)
  3567. if (version=='ED41') then
  3568. do lt = 1, 2
  3569. if (ed41_ipcoef_years(lt) == 0.) cycle
  3570. write (fname,'(a,"/v",a,"_",a,"_",a,"_IPCC_",a,".0.5x0.5.nc")') trim(fpath), trim(ver), trim(comp), &
  3571. & ed41_cyears(lt), trim(sectors_def(sector)%name)
  3572. ! test existence of file
  3573. inquire( file=trim(fname), exist=existfile)
  3574. if( .not. existfile ) then
  3575. write (gol,'(" EDGAR4.1 - file `",a,"` not found ")') trim(fname); call goErr
  3576. status=1; TRACEBACK; return
  3577. end if
  3578. ! distinguish 2d/3d sectors
  3579. if( sectors_def(sector)%f3d ) then
  3580. d3data(:,:,:) = d3data(:,:,:) + ed41_ipcoef_years(lt) * &
  3581. emission_ar5_Read3DRecord( trim(fname), recname, imonth, status )
  3582. else
  3583. d3data(:,:,1) = d3data(:,:,1) + ed41_ipcoef_years(lt) * &
  3584. emission_ed4_Read2DRecord( trim(fname), recname, status )
  3585. end if
  3586. IF_NOTOK_RETURN(status=1)
  3587. enddo
  3588. else
  3589. write (fname,'(a,"/v",a,"_",a,"_",i4.4,"_IPCC_",a,".0.5x0.5.nc")') trim(fpath), trim(ver), trim(comp), &
  3590. & year, trim(sectors_def(sector)%name)
  3591. ! test existence of file
  3592. inquire( file=trim(fname), exist=existfile)
  3593. if( .not. existfile ) then
  3594. write (gol,'(" EDGAR4.2 - file `",a,"` not found ")') trim(fname); call goErr
  3595. status=1; TRACEBACK; return
  3596. end if
  3597. if( sectors_def(sector)%f3d ) then
  3598. d3data(:,:,:) = d3data(:,:,:) + emission_ar5_Read3DRecord( trim(fname), recname, imonth, status )
  3599. else
  3600. d3data(:,:,1) = d3data(:,:,1) + emission_ed4_Read2DRecord( trim(fname), recname, status )
  3601. end if
  3602. IF_NOTOK_RETURN(status=1)
  3603. end if
  3604. status=0
  3605. end subroutine emission_ed4_ReadSector
  3606. !EOC
  3607. !--------------------------------------------------------------------------
  3608. ! TM5 !
  3609. !--------------------------------------------------------------------------
  3610. !BOP
  3611. !
  3612. ! !IROUTINE: EMISSION_LPJ_READSECTOR
  3613. !
  3614. ! !DESCRIPTION: Read an LPJ sector field out of an open file.
  3615. !\\
  3616. !\\
  3617. ! !INTERFACE:
  3618. !
  3619. subroutine emission_LPJ_ReadSector( fpath, iyear, imonth, sector, unit, emis, status )
  3620. !
  3621. ! !USES:
  3622. !
  3623. use dims, only : sec_year
  3624. !
  3625. ! !INPUT PARAMETERS:
  3626. !
  3627. character(len=*), intent(in) :: fpath
  3628. integer, intent(in) :: iyear
  3629. integer, intent(in) :: imonth
  3630. character(len=*), intent(in) :: sector
  3631. character(len=*), intent(in) :: unit
  3632. !
  3633. ! !OUTPUT PARAMETERS:
  3634. !
  3635. real, intent(out) :: emis(nlon360,nlat180)
  3636. integer, intent(out) :: status
  3637. !
  3638. ! !REVISION HISTORY:
  3639. ! 1 Oct 2010 - Achim Strunk - v0
  3640. !
  3641. ! !REMARKS:
  3642. !
  3643. !EOP
  3644. !------------------------------------------------------------------------
  3645. !BOC
  3646. character(len=*), parameter :: rname = mname//'/emission_LPJ_ReadSector'
  3647. ! --- local -----------------------------------
  3648. character(len=256) :: fname
  3649. character(len=256) :: fname_gridboxarea
  3650. real :: emis_in(lpj_dim_nlon,lpj_dim_nlat,1)
  3651. integer :: fid, varid, year, i, j
  3652. logical :: first=.true.
  3653. ! --- begin -----------------------------------
  3654. ! read in gridbox-area; once per CPU
  3655. if( .not. lpj_area_found ) then
  3656. fname_gridboxarea = trim(fpath)//'/'//trim(lpj_filestr_gridboxarea)
  3657. call emission_ReadGridboxArea(fname_gridboxarea, 'areaw', lpj_gridbox_area, &
  3658. & lpj_dim_nlon, lpj_dim_nlat, status )
  3659. lpj_area_found = .true.
  3660. IF_NOTOK_RETURN(status=1)
  3661. endif
  3662. ! Following emissions are from the EU HYMN project via the LPJ model (Spahni et al., Biogeosciences, 2011)
  3663. ! Three categories used: peatlands, wetsoils and wetlands
  3664. ! units in inputfiles: g CH4/y/m2
  3665. ! coverage is 60S - 90N ; no emissions south of 60S
  3666. ! grid cells with any emission have values -999 there skip in the summing across all emission types
  3667. !
  3668. ! CALCULATION EXAMPLE FOR CH4 FLUXES (e.g. for the year 2004):
  3669. ! ***************************************************************************
  3670. ! PEATLAND FLUX per grid cell (PLFpgc):
  3671. ! PLF = lpj_NHpeatlands_2004.nc(ch4_flux) * 0.75
  3672. ! PLFpgc = PLF * A * PF/2.61
  3673. ! "The PLF is corrected for microtopography of peatlands: half of the area emits only half as much thus 25% less in total [Wania et al., 2010]"
  3674. ! "The PF map overestimates total peatland area by a factor of 2.61 compared to Prigent et al., 2007"
  3675. !RICE AGRICULTURE FLUX per grid cell (RAFpgc) - Not Used as implicitly in EDGAR 4.0
  3676. !RAF = lpj_rice_2004.nc(ch4_flux)
  3677. !RAFpgc = RAF * A * RF
  3678. !WETLAND FLUX per grid cell (WLFpgc):
  3679. !WLF = lpj_wetlands_2004.nc(ch4_flux)
  3680. !WLFpgc = WLF * A * IF
  3681. !WETSOILS FLUX per grid cell (WSFpgc):
  3682. !WSF = lpj_wetsoils_2004.nc(ch4_flux)
  3683. !WSFpgc = WSF * A * (1-PF/2.61-IF-RF)
  3684. !"PF is set =0 between 60°S-45°N, IF is set =0 between 45°N-90°N"
  3685. !TOTAL NET FLUX per grid cell (TFpgc):
  3686. !TFpgc = PLFpgc + WLFpgc + RAFpgc + WSFpgc - SCFpgc
  3687. !e.g. for 2004 this results in a global net source:
  3688. !TFpgc = 28.17 + 81.31 + 43.11 + 63.16 - 25.83 Tg CH4/year
  3689. !TFpgc = 189.92 Tg CH4/year
  3690. !
  3691. ! sink term for uptake of CH4 by soils given in mg CH4/ y/ m2 / ppmv(CH4)
  3692. ! therefore store field and then apply later on using latitudinal average for CH4
  3693. !
  3694. ! SOIL CONSUMPTION FLUX per grid cell (SCFpgc):
  3695. ! SCF = lpj_soilconsumption_2004.nc(ch4_flux)
  3696. ! or
  3697. ! SCF = lpj_soilconsumption-perconc_2004.nc(ch4_flux) * atm. CH4 (in ppmv)
  3698. ! SCFpgc = SCF * A * (1-IF-RF) "peatland grid cells are already excluded"
  3699. if( .not. lpj_fractions_found ) then
  3700. fname = trim(fpath)//'/maps/lpj_natwet_fraction.nc'
  3701. CALL MDF_Open( TRIM(fname), MDF_NETCDF, MDF_READ, fid, status )
  3702. IF_NOTOK_RETURN(status=1)
  3703. CALL MDF_Inq_VarID( fid, 'inund', varid, status )
  3704. IF_ERROR_RETURN(status=1)
  3705. CALL MDF_Get_Var( fid, varid, lpj_frac_wetlands, status )
  3706. IF_NOTOK_RETURN(status=1)
  3707. CALL MDF_Close( fid, status )
  3708. IF_NOTOK_RETURN(status=1)
  3709. fname = trim(fpath)//'/maps/lpj_rice_fraction.nc'
  3710. CALL MDF_Open( TRIM(fname), MDF_NETCDF, MDF_READ, fid, status )
  3711. IF_NOTOK_RETURN(status=1)
  3712. CALL MDF_Inq_VarID( fid, 'rice', varid, status )
  3713. IF_ERROR_RETURN(status=1)
  3714. CALL MDF_Get_Var( fid, varid, lpj_frac_rice, status )
  3715. IF_NOTOK_RETURN(status=1)
  3716. CALL MDF_Close( fid, status )
  3717. IF_NOTOK_RETURN(status=1)
  3718. fname = trim(fpath)//'/maps/lpj_peatland_fraction.nc'
  3719. CALL MDF_Open( TRIM(fname), MDF_NETCDF, MDF_READ, fid, status )
  3720. IF_NOTOK_RETURN(status=1)
  3721. CALL MDF_Inq_VarID( fid, 'scfrac', varid, status )
  3722. IF_ERROR_RETURN(status=1)
  3723. CALL MDF_Get_Var( fid, varid, lpj_frac_peatlands, status )
  3724. IF_NOTOK_RETURN(status=1)
  3725. CALL MDF_Close( fid, status )
  3726. IF_NOTOK_RETURN(status=1)
  3727. lpj_fractions_found = .true.
  3728. lpj_frac_peatlands = lpj_frac_peatlands/2.61
  3729. endif
  3730. year = valid_year( iyear, lpj_avail, 'LPJ', first)
  3731. first=.false.
  3732. ! target file name with year
  3733. if (trim(sector).eq.'soilconsumption') then
  3734. write (fname,'(a,"/",a,"/lpj_",a,"-perconc_",i4.4,".nc")') trim(fpath), trim(sector), trim(sector), year
  3735. else
  3736. write (fname,'(a,"/",a,"/lpj_",a,"_",i4.4,".nc")') trim(fpath), trim(sector), trim(sector), year
  3737. end if
  3738. CALL MDF_Open( TRIM(fname), MDF_NETCDF, MDF_READ, fid, status )
  3739. IF_NOTOK_RETURN(status=1)
  3740. CALL MDF_Inq_VarID( fid, 'ch4_flux', varid, status )
  3741. IF_NOTOK_RETURN(status=1)
  3742. if( okdebug ) then
  3743. write (gol,'("EMISS-INFO - LPJ - found ch4 emissions for sector `",a,"` in file ",a)') &
  3744. trim(sector), trim(fname); call goPr
  3745. endif
  3746. emis = 0.0
  3747. ! extract record for requested month
  3748. CALL MDF_Get_Var( fid, varid, emis_in, status, start=(/1,1,imonth/) )
  3749. IF_NOTOK_RETURN(status=1)
  3750. do j=1,lpj_dim_nlat
  3751. do i=1, lpj_dim_nlon
  3752. if(emis_in(i,j,1)>0.) then
  3753. select case( trim(sector) )
  3754. case('wetlands')
  3755. !convert from [g m-2 per year] to [kg per cell per sec]
  3756. emis(i,j+30) = emis_in(i,j,1)*lpj_gridbox_area(i,j)*lpj_frac_wetlands(i,j,imonth)*(1.e-3/sec_year)
  3757. case('peatlands')
  3758. emis(i,j+30) = emis_in(i,j,1)*0.75*lpj_gridbox_area(i,j)*lpj_frac_peatlands(i,j)*(1.e-3/sec_year)
  3759. case('wetsoils')
  3760. emis(i,j+30) = emis_in(i,j,1)*lpj_gridbox_area(i,j)*&
  3761. &(1.-lpj_frac_wetlands(i,j,imonth)-lpj_frac_peatlands(i,j)-lpj_frac_rice(i,j,imonth))*(1.e-3/sec_year)
  3762. case('rice')
  3763. emis(i,j+30) = emis_in(i,j,1)*lpj_gridbox_area(i,j)*lpj_frac_rice(i,j,imonth)*(1.e-3/sec_year)
  3764. case('soilconsumption')
  3765. !convert from [mg m-2 per year per ppmv] to [kg per cell per sec per ppmv]
  3766. emis(i,j+30) = emis_in(i,j,1)*lpj_gridbox_area(i,j)*&
  3767. &(1. - lpj_frac_wetlands(i,j,imonth) - lpj_frac_rice(i,j,imonth))*(1.e-6/sec_year)
  3768. end select
  3769. endif
  3770. enddo
  3771. enddo
  3772. ! no coarsening needed, but used to shift the longitudes from [0, 360]
  3773. ! to [-180, 180]
  3774. emis = emission_coarsen_to_1x1( emis, nlon360, nlat180,.true., status )
  3775. CALL MDF_Close( fid, status )
  3776. IF_NOTOK_RETURN(status=1)
  3777. status = 0
  3778. end subroutine Emission_LPJ_ReadSector
  3779. !EOC
  3780. !--------------------------------------------------------------------------
  3781. ! TM5 !
  3782. !--------------------------------------------------------------------------
  3783. !BOP
  3784. !
  3785. ! !IROUTINE: EMISSION_HYMN_READSECTOR
  3786. !
  3787. ! !DESCRIPTION: Read a HYMN Non-LPJ sector field out of an open file.
  3788. !\\
  3789. !\\
  3790. ! !INTERFACE:
  3791. !
  3792. subroutine emission_HYMN_ReadSector( fpath, sector, unit, emis, status )
  3793. !
  3794. ! !USES:
  3795. !
  3796. use dims, only : sec_year, dxy11
  3797. !
  3798. ! !INPUT PARAMETERS:
  3799. !
  3800. character(len=*), intent(in) :: fpath
  3801. character(len=*), intent(in) :: sector
  3802. character(len=*), intent(in) :: unit
  3803. !
  3804. ! !OUTPUT PARAMETERS:
  3805. !
  3806. real, intent(out) :: emis(nlon360,nlat180)
  3807. integer, intent(out) :: status
  3808. !
  3809. ! !REVISION HISTORY:
  3810. ! 1 Oct 2010 - Achim Strunk - v0
  3811. !
  3812. ! !REMARKS:
  3813. !
  3814. !EOP
  3815. !------------------------------------------------------------------------
  3816. !BOC
  3817. character(len=*), parameter :: rname = mname//'/emission_HYMN_ReadSector'
  3818. ! --- local -----------------------------------
  3819. character(len=256) :: fname
  3820. character(len=256) :: fname_gridboxarea
  3821. integer :: fid, varid, i, j
  3822. real :: emis_in(nlon360,nlat180,1,1)
  3823. character(len=80) :: title
  3824. character(len=80) :: units
  3825. ! --- begin -----------------------------------
  3826. ! target file name with year
  3827. select case(trim(sector))
  3828. case('oceans')
  3829. write (fname,'(a,"/CH4-natural-nonLPJ/CH4-N40-Lambert-0000-sfc-glb100x100.hdf")' ) trim(fpath)
  3830. case('wildanimals')
  3831. write (fname,'(a,"/CH4-natural-nonLPJ/CH4-N70-Olson-0000-sfc-glb100x100.hdf")' ) trim(fpath)
  3832. case('termites')
  3833. write (fname,'(a,"/CH4-natural-nonLPJ/CH4-N71-Sanderson-0000-sfc-glb100x100.hdf")') trim(fpath)
  3834. end select
  3835. CALL MDF_Open( TRIM(fname), MDF_HDF4, MDF_READ, fid, status )
  3836. IF_NOTOK_RETURN(status=1)
  3837. CALL MDF_Inq_VarID( fid, 'field', varid, status )
  3838. IF_NOTOK_RETURN(status=1)
  3839. if( okdebug ) then
  3840. write (gol,'("EMISS-INFO - HYMN - found ch4 emissions from sector `",a,"` in file ",a)') &
  3841. trim(sector), trim(fname); call goPr
  3842. endif
  3843. emis = 0.0
  3844. CALL MDF_Get_Var( fid, varid, emis_in, status )
  3845. IF_NOTOK_RETURN(status=1)
  3846. ! from [kg/cell/yr] to [kg/cell/sec]
  3847. emis(:,:) = emis_in(:,:,1,1)/sec_year
  3848. CALL MDF_Close( fid, status )
  3849. IF_NOTOK_RETURN(status=1)
  3850. status = 0
  3851. end subroutine Emission_HYMN_ReadSector
  3852. !EOC
  3853. !--------------------------------------------------------------------------
  3854. ! TM5 !
  3855. !--------------------------------------------------------------------------
  3856. !BOP
  3857. !
  3858. ! !IROUTINE: emission_gfed_ReadSector
  3859. !
  3860. ! !DESCRIPTION: Read GFEDv3 out of an open file.
  3861. !\\
  3862. !\\
  3863. ! !INTERFACE:
  3864. !
  3865. subroutine emission_gfed_ReadSector( fpath, comp, iyear, imonth, recname, unit, emis, status )
  3866. !
  3867. ! !USES:
  3868. !
  3869. use chem_param, only : xmn, xmno2
  3870. !
  3871. ! !INPUT PARAMETERS:
  3872. !
  3873. character(len=*), intent(in) :: fpath
  3874. character(len=*), intent(in) :: comp
  3875. integer, intent(in) :: iyear
  3876. integer, intent(in) :: imonth
  3877. character(len=*), intent(in) :: recname
  3878. character(len=*), intent(in) :: unit
  3879. !
  3880. ! !OUTPUT PARAMETERS:
  3881. !
  3882. real, intent(out) :: emis(nlon360,nlat180)
  3883. integer, intent(out) :: status
  3884. !
  3885. ! !REVISION HISTORY:
  3886. ! 1 Oct 2010 - Achim Strunk -
  3887. !
  3888. ! !REMARKS:
  3889. !
  3890. !EOP
  3891. !------------------------------------------------------------------------
  3892. !BOC
  3893. character(len=*), parameter :: rname = mname//'/emission_gfed_ReadSector'
  3894. ! --- local -----------------------------------
  3895. character(len=256) :: fname
  3896. real :: emis_in(nlon720,nlat360,1)
  3897. real :: emis_help(nlon360,nlat180)
  3898. integer :: fid, varid, year, j
  3899. logical :: first=.true.
  3900. ! --- begin -----------------------------------
  3901. ! target file name with year
  3902. year = valid_year( iyear, gfed3_avail, 'GFEDv3', first)
  3903. first=.false.
  3904. write (fname,'(a,"/GFEDv3_surface_",a,"_",i4.4,".0.5x0.5.nc")') trim(fpath), trim(comp), year
  3905. ! read in gridbox-area; once per CPU
  3906. if( .not. area_found_05 ) then
  3907. call emission_ReadGridboxArea(fname, 'gridbox_area', gridbox_area_05, &
  3908. & nlon720, nlat360, status )
  3909. IF_NOTOK_RETURN(status=1)
  3910. area_found_05 = .true.
  3911. endif
  3912. CALL MDF_Open( TRIM(fname), MDF_NETCDF, MDF_READ, fid, status )
  3913. IF_NOTOK_RETURN(status=1)
  3914. CALL MDF_Inq_VarID( fid, trim(recname), varid, status )
  3915. IF_ERROR_RETURN(status=1)
  3916. if ( varid < 0 ) then
  3917. write (gol,'("EMISS-INFO - GFEDv3 - no `",a,"` emissions for `",a,"` in file ",a)') &
  3918. trim(recname), trim(comp), trim(fname); call goErr
  3919. status=1; TRACEBACK; return
  3920. else
  3921. if( okdebug ) then
  3922. write (gol,'("EMISS-INFO - GFEDv3 - found `",a,"` emissions for `",a,"` in file ",a)') &
  3923. trim(recname), trim(comp), trim(fname); call goPr
  3924. endif
  3925. CALL MDF_Get_Var( fid, varid, emis_in, status, start=(/1,1,imonth/) )
  3926. IF_NOTOK_RETURN(status=1)
  3927. ! convert from kg(species)/m^2/s to kg(species)/s
  3928. emis_in(:,:,1) = emis_in(:,:,1) * gridbox_area_05
  3929. ! combine grid cells :
  3930. if (trim(comp)=='bc' .or. trim(comp)=='oc') then
  3931. ! GFED3 emissions of BC and OC are correctly given in the files.
  3932. ! They don't need a shift in the zonal direction, but latitudes need to be reversed.
  3933. emis_help = emission_coarsen_to_1x1( emis_in(:,:,1), nlon720, nlat360, .false., status )
  3934. IF_NOTOK_RETURN(status=1)
  3935. do j=1,nlat180
  3936. emis(:,j)=emis_help(:,nlat180-j+1)
  3937. end do
  3938. else
  3939. ! GFED3 emissions of other components are erroneously shifted by 180 degrees in the files.
  3940. ! This is corrected by applying a shift to the data.
  3941. emis = emission_coarsen_to_1x1( emis_in(:,:,1), nlon720, nlat360, .true., status )
  3942. IF_NOTOK_RETURN(status=1)
  3943. endif
  3944. endif
  3945. CALL MDF_Close( fid, status )
  3946. IF_NOTOK_RETURN(status=1)
  3947. status = 0
  3948. end subroutine Emission_gfed_ReadSector
  3949. !EOC
  3950. !--------------------------------------------------------------------------
  3951. ! TM5 !
  3952. !--------------------------------------------------------------------------
  3953. !BOP
  3954. !
  3955. ! !IROUTINE: emission_retro_ReadSector
  3956. !
  3957. ! !DESCRIPTION: Read a RETRO sector field out of an open file.
  3958. !\\
  3959. !\\
  3960. ! !INTERFACE:
  3961. !
  3962. subroutine emission_retro_ReadSector( fpath, comp, iyear, imonth, recname, unit, emis, status )
  3963. !
  3964. ! !USES:
  3965. !
  3966. use chem_param, only : xmn, xmno2
  3967. !
  3968. ! !INPUT PARAMETERS:
  3969. !
  3970. character(len=*), intent(in) :: fpath
  3971. character(len=*), intent(in) :: comp
  3972. integer, intent(in) :: iyear
  3973. integer, intent(in) :: imonth
  3974. character(len=*), intent(in) :: recname
  3975. character(len=*), intent(in) :: unit
  3976. !
  3977. ! !OUTPUT PARAMETERS:
  3978. !
  3979. real, intent(out) :: emis(nlon360,nlat180)
  3980. integer, intent(out) :: status
  3981. !
  3982. ! !REVISION HISTORY:
  3983. ! 1 Oct 2010 - Achim Strunk -
  3984. !
  3985. ! !REMARKS:
  3986. !
  3987. !EOP
  3988. !------------------------------------------------------------------------
  3989. !BOC
  3990. character(len=*), parameter :: rname = mname//'/emission_retro_ReadSector'
  3991. character(len=256) :: fname
  3992. real :: emis_in(nlon720,nlat360,1)
  3993. integer :: fid, varid, year
  3994. logical :: first=.true.
  3995. ! --- begin -----------------------------------
  3996. year = valid_year( iyear, retro_avail, 'RETRO', first)
  3997. first=.false.
  3998. write (fname,'(a,"/RETRO_FIRES_V2_",i4.4,"_",a,"_aggregated.nc")') trim(fpath), year, trim(comp)
  3999. ! read in gridbox-area
  4000. if( .not. area_found_05 ) then
  4001. call emission_ReadGridboxArea(fname, 'gridbox_area', gridbox_area_05, &
  4002. & nlon720, nlat360, status )
  4003. IF_NOTOK_RETURN(status=1)
  4004. area_found_05 = .true.
  4005. endif
  4006. CALL MDF_Open( TRIM(fname), MDF_NETCDF, MDF_READ, fid, status )
  4007. IF_NOTOK_RETURN(status=1)
  4008. CALL MDF_Inq_VarID( fid, trim(recname), varid, status )
  4009. IF_ERROR_RETURN(status=1)
  4010. if ( varid < 0 ) then
  4011. write (gol,'("EMISS-INFO - RETRO - no `",a,"` emissions for `",a,"` in file ", a)') &
  4012. trim(recname), trim(comp), trim(fname); call goErr
  4013. status=1; TRACEBACK; return
  4014. else
  4015. if( okdebug ) then
  4016. write (gol,'("EMISS-INFO - RETRO - found `",a,"` emissions for `",a,"` in file ", a)') &
  4017. trim(recname), trim(comp), trim(fname); call goPr
  4018. endif
  4019. CALL MDF_Get_Var( fid, varid, emis_in, status, start=(/1,1,imonth/) )
  4020. IF_NOTOK_RETURN(status=1)
  4021. !convert from kg(species)/m^2/s to kg(species)/s
  4022. emis_in(:,:,1) = emis_in(:,:,1) * gridbox_area_05
  4023. ! combine grid cells :
  4024. emis = emission_coarsen_to_1x1( emis_in(:,:,1), nlon720, nlat360, .true., status )
  4025. IF_NOTOK_RETURN(status=1)
  4026. end if ! emis category found
  4027. CALL MDF_Close( fid, status )
  4028. IF_NOTOK_RETURN(status=1)
  4029. status = 0
  4030. end subroutine Emission_retro_ReadSector
  4031. !EOC
  4032. !--------------------------------------------------------------------------
  4033. ! TM5 !
  4034. !--------------------------------------------------------------------------
  4035. !BOP
  4036. !
  4037. ! !IROUTINE: emission_megan_ReadSector
  4038. !
  4039. ! !DESCRIPTION: Read a MACC-MEGAN sector field out of an open file.
  4040. !\\
  4041. !\\
  4042. ! !INTERFACE:
  4043. !
  4044. subroutine emission_megan_ReadSector( fpath, comp, iyear, imonth, recname, unit, emis, status )
  4045. !
  4046. ! !USES:
  4047. !
  4048. use chem_param, only : xmn, xmno2
  4049. !
  4050. ! !INPUT PARAMETERS:
  4051. !
  4052. character(len=*), intent(in) :: fpath
  4053. character(len=*), intent(in) :: comp
  4054. integer, intent(in) :: iyear
  4055. integer, intent(in) :: imonth
  4056. character(len=*), intent(in) :: recname
  4057. character(len=*), intent(in) :: unit
  4058. !
  4059. ! !OUTPUT PARAMETERS:
  4060. !
  4061. real, intent(out) :: emis(nlon360,nlat180)
  4062. integer, intent(out) :: status
  4063. integer :: i,j
  4064. !
  4065. ! REVISION HISTORY:
  4066. ! 29 Jan 2014 - Jason Williams -
  4067. !
  4068. ! !REMARKS:
  4069. !
  4070. !EOP
  4071. !------------------------------------------------------------------------
  4072. !BOC
  4073. character(len=*), parameter :: rname = mname//'/emission_megan_ReadSector'
  4074. character(len=256) :: fname
  4075. real :: emis_in(nlon720,nlat360,1)
  4076. real :: flip_array(360,180)
  4077. integer :: fid, varid, year
  4078. logical :: first=.true.
  4079. ! --- begin -----------------------------------
  4080. ! target file name with year
  4081. year = valid_year( iyear, megan_avail, 'MACC-MEGAN', first)
  4082. first=.false.
  4083. write (fname,'(a,"/MEGAN-MACC_biogenic_",i4.4,"_",a,".nc")') trim(fpath), year, trim(comp)
  4084. ! read in gridbox-area; once per CPU
  4085. if( .not. area_found_05 ) then
  4086. call emission_ReadGridboxArea(fname, 'gridbox_area', gridbox_area_05, nlon720, nlat360, status )
  4087. IF_NOTOK_RETURN(status=1)
  4088. area_found_05 = .true.
  4089. endif
  4090. CALL MDF_Open( TRIM(fname), MDF_NETCDF, MDF_READ, fid, status )
  4091. IF_NOTOK_RETURN(status=1)
  4092. CALL MDF_Inq_VarID( fid, trim(recname), varid, status )
  4093. IF_ERROR_RETURN(status=1)
  4094. if ( varid < 0 ) then
  4095. write (gol,'("EMISS-INFO - MACC-MEGAN - no `",a,"` emissions for `",a,"` in file ", a)') &
  4096. trim(recname), trim(comp), trim(fname); call goErr
  4097. status=1; TRACEBACK; return
  4098. else
  4099. if (okdebug) then
  4100. write (gol,'("EMISS-INFO - MACC-MEGAN - found `",a,"` emissions for `",a,"` in file ", a)') &
  4101. trim(recname), trim(comp), trim(fname); call goPr
  4102. endif
  4103. CALL MDF_Get_Var( fid, varid, emis_in, status, start=(/1,1,imonth/) )
  4104. IF_NOTOK_RETURN(status=1)
  4105. !convert from kg(species)/m^2/s to kg(species)/s
  4106. emis_in(:,:,1) = emis_in(:,:,1) * gridbox_area_05
  4107. ! combine grid cells :
  4108. emis = emission_coarsen_to_1x1( emis_in(:,:,1), nlon720, nlat360, .true., status )
  4109. IF_NOTOK_RETURN(status=1)
  4110. flip_array(:,:)=emis(:,:)
  4111. !
  4112. ! flip the array
  4113. !
  4114. do j=1,180
  4115. emis(:,j)=flip_array(:,(180-j)+1)
  4116. enddo
  4117. do i=1,180
  4118. flip_array(i,:)=emis(i+180,:)
  4119. flip_array(i+180,:)=emis(i,:)
  4120. enddo
  4121. do j=1,180
  4122. emis(:,j)=flip_array(:,j)
  4123. enddo
  4124. end if ! emis category found
  4125. CALL MDF_Close( fid, status )
  4126. IF_NOTOK_RETURN(status=1)
  4127. status = 0
  4128. end subroutine Emission_megan_ReadSector
  4129. !EOC
  4130. END MODULE EMISSION_READ