ppp_8f90_source.html 193 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
  5. <title>PUMA: /Users/home/WC/puma/src/ppp.f90 Source File</title>
  6. <link href="tabs.css" rel="stylesheet" type="text/css"/>
  7. <link href="doxygen.css" rel="stylesheet" type="text/css" />
  8. <link href="navtree.css" rel="stylesheet" type="text/css"/>
  9. <script type="text/javascript" src="jquery.js"></script>
  10. <script type="text/javascript" src="resize.js"></script>
  11. <script type="text/javascript" src="navtree.js"></script>
  12. <script type="text/javascript">
  13. $(document).ready(initResizable);
  14. </script>
  15. <link href="search/search.css" rel="stylesheet" type="text/css"/>
  16. <script type="text/javascript" src="search/search.js"></script>
  17. <script type="text/javascript">
  18. $(document).ready(function() { searchBox.OnSelectItem(0); });
  19. </script>
  20. </head>
  21. <body>
  22. <div id="top"><!-- do not remove this div! -->
  23. <div id="titlearea">
  24. <table cellspacing="0" cellpadding="0">
  25. <tbody>
  26. <tr style="height: 56px;">
  27. <td id="projectlogo"><img alt="Logo" src="puma103.jpg"/></td>
  28. <td style="padding-left: 0.5em;">
  29. <div id="projectname">PUMA
  30. &#160;<span id="projectnumber">219</span>
  31. </div>
  32. <div id="projectbrief">Portable University Model of the Atmosphere</div>
  33. </td>
  34. </tr>
  35. </tbody>
  36. </table>
  37. </div>
  38. <!-- Generated by Doxygen 1.7.5.1 -->
  39. <script type="text/javascript">
  40. var searchBox = new SearchBox("searchBox", "search",false,'Search');
  41. </script>
  42. <div id="navrow1" class="tabs">
  43. <ul class="tablist">
  44. <li><a href="index.html"><span>Main&#160;Page</span></a></li>
  45. <li><a href="annotated.html"><span>Data&#160;Types&#160;List</span></a></li>
  46. <li class="current"><a href="files.html"><span>Files</span></a></li>
  47. <li>
  48. <div id="MSearchBox" class="MSearchBoxInactive">
  49. <span class="left">
  50. <img id="MSearchSelect" src="search/mag_sel.png"
  51. onmouseover="return searchBox.OnSearchSelectShow()"
  52. onmouseout="return searchBox.OnSearchSelectHide()"
  53. alt=""/>
  54. <input type="text" id="MSearchField" value="Search" accesskey="S"
  55. onfocus="searchBox.OnSearchFieldFocus(true)"
  56. onblur="searchBox.OnSearchFieldFocus(false)"
  57. onkeyup="searchBox.OnSearchFieldChange(event)"/>
  58. </span><span class="right">
  59. <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
  60. </span>
  61. </div>
  62. </li>
  63. </ul>
  64. </div>
  65. <div id="navrow2" class="tabs2">
  66. <ul class="tablist">
  67. <li><a href="files.html"><span>File&#160;List</span></a></li>
  68. <li><a href="globals.html"><span>File&#160;Members</span></a></li>
  69. </ul>
  70. </div>
  71. </div>
  72. <div id="side-nav" class="ui-resizable side-nav-resizable">
  73. <div id="nav-tree">
  74. <div id="nav-tree-contents">
  75. </div>
  76. </div>
  77. <div id="splitbar" style="-moz-user-select:none;"
  78. class="ui-resizable-handle">
  79. </div>
  80. </div>
  81. <script type="text/javascript">
  82. initNavTree('ppp_8f90.html','');
  83. </script>
  84. <div id="doc-content">
  85. <div class="header">
  86. <div class="headertitle">
  87. <div class="title">/Users/home/WC/puma/src/ppp.f90</div> </div>
  88. </div>
  89. <div class="contents">
  90. <a href="ppp_8f90.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a><a class="code" href="classpumamod.html">00001</a> <span class="keyword">module</span> <a class="code" href="classpumamod.html">pumamod</a>
  91. <a name="l00002"></a>00002
  92. <a name="l00003"></a>00003 <span class="comment">! ****************************************************************</span>
  93. <a name="l00004"></a>00004 <span class="comment">! * Puma Pre Processor *</span>
  94. <a name="l00005"></a>00005 <span class="comment">! ****************************************************************</span>
  95. <a name="l00006"></a>00006 <span class="comment">! * E. Kirk &amp; T. Kunz &amp; F. Lunkeit *</span>
  96. <a name="l00007"></a>00007 <span class="comment">! * Meteorologisches Institut *</span>
  97. <a name="l00008"></a>00008 <span class="comment">! * Universitaet Hamburg *</span>
  98. <a name="l00009"></a>00009 <span class="comment">! * Bundesstrasse 55 *</span>
  99. <a name="l00010"></a>00010 <span class="comment">! * 20146 HAMBURG *</span>
  100. <a name="l00011"></a>00011 <span class="comment">! * 20-Apr-2009 GERMANY *</span>
  101. <a name="l00012"></a>00012 <span class="comment">! ****************************************************************</span>
  102. <a name="l00013"></a>00013
  103. <a name="l00014"></a>00014 <span class="comment">! ****************************************************************</span>
  104. <a name="l00015"></a>00015 <span class="comment">! * Insert your own code for modification of initial data to: *</span>
  105. <a name="l00016"></a>00016 <span class="comment">! * subroutine modify_orography *</span>
  106. <a name="l00017"></a>00017 <span class="comment">! * subroutine modify_ground_temperature *</span>
  107. <a name="l00018"></a>00018 <span class="comment">! ****************************************************************</span>
  108. <a name="l00019"></a>00019
  109. <a name="l00020"></a>00020 <span class="comment">! ****************************************************************</span>
  110. <a name="l00021"></a>00021 <span class="comment">! * PUMA in its default setup can run without initial data *</span>
  111. <a name="l00022"></a>00022 <span class="comment">! * The default setup is an aqua planet with no orography and *</span>
  112. <a name="l00023"></a>00023 <span class="comment">! * zonally symmetric forcing (newtonian cooling with Tr) *</span>
  113. <a name="l00024"></a>00024 <span class="comment">! * The atmosphere starts at rest with no horizontal gradients *</span>
  114. <a name="l00025"></a>00025 <span class="comment">! * *</span>
  115. <a name="l00026"></a>00026 <span class="comment">! * This preprocessor program performs following tasks: *</span>
  116. <a name="l00027"></a>00027 <span class="comment">! * 1) Prepare a realistic orography (T21 or T42) *</span>
  117. <a name="l00028"></a>00028 <span class="comment">! * 2) Enable user modification of this orography *</span>
  118. <a name="l00029"></a>00029 <span class="comment">! * 3) Enable user modification of the ground temperature field *</span>
  119. <a name="l00030"></a>00030 <span class="comment">! * 4) Adjust vertical profiles of Restoration Temperature *</span>
  120. <a name="l00031"></a>00031 <span class="comment">! * 5) Adjust the mean value of surface pressure *</span>
  121. <a name="l00032"></a>00032 <span class="comment">! * 6) Build an initial Ps field adjusted to orography *</span>
  122. <a name="l00033"></a>00033 <span class="comment">! * 7) Setup Yoden-profiles *</span>
  123. <a name="l00034"></a>00034 <span class="comment">! * *</span>
  124. <a name="l00035"></a>00035 <span class="comment">! * Inputfile: &lt;Naaa_surf_0129.sra&gt; with aaa=032,048,064, ... *</span>
  125. <a name="l00036"></a>00036 <span class="comment">! * &lt;Naaa_surf_0139.sra&gt; : Ts anomalies *</span>
  126. <a name="l00037"></a>00037 <span class="comment">! * Outputfiles: &lt;Naaa_surf_0129.sra&gt; : topography [m2/s2] *</span>
  127. <a name="l00038"></a>00038 <span class="comment">! * &lt;Naaa_surf_0134.sra&gt; : Surface pressure [hPa] *</span>
  128. <a name="l00039"></a>00039 <span class="comment">! * &lt;Naaa_surf_0121.sra&gt; : Constant part of Tr *</span>
  129. <a name="l00040"></a>00040 <span class="comment">! * &lt;Naaa_surf_0122.sra&gt; : Variable part of Tr *</span>
  130. <a name="l00041"></a>00041 <span class="comment">! * &lt;Naaa_surf_0123.sra&gt; : Damping time scales *</span>
  131. <a name="l00042"></a>00042 <span class="comment">! * *</span>
  132. <a name="l00043"></a>00043 <span class="comment">! * The outputfiles contain topography, surface pressure, *</span>
  133. <a name="l00044"></a>00044 <span class="comment">! * the part of Tr, that is constant in time and the part pf Tr *</span>
  134. <a name="l00045"></a>00045 <span class="comment">! * that can be modulated by an annual cycle. *</span>
  135. <a name="l00046"></a>00046 <span class="comment">! * *</span>
  136. <a name="l00047"></a>00047 <span class="comment">! * All files are written formatted, such avoiding the problems *</span>
  137. <a name="l00048"></a>00048 <span class="comment">! * assigned to big endian and little endian machines *</span>
  138. <a name="l00049"></a>00049 <span class="comment">! ****************************************************************</span>
  139. <a name="l00050"></a>00050
  140. <a name="l00051"></a>00051
  141. <a name="l00052"></a>00052 <span class="comment">! ****************************************************************</span>
  142. <a name="l00053"></a>00053 <span class="comment">! * The horizontal resolution of PUMA by the number of latitudes *</span>
  143. <a name="l00054"></a>00054 <span class="comment">! * nlat is read from file &quot;resolution_namelist&quot; *</span>
  144. <a name="l00055"></a>00055 <span class="comment">! ****************************************************************</span>
  145. <a name="l00056"></a><a class="code" href="classpumamod.html#a3411ab6d530e7e20888d7bfbe0f2bc41">00056</a> <span class="keywordtype">integer</span> :: nlat = 32
  146. <a name="l00057"></a>00057
  147. <a name="l00058"></a>00058 <span class="comment">! example values: 32, 48, 64, 128, 192, 256, 512, 1024</span>
  148. <a name="l00059"></a>00059 <span class="comment">! truncation: T21, T31, T42, T85, T127, T170, T341, T682</span>
  149. <a name="l00060"></a>00060
  150. <a name="l00061"></a>00061
  151. <a name="l00062"></a>00062 <span class="comment">! *****************************************************************</span>
  152. <a name="l00063"></a>00063 <span class="comment">! * The number of sigma levels of PUMA are modified after reading * </span>
  153. <a name="l00064"></a>00064 <span class="comment">! * file &lt;resolution_namelist&gt;. * </span>
  154. <a name="l00065"></a>00065 <span class="comment">! *****************************************************************</span>
  155. <a name="l00066"></a><a class="code" href="classpumamod.html#a3de2d3dcdd767a858dfb9f64f129087f">00066</a> <span class="keywordtype">integer</span> :: nlev = 10 <span class="comment">! Levels</span>
  156. <a name="l00067"></a>00067
  157. <a name="l00068"></a>00068
  158. <a name="l00069"></a>00069 <span class="comment">! *****************************************************************!</span>
  159. <a name="l00070"></a>00070 <span class="comment">! * Grid related paramters, which are reset after reading the file !</span>
  160. <a name="l00071"></a>00071 <span class="comment">! * &lt;resolution_namelist&gt;. All parameters are initialized for the !</span>
  161. <a name="l00072"></a>00072 <span class="comment">! * T21 truncation !</span>
  162. <a name="l00073"></a>00073 <span class="comment">! *****************************************************************!</span>
  163. <a name="l00074"></a><a class="code" href="classpumamod.html#ac6cf2d31f555e462d15dfb23afd6a035">00074</a> <span class="keywordtype">integer</span> :: nlon = 64 <span class="comment">! Longitudes = 2 * latitudes</span>
  164. <a name="l00075"></a><a class="code" href="classpumamod.html#ae619e60539d80754ec4298f0fdc6724e">00075</a> <span class="keywordtype">integer</span> :: ntru = 21 <span class="comment">! (nlon-1) / 3</span>
  165. <a name="l00076"></a><a class="code" href="classpumamod.html#aee2e0766afdaa439ad0c79c10289b723">00076</a> <span class="keywordtype">integer</span> :: nlpp = 32 <span class="comment">! Latitudes per process</span>
  166. <a name="l00077"></a><a class="code" href="classpumamod.html#a8bbbf57ba00e0a60edcb5f55b6c4881f">00077</a> <span class="keywordtype">integer</span> :: nhor = 2048 <span class="comment">! Horizontal part</span>
  167. <a name="l00078"></a><a class="code" href="classpumamod.html#a09581b8e97e093efc8ec479657f637bf">00078</a> <span class="keywordtype">integer</span> :: nlem = 9 <span class="comment">! Levels - 1</span>
  168. <a name="l00079"></a><a class="code" href="classpumamod.html#a05c1015570a9ac8a74602db90dfe9113">00079</a> <span class="keywordtype">integer</span> :: nlep = 11 <span class="comment">! Levels + 1</span>
  169. <a name="l00080"></a><a class="code" href="classpumamod.html#a44c4ca4a17cfda8c24d18f105166817f">00080</a> <span class="keywordtype">integer</span> :: nlsq = 100 <span class="comment">! Levels squared</span>
  170. <a name="l00081"></a><a class="code" href="classpumamod.html#a3f387b7be204f54ea75b61f0be441430">00081</a> <span class="keywordtype">integer</span> :: ntp1 = 22 <span class="comment">! ntru + 1</span>
  171. <a name="l00082"></a><a class="code" href="classpumamod.html#ae42b0619616180a024fc68c07e639f43">00082</a> <span class="keywordtype">integer</span> :: nrsp = 506 <span class="comment">! (ntru+1) * (ntru+2)</span>
  172. <a name="l00083"></a><a class="code" href="classpumamod.html#a40c76f46506eb6542ad7ccbed8dd35ba">00083</a> <span class="keywordtype">integer</span> :: ncsp = 253 <span class="comment">! nrsp / 2</span>
  173. <a name="l00084"></a><a class="code" href="classpumamod.html#a21fc1a421eaa018055d3e84704d8e594">00084</a> <span class="keywordtype">integer</span> :: nspp = 506 <span class="comment">! nodes per process</span>
  174. <a name="l00085"></a><a class="code" href="classpumamod.html#a16c9776cd5fc9e03115b811020c87c5a">00085</a> <span class="keywordtype">integer</span> :: nesp = 506 <span class="comment">! number of extended modes</span>
  175. <a name="l00086"></a><a class="code" href="classpumamod.html#a92c91c6f6d1af535729b74c33c515e87">00086</a> <span class="keywordtype">integer</span> :: nzom = 44 <span class="comment">! Number of zonal modes</span>
  176. <a name="l00087"></a>00087
  177. <a name="l00088"></a><a class="code" href="classpumamod.html#a6f175a2b93a1284714be362b3a1d6f39">00088</a> <span class="keywordtype">integer</span> :: nlah = 16 <span class="comment">! Half of latitudes</span>
  178. <a name="l00089"></a><a class="code" href="classpumamod.html#a5ac284ed19ba1f7367a214afe2193c1e">00089</a> <span class="keywordtype">integer</span> :: nhpp = 16 <span class="comment">! Half latitudes per process</span>
  179. <a name="l00090"></a>00090
  180. <a name="l00091"></a>00091 <span class="comment">! ****************************************************************</span>
  181. <a name="l00092"></a>00092 <span class="comment">! * Don&#39;t touch the following parameter definitions ! *</span>
  182. <a name="l00093"></a>00093 <span class="comment">! ****************************************************************</span>
  183. <a name="l00094"></a>00094
  184. <a name="l00095"></a>00095 parameter(AKAP = 0.286) <span class="comment">! Kappa</span>
  185. <a name="l00096"></a>00096 parameter(ALR = 0.0065) <span class="comment">! Lapse rate</span>
  186. <a name="l00097"></a>00097 parameter(EZ = 1.632993161855452D0) <span class="comment">! ez = 1 / sqrt(3/8)</span>
  187. <a name="l00098"></a>00098 parameter(GA = 9.81) <span class="comment">! Gravity</span>
  188. <a name="l00099"></a>00099 parameter(GASCON = 287.0) <span class="comment">! Gas constant</span>
  189. <a name="l00100"></a>00100 parameter(PI = 3.141592653589793D0) <span class="comment">! Pi</span>
  190. <a name="l00101"></a>00101 parameter(TWOPI = PI + PI) <span class="comment">! 2 Pi</span>
  191. <a name="l00102"></a>00102 parameter(PLARAD_EARTH = 6371000.0) <span class="comment">! Planet radius</span>
  192. <a name="l00103"></a>00103 parameter(SID_DAY_EARTH= 86164.) <span class="comment">! Siderial day Earth 23h 56m 04s</span>
  193. <a name="l00104"></a>00104 parameter(PNU = 0.02) <span class="comment">! Time filter</span>
  194. <a name="l00105"></a>00105 parameter(PNU21 = 1.0 - 2.0*PNU) <span class="comment">! Time filter 2</span>
  195. <a name="l00106"></a>00106 parameter(PSURF = 101100.0) <span class="comment">! Surface pressure [Pa]</span>
  196. <a name="l00107"></a>00107 parameter(WW = 0.00007292) <span class="comment">! Rotation speed [1/sec]</span>
  197. <a name="l00108"></a>00108 parameter(CV = PLARAD_EARTH * WW) <span class="comment">! cv</span>
  198. <a name="l00109"></a>00109 parameter(CT = CV*CV/GASCON) <span class="comment">! ct</span>
  199. <a name="l00110"></a>00110 parameter(OSCAR = CV*CV/GA) <span class="comment">! Scale Orography</span>
  200. <a name="l00111"></a>00111
  201. <a name="l00112"></a>00112
  202. <a name="l00113"></a>00113 <span class="comment">! *************</span>
  203. <a name="l00114"></a>00114 <span class="comment">! * filenames *</span>
  204. <a name="l00115"></a>00115 <span class="comment">! *************</span>
  205. <a name="l00116"></a>00116 <span class="comment">character (256) :: resolution_namelist = &quot;resolution_namelist&quot;</span>
  206. <a name="l00117"></a>00117 <span class="comment">character (256) :: puma_namelist = &quot;puma_namelist&quot;</span>
  207. <a name="l00118"></a>00118 <span class="comment">character (256) :: ppp_puma_txt = &quot;ppp-puma.txt&quot;</span>
  208. <a name="l00119"></a>00119
  209. <a name="l00120"></a>00120 <span class="comment">! *****************************************************************</span>
  210. <a name="l00121"></a>00121 <span class="comment">! * For multiruns the instance number is appended to the filename *</span>
  211. <a name="l00122"></a>00122 <span class="comment">! * e.g.: puma_namelist_1 puma_diag_1 etc. for instance # 1 *</span>
  212. <a name="l00123"></a>00123 <span class="comment">! *****************************************************************</span>
  213. <a name="l00124"></a>00124
  214. <a name="l00125"></a>00125
  215. <a name="l00126"></a>00126
  216. <a name="l00127"></a>00127
  217. <a name="l00128"></a>00128
  218. <a name="l00129"></a>00129
  219. <a name="l00130"></a>00130
  220. <a name="l00131"></a>00131
  221. <a name="l00132"></a>00132
  222. <a name="l00133"></a>00133
  223. <a name="l00134"></a>00134 <span class="comment">! **************************</span>
  224. <a name="l00135"></a>00135 <span class="comment">! * Global Integer Scalars *</span>
  225. <a name="l00136"></a>00136 <span class="comment">! **************************</span>
  226. <a name="l00137"></a>00137
  227. <a name="l00138"></a><a class="code" href="classpumamod.html#a3a1c81fe64adaf2b041e815e66e59e8d">00138</a> <span class="keywordtype">integer</span> :: kick = 1 <span class="comment">! kick &gt; 1 initializes eddy generation</span>
  228. <a name="l00139"></a><a class="code" href="classpumamod.html#ae82bde2eb42c2fab72e9d6c5d7b009f7">00139</a> <span class="keywordtype">integer</span> :: mpstep = 0 <span class="comment">! PUMA</span>
  229. <a name="l00140"></a><a class="code" href="classpumamod.html#a865b5e1934a6f612b35bade36c2d15bd">00140</a> <span class="keywordtype">integer</span> :: nafter = 0 <span class="comment">! PUMA</span>
  230. <a name="l00141"></a><a class="code" href="classpumamod.html#a0b0e7fc78c5ac39d54ce42a9902447a8">00141</a> <span class="keywordtype">integer</span> :: nwpd = 1 <span class="comment">! PUMA</span>
  231. <a name="l00142"></a><a class="code" href="classpumamod.html#ab5156c8a13ca4542d36017a32cb2e276">00142</a> <span class="keywordtype">integer</span> :: ncoeff = 0 <span class="comment">! number of modes to print</span>
  232. <a name="l00143"></a><a class="code" href="classpumamod.html#a9eabecdccc9c5124168c5d89bc15a1d5">00143</a> <span class="keywordtype">integer</span> :: ndel = 6 <span class="comment">! ndel</span>
  233. <a name="l00144"></a><a class="code" href="classpumamod.html#a54f043f98baef026666945f1440f91b5">00144</a> <span class="keywordtype">integer</span> :: ndiag = 12 <span class="comment">! write diagnostics interval</span>
  234. <a name="l00145"></a><a class="code" href="classpumamod.html#ae5867c6d3c10e9065d7b541ca679d112">00145</a> <span class="keywordtype">integer</span> :: nkits = 3 <span class="comment">! number of initial timesteps</span>
  235. <a name="l00146"></a><a class="code" href="classpumamod.html#a6d50c7a2bbb6196702e7f4f4a0dc5be8">00146</a> <span class="keywordtype">integer</span> :: nlevt = 9 <span class="comment">! tropospheric levels (set_vertical_grid)</span>
  236. <a name="l00147"></a>00147
  237. <a name="l00148"></a><a class="code" href="classpumamod.html#a32948de893d3d7aff01b6372d649f0f6">00148</a> <span class="keywordtype">integer</span> :: ngui = 0 <span class="comment">! PUMA variable</span>
  238. <a name="l00149"></a><a class="code" href="classpumamod.html#a87bc07500cf139d8845b380e0dfbe14f">00149</a> <span class="keywordtype">integer</span> :: nguidbg = 0 <span class="comment">! PUMA variable</span>
  239. <a name="l00150"></a><a class="code" href="classpumamod.html#aaee4fe4165cbc11489f204620de859b8">00150</a> <span class="keywordtype">integer</span> :: nqspec = 1 <span class="comment">! PLASIM variable</span>
  240. <a name="l00151"></a><a class="code" href="classpumamod.html#a461c71616d123104512f1679325a8ecf">00151</a> <span class="keywordtype">integer</span> :: nrun = 0 <span class="comment">! PUMA variable</span>
  241. <a name="l00152"></a><a class="code" href="classpumamod.html#a856ad9c4756a0ccbf7fd325b06f1f900">00152</a> <span class="keywordtype">integer</span> :: nstep = 0 <span class="comment">! current timestep</span>
  242. <a name="l00153"></a><a class="code" href="classpumamod.html#a01f12039746034a94bf226982a6d64ee">00153</a> <span class="keywordtype">integer</span> :: nstop = 0 <span class="comment">! finishing timestep</span>
  243. <a name="l00154"></a><a class="code" href="classpumamod.html#aed2697cde4ae8454c1807fba6dece761">00154</a> <span class="keywordtype">integer</span> :: nsync = 0 <span class="comment">! PUMA variable</span>
  244. <a name="l00155"></a><a class="code" href="classpumamod.html#a4e689422a383ca3ce7c337c46c66dc71">00155</a> <span class="keywordtype">integer</span> :: ntspd = 24 <span class="comment">! number of timesteps per day</span>
  245. <a name="l00156"></a><a class="code" href="classpumamod.html#a137990cf922778de47c453b0556f611a">00156</a> <span class="keywordtype">integer</span> :: ncu = 0 <span class="comment">! check unit (debug output)</span>
  246. <a name="l00157"></a><a class="code" href="classpumamod.html#ae291f08906944ef6e0aff0307de74028">00157</a> <span class="keywordtype">integer</span> :: noro = 0 <span class="comment">! 1: read orography</span>
  247. <a name="l00158"></a>00158 <span class="comment">! 2: orography is computed (sine wave)</span>
  248. <a name="l00159"></a>00159 <span class="comment">! 3: orography is computed (gauss)</span>
  249. <a name="l00160"></a>00160
  250. <a name="l00161"></a><a class="code" href="classpumamod.html#a2724444f4ea0cd1c9ddf8f7b40a0cd5c">00161</a> <span class="keywordtype">integer</span> :: norox = 0 <span class="comment">! x-wavenumber of idealized orography</span>
  251. <a name="l00162"></a><a class="code" href="classpumamod.html#ad9f0e1be51ddecef14ef8259d22f110b">00162</a> <span class="keywordtype">integer</span> :: nreverse = 0 <span class="comment">! t-gradient reversal in stratosphere; 0:no 1:yes</span>
  252. <a name="l00163"></a><a class="code" href="classpumamod.html#a1454296ae1e1d03a284178628a4a3e84">00163</a> <span class="keywordtype">integer</span> :: ncorrect = 0 <span class="comment">! correct tr due to orography (0:no, 1:yes)</span>
  253. <a name="l00164"></a><a class="code" href="classpumamod.html#a688f0876bf83c724d71700aa98835d6e">00164</a> <span class="keywordtype">integer</span> :: nsym = 0 <span class="comment">! produces total symmetric initial conditions </span>
  254. <a name="l00165"></a>00165
  255. <a name="l00166"></a><a class="code" href="classpumamod.html#aca88948c25a082cc21503423423a9cad">00166</a> <span class="keywordtype">integer</span> :: nsrv = 1 <span class="comment">! 1: write gridpoint fields for diagnostics</span>
  256. <a name="l00167"></a><a class="code" href="classpumamod.html#a1f0d5ea8b0f0de798929e63bb5904e86">00167</a> <span class="keywordtype">integer</span> :: lon1oro = 0 <span class="comment">! Define rectangle for anomaly</span>
  257. <a name="l00168"></a><a class="code" href="classpumamod.html#a5acbb0c115c64b84b8b1b25ad84f30aa">00168</a> <span class="keywordtype">integer</span> :: lon2oro = 0 <span class="comment">! </span>
  258. <a name="l00169"></a><a class="code" href="classpumamod.html#aa7bc46dd3fcacd50e1946b36f1df9f6e">00169</a> <span class="keywordtype">integer</span> :: lat1oro = 0 <span class="comment">! </span>
  259. <a name="l00170"></a><a class="code" href="classpumamod.html#ab0d522022938c1aea11f6c7e31ad8e65">00170</a> <span class="keywordtype">integer</span> :: lat2oro = 0 <span class="comment">! </span>
  260. <a name="l00171"></a><a class="code" href="classpumamod.html#a57aac3712e7ae661fa9dd04fe6495ff0">00171</a> <span class="keywordtype">integer</span> :: ntgr = 0 <span class="comment">! 1: read ground temperature</span>
  261. <a name="l00172"></a><a class="code" href="classpumamod.html#a5413d20acb64106fee3e0b8cd6b99efd">00172</a> <span class="keywordtype">integer</span> :: lon1tgr = 0 <span class="comment">! Define rectangle for anomaly</span>
  262. <a name="l00173"></a><a class="code" href="classpumamod.html#a76c8a5bcafbc5b01c5d6c9732a5cdcf1">00173</a> <span class="keywordtype">integer</span> :: lon2tgr = 0 <span class="comment">! </span>
  263. <a name="l00174"></a><a class="code" href="classpumamod.html#a92dedf7e953e229c20b8bb58cb042415">00174</a> <span class="keywordtype">integer</span> :: lat1tgr = 0 <span class="comment">! </span>
  264. <a name="l00175"></a><a class="code" href="classpumamod.html#a3f3522edc6079ba74938bdcf2a780610">00175</a> <span class="keywordtype">integer</span> :: lat2tgr = 0 <span class="comment">! </span>
  265. <a name="l00176"></a><a class="code" href="classpumamod.html#a4e187fd01cc77d813b423d7fb921252d">00176</a> <span class="keywordtype">integer</span> :: nstrato = 0 <span class="comment">! 1: Torben&#39;s stratosphere forcing</span>
  266. <a name="l00177"></a><a class="code" href="classpumamod.html#adb0a88ab45e621b010dc35fb9648b4e4">00177</a> <span class="keywordtype">integer</span> :: nsponge = 0 <span class="comment">! Switch for sponge layer</span>
  267. <a name="l00178"></a><a class="code" href="classpumamod.html#a0f47e459576ce1b123298a6c3dd7d91b">00178</a> <span class="keywordtype">integer</span> :: nhelsua = 0 <span class="comment">! 1: Set up Held &amp; Suarez T_R field</span>
  268. <a name="l00179"></a>00179 <span class="comment">! instead of original PUMA T_R field</span>
  269. <a name="l00180"></a>00180 <span class="comment">! 2: Set up Held &amp; Suarez T_R field</span>
  270. <a name="l00181"></a>00181 <span class="comment">! instead of original PUMA T_R field</span>
  271. <a name="l00182"></a>00182 <span class="comment">! AND use latitudinally varying</span>
  272. <a name="l00183"></a>00183 <span class="comment">! heating timescale in PUMA (H&amp;Z(94)),</span>
  273. <a name="l00184"></a>00184 <span class="comment">! irrelevant for PumaPreProcessor (ppp)</span>
  274. <a name="l00185"></a>00185 <span class="comment">! 3: Use latitudinally varying</span>
  275. <a name="l00186"></a>00186 <span class="comment">! heating timescale in PUMA (H&amp;Z(94)),</span>
  276. <a name="l00187"></a>00187 <span class="comment">! irrelevant for PumaPreProcessor (ppp)</span>
  277. <a name="l00188"></a><a class="code" href="classpumamod.html#a57b5b04397af1927fb03ce17e7376949">00188</a> <span class="keywordtype">integer</span> :: ntestgp = 0 <span class="comment">! switch 0/1 produce a second set of restoration </span>
  278. <a name="l00189"></a>00189 <span class="comment">! restoration temperatures and damping time scales</span>
  279. <a name="l00190"></a><a class="code" href="classpumamod.html#a24838036db3be03c1a4b61262d662f89">00190</a> <span class="keywordtype">integer</span> :: nvg = 0 <span class="comment">! type of vertical grid</span>
  280. <a name="l00191"></a>00191 <span class="comment">! 0 = linear</span>
  281. <a name="l00192"></a>00192 <span class="comment">! 1 = Scinocca &amp; Haynes</span>
  282. <a name="l00193"></a>00193 <span class="comment">! 2 = Polvani &amp; Kushner</span>
  283. <a name="l00194"></a>00194
  284. <a name="l00195"></a><a class="code" href="classpumamod.html#ab503ecf77d192f1191181556fa21346e">00195</a> <span class="keywordtype">integer</span> :: nyoden = 0 <span class="comment">! &gt; 0 Read yoden profile t0(:) and dt(:)</span>
  285. <a name="l00196"></a><a class="code" href="classpumamod.html#a9cd1e899ff739d1fde6cb241167a0b14">00196</a> <span class="keywordtype">integer</span> :: npackgp = 1 <span class="comment">! used in PUMA</span>
  286. <a name="l00197"></a><a class="code" href="classpumamod.html#a3df9e3f62930046dd998328d83f90782">00197</a> <span class="keywordtype">integer</span> :: npacksp = 1 <span class="comment">! used in PUMA</span>
  287. <a name="l00198"></a><a class="code" href="classpumamod.html#ab83d8b5f0baf291cbf7be672044ddbaf">00198</a> <span class="keywordtype">integer</span> :: noutput = 0 <span class="comment">! used in PUMA</span>
  288. <a name="l00199"></a><a class="code" href="classpumamod.html#a44281642d8b5de10c4c6309d65787612">00199</a> <span class="keywordtype">integer</span> :: noutsrv = 0 <span class="comment">! used in PUMA</span>
  289. <a name="l00200"></a>00200
  290. <a name="l00201"></a>00201
  291. <a name="l00202"></a>00202 <span class="comment">! These three predifined Yoden profiles may be selected by setting</span>
  292. <a name="l00203"></a>00203 <span class="comment">! NYODEN= 1, 3 or 5 and nlev=20</span>
  293. <a name="l00204"></a>00204
  294. <a name="l00205"></a><a class="code" href="classpumamod.html#a90a6d9081ae4e97368fd93f921dca1d8">00205</a> <span class="keywordtype">real</span> :: t0yod1(20) = (/224.14,213.91,211.36,212.95,217.56
  295. <a name="l00206"></a>00206 ,224.07,231.24,237.73,243.54,248.87
  296. <a name="l00207"></a>00207 ,253.41,257.83,261.72,265.60,268.96
  297. <a name="l00208"></a>00208 ,272.33,275.36,278.34,281.06,283.74/)
  298. <a name="l00209"></a><a class="code" href="classpumamod.html#a01f849a7ffd4d78c73588a15edbc3527">00209</a> <span class="keywordtype">real</span> :: dtyod1(20) = (/ 0.00, 0.00, 2.00, 9.19, 19.13
  299. <a name="l00210"></a>00210 , 28.26, 34.91, 40.37, 45.10, 49.19
  300. <a name="l00211"></a>00211 , 52.05, 54.69, 56.20, 57.70, 58.31
  301. <a name="l00212"></a>00212 , 58.91, 59.26, 59.56, 59.76, 59.94/)
  302. <a name="l00213"></a><a class="code" href="classpumamod.html#ab716103cdc0613b90aea0b0f3f76890e">00213</a> <span class="keywordtype">real</span> :: t0yod3(20) = (/265.14,254.91,246.36,240.95,237.56
  303. <a name="l00214"></a>00214 ,234.65,235.24,237.73,243.54,248.87
  304. <a name="l00215"></a>00215 ,253.41,257.83,261.72,265.60,268.96
  305. <a name="l00216"></a>00216 ,272.33,275.36,278.34,281.06,283.74/)
  306. <a name="l00217"></a><a class="code" href="classpumamod.html#a0f35364ab66cbd60fdedebdd3c776eee">00217</a> <span class="keywordtype">real</span> :: dtyod3(20) = (/ 0.00, -3.05,-20.32,-26.19,-28.13
  307. <a name="l00218"></a>00218 , 28.26, 34.91, 40.37, 45.10, 49.19
  308. <a name="l00219"></a>00219 , 52.05, 54.69, 56.20, 57.70, 58.31
  309. <a name="l00220"></a>00220 , 58.91, 59.26, 59.56, 59.76, 59.94/)
  310. <a name="l00221"></a><a class="code" href="classpumamod.html#aae0fef74d51d5c0b6ac17c46aee81602">00221</a> <span class="keywordtype">real</span> :: t0yod5(20) = (/305.00,298.00,292.00,286.00,280.00
  311. <a name="l00222"></a>00222 ,274.00,268.00,261.00,256.54,254.87
  312. <a name="l00223"></a>00223 ,253.41,257.83,261.72,265.60,268.96
  313. <a name="l00224"></a>00224 ,272.33,275.36,278.34,281.06,283.74/)
  314. <a name="l00225"></a><a class="code" href="classpumamod.html#ac054354166003ed7452262a59c8edf70">00225</a> <span class="keywordtype">real</span> :: dtyod5(20) = (/ 0.00, -3.05,-21.32,-27.19,-29.13
  315. <a name="l00226"></a>00226 ,-32.26,-34.91,-40.37,-45.10,-49.19
  316. <a name="l00227"></a>00227 , 52.05, 54.69, 56.20, 57.70, 58.31
  317. <a name="l00228"></a>00228 , 58.91, 59.26, 59.56, 59.76, 59.94/)
  318. <a name="l00229"></a><a class="code" href="classpumamod.html#ac3109427e5fbc7662c648cc9c556bcee">00229</a> <span class="keywordtype">real</span> :: t0yod7(20) = (/265.14,254.91,246.36,240.95,237.56
  319. <a name="l00230"></a>00230 ,234.65,235.24,237.73,243.54,248.87
  320. <a name="l00231"></a>00231 ,253.41,257.83,261.72,265.60,268.96
  321. <a name="l00232"></a>00232 ,272.33,275.36,278.34,281.06,283.74/)
  322. <a name="l00233"></a><a class="code" href="classpumamod.html#a062241f749f35c2747f925d690b667ef">00233</a> <span class="keywordtype">real</span> :: dtyod7(20) = (/ 0.00,-25.05,-64.32,-58.19,-22.13
  323. <a name="l00234"></a>00234 , 28.26, 34.91, 40.37, 45.10, 49.19
  324. <a name="l00235"></a>00235 , 52.05, 54.69, 56.20, 57.70, 58.31
  325. <a name="l00236"></a>00236 , 58.91, 59.26, 59.56, 59.76, 60.00/)
  326. <a name="l00237"></a><a class="code" href="classpumamod.html#a5a6a9e0c6cef3144d8d0c455fa24e42a">00237</a> <span class="keywordtype">real</span> :: t0yod8(20) = (/265.14,254.91,246.36,240.95,237.56
  327. <a name="l00238"></a>00238 ,234.65,235.24,237.73,243.54,248.87
  328. <a name="l00239"></a>00239 ,253.41,257.83,261.72,265.60,268.96
  329. <a name="l00240"></a>00240 ,272.33,275.36,278.34,281.06,283.74/)
  330. <a name="l00241"></a><a class="code" href="classpumamod.html#a850c526a93c8b38f08112d84f46c3d61">00241</a> <span class="keywordtype">real</span> :: dtyod8(20) = (/ 0.00,-25.05,-64.32,-58.19,-22.13
  331. <a name="l00242"></a>00242 , 18.26, 24.91, 30.37, 35.10, 39.19
  332. <a name="l00243"></a>00243 , 42.05, 44.69, 46.20, 47.70, 48.31
  333. <a name="l00244"></a>00244 , 48.91, 49.26, 49.56, 49.76, 50.00/)
  334. <a name="l00245"></a><a class="code" href="classpumamod.html#ac0e77a6a01e1b88a9c1b29535bf4a5d5">00245</a> <span class="keywordtype">real</span> :: t0yod9(20) = (/265.14,254.91,246.36,240.95,237.56
  335. <a name="l00246"></a>00246 ,234.65,235.24,237.73,243.54,248.87
  336. <a name="l00247"></a>00247 ,253.41,257.83,261.72,265.60,268.96
  337. <a name="l00248"></a>00248 ,272.33,275.36,278.34,281.06,283.74/)
  338. <a name="l00249"></a><a class="code" href="classpumamod.html#a9599e6b32e3833c098fe5029b7ee70be">00249</a> <span class="keywordtype">real</span> :: dtyod9(20) = (/ 0.00, 0.00, 0.00, 0.00, 0.00
  339. <a name="l00250"></a>00250 , 28.26, 34.91, 40.37, 45.10, 49.19
  340. <a name="l00251"></a>00251 , 52.05, 54.69, 56.20, 57.70, 58.31
  341. <a name="l00252"></a>00252 , 58.91, 59.26, 59.56, 59.76, 60.00/)
  342. <a name="l00253"></a>00253
  343. <a name="l00254"></a><a class="code" href="classpumamod.html#a4766e3a4673c92cf9958d8241cbcbc65">00254</a> <span class="keywordtype">integer</span> :: nfls = 1 <span class="comment">! =1: lower stratospheric forcing is applied,</span>
  344. <a name="l00255"></a>00255 <span class="comment">! see parameters flsp0, flsdp, flsamp and</span>
  345. <a name="l00256"></a>00256 <span class="comment">! flsoff below</span>
  346. <a name="l00257"></a>00257
  347. <a name="l00258"></a>00258 <span class="comment">! ***********************</span>
  348. <a name="l00259"></a>00259 <span class="comment">! * Global Real Scalars *</span>
  349. <a name="l00260"></a>00260 <span class="comment">! ***********************</span>
  350. <a name="l00261"></a>00261
  351. <a name="l00262"></a><a class="code" href="classpumamod.html#a439717e747222ba51cf20b010f3e516c">00262</a> <span class="keywordtype">real</span> :: delt <span class="comment">! 2 pi / ntspd timestep interval</span>
  352. <a name="l00263"></a><a class="code" href="classpumamod.html#a42f46b51b6a92eed14840e3c161d80a1">00263</a> <span class="keywordtype">real</span> :: delt2 <span class="comment">! 2 * delt</span>
  353. <a name="l00264"></a>00264 <span class="comment">!</span>
  354. <a name="l00265"></a>00265 <span class="comment">! namelist parameter for yoden setup</span>
  355. <a name="l00266"></a>00266 <span class="comment">! (for arrays to and dt see namelist arrays below)</span>
  356. <a name="l00267"></a>00267
  357. <a name="l00268"></a><a class="code" href="classpumamod.html#ae1160d24a7abdc97bc3389044621d3d7">00268</a> <span class="keywordtype">real</span> :: dtep = 60.0 <span class="comment">! delta T equator &lt;-&gt; pole [K]</span>
  358. <a name="l00269"></a><a class="code" href="classpumamod.html#a9f9ff76b20700deda41db8834db4b3c3">00269</a> <span class="keywordtype">real</span> :: dtns = 0.0 <span class="comment">! delta T north &lt;-&gt; south [K]</span>
  359. <a name="l00270"></a><a class="code" href="classpumamod.html#a58d401b03b69eccd92e7864d3d821c4c">00270</a> <span class="keywordtype">real</span> :: dtrop = 12000.0 <span class="comment">! Tropopause height [m]</span>
  360. <a name="l00271"></a><a class="code" href="classpumamod.html#ac02146e243330a0df79fb4657d748ef4">00271</a> <span class="keywordtype">real</span> :: dttrp = 2.0 <span class="comment">! Tropopause smoothing [K]</span>
  361. <a name="l00272"></a><a class="code" href="classpumamod.html#af197fe0d42694469ea20c754ddfb1172">00272</a> <span class="keywordtype">real</span> :: dtzz = 10.0 <span class="comment">! delta(Theta)/H additional lapserate in</span>
  362. <a name="l00273"></a><a class="code" href="classpumamod.html#a3584bf754ed1ce4f81f9ae5c2d909c55">00273</a> <span class="keywordtype">real</span> :: syncstr= 0.0 <span class="comment">! PUMA variable</span>
  363. <a name="l00274"></a>00274 <span class="comment">! Held &amp; Suarez T_R field</span>
  364. <a name="l00275"></a><a class="code" href="classpumamod.html#a7e20a606bb6a44f41a19e4b5f5a8cd3c">00275</a> <span class="keywordtype">real</span> :: ttp = 200.0 <span class="comment">! Tropopause temperature in</span>
  365. <a name="l00276"></a>00276 <span class="comment">! Held &amp; Suarez T_R field</span>
  366. <a name="l00277"></a><a class="code" href="classpumamod.html#aacb92e3b939fec35b06f04caded9fc93">00277</a> <span class="keywordtype">real</span> :: plavor= EZ <span class="comment">! planetary vorticity</span>
  367. <a name="l00278"></a><a class="code" href="classpumamod.html#a80df9669ec5bab4a057cae01f5c1a2e6">00278</a> <span class="keywordtype">real</span> :: rotspd = 1.0 <span class="comment">! rotation speed 1.0 = normal Earth rotation</span>
  368. <a name="l00279"></a><a class="code" href="classpumamod.html#abc4579c91fd4501ba251a05dd1bf516c">00279</a> <span class="keywordtype">real</span> :: sigmax= 6.0e-7 <span class="comment">! sigma for top half level</span>
  369. <a name="l00280"></a><a class="code" href="classpumamod.html#a3c92fd62d271fb04326fc32013d8c199">00280</a> <span class="keywordtype">real</span> :: tdiss = 0.25 <span class="comment">! diffusion time scale [days]</span>
  370. <a name="l00281"></a><a class="code" href="classpumamod.html#aa0e01ba5d349492b3449f389b5f93fed">00281</a> <span class="keywordtype">real</span> :: tac = 0. <span class="comment">! length of annual cycle [days] (0 = no cycle)</span>
  371. <a name="l00282"></a><a class="code" href="classpumamod.html#a7784d994e8d1702725dd2241891c1405">00282</a> <span class="keywordtype">real</span> :: pac = 0. <span class="comment">! phase of the annual cycle [days]</span>
  372. <a name="l00283"></a><a class="code" href="classpumamod.html#a65df7e27542e483c7082758755d1f328">00283</a> <span class="keywordtype">real</span> :: tgr = 288.0 <span class="comment">! Ground Temperature in mean profile [K]</span>
  373. <a name="l00284"></a><a class="code" href="classpumamod.html#aa50284698e4f6c0677ad8674c812a287">00284</a> <span class="keywordtype">real</span> :: oroano= 0.0 <span class="comment">! Orography anomaly in [gpm]</span>
  374. <a name="l00285"></a><a class="code" href="classpumamod.html#aacd677d71f3a3b99afa150ea6e76ffd7">00285</a> <span class="keywordtype">real</span> :: tgrano= 0.0 <span class="comment">! Ground temperature anomaly in [K]</span>
  375. <a name="l00286"></a>00286 <span class="comment">!!</span>
  376. <a name="l00287"></a><a class="code" href="classpumamod.html#acc7c9a43a2f8163077730a971e145878">00287</a> <span class="keywordtype">real</span> :: alrs = -0.0000<span class="comment">! stratospheric lapse rate [K/m]</span>
  377. <a name="l00288"></a><a class="code" href="classpumamod.html#aed84e71b62422066731030c119782c49">00288</a> <span class="keywordtype">real</span> :: horo = 0.0 <span class="comment">! height of the idealized orography [m]</span>
  378. <a name="l00289"></a><a class="code" href="classpumamod.html#abc7fb7a57043486f15c7aca03158fb2f">00289</a> <span class="keywordtype">real</span> :: orofac= 1.0 <span class="comment">! factor to scale the orograpy</span>
  379. <a name="l00290"></a><a class="code" href="classpumamod.html#a5d1817a2b6703189d6ab73252b1996af">00290</a> <span class="keywordtype">real</span> :: ttropo= 250.0 <span class="comment">! temp. at tropopause</span>
  380. <a name="l00291"></a>00291 <span class="comment">!!</span>
  381. <a name="l00292"></a><a class="code" href="classpumamod.html#aabd49cfc66d47dea3cf55589fc8ddabc">00292</a> <span class="keywordtype">real</span> :: dorox = 0.0 <span class="comment">! lon. base point for gauss mountain [dec]</span>
  382. <a name="l00293"></a><a class="code" href="classpumamod.html#a2775f20201557322bc0de9c6967cc476">00293</a> <span class="keywordtype">real</span> :: doroy = 0.0 <span class="comment">! lat. base point for gauss mountain [dec]</span>
  383. <a name="l00294"></a><a class="code" href="classpumamod.html#a848fc48f89796c7e1bfb0b1a6d2edb50">00294</a> <span class="keywordtype">real</span> :: doroxs = 0.0 <span class="comment">! gauss mountain scale in lon.-dir. [dec]</span>
  384. <a name="l00295"></a><a class="code" href="classpumamod.html#ad8bf2c0adad70f111c86eb8924c1c52c">00295</a> <span class="keywordtype">real</span> :: doroys = 0.0 <span class="comment">! gauss mountain scale in lat.-dir. [dec]</span>
  385. <a name="l00296"></a>00296
  386. <a name="l00297"></a><a class="code" href="classpumamod.html#a2ff5f72c2ec1bb2f7a1931932165c297">00297</a> <span class="keywordtype">real</span> :: tauta = 40.0 <span class="comment">! heating timescale far from surface [days]</span>
  387. <a name="l00298"></a><a class="code" href="classpumamod.html#a3e769cf019402107f3c6e96b8740cf35">00298</a> <span class="keywordtype">real</span> :: tauts = 4.0 <span class="comment">! heating timescale close to surface [days] </span>
  388. <a name="l00299"></a><a class="code" href="classpumamod.html#a9c5b63f9c6cf129e3aa566b6343beb6a">00299</a> <span class="keywordtype">real</span> :: sid_day= SID_DAY_EARTH <span class="comment">! siderial day [sec]</span>
  389. <a name="l00300"></a>00300
  390. <a name="l00301"></a>00301
  391. <a name="l00302"></a>00302
  392. <a name="l00303"></a><a class="code" href="classpumamod.html#ad8b8310adc7cc23bb372abec1bb098b5">00303</a> <span class="keywordtype">real</span> :: zsigb = 0.7 <span class="comment">! sigma_b for Held&amp;Suarez frict. and heat. </span>
  393. <a name="l00304"></a>00304 <span class="comment">! time scale </span>
  394. <a name="l00305"></a>00305
  395. <a name="l00306"></a>00306
  396. <a name="l00307"></a>00307
  397. <a name="l00308"></a>00308 <span class="comment">! * parameter for stratospheric forcing *</span>
  398. <a name="l00309"></a>00309
  399. <a name="l00310"></a><a class="code" href="classpumamod.html#aaf1e5289f2d9067fb27ac9ac6a07e554">00310</a> <span class="keywordtype">real</span> :: alrpv = 0.002 <span class="comment">! Vertical lapse rate of stratospheric</span>
  400. <a name="l00311"></a>00311 <span class="comment">! polar vortex forcing restoration</span>
  401. <a name="l00312"></a>00312 <span class="comment">! temperature field. It corresponds to</span>
  402. <a name="l00313"></a>00313 <span class="comment">! &#39;gamma&#39; in Polvani &amp; Kushner (2002).</span>
  403. <a name="l00314"></a>00314 <span class="comment">! But alrpv is in [K/m], thus,</span>
  404. <a name="l00315"></a>00315 <span class="comment">! alrpv=0.002 corresponds to &#39;gamma=2&#39;</span>
  405. <a name="l00316"></a>00316 <span class="comment">! in P&amp;K (2002).</span>
  406. <a name="l00317"></a><a class="code" href="classpumamod.html#a3d7cf5223d98e0c95a4377560f9aac6c">00317</a> <span class="keywordtype">real</span> :: radpv = 50. <span class="comment">! Radius of stratospheric polar vortex</span>
  407. <a name="l00318"></a>00318 <span class="comment">! forcing [deg latitude]</span>
  408. <a name="l00319"></a><a class="code" href="classpumamod.html#a69b908f8d7731d272c19d329fcd33706">00319</a> <span class="keywordtype">real</span> :: edgepv = 10. <span class="comment">! Width of edge of stratospheric polar</span>
  409. <a name="l00320"></a>00320 <span class="comment">! vortex forcing [deg latitude].</span>
  410. <a name="l00321"></a>00321 <span class="comment">! If edgepv=0., then no polar vortex is</span>
  411. <a name="l00322"></a>00322 <span class="comment">! set up.</span>
  412. <a name="l00323"></a><a class="code" href="classpumamod.html#a7171bac7e6ef17b935eac4171b1149ff">00323</a> <span class="keywordtype">real</span> :: pmaxpv = 10000. <span class="comment">! Lower boundary of stratospheric polar</span>
  413. <a name="l00324"></a>00324 <span class="comment">! vortex forcing, max. pressure [Pa].</span>
  414. <a name="l00325"></a>00325 <span class="comment">! If pmaxpv=0. then pmaxpv is set to the</span>
  415. <a name="l00326"></a>00326 <span class="comment">! pressure at tropopause height, specified</span>
  416. <a name="l00327"></a>00327 <span class="comment">! by dtrop, according to the US standard</span>
  417. <a name="l00328"></a>00328 <span class="comment">! atmosphere (USSA) vertical profile, used</span>
  418. <a name="l00329"></a>00329 <span class="comment">! for contruction of the restoration</span>
  419. <a name="l00330"></a>00330 <span class="comment">! temperature field. With the standard</span>
  420. <a name="l00331"></a>00331 <span class="comment">! setting (dtrop=11000m, ALR=0.0065K/m,</span>
  421. <a name="l00332"></a>00332 <span class="comment">! tgr=288.15K) this gives pmaxpv=22632Pa.</span>
  422. <a name="l00333"></a>00333 <span class="comment">! ++++NOTE: pmaxpv should be within the</span>
  423. <a name="l00334"></a>00334 <span class="comment">! second USSA layer, that is the interval</span>
  424. <a name="l00335"></a>00335 <span class="comment">! from 54749Pa to 22632Pa (in case of</span>
  425. <a name="l00336"></a>00336 <span class="comment">! standard parameter setting).++++</span>
  426. <a name="l00337"></a>00337
  427. <a name="l00338"></a><a class="code" href="classpumamod.html#a13482db37c1abe130d4dc4af706bbfcd">00338</a> <span class="keywordtype">real</span> :: flsp0 = 10000. <span class="comment">! pressure of max. lower stratospheric forcing</span>
  428. <a name="l00339"></a>00339 <span class="comment">! field [Pa]</span>
  429. <a name="l00340"></a><a class="code" href="classpumamod.html#a51e58c7fbc975478f8dbe96463b3a433">00340</a> <span class="keywordtype">real</span> :: flsdp = 9000. <span class="comment">! half of vertical extension of lower</span>
  430. <a name="l00341"></a>00341 <span class="comment">! stratospheric forcing field [Pa]</span>
  431. <a name="l00342"></a><a class="code" href="classpumamod.html#a3989013e6e41db4fe84fe588114e3298">00342</a> <span class="keywordtype">real</span> :: flsamp = 15. <span class="comment">! amplitude of lower stratospheric forcing</span>
  432. <a name="l00343"></a>00343 <span class="comment">! field [K]</span>
  433. <a name="l00344"></a><a class="code" href="classpumamod.html#a2a580be12b22eb35c66b88168ad41a5a">00344</a> <span class="keywordtype">real</span> :: flsoff = -5. <span class="comment">! offset of lower stratospheric forcing</span>
  434. <a name="l00345"></a>00345 <span class="comment">! field [K]</span>
  435. <a name="l00346"></a>00346
  436. <a name="l00347"></a>00347
  437. <a name="l00348"></a>00348 <span class="comment">! *******************</span>
  438. <a name="l00349"></a>00349 <span class="comment">! * Namelist Arrays *</span>
  439. <a name="l00350"></a>00350 <span class="comment">! *******************</span>
  440. <a name="l00351"></a>00351 <span class="comment">! workaround for older fortran versions, where allocatable arrays</span>
  441. <a name="l00352"></a>00352 <span class="comment">! are not allowed in namelists</span>
  442. <a name="l00353"></a>00353
  443. <a name="l00354"></a>00354
  444. <a name="l00355"></a><a class="code" href="classpumamod.html#a80d5840e4839b80e13a754bc1ad9e5cd">00355</a> <span class="keywordtype">integer</span>, <span class="keywordtype">parameter</span> :: MAXLEV = 100
  445. <a name="l00356"></a><a class="code" href="classpumamod.html#ab32dffe308b27471e38da867575f6811">00356</a> <span class="keywordtype">integer</span>, <span class="keywordtype">parameter</span> :: MAXSELZW = 42
  446. <a name="l00357"></a><a class="code" href="classpumamod.html#a9d128654f0c25001f195e33b7a28029d">00357</a> <span class="keywordtype">integer</span>, <span class="keywordtype">parameter</span> :: MAXSELSP = ((MAXSELZW+1) * (MAXSELZW+2)) / 2
  447. <a name="l00358"></a><a class="code" href="classpumamod.html#af4ef7f7d21aa9c3043e4efaa1a0b0c3e">00358</a> <span class="keywordtype">integer</span> :: nselect(0:MAXSELZW) = 1 <span class="comment">! NSELECT can be used up tp T42</span>
  448. <a name="l00359"></a><a class="code" href="classpumamod.html#a2c894b8fdb5ec54ea52d347187671e2c">00359</a> <span class="keywordtype">integer</span> :: nspecsel(MAXSELSP) = 1
  449. <a name="l00360"></a><a class="code" href="classpumamod.html#a15b0384953f7f10aa3e03dee7662e0f3">00360</a> <span class="keywordtype">integer</span> :: ndl(MAXLEV) = 0
  450. <a name="l00361"></a><a class="code" href="classpumamod.html#a89c938c5067b7da4825d70342cc62fc5">00361</a> <span class="keywordtype">real</span> :: restim(MAXLEV) = 15.0
  451. <a name="l00362"></a><a class="code" href="classpumamod.html#a0fe6c7d70c84c4134653d23d7ba1f542">00362</a> <span class="keywordtype">real</span> :: sigmah(MAXLEV) = 0.0
  452. <a name="l00363"></a><a class="code" href="classpumamod.html#a15be485545b52c4c0fa534fe17e9408b">00363</a> <span class="keywordtype">real</span> :: t0k(MAXLEV) = 250.0
  453. <a name="l00364"></a><a class="code" href="classpumamod.html#aaa502cf0bf055e6a77058cb9a894c808">00364</a> <span class="keywordtype">real</span> :: t0(MAXLEV) = 250.0
  454. <a name="l00365"></a><a class="code" href="classpumamod.html#ac25246ebd045c4eba43e3cf8d1d7596e">00365</a> <span class="keywordtype">real</span> :: tfrc(MAXLEV) = 0.0
  455. <a name="l00366"></a><a class="code" href="classpumamod.html#ad1899f0a731ed4ab715422d9fd8d444b">00366</a> <span class="keywordtype">real</span> :: dt(MAXLEV) = 0.0
  456. <a name="l00367"></a>00367
  457. <a name="l00368"></a>00368 <span class="comment">! **************************</span>
  458. <a name="l00369"></a>00369 <span class="comment">! * Global Spectral Arrays *</span>
  459. <a name="l00370"></a>00370 <span class="comment">! **************************</span>
  460. <a name="l00371"></a>00371
  461. <a name="l00372"></a><a class="code" href="classpumamod.html#a25b4901a49e21188037f1e234de26a52">00372</a> <span class="keywordtype">real</span>, <span class="keywordtype">allocatable</span> :: sor(:) <span class="comment">! Spectral Orography</span>
  462. <a name="l00373"></a><a class="code" href="classpumamod.html#a9e408d75104293064d995076d4dbbce4">00373</a> <span class="keywordtype">real</span>, <span class="keywordtype">allocatable</span> :: ssp(:) <span class="comment">! Spectral surface pressure</span>
  463. <a name="l00374"></a><a class="code" href="classpumamod.html#ab9cb9fb36cedabd96373ce2d69554d93">00374</a> <span class="keywordtype">real</span>, <span class="keywordtype">allocatable</span> :: stg(:) <span class="comment">! Spectral ground temperature</span>
  464. <a name="l00375"></a><a class="code" href="classpumamod.html#a0a5b087ce0b768e344e2e0fd38dccd49">00375</a> <span class="keywordtype">real</span>, <span class="keywordtype">allocatable</span> :: sep(:) <span class="comment">! Spectral equator-pole gradient</span>
  465. <a name="l00376"></a><a class="code" href="classpumamod.html#af7adda7c9fa3da6ac86737a9579b4588">00376</a> <span class="keywordtype">real</span>, <span class="keywordtype">allocatable</span> :: sns(:) <span class="comment">! Spectral north-south gradient</span>
  466. <a name="l00377"></a><a class="code" href="classpumamod.html#a8da7a3798ee3323bf38b6c7b815a3928">00377</a> <span class="keywordtype">real</span>, <span class="keywordtype">allocatable</span> :: spnorm(:) <span class="comment">! ECHAM -&gt; PUMA normalization factors</span>
  467. <a name="l00378"></a><a class="code" href="classpumamod.html#a3eb3e9be54dfc5066878573e5bac8386">00378</a> <span class="keywordtype">real</span>, <span class="keywordtype">allocatable</span> :: sr1(:,:) <span class="comment">! Constant part of Tr</span>
  468. <a name="l00379"></a><a class="code" href="classpumamod.html#ae778b35555f5b6530d47f7cb75422a94">00379</a> <span class="keywordtype">real</span>, <span class="keywordtype">allocatable</span> :: sr2(:,:) <span class="comment">! Variable part of Tr</span>
  469. <a name="l00380"></a>00380
  470. <a name="l00381"></a>00381 <span class="comment">! ***************************</span>
  471. <a name="l00382"></a>00382 <span class="comment">! * Global Gridpoint Arrays *</span>
  472. <a name="l00383"></a>00383 <span class="comment">! ***************************</span>
  473. <a name="l00384"></a>00384
  474. <a name="l00385"></a><a class="code" href="classpumamod.html#a40784d8720abb9ae62f1a66c0dbf666d">00385</a> <span class="keywordtype">real</span>, <span class="keywordtype">allocatable</span> :: gor(:,:) <span class="comment">! Orography</span>
  475. <a name="l00386"></a><a class="code" href="classpumamod.html#aade6f1ed946b27ba82c9ec0249699994">00386</a> <span class="keywordtype">real</span>, <span class="keywordtype">allocatable</span> :: gsp(:,:) <span class="comment">! Surface pressure</span>
  476. <a name="l00387"></a><a class="code" href="classpumamod.html#ad349c2130e94459e9c8e90c4b4208876">00387</a> <span class="keywordtype">real</span>, <span class="keywordtype">allocatable</span> :: gtg(:,:) <span class="comment">! Ground temperature</span>
  477. <a name="l00388"></a><a class="code" href="classpumamod.html#aa15249f48df29a85f239fb007058eacb">00388</a> <span class="keywordtype">real</span>, <span class="keywordtype">allocatable</span> :: gan(:,:) <span class="comment">! Ground temperature anomaly</span>
  478. <a name="l00389"></a><a class="code" href="classpumamod.html#a8f2231a34a19b8792db080ae8e4d9454">00389</a> <span class="keywordtype">real</span>, <span class="keywordtype">allocatable</span> :: gep(:,:) <span class="comment">! Equator-pole gradient</span>
  479. <a name="l00390"></a><a class="code" href="classpumamod.html#adaa3dc50fbf3e39e14e9e2e9320e8f6f">00390</a> <span class="keywordtype">real</span>, <span class="keywordtype">allocatable</span> :: gns(:,:) <span class="comment">! North-south gradient</span>
  480. <a name="l00391"></a><a class="code" href="classpumamod.html#acb21b0133fc9d543c9a472c65c1fc025">00391</a> <span class="keywordtype">real</span>, <span class="keywordtype">allocatable</span> :: gtc(:,:,:) <span class="comment">! Restoration Temperature</span>
  481. <a name="l00392"></a><a class="code" href="classpumamod.html#a24ec113507c8c09685e26fdf2ad94948">00392</a> <span class="keywordtype">real</span>, <span class="keywordtype">allocatable</span> :: gtv(:,:,:) <span class="comment">! Restoration Temperature NS mode</span>
  482. <a name="l00393"></a><a class="code" href="classpumamod.html#afde0b96dd53a26b1703595f64071516d">00393</a> <span class="keywordtype">real</span>, <span class="keywordtype">allocatable</span> :: gtdamp(:,:,:)<span class="comment">! Reciprocal of damping time scale for T </span>
  483. <a name="l00394"></a><a class="code" href="classpumamod.html#a7b5ac8c859782a4cc38346f7b9a61dcd">00394</a> <span class="keywordtype">real</span>, <span class="keywordtype">allocatable</span> :: gaf(:,:,:) <span class="comment">! Anomaly factors</span>
  484. <a name="l00395"></a><a class="code" href="classpumamod.html#a5cb12da2095a04506c22df1b670575f6">00395</a> <span class="keywordtype">real</span>, <span class="keywordtype">allocatable</span> :: gra(:) <span class="comment">! Gradient factors</span>
  485. <a name="l00396"></a>00396
  486. <a name="l00397"></a>00397 <span class="comment">! *******************</span>
  487. <a name="l00398"></a>00398 <span class="comment">! * Latitude Arrays *</span>
  488. <a name="l00399"></a>00399 <span class="comment">! *******************</span>
  489. <a name="l00400"></a>00400
  490. <a name="l00401"></a><a class="code" href="classpumamod.html#a657def2270ed1f8c5137ba82b1d2cb69">00401</a> <span class="keywordtype">character (3)</span>, <span class="keywordtype">allocatable</span> :: chlat(:) <span class="comment">! label for latitudes</span>
  491. <a name="l00402"></a>00402
  492. <a name="l00403"></a><a class="code" href="classpumamod.html#afaa36786d595931f29f0eb93f01ed83d">00403</a> <span class="keywordtype">real (kind=8)</span>, <span class="keywordtype">allocatable</span> :: sid(:) <span class="comment">! sin(phi)</span>
  493. <a name="l00404"></a><a class="code" href="classpumamod.html#af7724a88a5fba5e0ea4a278eca324b7b">00404</a> <span class="keywordtype">real (kind=8)</span>, <span class="keywordtype">allocatable</span> :: gwd(:) <span class="comment">! Gaussian weight</span>
  494. <a name="l00405"></a><a class="code" href="classpumamod.html#a5be628a4dc3f151cd3a2500954bd707a">00405</a> <span class="keywordtype">real (kind=8)</span>, <span class="keywordtype">allocatable</span> :: csq(:) <span class="comment">! cos(phi)^2</span>
  495. <a name="l00406"></a><a class="code" href="classpumamod.html#af689f39b83711b2d5c805279eb5391c1">00406</a> <span class="keywordtype">real (kind=8)</span>, <span class="keywordtype">allocatable</span> :: dla(:) <span class="comment">! phi</span>
  496. <a name="l00407"></a>00407
  497. <a name="l00408"></a>00408
  498. <a name="l00409"></a>00409 <span class="comment">! ****************</span>
  499. <a name="l00410"></a>00410 <span class="comment">! * Level Arrays *</span>
  500. <a name="l00411"></a>00411 <span class="comment">! ****************</span>
  501. <a name="l00412"></a>00412
  502. <a name="l00413"></a><a class="code" href="classpumamod.html#a2ce41df1b8a64f3eb8788faa374977e7">00413</a> <span class="keywordtype">real</span>, <span class="keywordtype">allocatable</span> :: t0d(:) <span class="comment">! vertical t0k gradient</span>
  503. <a name="l00414"></a><a class="code" href="classpumamod.html#a11d50c855ac5c212c04a3640ddfa362d">00414</a> <span class="keywordtype">real</span>, <span class="keywordtype">allocatable</span> :: dsigma(:)
  504. <a name="l00415"></a><a class="code" href="classpumamod.html#af7f7c6447115a5e0079679528c5e20af">00415</a> <span class="keywordtype">real</span>, <span class="keywordtype">allocatable</span> :: rdsig(:)
  505. <a name="l00416"></a><a class="code" href="classpumamod.html#a645a8743bd64422c6d0b4dfc7182fa23">00416</a> <span class="keywordtype">real</span>, <span class="keywordtype">allocatable</span> :: sigma(:)
  506. <a name="l00417"></a><a class="code" href="classpumamod.html#af17f19dbdc2165bfaca19bed26fd393d">00417</a> <span class="keywordtype">real</span>, <span class="keywordtype">allocatable</span> :: tkp(:)
  507. <a name="l00418"></a>00418
  508. <a name="l00419"></a>00419 <span class="comment">! **********************</span>
  509. <a name="l00420"></a>00420 <span class="comment">! * Dummy declarations *</span>
  510. <a name="l00421"></a>00421 <span class="comment">! **********************</span>
  511. <a name="l00422"></a>00422
  512. <a name="l00423"></a><a class="code" href="classpumamod.html#ac97014556deaf23263381f8f385e24bf">00423</a> <span class="keywordtype">real</span> :: gp(2)
  513. <a name="l00424"></a><a class="code" href="classpumamod.html#a7ca052eca893b2dd15b3e2c59417383b">00424</a> <span class="keywordtype">real</span> :: sp(2)
  514. <a name="l00425"></a><a class="code" href="classpumamod.html#a7e9cb053d22629a087d9fb20373d6845">00425</a> <span class="keywordtype">real</span> :: gpj(2)
  515. <a name="l00426"></a><a class="code" href="classpumamod.html#af0504dba05d1852caaa89cc26864d4c1">00426</a> <span class="keywordtype">real</span> :: gu(2,2)
  516. <a name="l00427"></a><a class="code" href="classpumamod.html#a2c2f72279b235e6fabc99913fed1f718">00427</a> <span class="keywordtype">real</span> :: gv(2,2)
  517. <a name="l00428"></a><a class="code" href="classpumamod.html#a9bd99450c5fc8037436814f7b574e29f">00428</a> <span class="keywordtype">real</span> :: sd(2,2)
  518. <a name="l00429"></a><a class="code" href="classpumamod.html#a74c9dc30cb632807156f147f54448742">00429</a> <span class="keywordtype">real</span> :: st(2,2)
  519. <a name="l00430"></a><a class="code" href="classpumamod.html#a94eae8b357e81b00aec6660f112b76b0">00430</a> <span class="keywordtype">real</span> :: sq(2,2)
  520. <a name="l00431"></a><a class="code" href="classpumamod.html#acdc2f913a6792772fcb9a2ebf1b0b043">00431</a> <span class="keywordtype">real</span> :: sz(2,2)
  521. <a name="l00432"></a><a class="code" href="classpumamod.html#a00b4d8ae29f6999627d3b93cdfcec1ea">00432</a> <span class="keywordtype">real</span> :: gd(2,2)
  522. <a name="l00433"></a><a class="code" href="classpumamod.html#abcc9eef5e9aa5ecf04a6d77fd888feb9">00433</a> <span class="keywordtype">real</span> :: gq(2,2)
  523. <a name="l00434"></a><a class="code" href="classpumamod.html#a19345ffa11bc96c6b5a16f205d54d59c">00434</a> <span class="keywordtype">real</span> :: gt(2,2)
  524. <a name="l00435"></a><a class="code" href="classpumamod.html#a0e0c4c718b441b61b728ccb5b97b8184">00435</a> <span class="keywordtype">real</span> :: gz(2,2)
  525. <a name="l00436"></a>00436
  526. <a name="l00437"></a>00437 <span class="keyword"> end module pumamod</span>
  527. <a name="l00438"></a>00438
  528. <a name="l00439"></a><a class="code" href="ppp_8f90.html#a4d3d5ecbb97268b3c90454dee07327fe">00439</a> <span class="keyword">program</span> <a class="code" href="ppp_8f90.html#a4d3d5ecbb97268b3c90454dee07327fe">ppp</a>
  529. <a name="l00440"></a>00440
  530. <a name="l00441"></a>00441 <span class="comment">! open file ppp-puma interface information</span>
  531. <a name="l00442"></a>00442 <span class="keyword">if</span> (mypid == NROOT) <span class="keyword">then</span>
  532. <a name="l00443"></a>00443 <span class="keyword">open</span>(95,file=<span class="stringliteral">&quot;ppp-puma.txt&quot;</span>,form=<span class="stringliteral">&#39;formatted&#39;</span>)
  533. <a name="l00444"></a>00444 <span class="keyword">endif</span>
  534. <a name="l00445"></a>00445
  535. <a name="l00446"></a>00446 call <a class="code" href="ppp_8f90.html#a0952e51b37b6196b4f5d85a5cb93c75b">resolution</a>
  536. <a name="l00447"></a>00447 call <a class="code" href="ppp_8f90.html#afde378004f20ed8741a7e9bcd82cbfe4">prolog</a>
  537. <a name="l00448"></a>00448 call <a class="code" href="ppp_8f90.html#aefdbfd36b330ce29d344d428431119c9">gridpoint</a>
  538. <a name="l00449"></a>00449
  539. <a name="l00450"></a>00450 <span class="comment">! close file ppp-puma interface information</span>
  540. <a name="l00451"></a>00451 <span class="keyword">if</span> (mypid == NROOT) <span class="keyword">then</span>
  541. <a name="l00452"></a>00452 <span class="keyword">close</span>(95)
  542. <a name="l00453"></a>00453 <span class="keyword">endif</span>
  543. <a name="l00454"></a>00454
  544. <a name="l00455"></a>00455 stop
  545. <a name="l00456"></a>00456 <span class="keyword"> end</span>
  546. <a name="l00457"></a>00457
  547. <a name="l00458"></a>00458 <span class="comment">! ******************************</span>
  548. <a name="l00459"></a>00459 <span class="comment">! * SUBROUTINE ALLOCATE_ARRAYS *</span>
  549. <a name="l00460"></a>00460 <span class="comment">! ******************************</span>
  550. <a name="l00461"></a>00461
  551. <a name="l00462"></a><a class="code" href="ppp_8f90.html#a486bae2289e6e28e652b41555030d3e6">00462</a> <span class="keyword">subroutine </span><a class="code" href="ppp_8f90.html#a486bae2289e6e28e652b41555030d3e6">allocate_arrays</a>
  552. <a name="l00463"></a>00463 use <span class="keywordflow">pumamod</span>
  553. <a name="l00464"></a>00464
  554. <a name="l00465"></a>00465 <span class="comment">!--- Global Spectral Arrays </span>
  555. <a name="l00466"></a>00466 <span class="keyword">allocate</span>(sor(nesp)) ; sor(:) = 0.0 <span class="comment">! Spectral Orography</span>
  556. <a name="l00467"></a>00467 <span class="keyword">allocate</span>(ssp(nesp)) ; ssp(:) = 0.0 <span class="comment">! Spectral surface pressure</span>
  557. <a name="l00468"></a>00468 <span class="keyword">allocate</span>(stg(nesp)) ; stg(:) = 0.0 <span class="comment">! Spectral ground temperature</span>
  558. <a name="l00469"></a>00469 <span class="keyword">allocate</span>(sep(nesp)) ; sep(:) = 0.0 <span class="comment">! Spectral equator-pole gradient</span>
  559. <a name="l00470"></a>00470 <span class="keyword">allocate</span>(sns(nesp)) ; sns(:) = 0.0 <span class="comment">! Spectral north-south gradient</span>
  560. <a name="l00471"></a>00471 <span class="keyword">allocate</span>(spnorm(nesp)) ; spnorm(:) = 0.0 <span class="comment">! ECHAM -&gt; PUMA normalization</span>
  561. <a name="l00472"></a>00472 <span class="keyword">allocate</span>(sr1(nesp,nlev)) ; sr1(:,:) = 0.0 <span class="comment">! Constant part of Tr</span>
  562. <a name="l00473"></a>00473 <span class="keyword">allocate</span>(sr2(nesp,nlev)) ; sr2(:,:) = 0.0 <span class="comment">! Variable part of Tr</span>
  563. <a name="l00474"></a>00474
  564. <a name="l00475"></a>00475 <span class="comment">!--- Global Gridpoint Arrays</span>
  565. <a name="l00476"></a>00476 <span class="keyword">allocate</span>(gor(nlon,nlat)) ; gor(:,:) = 0.0 <span class="comment">! Orography</span>
  566. <a name="l00477"></a>00477 <span class="keyword">allocate</span>(gsp(nlon,nlat)) ; gsp(:,:) = 0.0 <span class="comment">! Surface pressure</span>
  567. <a name="l00478"></a>00478 <span class="keyword">allocate</span>(gtg(nlon,nlat)) ; gtg(:,:) = 0.0 <span class="comment">! Ground temperature</span>
  568. <a name="l00479"></a>00479 <span class="keyword">allocate</span>(gan(nlon,nlat)) ; gan(:,:) = 0.0 <span class="comment">! Ground temperature anomaly</span>
  569. <a name="l00480"></a>00480 <span class="keyword">allocate</span>(gep(nlon,nlat)) ; gep(:,:) = 0.0 <span class="comment">! Equator-pole gradient</span>
  570. <a name="l00481"></a>00481 <span class="keyword">allocate</span>(gns(nlon,nlat)) ; gns(:,:) = 0.0 <span class="comment">! North-south gradient</span>
  571. <a name="l00482"></a>00482 <span class="keyword">allocate</span>(gtc(nlon,nlat,nlev)) ; gtc(:,:,:) = 0.0 <span class="comment">! Restoration Temperature</span>
  572. <a name="l00483"></a>00483 <span class="keyword">allocate</span>(gtv(nlon,nlat,nlev)) ; gtv(:,:,:) = 0.0 <span class="comment">! Rest. Temperature NS mode</span>
  573. <a name="l00484"></a>00484 <span class="keyword">allocate</span>(gtdamp(nlon,nlat,nlev)); gtdamp(:,:,:) = 0.0 <span class="comment">! Reciprocal of damping time scale for T</span>
  574. <a name="l00485"></a>00485 <span class="keyword">allocate</span>(gaf(nlon,nlat,nlev)) ; gaf(:,:,:) = 0.0 <span class="comment">! Anomaly factors</span>
  575. <a name="l00486"></a>00486
  576. <a name="l00487"></a>00487 <span class="comment">!--- Latitude Arrays</span>
  577. <a name="l00488"></a>00488 <span class="keyword">allocate</span>(chlat(nlat)) ; chlat(:) = <span class="stringliteral">&quot; &quot;</span> <span class="comment">! label for latitudes</span>
  578. <a name="l00489"></a>00489 <span class="keyword">allocate</span>(sid(nlat)) ; sid(:) = 0.0 <span class="comment">! sin(phi)</span>
  579. <a name="l00490"></a>00490 <span class="keyword">allocate</span>(gwd(nlat)) ; gwd(:) = 0.0 <span class="comment">! Gaussian weight</span>
  580. <a name="l00491"></a>00491 <span class="keyword">allocate</span>(csq(nlat)) ; csq(:) = 0.0 <span class="comment">! cos(phi)^2</span>
  581. <a name="l00492"></a>00492 <span class="keyword">allocate</span>(dla(nlat)) ; dla(:) = 0.0 <span class="comment">! phi</span>
  582. <a name="l00493"></a>00493
  583. <a name="l00494"></a>00494 <span class="comment">!--- Level Arrays</span>
  584. <a name="l00495"></a>00495 <span class="keyword">allocate</span>(gra(nlev)) ; gra(:) = 0.0 <span class="comment">! Gradient factors</span>
  585. <a name="l00496"></a>00496 <span class="keyword">allocate</span>(t0d(nlev)) ; t0d(:) = 0.0 <span class="comment">! vertical t0k gradient</span>
  586. <a name="l00497"></a>00497 <span class="keyword">allocate</span>(dsigma(nlev)) ; dsigma(:) = 0.0
  587. <a name="l00498"></a>00498 <span class="keyword">allocate</span>(rdsig(nlev)) ; rdsig(:) = 0.0
  588. <a name="l00499"></a>00499 <span class="keyword">allocate</span>(sigma(nlev)) ; sigma(:) = 0.0
  589. <a name="l00500"></a>00500 <span class="keyword">allocate</span>(tkp(nlev)) ; tkp(:) = 0.0
  590. <a name="l00501"></a>00501
  591. <a name="l00502"></a>00502 return
  592. <a name="l00503"></a>00503 <span class="keyword"> end subroutine allocate_arrays</span>
  593. <a name="l00504"></a>00504
  594. <a name="l00505"></a>00505 <span class="comment">! ===========================</span>
  595. <a name="l00506"></a>00506 <span class="comment">! SUBROUTINE MODIFY_OROGRAPHY</span>
  596. <a name="l00507"></a>00507 <span class="comment">! ===========================</span>
  597. <a name="l00508"></a>00508
  598. <a name="l00509"></a><a class="code" href="ppp_8f90.html#a4b65f4d96e40adbdb96584789e31c413">00509</a> <span class="keyword">subroutine </span><a class="code" href="ppp_8f90.html#a4b65f4d96e40adbdb96584789e31c413">modify_orography</a>(por)
  599. <a name="l00510"></a>00510 use <span class="keywordflow">pumamod</span>
  600. <a name="l00511"></a>00511 <span class="keywordtype">real</span> :: por(nlon,nlat)
  601. <a name="l00512"></a>00512
  602. <a name="l00513"></a>00513 <span class="comment">! Array &lt;por&gt; contains the orography on a Gaussian grid</span>
  603. <a name="l00514"></a>00514 <span class="comment">! the units are that of a geopotential [m2/s2] (gpm * g)</span>
  604. <a name="l00515"></a>00515 <span class="comment">! You may modify the orography here with your own code</span>
  605. <a name="l00516"></a>00516 <span class="comment">! The new orography is spectrally fitted after this routine</span>
  606. <a name="l00517"></a>00517 <span class="comment">! A gridpoint representation is written in service format</span>
  607. <a name="l00518"></a>00518 <span class="comment">! to file &lt;puma_oro_tnn.srv&gt; with nn = spectral truncation.</span>
  608. <a name="l00519"></a>00519
  609. <a name="l00520"></a>00520 <span class="keyword">if</span> (noro == 2) call <a class="code" href="ppp_8f90.html#af163501e7aad4a154d2317e8adbf8414">mkoro</a>(por)
  610. <a name="l00521"></a>00521 <span class="keyword">if</span> (noro == 3) call <a class="code" href="ppp_8f90.html#af9ce54d8de253b6c88bc6b01b3a247a5">mkorog</a>(por)
  611. <a name="l00522"></a>00522
  612. <a name="l00523"></a>00523 <span class="comment">! Rectangular anomaly</span>
  613. <a name="l00524"></a>00524
  614. <a name="l00525"></a>00525 <span class="comment">! if (oroano /= 0.0 .and. lat1oro &gt; 0 .and. lat2oro &lt;= nlat &amp;</span>
  615. <a name="l00526"></a>00526 <span class="comment">! .and. lon1oro &gt; 0 .and. lon2oro &lt;= nlon &amp;</span>
  616. <a name="l00527"></a>00527 <span class="comment">! .and. lat1oro &lt; lat2oro .and. lon1oro &lt; lon2oro) then</span>
  617. <a name="l00528"></a>00528 <span class="comment">! do jlat = lat1oro , lat2oro</span>
  618. <a name="l00529"></a>00529 <span class="comment">! do jlon = lon1oro , lon2oro</span>
  619. <a name="l00530"></a>00530 <span class="comment">! por(jlon,jlat) = por(jlon,jlat) + oroano * GA</span>
  620. <a name="l00531"></a>00531 <span class="comment">! if (por(jlon,jlat) &lt; 0.0) por(jlon,jlat) = 0.0</span>
  621. <a name="l00532"></a>00532 <span class="comment">! enddo</span>
  622. <a name="l00533"></a>00533 <span class="comment">! enddo</span>
  623. <a name="l00534"></a>00534 <span class="comment">! endif</span>
  624. <a name="l00535"></a>00535
  625. <a name="l00536"></a>00536 <span class="comment">! Elliptic anomaly</span>
  626. <a name="l00537"></a>00537
  627. <a name="l00538"></a>00538 <span class="keyword">if</span> (oroano /= 0.0 .and. lat1oro &gt; 0 .and. lat2oro &lt;= nlat &amp;
  628. <a name="l00539"></a>00539 .and. lon1oro &gt; 0 .and. lon2oro &lt;= nlon &amp;
  629. <a name="l00540"></a>00540 .and. lat1oro &lt; lat2oro .and. lon1oro &lt; lon2oro) <span class="keyword">then</span>
  630. <a name="l00541"></a>00541 x0 = (lon1oro + lon2oro) * 0.5
  631. <a name="l00542"></a>00542 y0 = (lat1oro + lat2oro) * 0.5
  632. <a name="l00543"></a>00543 xf = PI / (lon2oro - lon1oro)
  633. <a name="l00544"></a>00544 yf = PI / (lat2oro - lat1oro)
  634. <a name="l00545"></a>00545 <span class="keyword">do</span> jlat = lat1oro , lat2oro
  635. <a name="l00546"></a>00546 yb = (jlat - y0) * yf
  636. <a name="l00547"></a>00547 <span class="keyword">do</span> jlon = lon1oro , lon2oro
  637. <a name="l00548"></a>00548 xa = (jlon - x0) * xf
  638. <a name="l00549"></a>00549 cx = cos(xa)
  639. <a name="l00550"></a>00550 cy = cos(yb)
  640. <a name="l00551"></a>00551 <span class="keyword">if</span> (cx &gt; 0.0 .and. cy &gt; 0.0) <span class="keyword">then</span>
  641. <a name="l00552"></a>00552 por(jlon,jlat) = por(jlon,jlat) + oroano * GA * cx * cy
  642. <a name="l00553"></a>00553 <span class="keyword">endif</span>
  643. <a name="l00554"></a>00554 <span class="keyword">if</span> (por(jlon,jlat) &lt; 0.0) por(jlon,jlat) = 0.0
  644. <a name="l00555"></a>00555 <span class="keyword">enddo</span>
  645. <a name="l00556"></a>00556 <span class="keyword">enddo</span>
  646. <a name="l00557"></a>00557 <span class="keyword">endif</span>
  647. <a name="l00558"></a>00558
  648. <a name="l00559"></a>00559 return
  649. <a name="l00560"></a>00560 <span class="keyword"> end</span>
  650. <a name="l00561"></a>00561
  651. <a name="l00562"></a>00562 <span class="comment">! ====================================</span>
  652. <a name="l00563"></a>00563 <span class="comment">! SUBROUTINE MODIFY_GROUND_TEMPERATURE</span>
  653. <a name="l00564"></a>00564 <span class="comment">! ====================================</span>
  654. <a name="l00565"></a>00565
  655. <a name="l00566"></a><a class="code" href="ppp_8f90.html#a7c8f4c3a7e4437cad6804ae0ce847552">00566</a> <span class="keyword">subroutine </span><a class="code" href="ppp_8f90.html#a7c8f4c3a7e4437cad6804ae0ce847552">modify_ground_temperature</a>(ptgr)
  656. <a name="l00567"></a>00567 use <span class="keywordflow">pumamod</span>
  657. <a name="l00568"></a>00568 <span class="keywordtype">real</span> :: ptgr(nlon,nlat)
  658. <a name="l00569"></a>00569
  659. <a name="l00570"></a>00570 <span class="comment">! Array &lt;ptgr&gt; contains the ground temperature on a Gaussian grid.</span>
  660. <a name="l00571"></a>00571 <span class="comment">! The units are [K]</span>
  661. <a name="l00572"></a>00572 <span class="comment">! You may modify the ground temperature here with your own code.</span>
  662. <a name="l00573"></a>00573 <span class="comment">! The new ground temperature is used to construct the temperature</span>
  663. <a name="l00574"></a>00574 <span class="comment">! profile of the restoration temperature on each grid point.</span>
  664. <a name="l00575"></a>00575 <span class="comment">! A gridpoint representation is written in service format</span>
  665. <a name="l00576"></a>00576 <span class="comment">! to file &lt;puma_gtgr_tnn.srv&gt; with nn = spectral truncation.</span>
  666. <a name="l00577"></a>00577
  667. <a name="l00578"></a>00578 <span class="keyword">if</span> (tgrano /= 0.0 .and. lat1tgr &gt; 0 .and. lat2tgr &lt;= nlat &amp;
  668. <a name="l00579"></a>00579 .and. lon1tgr &gt; 0 .and. lon2tgr &lt;= nlon &amp;
  669. <a name="l00580"></a>00580 .and. lat1tgr &lt; lat2tgr .and. lon1tgr &lt; lon2tgr) <span class="keyword">then</span>
  670. <a name="l00581"></a>00581 <span class="keyword">do</span> jlat = lat1tgr , lat2tgr
  671. <a name="l00582"></a>00582 <span class="keyword">do</span> jlon = lon1tgr , lon2tgr
  672. <a name="l00583"></a>00583 gan(jlon,jlat) = gan(jlon,jlat) + tgrano
  673. <a name="l00584"></a>00584 ptgr(jlon,jlat) = ptgr(jlon,jlat) + tgrano
  674. <a name="l00585"></a>00585 <span class="keyword">if</span> (ptgr(jlon,jlat) &lt; 0.0) ptgr(jlon,jlat) = 0.0
  675. <a name="l00586"></a>00586 <span class="keyword">enddo</span>
  676. <a name="l00587"></a>00587 <span class="keyword">enddo</span>
  677. <a name="l00588"></a>00588 <span class="keyword">endif</span>
  678. <a name="l00589"></a>00589
  679. <a name="l00590"></a>00590 return
  680. <a name="l00591"></a>00591 <span class="keyword"> end</span>
  681. <a name="l00592"></a>00592
  682. <a name="l00593"></a>00593
  683. <a name="l00594"></a>00594 <span class="comment">! ================</span>
  684. <a name="l00595"></a>00595 <span class="comment">! SUBROUTINE MKORO</span>
  685. <a name="l00596"></a>00596 <span class="comment">! ================</span>
  686. <a name="l00597"></a>00597
  687. <a name="l00598"></a><a class="code" href="ppp_8f90.html#af163501e7aad4a154d2317e8adbf8414">00598</a> <span class="keyword">subroutine </span><a class="code" href="ppp_8f90.html#af163501e7aad4a154d2317e8adbf8414">mkoro</a>(por)
  688. <a name="l00599"></a>00599 use <span class="keywordflow">pumamod</span>
  689. <a name="l00600"></a>00600 <span class="comment">!</span>
  690. <a name="l00601"></a>00601 <span class="keywordtype">real</span> por(nlon,nlat)
  691. <a name="l00602"></a>00602 <span class="comment">!</span>
  692. <a name="l00603"></a>00603 zscale=horo*GA*0.5
  693. <a name="l00604"></a>00604 <span class="comment">!</span>
  694. <a name="l00605"></a>00605 por(:,:)=0.
  695. <a name="l00606"></a>00606 <span class="comment">!</span>
  696. <a name="l00607"></a>00607 <span class="keyword">do</span> jlat=1,nlat/2
  697. <a name="l00608"></a>00608 zlat=dla(jlat)
  698. <a name="l00609"></a>00609 zfacy=(sin(2.*zlat))**2
  699. <a name="l00610"></a>00610 <span class="keyword">do</span> jlon=1,nlon
  700. <a name="l00611"></a>00611 <span class="keyword">if</span>(norox &gt; 0) <span class="keyword">then</span>
  701. <a name="l00612"></a>00612 zfacx=(1.+cos(norox*<span class="keywordtype">real</span>(jlon)*TWOPI/<span class="keywordtype">real</span>(nlon)))
  702. <a name="l00613"></a>00613 <span class="keyword">else</span>
  703. <a name="l00614"></a>00614 zfacx=1.
  704. <a name="l00615"></a>00615 <span class="keyword">endif</span>
  705. <a name="l00616"></a>00616 por(jlon,jlat)=zscale*zfacx*zfacy
  706. <a name="l00617"></a>00617 <span class="keyword">enddo</span>
  707. <a name="l00618"></a>00618 <span class="keyword">enddo</span>
  708. <a name="l00619"></a>00619 <span class="comment">!</span>
  709. <a name="l00620"></a>00620 <span class="keyword">if</span>(nsym == 1) <span class="keyword">then</span>
  710. <a name="l00621"></a>00621 <span class="keyword">do</span> jlat=1,nlat/2
  711. <a name="l00622"></a>00622 j2=nlat+1-jlat
  712. <a name="l00623"></a>00623 por(:,j2)=por(:,jlat)
  713. <a name="l00624"></a>00624 <span class="keyword">enddo</span>
  714. <a name="l00625"></a>00625 <span class="keyword">endif</span>
  715. <a name="l00626"></a>00626 <span class="comment">!</span>
  716. <a name="l00627"></a>00627 return
  717. <a name="l00628"></a>00628 <span class="keyword"> end</span>
  718. <a name="l00629"></a>00629
  719. <a name="l00630"></a>00630 <span class="comment">! =================</span>
  720. <a name="l00631"></a>00631 <span class="comment">! SUBROUTINE MKOROG</span>
  721. <a name="l00632"></a>00632 <span class="comment">! =================</span>
  722. <a name="l00633"></a>00633
  723. <a name="l00634"></a><a class="code" href="ppp_8f90.html#af9ce54d8de253b6c88bc6b01b3a247a5">00634</a> <span class="keyword">subroutine </span><a class="code" href="ppp_8f90.html#af9ce54d8de253b6c88bc6b01b3a247a5">mkorog</a>(por)
  724. <a name="l00635"></a>00635 use <span class="keywordflow">pumamod</span>
  725. <a name="l00636"></a>00636 <span class="comment">!</span>
  726. <a name="l00637"></a>00637 <span class="keywordtype">real</span> por(nlon,nlat)
  727. <a name="l00638"></a>00638 <span class="comment">!</span>
  728. <a name="l00639"></a>00639 zscale=horo*GA
  729. <a name="l00640"></a>00640 <span class="comment">!</span>
  730. <a name="l00641"></a>00641 zlon0=dorox*PI/180.
  731. <a name="l00642"></a>00642 zlat0=doroy*PI/180.
  732. <a name="l00643"></a>00643 zlons=(180./(doroxs*PI))**2
  733. <a name="l00644"></a>00644 zlats=(180./(doroys*PI))**2
  734. <a name="l00645"></a>00645 <span class="comment">!</span>
  735. <a name="l00646"></a>00646 <span class="keyword">do</span> jlat=1,nlat
  736. <a name="l00647"></a>00647 zlat=dla(jlat)
  737. <a name="l00648"></a>00648 <span class="comment">!! zcos2=cos(zlat)**2</span>
  738. <a name="l00649"></a>00649 zcos2=1.
  739. <a name="l00650"></a>00650 zdlat2=(zlat-zlat0)**2
  740. <a name="l00651"></a>00651 <span class="keyword">do</span> jlon=1,nlon
  741. <a name="l00652"></a>00652 zlon=TWOPI*<span class="keywordtype">real</span>(jlon-1)/<span class="keywordtype">real</span>(nlon)
  742. <a name="l00653"></a>00653 zdlon=abs(zlon-zlon0)
  743. <a name="l00654"></a>00654 <span class="keyword">if</span>(zdlon &gt; PI) zdlon=TWOPI-zdlon
  744. <a name="l00655"></a>00655 zdlon2=zdlon**2
  745. <a name="l00656"></a>00656 por(jlon,jlat)=zscale*EXP(-zlons*zcos2*zdlon2-zlats*zdlat2)
  746. <a name="l00657"></a>00657 <span class="keyword">enddo</span>
  747. <a name="l00658"></a>00658 <span class="keyword">enddo</span>
  748. <a name="l00659"></a>00659 <span class="comment">!</span>
  749. <a name="l00660"></a>00660 <span class="keyword">if</span>(nsym == 1 .and. zlat0 &gt; 0.) <span class="keyword">then</span>
  750. <a name="l00661"></a>00661 <span class="keyword">do</span> jlat=1,nlat/2
  751. <a name="l00662"></a>00662 j2=nlat+1-jlat
  752. <a name="l00663"></a>00663 por(:,j2)=por(:,jlat)
  753. <a name="l00664"></a>00664 <span class="keyword">enddo</span>
  754. <a name="l00665"></a>00665 elseif(nsym == 1 .and. zlat0 &lt; 0.) <span class="keyword">then</span>
  755. <a name="l00666"></a>00666 <span class="keyword">do</span> jlat=1,nlat/2
  756. <a name="l00667"></a>00667 j2=nlat+1-jlat
  757. <a name="l00668"></a>00668 por(:,jlat)=por(:,j2)
  758. <a name="l00669"></a>00669 <span class="keyword">enddo</span>
  759. <a name="l00670"></a>00670 <span class="keyword">endif</span>
  760. <a name="l00671"></a>00671 <span class="comment">!</span>
  761. <a name="l00672"></a>00672 return
  762. <a name="l00673"></a>00673 <span class="keyword"> end</span>
  763. <a name="l00674"></a>00674
  764. <a name="l00675"></a>00675 <span class="comment">! =================</span>
  765. <a name="l00676"></a>00676 <span class="comment">! SUBROUTINE PROLOG</span>
  766. <a name="l00677"></a>00677 <span class="comment">! =================</span>
  767. <a name="l00678"></a>00678
  768. <a name="l00679"></a><a class="code" href="ppp_8f90.html#afde378004f20ed8741a7e9bcd82cbfe4">00679</a> <span class="keyword">subroutine </span><a class="code" href="ppp_8f90.html#afde378004f20ed8741a7e9bcd82cbfe4">prolog</a>
  769. <a name="l00680"></a>00680 use <span class="keywordflow">pumamod</span>
  770. <a name="l00681"></a>00681
  771. <a name="l00682"></a>00682
  772. <a name="l00683"></a>00683
  773. <a name="l00684"></a>00684 call <a class="code" href="ppp_8f90.html#a486bae2289e6e28e652b41555030d3e6">allocate_arrays</a>
  774. <a name="l00685"></a>00685
  775. <a name="l00686"></a>00686 call <a class="code" href="ppp_8f90.html#a57e32ca0b91b99739b892a459ec40953">printparameter</a>
  776. <a name="l00687"></a>00687 call <a class="code" href="gaussmod_8f90.html#a841a2f8e9025371eddc985235e1831ab">inigau</a>(nlat,sid,gwd)
  777. <a name="l00688"></a>00688 call <a class="code" href="ppp_8f90.html#a7780f6c3a813605c014f7da964ff83d2">inilat</a>
  778. <a name="l00689"></a>00689 call <a class="code" href="ppp_8f90.html#a03d027a1b5f735efb9bce2396d5fc2b6">legpri</a>
  779. <a name="l00690"></a>00690 call <a class="code" href="ppp_8f90.html#a8a75958ca9ba25aeec49db140b483871">readnl</a>
  780. <a name="l00691"></a>00691 call <a class="code" href="ppp_8f90.html#a5087a1dafe7b39d03c6547fde711b55a">initpm</a>
  781. <a name="l00692"></a>00692 call <a class="code" href="legsym_8f90.html#a86bc436e65d6c4ddde72bb3cce7dc8c8">legini</a>(nlat,nlpp,nesp,nlev,plavor,sid,gwd)
  782. <a name="l00693"></a>00693 call <a class="code" href="ppp_8f90.html#a51f5938296dd343ce807dbb6d1a16e49">initfd</a>
  783. <a name="l00694"></a>00694
  784. <a name="l00695"></a>00695
  785. <a name="l00696"></a>00696 <span class="keyword">if</span> (mypid == NROOT) <span class="keyword">then</span>
  786. <a name="l00697"></a>00697 call <a class="code" href="ppp_8f90.html#adbcdb3579718dc6067a1b2ec4d26e476">ppp_write_i</a>(<span class="stringliteral">&#39;NLAT&#39;</span>,1,nlat)
  787. <a name="l00698"></a>00698 call <a class="code" href="ppp_8f90.html#adbcdb3579718dc6067a1b2ec4d26e476">ppp_write_i</a>(<span class="stringliteral">&#39;NLEV&#39;</span>,1,nlev)
  788. <a name="l00699"></a>00699 call <a class="code" href="ppp_8f90.html#adbcdb3579718dc6067a1b2ec4d26e476">ppp_write_i</a>(<span class="stringliteral">&#39;NHELSUA&#39;</span>,1,nhelsua)
  789. <a name="l00700"></a>00700 call <a class="code" href="ppp_8f90.html#a74276344215789d1e8fdce713dd9cd25">ppp_write_r</a>(<span class="stringliteral">&#39;SIGMH&#39;</span>,NLEV,sigmah)
  790. <a name="l00701"></a>00701 <span class="keyword">endif</span>
  791. <a name="l00702"></a>00702
  792. <a name="l00703"></a>00703 return
  793. <a name="l00704"></a>00704 <span class="keyword"> end</span>
  794. <a name="l00705"></a>00705
  795. <a name="l00706"></a>00706 <span class="comment">! =================</span>
  796. <a name="l00707"></a>00707 <span class="comment">! SUBROUTINE INITFD</span>
  797. <a name="l00708"></a>00708 <span class="comment">! =================</span>
  798. <a name="l00709"></a>00709
  799. <a name="l00710"></a><a class="code" href="ppp_8f90.html#a51f5938296dd343ce807dbb6d1a16e49">00710</a> <span class="keyword">subroutine </span><a class="code" href="ppp_8f90.html#a51f5938296dd343ce807dbb6d1a16e49">initfd</a>
  800. <a name="l00711"></a>00711 use <span class="keywordflow">pumamod</span>
  801. <a name="l00712"></a>00712
  802. <a name="l00713"></a>00713 dimension zrmean(nlev)
  803. <a name="l00714"></a>00714
  804. <a name="l00715"></a>00715 zfmode0 = sqrt(2.0)
  805. <a name="l00716"></a>00716 zfmode1 = 1.0 / sqrt(6.0)
  806. <a name="l00717"></a>00717 zfmode2 = -2.0 / 3.0 * sqrt(0.4)
  807. <a name="l00718"></a>00718
  808. <a name="l00719"></a>00719 stg(1) = zfmode0 * tgr <span class="comment">! Ground temperature [K]</span>
  809. <a name="l00720"></a>00720 sns(3) = zfmode1 * dtns <span class="comment">! North-South gradient [K]</span>
  810. <a name="l00721"></a>00721 sep(5) = zfmode2 * dtep <span class="comment">! Equator-Pole gradient [K]</span>
  811. <a name="l00722"></a>00722
  812. <a name="l00723"></a>00723 <span class="comment">! Find sigma at dtrop</span>
  813. <a name="l00724"></a>00724
  814. <a name="l00725"></a>00725 zttrop = tgr - dtrop * ALR
  815. <a name="l00726"></a>00726 ztps = (zttrop/tgr)**(GA/(ALR*GASCON))
  816. <a name="l00727"></a>00727
  817. <a name="l00728"></a>00728 <span class="comment">! The North-South and Equator-Pole gradients are defined on z=0.</span>
  818. <a name="l00729"></a>00729 <span class="comment">! gra() modifies the gradient from full at z=0 to zero at tropopause</span>
  819. <a name="l00730"></a>00730 <span class="comment">! PUMA aquaplanet compatibility mode (sine function used)</span>
  820. <a name="l00731"></a>00731
  821. <a name="l00732"></a>00732 <span class="keyword">do</span> jlev = 1 , nlev
  822. <a name="l00733"></a>00733 gra(jlev) = sin(0.5 * PI * (sigma(jlev) - ztps) / (1.0-ztps))
  823. <a name="l00734"></a>00734 <span class="keyword">if</span> (gra(jlev) &lt; 0.0) gra(jlev) = 0.0
  824. <a name="l00735"></a>00735 <span class="keyword">enddo</span>
  825. <a name="l00736"></a>00736
  826. <a name="l00737"></a>00737 return
  827. <a name="l00738"></a>00738 <span class="keyword"> end</span>
  828. <a name="l00739"></a>00739
  829. <a name="l00740"></a>00740 <span class="comment">! ==========================</span>
  830. <a name="l00741"></a>00741 <span class="comment">! SUBROUTINE ANOMALY_FACTORS</span>
  831. <a name="l00742"></a>00742 <span class="comment">! ==========================</span>
  832. <a name="l00743"></a>00743
  833. <a name="l00744"></a><a class="code" href="ppp_8f90.html#a7f841b10d9e4f470513770f91f92c0bc">00744</a> <span class="keyword">subroutine </span><a class="code" href="ppp_8f90.html#a7f841b10d9e4f470513770f91f92c0bc">anomaly_factors</a>
  834. <a name="l00745"></a>00745 use <span class="keywordflow">pumamod</span>
  835. <a name="l00746"></a>00746
  836. <a name="l00747"></a>00747 <span class="keyword">do</span> jlat = 1 , nlat
  837. <a name="l00748"></a>00748 <span class="keyword">do</span> jlon = 1 , nlon
  838. <a name="l00749"></a>00749
  839. <a name="l00750"></a>00750 <span class="comment">! Find sigma at dtrop</span>
  840. <a name="l00751"></a>00751
  841. <a name="l00752"></a>00752 zttrop = tgr - dtrop * ALR
  842. <a name="l00753"></a>00753 ztps = (zttrop/gtg(jlon,jlat))**(GA/(ALR*GASCON))
  843. <a name="l00754"></a>00754
  844. <a name="l00755"></a>00755 <span class="comment">! The North-South and Equator-Pole gradients are defined on z=0.</span>
  845. <a name="l00756"></a>00756 <span class="comment">! gaf() modifies the gradient from full at z=0 to zero at tropopause</span>
  846. <a name="l00757"></a>00757 <span class="comment">! PUMA aquaplanet compatibility mode (sine function used)</span>
  847. <a name="l00758"></a>00758
  848. <a name="l00759"></a>00759 <span class="keyword">if</span>(nreverse == 0) <span class="keyword">then</span>
  849. <a name="l00760"></a>00760 <span class="keyword">do</span> jlev = 1 , nlev
  850. <a name="l00761"></a>00761 gaf(jlon,jlat,jlev) = sin(0.5 * PI * (sigma(jlev) - ztps) / (1.0-ztps))
  851. <a name="l00762"></a>00762 <span class="keyword">if</span> (gaf(jlon,jlat,jlev) &lt; 0.0) gaf(jlon,jlat,jlev) = 0.0
  852. <a name="l00763"></a>00763 <span class="keyword">enddo</span>
  853. <a name="l00764"></a>00764 <span class="keyword">else</span>
  854. <a name="l00765"></a>00765 <span class="keyword">do</span> jlev = 1 , nlev
  855. <a name="l00766"></a>00766 gaf(jlon,jlat,jlev) = sin(0.5 * PI * (sigma(jlev) - ztps) / (1.0-ztps))
  856. <a name="l00767"></a>00767 <span class="keyword">if</span> (sigma(jlev) &lt; ztps) &amp;
  857. <a name="l00768"></a>00768 &amp; gaf(jlon,jlat,jlev) = sin(PI*(sigma(jlev)-ztps)/(ztps-sigma(1)))
  858. <a name="l00769"></a>00769 <span class="keyword">enddo</span>
  859. <a name="l00770"></a>00770 <span class="keyword">endif</span>
  860. <a name="l00771"></a>00771
  861. <a name="l00772"></a>00772 <span class="keyword">enddo</span>
  862. <a name="l00773"></a>00773 <span class="keyword">enddo</span>
  863. <a name="l00774"></a>00774
  864. <a name="l00775"></a>00775 return
  865. <a name="l00776"></a>00776 <span class="keyword"> end</span>
  866. <a name="l00777"></a>00777
  867. <a name="l00778"></a>00778
  868. <a name="l00779"></a>00779 <span class="comment">! ========================</span>
  869. <a name="l00780"></a>00780 <span class="comment">! SUBROUTINE READ_GAN_GRID</span>
  870. <a name="l00781"></a>00781 <span class="comment">! ========================</span>
  871. <a name="l00782"></a>00782
  872. <a name="l00783"></a><a class="code" href="ppp_8f90.html#ab9365bc6b428500db06eb0a96278de88">00783</a> <span class="keyword">subroutine </span><a class="code" href="ppp_8f90.html#ab9365bc6b428500db06eb0a96278de88">read_gan_grid</a>(kread)
  873. <a name="l00784"></a>00784 use <span class="keywordflow">pumamod</span>
  874. <a name="l00785"></a>00785
  875. <a name="l00786"></a>00786 <span class="keywordtype">logical</span> :: lexist
  876. <a name="l00787"></a>00787 <span class="keywordtype">integer</span> :: ihead(8)
  877. <a name="l00788"></a>00788 <span class="keywordtype">character(20)</span> :: ynumber
  878. <a name="l00789"></a>00789 <span class="keywordtype">character(256)</span> :: yfilename
  879. <a name="l00790"></a>00790
  880. <a name="l00791"></a>00791 <span class="comment">! Read temperature anomalies for PUMA</span>
  881. <a name="l00792"></a>00792 <span class="comment">! Use formatted Service style</span>
  882. <a name="l00793"></a>00793
  883. <a name="l00794"></a>00794 kread = 0
  884. <a name="l00795"></a>00795
  885. <a name="l00796"></a>00796 <span class="keyword">if</span> (nlat &lt; 1000) <span class="keyword">then</span>
  886. <a name="l00797"></a>00797 <span class="keyword">write</span>(ynumber,<span class="stringliteral">&#39;(I3.3)&#39;</span>) nlat
  887. <a name="l00798"></a>00798 <span class="keyword">else</span>
  888. <a name="l00799"></a>00799 <span class="keyword">write</span>(ynumber,<span class="stringliteral">&#39;(I4.4)&#39;</span>) nlat
  889. <a name="l00800"></a>00800 <span class="keyword">endif</span>
  890. <a name="l00801"></a>00801
  891. <a name="l00802"></a>00802 yfilename = <span class="stringliteral">&quot;N&quot;</span> // trim(adjustl(ynumber)) // <span class="stringliteral">&quot;_surf_0139.sra&quot;</span>
  892. <a name="l00803"></a>00803 <span class="keyword">inquire</span>(file=yfilename,exist=lexist)
  893. <a name="l00804"></a>00804 <span class="keyword">if</span> (lexist) <span class="keyword">then</span>
  894. <a name="l00805"></a>00805 <span class="keyword">write</span>(*,*) <span class="stringliteral">&#39; Reading anomaly temperature from file &lt;&#39;</span>,trim(yfilename),<span class="stringliteral">&#39;&gt;&#39;</span>
  895. <a name="l00806"></a>00806 <span class="keyword">open</span> (65,file=yfilename,form=<span class="stringliteral">&#39;formatted&#39;</span>)
  896. <a name="l00807"></a>00807 <span class="keyword">read</span> (65,*) ihead(:)
  897. <a name="l00808"></a>00808 <span class="keyword">read</span> (65,*) gan(:,:)
  898. <a name="l00809"></a>00809 <span class="keyword">close</span>(65)
  899. <a name="l00810"></a>00810 kread = 1
  900. <a name="l00811"></a>00811 <span class="keyword">else</span>
  901. <a name="l00812"></a>00812 <span class="keyword">write</span>(*,*) <span class="stringliteral">&#39; No anomaly temperature file&#39;</span>
  902. <a name="l00813"></a>00813 <span class="keyword">endif</span>
  903. <a name="l00814"></a>00814 return
  904. <a name="l00815"></a>00815 <span class="keyword"> end subroutine read_gan_grid</span>
  905. <a name="l00816"></a>00816
  906. <a name="l00817"></a>00817
  907. <a name="l00818"></a>00818 <span class="comment">! ========================</span>
  908. <a name="l00819"></a>00819 <span class="comment">! SUBROUTINE READ_ORO_GRID</span>
  909. <a name="l00820"></a>00820 <span class="comment">! ========================</span>
  910. <a name="l00821"></a>00821
  911. <a name="l00822"></a><a class="code" href="ppp_8f90.html#a0160f7188865bdf68c170ebafa9e63ba">00822</a> <span class="keyword">subroutine </span><a class="code" href="ppp_8f90.html#a0160f7188865bdf68c170ebafa9e63ba">read_oro_grid</a>(kread)
  912. <a name="l00823"></a>00823 use <span class="keywordflow">pumamod</span>
  913. <a name="l00824"></a>00824
  914. <a name="l00825"></a>00825 <span class="keywordtype">logical</span> :: lexist
  915. <a name="l00826"></a>00826 <span class="keywordtype">integer</span> :: ihead(8)
  916. <a name="l00827"></a>00827 <span class="keywordtype">character(20)</span> :: ynumber
  917. <a name="l00828"></a>00828 <span class="keywordtype">character(256)</span> :: yfilename
  918. <a name="l00829"></a>00829
  919. <a name="l00830"></a>00830 <span class="comment">! Read orography for PUMA</span>
  920. <a name="l00831"></a>00831 <span class="comment">! Use formatted Service style</span>
  921. <a name="l00832"></a>00832
  922. <a name="l00833"></a>00833 kread = 0
  923. <a name="l00834"></a>00834
  924. <a name="l00835"></a>00835 <span class="keyword">if</span> (nlat &lt; 1000) <span class="keyword">then</span>
  925. <a name="l00836"></a>00836 <span class="keyword">write</span>(ynumber,<span class="stringliteral">&#39;(I3.3)&#39;</span>) nlat
  926. <a name="l00837"></a>00837 <span class="keyword">else</span>
  927. <a name="l00838"></a>00838 <span class="keyword">write</span>(ynumber,<span class="stringliteral">&#39;(I4.4)&#39;</span>) nlat
  928. <a name="l00839"></a>00839 <span class="keyword">endif</span>
  929. <a name="l00840"></a>00840
  930. <a name="l00841"></a>00841 yfilename = <span class="stringliteral">&quot;N&quot;</span> // trim(adjustl(ynumber)) // <span class="stringliteral">&quot;_surf_0129.sra&quot;</span>
  931. <a name="l00842"></a>00842 <span class="keyword">inquire</span>(file=yfilename,exist=lexist)
  932. <a name="l00843"></a>00843 <span class="keyword">if</span> (lexist) <span class="keyword">then</span>
  933. <a name="l00844"></a>00844 <span class="keyword">write</span>(*,*) <span class="stringliteral">&#39; Reading orography from file &lt;&#39;</span>,trim(yfilename),<span class="stringliteral">&#39;&gt;&#39;</span>
  934. <a name="l00845"></a>00845 <span class="keyword">open</span> (65,file=yfilename,form=<span class="stringliteral">&#39;formatted&#39;</span>)
  935. <a name="l00846"></a>00846 <span class="keyword">read</span> (65,*) ihead(:)
  936. <a name="l00847"></a>00847 <span class="keyword">read</span> (65,*) gor(:,:)
  937. <a name="l00848"></a>00848 <span class="keyword">close</span>(65)
  938. <a name="l00849"></a>00849 kread = 1
  939. <a name="l00850"></a>00850 <span class="keyword">else</span>
  940. <a name="l00851"></a>00851 gor(:,:) = 0.0
  941. <a name="l00852"></a>00852 <span class="keyword">write</span>(*,*) <span class="stringliteral">&#39; No orography file - starting with zero orography&#39;</span>
  942. <a name="l00853"></a>00853 <span class="keyword">endif</span>
  943. <a name="l00854"></a>00854 return
  944. <a name="l00855"></a>00855 <span class="keyword"> end subroutine read_oro_grid</span>
  945. <a name="l00856"></a>00856
  946. <a name="l00857"></a>00857
  947. <a name="l00858"></a>00858 <span class="comment">! ====================</span>
  948. <a name="l00859"></a>00859 <span class="comment">! SUBROUTINE WRITE_ORO</span>
  949. <a name="l00860"></a>00860 <span class="comment">! ====================</span>
  950. <a name="l00861"></a>00861
  951. <a name="l00862"></a><a class="code" href="ppp_8f90.html#a874acd25b1eb736cf7273817e3dcbdf8">00862</a> <span class="keyword">subroutine </span><a class="code" href="ppp_8f90.html#a874acd25b1eb736cf7273817e3dcbdf8">write_oro</a>
  952. <a name="l00863"></a>00863 use <span class="keywordflow">pumamod</span>
  953. <a name="l00864"></a>00864
  954. <a name="l00865"></a>00865 dimension itime(8)
  955. <a name="l00866"></a>00866 dimension ihead(8)
  956. <a name="l00867"></a>00867
  957. <a name="l00868"></a>00868 <span class="keywordtype">character(20)</span> :: ynumber
  958. <a name="l00869"></a>00869 <span class="keywordtype">character(256)</span> :: yfilename
  959. <a name="l00870"></a>00870
  960. <a name="l00871"></a>00871 call date_and_time(values=itime)
  961. <a name="l00872"></a>00872
  962. <a name="l00873"></a>00873 <span class="comment">! Write orography for PUMA</span>
  963. <a name="l00874"></a>00874 <span class="comment">! Use formatted Service style</span>
  964. <a name="l00875"></a>00875
  965. <a name="l00876"></a>00876 <span class="keyword">if</span> (nlat &lt; 1000) <span class="keyword">then</span>
  966. <a name="l00877"></a>00877 <span class="keyword">write</span>(ynumber,<span class="stringliteral">&#39;(I3.3)&#39;</span>) nlat
  967. <a name="l00878"></a>00878 <span class="keyword">else</span>
  968. <a name="l00879"></a>00879 <span class="keyword">write</span>(ynumber,<span class="stringliteral">&#39;(I4.4)&#39;</span>) nlat
  969. <a name="l00880"></a>00880 <span class="keyword">endif</span>
  970. <a name="l00881"></a>00881
  971. <a name="l00882"></a>00882 yfilename = <span class="stringliteral">&quot;N&quot;</span> // trim(adjustl(ynumber)) // <span class="stringliteral">&quot;_surf_0129.sra&quot;</span>
  972. <a name="l00883"></a>00883 <span class="keyword">open</span>(60,file=yfilename,form=<span class="stringliteral">&#39;formatted&#39;</span>)
  973. <a name="l00884"></a>00884 ihead(1) = 129 <span class="comment">! code for orography</span>
  974. <a name="l00885"></a>00885 ihead(2) = 0 <span class="comment">! level</span>
  975. <a name="l00886"></a>00886 ihead(3) = itime(1) * 10000 + itime(2) * 100 + itime(3) <span class="comment">! YYYYMMDD</span>
  976. <a name="l00887"></a>00887 ihead(4) = itime(5) * 100 + itime(6) <span class="comment">! HHMM</span>
  977. <a name="l00888"></a>00888 ihead(5) = nlon <span class="comment">! 1. dimension</span>
  978. <a name="l00889"></a>00889 ihead(6) = nlat <span class="comment">! 2. dimension</span>
  979. <a name="l00890"></a>00890 ihead(7) = 1
  980. <a name="l00891"></a>00891 ihead(8) = 0
  981. <a name="l00892"></a>00892
  982. <a name="l00893"></a>00893 <span class="keyword">write</span> (60,<span class="stringliteral">&#39;(8I10)&#39;</span>) ihead(:)
  983. <a name="l00894"></a>00894 <span class="keyword">write</span> (60,<span class="stringliteral">&#39;(8F10.3)&#39;</span>) gor(:,:)
  984. <a name="l00895"></a>00895
  985. <a name="l00896"></a>00896 <span class="keyword">close</span>(60)
  986. <a name="l00897"></a>00897
  987. <a name="l00898"></a>00898 return
  988. <a name="l00899"></a>00899 <span class="keyword"> end subroutine write_oro</span>
  989. <a name="l00900"></a>00900
  990. <a name="l00901"></a>00901
  991. <a name="l00902"></a>00902 <span class="comment">! ===================</span>
  992. <a name="l00903"></a>00903 <span class="comment">! SUBROUTINE WRITE_PS</span>
  993. <a name="l00904"></a>00904 <span class="comment">! ===================</span>
  994. <a name="l00905"></a>00905
  995. <a name="l00906"></a><a class="code" href="ppp_8f90.html#a9ffa8d77da63780dde165c7f4651592a">00906</a> <span class="keyword">subroutine </span><a class="code" href="ppp_8f90.html#a9ffa8d77da63780dde165c7f4651592a">write_ps</a>
  996. <a name="l00907"></a>00907 use <span class="keywordflow">pumamod</span>
  997. <a name="l00908"></a>00908
  998. <a name="l00909"></a>00909 dimension itime(8)
  999. <a name="l00910"></a>00910 dimension ihead(8)
  1000. <a name="l00911"></a>00911
  1001. <a name="l00912"></a>00912 <span class="keywordtype">character(20)</span> :: ynumber
  1002. <a name="l00913"></a>00913 <span class="keywordtype">character(256)</span> :: yfilename
  1003. <a name="l00914"></a>00914
  1004. <a name="l00915"></a>00915 <span class="keywordtype">real</span> :: zpres(nlon,nlat)
  1005. <a name="l00916"></a>00916
  1006. <a name="l00917"></a>00917 call date_and_time(values=itime)
  1007. <a name="l00918"></a>00918
  1008. <a name="l00919"></a>00919 <span class="comment">! Write surface pressure for PUMA</span>
  1009. <a name="l00920"></a>00920 <span class="comment">! Use formatted Service style</span>
  1010. <a name="l00921"></a>00921
  1011. <a name="l00922"></a>00922 <span class="keyword">if</span> (nlat &lt; 1000) <span class="keyword">then</span>
  1012. <a name="l00923"></a>00923 <span class="keyword">write</span>(ynumber,<span class="stringliteral">&#39;(I3.3)&#39;</span>) nlat
  1013. <a name="l00924"></a>00924 <span class="keyword">else</span>
  1014. <a name="l00925"></a>00925 <span class="keyword">write</span>(ynumber,<span class="stringliteral">&#39;(I4.4)&#39;</span>) nlat
  1015. <a name="l00926"></a>00926 <span class="keyword">endif</span>
  1016. <a name="l00927"></a>00927 yfilename = <span class="stringliteral">&quot;N&quot;</span> // trim(adjustl(ynumber)) // <span class="stringliteral">&quot;_surf_0134.sra&quot;</span>
  1017. <a name="l00928"></a>00928 <span class="keyword">open</span>(60,file=yfilename,form=<span class="stringliteral">&#39;formatted&#39;</span>)
  1018. <a name="l00929"></a>00929 ihead(1) = 134 <span class="comment">! code for surface pressure [hPa]</span>
  1019. <a name="l00930"></a>00930 ihead(2) = 0 <span class="comment">! level</span>
  1020. <a name="l00931"></a>00931 ihead(3) = itime(1) * 10000 + itime(2) * 100 + itime(3) <span class="comment">! YYYYMMDD</span>
  1021. <a name="l00932"></a>00932 ihead(4) = itime(5) * 100 + itime(6) <span class="comment">! HHMM</span>
  1022. <a name="l00933"></a>00933 ihead(5) = nlon <span class="comment">! 1. dimension</span>
  1023. <a name="l00934"></a>00934 ihead(6) = nlat <span class="comment">! 2. dimension</span>
  1024. <a name="l00935"></a>00935 ihead(7) = 1
  1025. <a name="l00936"></a>00936 ihead(8) = 0
  1026. <a name="l00937"></a>00937
  1027. <a name="l00938"></a>00938 zpres(:,:) = 0.01 * PSURF * exp(gsp(:,:)) <span class="comment">! Store as [hPa]</span>
  1028. <a name="l00939"></a>00939
  1029. <a name="l00940"></a>00940 <span class="keyword">write</span> (60,<span class="stringliteral">&#39;(8I10)&#39;</span>) ihead(:)
  1030. <a name="l00941"></a>00941 <span class="keyword">write</span> (60,<span class="stringliteral">&#39;(8F10.4)&#39;</span>) zpres(:,:)
  1031. <a name="l00942"></a>00942
  1032. <a name="l00943"></a>00943 <span class="keyword">close</span>(60)
  1033. <a name="l00944"></a>00944
  1034. <a name="l00945"></a>00945 return
  1035. <a name="l00946"></a>00946 <span class="keyword"> end subroutine write_ps</span>
  1036. <a name="l00947"></a>00947
  1037. <a name="l00948"></a>00948
  1038. <a name="l00949"></a>00949 <span class="comment">! ====================</span>
  1039. <a name="l00950"></a>00950 <span class="comment">! SUBROUTINE WRITE_GTC</span>
  1040. <a name="l00951"></a>00951 <span class="comment">! ====================</span>
  1041. <a name="l00952"></a>00952
  1042. <a name="l00953"></a><a class="code" href="ppp_8f90.html#ae20643bdbfabfc228f286eec7a42e944">00953</a> <span class="keyword">subroutine </span><a class="code" href="ppp_8f90.html#ae20643bdbfabfc228f286eec7a42e944">write_gtc</a>
  1043. <a name="l00954"></a>00954 use <span class="keywordflow">pumamod</span>
  1044. <a name="l00955"></a>00955
  1045. <a name="l00956"></a>00956 dimension itime(8)
  1046. <a name="l00957"></a>00957 dimension ihead(8)
  1047. <a name="l00958"></a>00958
  1048. <a name="l00959"></a>00959 <span class="keywordtype">character(20)</span> :: ynumber
  1049. <a name="l00960"></a>00960 <span class="keywordtype">character(256)</span> :: yfilename
  1050. <a name="l00961"></a>00961
  1051. <a name="l00962"></a>00962 call date_and_time(values=itime)
  1052. <a name="l00963"></a>00963
  1053. <a name="l00964"></a>00964 <span class="comment">! Write constant part of Tr</span>
  1054. <a name="l00965"></a>00965 <span class="comment">! Use formatted Service style</span>
  1055. <a name="l00966"></a>00966
  1056. <a name="l00967"></a>00967 <span class="keyword">if</span> (nlat &lt; 1000) <span class="keyword">then</span>
  1057. <a name="l00968"></a>00968 <span class="keyword">write</span>(ynumber,<span class="stringliteral">&#39;(I3.3)&#39;</span>) nlat
  1058. <a name="l00969"></a>00969 <span class="keyword">else</span>
  1059. <a name="l00970"></a>00970 <span class="keyword">write</span>(ynumber,<span class="stringliteral">&#39;(I4.4)&#39;</span>) nlat
  1060. <a name="l00971"></a>00971 <span class="keyword">endif</span>
  1061. <a name="l00972"></a>00972 yfilename = <span class="stringliteral">&quot;N&quot;</span> // trim(adjustl(ynumber)) // <span class="stringliteral">&quot;_surf_0121.sra&quot;</span>
  1062. <a name="l00973"></a>00973
  1063. <a name="l00974"></a>00974 <span class="keyword">open</span>(60,file=yfilename,form=<span class="stringliteral">&#39;formatted&#39;</span>)
  1064. <a name="l00975"></a>00975 ihead(1) = 121 <span class="comment">! code for Tr const</span>
  1065. <a name="l00976"></a>00976 ihead(2) = 0 <span class="comment">! level</span>
  1066. <a name="l00977"></a>00977 ihead(3) = itime(1) * 10000 + itime(2) * 100 + itime(3) <span class="comment">! YYYYMMDD</span>
  1067. <a name="l00978"></a>00978 ihead(4) = itime(5) * 100 + itime(6) <span class="comment">! HHMM</span>
  1068. <a name="l00979"></a>00979 ihead(5) = nlon <span class="comment">! 1. dimension</span>
  1069. <a name="l00980"></a>00980 ihead(6) = nlat <span class="comment">! 2. dimension</span>
  1070. <a name="l00981"></a>00981 ihead(7) = 1
  1071. <a name="l00982"></a>00982 ihead(8) = 0
  1072. <a name="l00983"></a>00983
  1073. <a name="l00984"></a>00984 <span class="keyword">do</span> jlev = 1 , nlev
  1074. <a name="l00985"></a>00985 ihead(2) = jlev
  1075. <a name="l00986"></a>00986 <span class="keyword">write</span> (60,<span class="stringliteral">&#39;(8I10)&#39;</span>) ihead(:)
  1076. <a name="l00987"></a>00987 <span class="keyword">write</span> (60,<span class="stringliteral">&#39;(8F10.4)&#39;</span>) gtc(:,:,jlev)
  1077. <a name="l00988"></a>00988 <span class="keyword">enddo</span>
  1078. <a name="l00989"></a>00989
  1079. <a name="l00990"></a>00990 <span class="keyword">close</span>(60)
  1080. <a name="l00991"></a>00991
  1081. <a name="l00992"></a>00992 return
  1082. <a name="l00993"></a>00993 <span class="keyword"> end subroutine write_gtc</span>
  1083. <a name="l00994"></a>00994
  1084. <a name="l00995"></a>00995
  1085. <a name="l00996"></a>00996
  1086. <a name="l00997"></a>00997 <span class="comment">! ====================</span>
  1087. <a name="l00998"></a>00998 <span class="comment">! SUBROUTINE WRITE_GTV</span>
  1088. <a name="l00999"></a>00999 <span class="comment">! ====================</span>
  1089. <a name="l01000"></a>01000
  1090. <a name="l01001"></a><a class="code" href="ppp_8f90.html#a89cf301d11495b03846a06a6b3cb095f">01001</a> <span class="keyword">subroutine </span><a class="code" href="ppp_8f90.html#a89cf301d11495b03846a06a6b3cb095f">write_gtv</a>
  1091. <a name="l01002"></a>01002 use <span class="keywordflow">pumamod</span>
  1092. <a name="l01003"></a>01003
  1093. <a name="l01004"></a>01004 dimension itime(8)
  1094. <a name="l01005"></a>01005 dimension ihead(8)
  1095. <a name="l01006"></a>01006
  1096. <a name="l01007"></a>01007 <span class="keywordtype">character(20)</span> :: ynumber
  1097. <a name="l01008"></a>01008 <span class="keywordtype">character(256)</span> :: yfilename
  1098. <a name="l01009"></a>01009
  1099. <a name="l01010"></a>01010 call date_and_time(values=itime)
  1100. <a name="l01011"></a>01011
  1101. <a name="l01012"></a>01012 <span class="comment">! Write variable part of Tr</span>
  1102. <a name="l01013"></a>01013 <span class="comment">! Use formatted Service style</span>
  1103. <a name="l01014"></a>01014
  1104. <a name="l01015"></a>01015 <span class="keyword">if</span> (nlat &lt; 1000) <span class="keyword">then</span>
  1105. <a name="l01016"></a>01016 <span class="keyword">write</span>(ynumber,<span class="stringliteral">&#39;(I3.3)&#39;</span>) nlat
  1106. <a name="l01017"></a>01017 <span class="keyword">else</span>
  1107. <a name="l01018"></a>01018 <span class="keyword">write</span>(ynumber,<span class="stringliteral">&#39;(I4.4)&#39;</span>) nlat
  1108. <a name="l01019"></a>01019 <span class="keyword">endif</span>
  1109. <a name="l01020"></a>01020 yfilename = <span class="stringliteral">&quot;N&quot;</span> // trim(adjustl(ynumber)) // <span class="stringliteral">&quot;_surf_0122.sra&quot;</span>
  1110. <a name="l01021"></a>01021 <span class="keyword">open</span>(60,file=yfilename,form=<span class="stringliteral">&#39;formatted&#39;</span>)
  1111. <a name="l01022"></a>01022 ihead(1) = 122 <span class="comment">! code for Tr variable</span>
  1112. <a name="l01023"></a>01023 ihead(2) = 0 <span class="comment">! level</span>
  1113. <a name="l01024"></a>01024 ihead(3) = itime(1) * 10000 + itime(2) * 100 + itime(3) <span class="comment">! YYYYMMDD</span>
  1114. <a name="l01025"></a>01025 ihead(4) = itime(5) * 100 + itime(6) <span class="comment">! HHMM</span>
  1115. <a name="l01026"></a>01026 ihead(5) = nlon <span class="comment">! 1. dimension</span>
  1116. <a name="l01027"></a>01027 ihead(6) = nlat <span class="comment">! 2. dimension</span>
  1117. <a name="l01028"></a>01028 ihead(7) = 1
  1118. <a name="l01029"></a>01029 ihead(8) = 0
  1119. <a name="l01030"></a>01030
  1120. <a name="l01031"></a>01031 <span class="keyword">do</span> jlev = 1 , nlev
  1121. <a name="l01032"></a>01032 ihead(2) = jlev
  1122. <a name="l01033"></a>01033 <span class="keyword">write</span> (60,<span class="stringliteral">&#39;(8I10)&#39;</span>) ihead(:)
  1123. <a name="l01034"></a>01034 <span class="keyword">write</span> (60,<span class="stringliteral">&#39;(8F10.4)&#39;</span>) gtv(:,:,jlev)
  1124. <a name="l01035"></a>01035 <span class="keyword">enddo</span>
  1125. <a name="l01036"></a>01036
  1126. <a name="l01037"></a>01037 <span class="keyword">close</span>(60)
  1127. <a name="l01038"></a>01038
  1128. <a name="l01039"></a>01039 return
  1129. <a name="l01040"></a>01040 <span class="keyword"> end subroutine write_gtv</span>
  1130. <a name="l01041"></a>01041
  1131. <a name="l01042"></a>01042
  1132. <a name="l01043"></a>01043 <span class="comment">! ========================</span>
  1133. <a name="l01044"></a>01044 <span class="comment">! SUBROUTINE WRITE_VARGP2D</span>
  1134. <a name="l01045"></a>01045 <span class="comment">! ========================</span>
  1135. <a name="l01046"></a>01046
  1136. <a name="l01047"></a><a class="code" href="ppp_8f90.html#a2d0d1495a01c220ffb26fc235bcbfc8d">01047</a> <span class="keyword">subroutine </span><a class="code" href="ppp_8f90.html#a2d0d1495a01c220ffb26fc235bcbfc8d">write_vargp2D</a>(zgp,kcode)
  1137. <a name="l01048"></a>01048 use <span class="keywordflow">pumamod</span>
  1138. <a name="l01049"></a>01049
  1139. <a name="l01050"></a>01050 dimension itime(8)
  1140. <a name="l01051"></a>01051 dimension ihead(8)
  1141. <a name="l01052"></a>01052
  1142. <a name="l01053"></a>01053 <span class="keywordtype">character(20)</span> :: ynumber
  1143. <a name="l01054"></a>01054 <span class="keywordtype">character(256)</span> :: yfilename
  1144. <a name="l01055"></a>01055 <span class="keywordtype">real</span> :: zgp(nlon,nlat)
  1145. <a name="l01056"></a>01056
  1146. <a name="l01057"></a>01057
  1147. <a name="l01058"></a>01058 call date_and_time(values=itime)
  1148. <a name="l01059"></a>01059
  1149. <a name="l01060"></a>01060 <span class="comment">! produce file name to be written</span>
  1150. <a name="l01061"></a>01061 <span class="keyword">if</span> (NLAT &lt; 1000) <span class="keyword">then</span>
  1151. <a name="l01062"></a>01062 <span class="keyword">write</span>(yfilename,<span class="stringliteral">&#39;(&quot;N&quot;,I3.3,&quot;_surf_&quot;,I4.4,&quot;.sra&quot;)&#39;</span>) NLAT,kcode
  1152. <a name="l01063"></a>01063 <span class="keyword">else</span>
  1153. <a name="l01064"></a>01064 <span class="keyword">write</span>(yfilename,<span class="stringliteral">&#39;(&quot;N&quot;,I4.4,&quot;_surf_&quot;,I4.4,&quot;.sra&quot;)&#39;</span>) NLAT,kcode
  1154. <a name="l01065"></a>01065 <span class="keyword">endif</span>
  1155. <a name="l01066"></a>01066
  1156. <a name="l01067"></a>01067
  1157. <a name="l01068"></a>01068
  1158. <a name="l01069"></a>01069 <span class="keyword">open</span>(60,file=yfilename,form=<span class="stringliteral">&#39;formatted&#39;</span>)
  1159. <a name="l01070"></a>01070 ihead(1) = kcode <span class="comment">! code for reciprocal of damping time scale </span>
  1160. <a name="l01071"></a>01071 ihead(2) = 0 <span class="comment">! level</span>
  1161. <a name="l01072"></a>01072 ihead(3) = itime(1) * 10000 + itime(2) * 100 + itime(3) <span class="comment">! YYYYMMDD</span>
  1162. <a name="l01073"></a>01073 ihead(4) = itime(5) * 100 + itime(6) <span class="comment">! HHMM</span>
  1163. <a name="l01074"></a>01074 ihead(5) = nlon <span class="comment">! 1. dimension</span>
  1164. <a name="l01075"></a>01075 ihead(6) = nlat <span class="comment">! 2. dimension</span>
  1165. <a name="l01076"></a>01076 ihead(7) = 1
  1166. <a name="l01077"></a>01077 ihead(8) = 0
  1167. <a name="l01078"></a>01078
  1168. <a name="l01079"></a>01079 <span class="keyword">select</span> <span class="keyword">case</span>(kcode)
  1169. <a name="l01080"></a>01080 <span class="keyword">case</span>(129,134)
  1170. <a name="l01081"></a>01081 ihead(2) = 0
  1171. <a name="l01082"></a>01082 <span class="keyword">write</span> (60,<span class="stringliteral">&#39;(8I10)&#39;</span>) ihead(:)
  1172. <a name="l01083"></a>01083 <span class="keyword">write</span> (60,<span class="stringliteral">&#39;(8(X,E16.10))&#39;</span>) zgp(:,:)
  1173. <a name="l01084"></a>01084 <span class="keyword">end select</span>
  1174. <a name="l01085"></a>01085
  1175. <a name="l01086"></a>01086 <span class="keyword">close</span>(60)
  1176. <a name="l01087"></a>01087
  1177. <a name="l01088"></a>01088 return
  1178. <a name="l01089"></a>01089 <span class="keyword"> end subroutine write_vargp2D</span>
  1179. <a name="l01090"></a>01090
  1180. <a name="l01091"></a>01091 <span class="comment">! ========================</span>
  1181. <a name="l01092"></a>01092 <span class="comment">! SUBROUTINE WRITE_VARGP3D</span>
  1182. <a name="l01093"></a>01093 <span class="comment">! ========================</span>
  1183. <a name="l01094"></a>01094
  1184. <a name="l01095"></a><a class="code" href="ppp_8f90.html#a5a952435a8bde10e925935c211aa9c4f">01095</a> <span class="keyword">subroutine </span><a class="code" href="ppp_8f90.html#a5a952435a8bde10e925935c211aa9c4f">write_vargp3D</a>(zgp,kcode,klev)
  1185. <a name="l01096"></a>01096 use <span class="keywordflow">pumamod</span>
  1186. <a name="l01097"></a>01097
  1187. <a name="l01098"></a>01098 dimension itime(8)
  1188. <a name="l01099"></a>01099 dimension ihead(8)
  1189. <a name="l01100"></a>01100
  1190. <a name="l01101"></a>01101 <span class="keywordtype">character(20)</span> :: ynumber
  1191. <a name="l01102"></a>01102 <span class="keywordtype">character(256)</span> :: yfilename
  1192. <a name="l01103"></a>01103 <span class="keywordtype">real</span> :: zgp(nlon,nlat,klev)
  1193. <a name="l01104"></a>01104
  1194. <a name="l01105"></a>01105
  1195. <a name="l01106"></a>01106 call date_and_time(values=itime)
  1196. <a name="l01107"></a>01107
  1197. <a name="l01108"></a>01108 <span class="comment">! produce file name to be written</span>
  1198. <a name="l01109"></a>01109 <span class="keyword">if</span> (NLAT &lt; 1000) <span class="keyword">then</span>
  1199. <a name="l01110"></a>01110 <span class="keyword">write</span>(yfilename,<span class="stringliteral">&#39;(&quot;N&quot;,I3.3,&quot;_surf_&quot;,I4.4,&quot;.sra&quot;)&#39;</span>) NLAT,kcode
  1200. <a name="l01111"></a>01111 <span class="keyword">else</span>
  1201. <a name="l01112"></a>01112 <span class="keyword">write</span>(yfilename,<span class="stringliteral">&#39;(&quot;N&quot;,I4.4,&quot;_surf_&quot;,I4.4,&quot;.sra&quot;)&#39;</span>) NLAT,kcode
  1202. <a name="l01113"></a>01113 <span class="keyword">endif</span>
  1203. <a name="l01114"></a>01114
  1204. <a name="l01115"></a>01115
  1205. <a name="l01116"></a>01116
  1206. <a name="l01117"></a>01117 <span class="keyword">open</span>(60,file=yfilename,form=<span class="stringliteral">&#39;formatted&#39;</span>)
  1207. <a name="l01118"></a>01118 ihead(1) = kcode <span class="comment">! code for reciprocal of damping time scale </span>
  1208. <a name="l01119"></a>01119 ihead(2) = 0 <span class="comment">! level</span>
  1209. <a name="l01120"></a>01120 ihead(3) = itime(1) * 10000 + itime(2) * 100 + itime(3) <span class="comment">! YYYYMMDD</span>
  1210. <a name="l01121"></a>01121 ihead(4) = itime(5) * 100 + itime(6) <span class="comment">! HHMM</span>
  1211. <a name="l01122"></a>01122 ihead(5) = nlon <span class="comment">! 1. dimension</span>
  1212. <a name="l01123"></a>01123 ihead(6) = nlat <span class="comment">! 2. dimension</span>
  1213. <a name="l01124"></a>01124 ihead(7) = 1
  1214. <a name="l01125"></a>01125 ihead(8) = 0
  1215. <a name="l01126"></a>01126
  1216. <a name="l01127"></a>01127 <span class="keyword">select</span> <span class="keyword">case</span>(kcode)
  1217. <a name="l01128"></a>01128 <span class="keyword">case</span>(121,122,123,124,125,126)
  1218. <a name="l01129"></a>01129 <span class="keyword">do</span> jlev = 1 , klev
  1219. <a name="l01130"></a>01130 ihead(2) = jlev
  1220. <a name="l01131"></a>01131 <span class="keyword">write</span> (60,<span class="stringliteral">&#39;(8I10)&#39;</span>) ihead(:)
  1221. <a name="l01132"></a>01132 <span class="keyword">write</span> (60,<span class="stringliteral">&#39;(8(X,E16.10))&#39;</span>) zgp(:,:,jlev)
  1222. <a name="l01133"></a>01133 <span class="keyword">enddo</span>
  1223. <a name="l01134"></a>01134 <span class="keyword">end select</span>
  1224. <a name="l01135"></a>01135
  1225. <a name="l01136"></a>01136 <span class="keyword">close</span>(60)
  1226. <a name="l01137"></a>01137
  1227. <a name="l01138"></a>01138 return
  1228. <a name="l01139"></a>01139 <span class="keyword"> end subroutine write_vargp3D</span>
  1229. <a name="l01140"></a>01140
  1230. <a name="l01141"></a>01141
  1231. <a name="l01142"></a>01142 <span class="comment">! ====================</span>
  1232. <a name="l01143"></a>01143 <span class="comment">! SUBROUTINE GRIDPOINT</span>
  1233. <a name="l01144"></a>01144 <span class="comment">! ====================</span>
  1234. <a name="l01145"></a>01145
  1235. <a name="l01146"></a><a class="code" href="ppp_8f90.html#aefdbfd36b330ce29d344d428431119c9">01146</a> <span class="keyword">subroutine </span><a class="code" href="ppp_8f90.html#aefdbfd36b330ce29d344d428431119c9">gridpoint</a>
  1236. <a name="l01147"></a>01147 use <span class="keywordflow">pumamod</span>
  1237. <a name="l01148"></a>01148 <span class="comment">!!</span>
  1238. <a name="l01149"></a>01149 dimension ihead(8)
  1239. <a name="l01150"></a>01150 dimension zprof(nlev)
  1240. <a name="l01151"></a>01151 dimension zzprof(nlon,nlat,nlev)
  1241. <a name="l01152"></a>01152 <span class="keywordtype">character(256)</span> :: yfilename,yfohead,yfodata,ymessage
  1242. <a name="l01153"></a>01153 <span class="keywordtype">logical</span> :: exist
  1243. <a name="l01154"></a>01154
  1244. <a name="l01155"></a>01155 <span class="comment">! Read orography</span>
  1245. <a name="l01156"></a>01156
  1246. <a name="l01157"></a>01157 gor(:,:) = 0.0
  1247. <a name="l01158"></a>01158 <span class="keyword">if</span> (noro &gt; 0) <span class="keyword">then</span>
  1248. <a name="l01159"></a>01159 call <a class="code" href="ppp_8f90.html#a0160f7188865bdf68c170ebafa9e63ba">read_oro_grid</a>(iread)
  1249. <a name="l01160"></a>01160 <span class="keyword">endif</span>
  1250. <a name="l01161"></a>01161
  1251. <a name="l01162"></a>01162 <span class="comment">! Read ground anomaly temperature</span>
  1252. <a name="l01163"></a>01163
  1253. <a name="l01164"></a>01164 call <a class="code" href="ppp_8f90.html#ab9365bc6b428500db06eb0a96278de88">read_gan_grid</a>(iread)
  1254. <a name="l01165"></a>01165
  1255. <a name="l01166"></a>01166 call <a class="code" href="legsym_8f90.html#aec404fc15930c6e4584c088a399ea099">sp2fc</a>(sns,gns)
  1256. <a name="l01167"></a>01167 call <a class="code" href="legsym_8f90.html#aec404fc15930c6e4584c088a399ea099">sp2fc</a>(sep,gep)
  1257. <a name="l01168"></a>01168 call <a class="code" href="legsym_8f90.html#aec404fc15930c6e4584c088a399ea099">sp2fc</a>(stg,gtg)
  1258. <a name="l01169"></a>01169
  1259. <a name="l01170"></a>01170 call <a class="code" href="legsym_8f90.html#a308819246e409c8dbe1e778d304ef415">alt2reg</a>(gns,1)
  1260. <a name="l01171"></a>01171 call <a class="code" href="legsym_8f90.html#a308819246e409c8dbe1e778d304ef415">alt2reg</a>(gep,1)
  1261. <a name="l01172"></a>01172 call <a class="code" href="legsym_8f90.html#a308819246e409c8dbe1e778d304ef415">alt2reg</a>(gtg,1)
  1262. <a name="l01173"></a>01173
  1263. <a name="l01174"></a>01174
  1264. <a name="l01175"></a>01175 call <a class="code" href="fft991mod_8f90.html#aa0cf4000171aaaf40d5e9850f73703db">fc2gp</a>(gns,nlon,nlat)
  1265. <a name="l01176"></a>01176 call <a class="code" href="fft991mod_8f90.html#aa0cf4000171aaaf40d5e9850f73703db">fc2gp</a>(gep,nlon,nlat)
  1266. <a name="l01177"></a>01177 call <a class="code" href="fft991mod_8f90.html#aa0cf4000171aaaf40d5e9850f73703db">fc2gp</a>(gtg,nlon,nlat)
  1267. <a name="l01178"></a>01178
  1268. <a name="l01179"></a>01179 gtg(:,:) = gtg(:,:) + gan(:,:)
  1269. <a name="l01180"></a>01180
  1270. <a name="l01181"></a>01181 call <a class="code" href="ppp_8f90.html#a4b65f4d96e40adbdb96584789e31c413">modify_orography</a>(gor) <span class="comment">! User interface</span>
  1271. <a name="l01182"></a>01182
  1272. <a name="l01183"></a>01183 <span class="keyword">if</span> (nyoden /= 0) <span class="keyword">then</span>
  1273. <a name="l01184"></a>01184 call <a class="code" href="ppp_8f90.html#a76e236098c9f27c53d3a8827d11554cf">yoden</a>
  1274. <a name="l01185"></a>01185 <span class="keyword">else</span>
  1275. <a name="l01186"></a>01186 <span class="comment">! compute ground temperature on orography surface</span>
  1276. <a name="l01187"></a>01187
  1277. <a name="l01188"></a>01188 gtg(:,:) = gtg(:,:) - ALR * gor(:,:) / GA <span class="comment">! [gpm]</span>
  1278. <a name="l01189"></a>01189
  1279. <a name="l01190"></a>01190 call <a class="code" href="ppp_8f90.html#a7c8f4c3a7e4437cad6804ae0ce847552">modify_ground_temperature</a>(gtg) <span class="comment">! User interface</span>
  1280. <a name="l01191"></a>01191
  1281. <a name="l01192"></a>01192 call <a class="code" href="ppp_8f90.html#a7f841b10d9e4f470513770f91f92c0bc">anomaly_factors</a> <span class="comment">! Compute factors for NS &amp; EP</span>
  1282. <a name="l01193"></a>01193
  1283. <a name="l01194"></a>01194 <span class="comment">! Compute vertical profile for each column</span>
  1284. <a name="l01195"></a>01195
  1285. <a name="l01196"></a>01196 <span class="keyword">do</span> jlat = 1 , nlat
  1286. <a name="l01197"></a>01197 <span class="keyword">do</span> jlon = 1 , nlon
  1287. <a name="l01198"></a>01198 call <a class="code" href="ppp_8f90.html#a109d8c58aa308107712782398903ea71">tprofile</a>(gtg(jlon,jlat),zprof,gor(jlon,jlat)/GA)
  1288. <a name="l01199"></a>01199 gtc(jlon,jlat,:) = zprof(:)
  1289. <a name="l01200"></a>01200 <span class="keyword">enddo</span>
  1290. <a name="l01201"></a>01201 <span class="keyword">enddo</span>
  1291. <a name="l01202"></a>01202
  1292. <a name="l01203"></a>01203 <span class="comment">! Modify Restoration Temperature with EP mode</span>
  1293. <a name="l01204"></a>01204
  1294. <a name="l01205"></a>01205 <span class="keyword">do</span> jlev = 1 , nlev
  1295. <a name="l01206"></a>01206 gtc(:,:,jlev) = gtc(:,:,jlev) + gaf(:,:,jlev) * gep(:,:)
  1296. <a name="l01207"></a>01207 <span class="keyword">enddo</span>
  1297. <a name="l01208"></a>01208
  1298. <a name="l01209"></a>01209 <span class="comment">! Compute vertical profile for each column including variable NS mode</span>
  1299. <a name="l01210"></a>01210
  1300. <a name="l01211"></a>01211 <span class="keyword">do</span> jlev = 1 , nlev
  1301. <a name="l01212"></a>01212 gtv(:,:,jlev) = gaf(:,:,jlev) * gns(:,:)
  1302. <a name="l01213"></a>01213 <span class="keyword">enddo</span>
  1303. <a name="l01214"></a>01214
  1304. <a name="l01215"></a>01215 <span class="keyword">endif</span> <span class="comment">! (nyoden == 1)</span>
  1305. <a name="l01216"></a>01216
  1306. <a name="l01217"></a>01217 <span class="comment">! Initialize surface pressure (LnPs)</span>
  1307. <a name="l01218"></a>01218
  1308. <a name="l01219"></a>01219 <span class="keyword">do</span> jlat = 1 , nlat
  1309. <a name="l01220"></a>01220 <span class="keyword">do</span> jlon = 1 , nlon
  1310. <a name="l01221"></a>01221 gsp(jlon,jlat) = -gor(jlon,jlat) / (GASCON*tgr)
  1311. <a name="l01222"></a>01222 <span class="keyword">enddo</span>
  1312. <a name="l01223"></a>01223 <span class="keyword">enddo</span>
  1313. <a name="l01224"></a>01224
  1314. <a name="l01225"></a>01225 <span class="comment">! if (nhelsua == 1 .or. nhelsua == 2) then</span>
  1315. <a name="l01226"></a>01226 <span class="keyword">if</span> (nhelsua &gt; 0) <span class="keyword">then</span>
  1316. <a name="l01227"></a>01227 call <a class="code" href="ppp_8f90.html#a6e5d7b2cf5629dbed1ee32fc656595dc">heldsuarez</a>
  1317. <a name="l01228"></a>01228 gor(:,:) = 0.0
  1318. <a name="l01229"></a>01229 gsp(:,:) = 0.0
  1319. <a name="l01230"></a>01230 <span class="keyword">endif</span>
  1320. <a name="l01231"></a>01231
  1321. <a name="l01232"></a>01232
  1322. <a name="l01233"></a>01233 <span class="keyword">if</span> (nstrato == 1) <span class="keyword">then</span>
  1323. <a name="l01234"></a>01234 call <a class="code" href="ppp_8f90.html#aa036704b2d766c3d7b7b48756b972d05">setzt2</a> <span class="comment">! Torben&#39;s forcing initialisation</span>
  1324. <a name="l01235"></a>01235 <span class="keyword">endif</span>
  1325. <a name="l01236"></a>01236
  1326. <a name="l01237"></a>01237 call <a class="code" href="ppp_8f90.html#a874acd25b1eb736cf7273817e3dcbdf8">write_oro</a>
  1327. <a name="l01238"></a>01238 call <a class="code" href="ppp_8f90.html#a9ffa8d77da63780dde165c7f4651592a">write_ps</a>
  1328. <a name="l01239"></a>01239 call <a class="code" href="ppp_8f90.html#ae20643bdbfabfc228f286eec7a42e944">write_gtc</a>
  1329. <a name="l01240"></a>01240 call <a class="code" href="ppp_8f90.html#a89cf301d11495b03846a06a6b3cb095f">write_gtv</a>
  1330. <a name="l01241"></a>01241 call <a class="code" href="ppp_8f90.html#a5a952435a8bde10e925935c211aa9c4f">write_vargp3D</a>(gtdamp,123,nlev)
  1331. <a name="l01242"></a>01242 <span class="keyword">if</span> (ntestgp == 1) <span class="keyword">then</span>
  1332. <a name="l01243"></a>01243 call <a class="code" href="ppp_8f90.html#a5a952435a8bde10e925935c211aa9c4f">write_vargp3D</a>(gtc,124,nlev)
  1333. <a name="l01244"></a>01244 call <a class="code" href="ppp_8f90.html#a5a952435a8bde10e925935c211aa9c4f">write_vargp3D</a>(gtv,125,nlev)
  1334. <a name="l01245"></a>01245 call <a class="code" href="ppp_8f90.html#a5a952435a8bde10e925935c211aa9c4f">write_vargp3D</a>(gtdamp,126,nlev)
  1335. <a name="l01246"></a>01246 <span class="keyword">endif</span>
  1336. <a name="l01247"></a>01247
  1337. <a name="l01248"></a>01248 call <a class="code" href="ppp_8f90.html#aa92d6879772b364173e13521d835895e">printprofile</a>
  1338. <a name="l01249"></a>01249
  1339. <a name="l01250"></a>01250 return
  1340. <a name="l01251"></a>01251 <span class="keyword"> end</span>
  1341. <a name="l01252"></a>01252
  1342. <a name="l01253"></a>01253 <span class="comment">! =====================</span>
  1343. <a name="l01254"></a>01254 <span class="comment">! SUBROUTINE HELDSUAREZ</span>
  1344. <a name="l01255"></a>01255 <span class="comment">! =====================</span>
  1345. <a name="l01256"></a>01256
  1346. <a name="l01257"></a><a class="code" href="ppp_8f90.html#a6e5d7b2cf5629dbed1ee32fc656595dc">01257</a> <span class="keyword">subroutine </span><a class="code" href="ppp_8f90.html#a6e5d7b2cf5629dbed1ee32fc656595dc">heldsuarez</a>
  1347. <a name="l01258"></a>01258 use <span class="keywordflow">pumamod</span>
  1348. <a name="l01259"></a>01259
  1349. <a name="l01260"></a>01260 <span class="comment">! Set up the restoration temperature field according to that given</span>
  1350. <a name="l01261"></a>01261 <span class="comment">! in Held &amp; Suarez (1994, Bul. Amer. Meteor. Soc.).</span>
  1351. <a name="l01262"></a>01262 <span class="comment">! Only difference: There is an offset of 1./3. added to the sine of</span>
  1352. <a name="l01263"></a>01263 <span class="comment">! latitude. The reason is that the namelist parameter TGR still</span>
  1353. <a name="l01264"></a>01264 <span class="comment">! represents the global mean of surface restoration temperature.</span>
  1354. <a name="l01265"></a>01265 <span class="comment">!</span>
  1355. <a name="l01266"></a>01266 <span class="comment">! ==&gt; Set TGR=295. in order to get exactly the same restoration</span>
  1356. <a name="l01267"></a>01267 <span class="comment">! temperature field as in Held &amp; Suarez (1994).</span>
  1357. <a name="l01268"></a>01268 <span class="comment">!</span>
  1358. <a name="l01269"></a>01269 <span class="comment">! ==&gt; DTNS in H&amp;S (1994) is the equator-pole difference while</span>
  1359. <a name="l01270"></a>01270 <span class="comment">! PUMA uses DTNS for pole-pole difference. Therefore we use</span>
  1360. <a name="l01271"></a>01271 <span class="comment">! 0.5 * dtns in this subroutine.</span>
  1361. <a name="l01272"></a>01272
  1362. <a name="l01273"></a>01273
  1363. <a name="l01274"></a>01274 <span class="comment">! Produce restoration temperature</span>
  1364. <a name="l01275"></a>01275
  1365. <a name="l01276"></a>01276 <span class="keywordtype">real</span> :: zp0,z3
  1366. <a name="l01277"></a>01277 <span class="keywordtype">real</span> :: zdtc,zdtv,zsip
  1367. <a name="l01278"></a>01278
  1368. <a name="l01279"></a>01279 zp0 = 100000.
  1369. <a name="l01280"></a>01280 z3 = 1.0 / 3.0
  1370. <a name="l01281"></a>01281 <span class="keyword">if</span> (nhelsua == 1 .or. nhelsua == 2) <span class="keyword">then</span>
  1371. <a name="l01282"></a>01282 <span class="keyword">do</span> jlev=1,nlev
  1372. <a name="l01283"></a>01283 <span class="keyword">do</span> jlat=1,nlat
  1373. <a name="l01284"></a>01284 zsip = sigma(jlev)*PSURF/zp0
  1374. <a name="l01285"></a>01285 zdtc = dtep * (sid(jlat)**2-z3) + dtzz * log(zsip) * csq(jlat)
  1375. <a name="l01286"></a>01286 zdtv = zdtc - 0.5 * dtns * sid(jlat)
  1376. <a name="l01287"></a>01287 gtc(:,jlat,jlev) = max(ttp, (tgr - zdtc) * zsip**AKAP)
  1377. <a name="l01288"></a>01288 gtv(:,jlat,jlev) = max(ttp, (tgr - zdtv) * zsip**AKAP)
  1378. <a name="l01289"></a>01289 <span class="keyword">enddo</span>
  1379. <a name="l01290"></a>01290 <span class="keyword">enddo</span>
  1380. <a name="l01291"></a>01291 gtv(:,:,:) = gtv(:,:,:) - gtc(:,:,:)
  1381. <a name="l01292"></a>01292 <span class="keyword">endif</span>
  1382. <a name="l01293"></a>01293
  1383. <a name="l01294"></a>01294 <span class="comment">! Produce reciprocal of damping time scale for T [1/sec]</span>
  1384. <a name="l01295"></a>01295
  1385. <a name="l01296"></a>01296 <span class="comment">! tauta = 1.0 / (TWOPI * tauta)</span>
  1386. <a name="l01297"></a>01297 <span class="comment">! tauts = 1.0 / (TWOPI * tauts)</span>
  1387. <a name="l01298"></a>01298
  1388. <a name="l01299"></a>01299 rtauta_dim = 1.0 /(tauta*sid_day)
  1389. <a name="l01300"></a>01300 rtauts_dim = 1.0 /(tauts*sid_day)
  1390. <a name="l01301"></a>01301 <span class="keyword">if</span> (nhelsua == 2 .or. nhelsua == 3) <span class="keyword">then</span>
  1391. <a name="l01302"></a>01302 <span class="keyword">do</span> jlev=1,nlev
  1392. <a name="l01303"></a>01303 <span class="keyword">if</span> (sigma(jlev) &gt; zsigb) <span class="keyword">then</span>
  1393. <a name="l01304"></a>01304 <span class="keyword">do</span> jlat = 1,nlat
  1394. <a name="l01305"></a>01305 gtdamp(1:nlon,jlat,jlev) = rtauta_dim &amp;
  1395. <a name="l01306"></a>01306 &amp; + (rtauts_dim - rtauta_dim) * ((sigma(jlev) - zsigb) / (1. - zsigb)) &amp;
  1396. <a name="l01307"></a>01307 &amp; * (1. - sid(jlat)**2)**2
  1397. <a name="l01308"></a>01308 <span class="keyword">enddo</span>
  1398. <a name="l01309"></a>01309 <span class="keyword">else</span>
  1399. <a name="l01310"></a>01310 gtdamp(:,:,jlev) = rtauta_dim
  1400. <a name="l01311"></a>01311 <span class="keyword">endif</span>
  1401. <a name="l01312"></a>01312 <span class="keyword">enddo</span>
  1402. <a name="l01313"></a>01313 <span class="keyword">endif</span>
  1403. <a name="l01314"></a>01314
  1404. <a name="l01315"></a>01315 return
  1405. <a name="l01316"></a>01316 <span class="keyword"> end</span>
  1406. <a name="l01317"></a>01317
  1407. <a name="l01318"></a>01318 <span class="comment">! =====================</span>
  1408. <a name="l01319"></a>01319 <span class="comment">! SUBROUTINE RESOLUTION</span>
  1409. <a name="l01320"></a>01320 <span class="comment">! =====================</span>
  1410. <a name="l01321"></a>01321
  1411. <a name="l01322"></a><a class="code" href="ppp_8f90.html#a0952e51b37b6196b4f5d85a5cb93c75b">01322</a> <span class="keyword">subroutine </span><a class="code" href="ppp_8f90.html#a0952e51b37b6196b4f5d85a5cb93c75b">resolution</a>
  1412. <a name="l01323"></a>01323 use <span class="keywordflow">pumamod</span>
  1413. <a name="l01324"></a>01324 <span class="keywordtype">logical</span> :: lex
  1414. <a name="l01325"></a>01325 namelist /res/ nlat, nlev
  1415. <a name="l01326"></a>01326
  1416. <a name="l01327"></a>01327 nlat = 32
  1417. <a name="l01328"></a>01328 nlev = 10
  1418. <a name="l01329"></a>01329
  1419. <a name="l01330"></a>01330 <span class="keyword">inquire</span>(file=resolution_namelist,exist=lex)
  1420. <a name="l01331"></a>01331 <span class="keyword">if</span> (.not. lex) <span class="keyword">then</span>
  1421. <a name="l01332"></a>01332 resolution_namelist = trim(resolution_namelist) // <span class="stringliteral">&quot;_00&quot;</span>
  1422. <a name="l01333"></a>01333 <span class="keyword">inquire</span>(file=resolution_namelist,exist=lex)
  1423. <a name="l01334"></a>01334 <span class="keyword">endif</span>
  1424. <a name="l01335"></a>01335
  1425. <a name="l01336"></a>01336 <span class="keyword">if</span> (lex) <span class="keyword">then</span>
  1426. <a name="l01337"></a>01337 <span class="keyword">open</span>(14,file=resolution_namelist)
  1427. <a name="l01338"></a>01338 <span class="keyword">read</span>(14,res)
  1428. <a name="l01339"></a>01339 <span class="keyword">close</span>(14)
  1429. <a name="l01340"></a>01340 <span class="keyword">endif</span>
  1430. <a name="l01341"></a>01341
  1431. <a name="l01342"></a>01342 nlem = nlev - 1
  1432. <a name="l01343"></a>01343 nlep = nlev + 1
  1433. <a name="l01344"></a>01344 nlsq = nlev * nlev
  1434. <a name="l01345"></a>01345
  1435. <a name="l01346"></a>01346 nlon = nlat + nlat <span class="comment">! Longitudes</span>
  1436. <a name="l01347"></a>01347 nlah = nlat / 2
  1437. <a name="l01348"></a>01348 nlpp = nlat
  1438. <a name="l01349"></a>01349 nhpp = nlah
  1439. <a name="l01350"></a>01350 nhor = nlon * nlpp
  1440. <a name="l01351"></a>01351
  1441. <a name="l01352"></a>01352 ntru = (nlon - 1) / 3
  1442. <a name="l01353"></a>01353 ntp1 = ntru + 1
  1443. <a name="l01354"></a>01354 nzom = ntp1 + ntp1
  1444. <a name="l01355"></a>01355 nrsp = (ntru + 1) * (ntru + 2)
  1445. <a name="l01356"></a>01356 ncsp = nrsp / 2
  1446. <a name="l01357"></a>01357 nspp = nrsp
  1447. <a name="l01358"></a>01358 nesp = nspp
  1448. <a name="l01359"></a>01359
  1449. <a name="l01360"></a>01360 return
  1450. <a name="l01361"></a>01361 <span class="keyword"> end</span>
  1451. <a name="l01362"></a>01362
  1452. <a name="l01363"></a>01363 <span class="comment">! =================</span>
  1453. <a name="l01364"></a>01364 <span class="comment">! SUBROUTINE READNL</span>
  1454. <a name="l01365"></a>01365 <span class="comment">! =================</span>
  1455. <a name="l01366"></a>01366
  1456. <a name="l01367"></a><a class="code" href="ppp_8f90.html#a8a75958ca9ba25aeec49db140b483871">01367</a> <span class="keyword">subroutine </span><a class="code" href="ppp_8f90.html#a8a75958ca9ba25aeec49db140b483871">readnl</a>
  1457. <a name="l01368"></a>01368 use <span class="keywordflow">pumamod</span>
  1458. <a name="l01369"></a>01369
  1459. <a name="l01370"></a>01370 <span class="comment">! This namelist must be identical to namelist inp in puma.f90</span>
  1460. <a name="l01371"></a>01371
  1461. <a name="l01372"></a>01372 namelist /inp/ &amp;
  1462. <a name="l01373"></a>01373 alpha , alrpv , alrs , disp &amp;
  1463. <a name="l01374"></a>01374 , dorox , doroxs , doroy , doroys , dt , dtep &amp;
  1464. <a name="l01375"></a>01375 , dtns , dtrop , dttrp , dtzz , dvdiff , edgepv &amp;
  1465. <a name="l01376"></a>01376 , epsync &amp;
  1466. <a name="l01377"></a>01377 , flsp0 , flsdp , flsamp , flsoff , horo , kick &amp;
  1467. <a name="l01378"></a>01378 , lat1oro , lat1tgr , lat2oro , lat2tgr &amp;
  1468. <a name="l01379"></a>01379 , lon1oro , lon1tgr , lon2oro , lon2tgr &amp;
  1469. <a name="l01380"></a>01380 , mpstep &amp;
  1470. <a name="l01381"></a>01381 , nafter , ncoeff , ncorrect, ncu , ndel , ndiag &amp;
  1471. <a name="l01382"></a>01382 , ndl , nextout , nfls , ngui , nguidbg &amp;
  1472. <a name="l01383"></a>01383 , nhelsua, nsync &amp;
  1473. <a name="l01384"></a>01384 , ntestgp , nkits &amp;
  1474. <a name="l01385"></a>01385 , nlevt , nmonths , noro , norox , noutput , noutsrv &amp;
  1475. <a name="l01386"></a>01386 , npackgp , npacksp , nreverse&amp;
  1476. <a name="l01387"></a>01387 , nruido , nrun , nselect , nspecsel, nsponge , nsrv &amp;
  1477. <a name="l01388"></a>01388 , <a class="code" href="pumax_8c.html#a354c90bb46e1789fe52c4759474c2c89">nstep</a> , nstop , nstrato , ntgr , nsym , ntspd &amp;
  1478. <a name="l01389"></a>01389 , nvg , nwpd , nwspini , nyears , nyoden &amp;
  1479. <a name="l01390"></a>01390 , oroano , orofac &amp;
  1480. <a name="l01391"></a>01391 , pac , pmaxpv , pspon &amp;
  1481. <a name="l01392"></a>01392 , radpv , restim , rotspd &amp;
  1482. <a name="l01393"></a>01393 , sigmah , sigmax , sponk &amp;
  1483. <a name="l01394"></a>01394 , t0 , t0k , tac , tauta , tauts &amp;
  1484. <a name="l01395"></a>01395 , tdiss , tfrc , tgr , tgrano , ttp &amp;
  1485. <a name="l01396"></a>01396 , nenergy , nentropy, ndheat
  1486. <a name="l01397"></a>01397
  1487. <a name="l01398"></a>01398 nselect(:) = 1
  1488. <a name="l01399"></a>01399 nspecsel(:) = 1
  1489. <a name="l01400"></a>01400 ndl(:) = 0
  1490. <a name="l01401"></a>01401 restim(:) = 15.0
  1491. <a name="l01402"></a>01402 sigmah(:) = 0.0
  1492. <a name="l01403"></a>01403 tfrc(1:nlev) = (/ (0.0,i=1,nlem), 1.0 /)
  1493. <a name="l01404"></a>01404 t0k(:) = 250.0
  1494. <a name="l01405"></a>01405 t0(:) = 250.0
  1495. <a name="l01406"></a>01406 dt(:) = 0.0
  1496. <a name="l01407"></a>01407
  1497. <a name="l01408"></a>01408 <span class="keyword">open</span>(13,file=<span class="stringliteral">&#39;ppp_namelist&#39;</span>)
  1498. <a name="l01409"></a>01409 <span class="keyword">read</span> (13,inp)
  1499. <a name="l01410"></a>01410
  1500. <a name="l01411"></a>01411 <span class="comment">! Use predefined Yoden profile ?</span>
  1501. <a name="l01412"></a>01412
  1502. <a name="l01413"></a>01413 <span class="keyword">if</span> (nlev == 20 .and. nyoden &gt; 0) <span class="keyword">then</span>
  1503. <a name="l01414"></a>01414 <span class="comment">! noro = 0 ! Don&#39;t read orography</span>
  1504. <a name="l01415"></a>01415 <span class="comment">! norox = 2 ! Make idealized orography</span>
  1505. <a name="l01416"></a>01416 <span class="comment">! horo = 500.0 ! Height of idealized orography</span>
  1506. <a name="l01417"></a>01417 alrs = -0.001 <span class="comment">! Stratospheric lapse rate</span>
  1507. <a name="l01418"></a>01418 nreverse = 0 <span class="comment">! No T-gradient reversal at tropopause</span>
  1508. <a name="l01419"></a>01419 ncorrect = 0 <span class="comment">! No T-correction due to orography</span>
  1509. <a name="l01420"></a>01420 idim = min(20,nlev)
  1510. <a name="l01421"></a>01421 <span class="keyword">if</span> (nyoden == 1) <span class="keyword">then</span>
  1511. <a name="l01422"></a>01422 t0(1:idim) = t0yod1(1:idim)
  1512. <a name="l01423"></a>01423 dt(1:idim) = dtyod1(1:idim)
  1513. <a name="l01424"></a>01424 <span class="keyword">else</span> <span class="keyword">if</span> (nyoden == 3) <span class="keyword">then</span>
  1514. <a name="l01425"></a>01425 t0(1:idim) = t0yod3(1:idim)
  1515. <a name="l01426"></a>01426 dt(1:idim) = dtyod3(1:idim)
  1516. <a name="l01427"></a>01427 <span class="keyword">else</span> <span class="keyword">if</span> (nyoden == 5) <span class="keyword">then</span>
  1517. <a name="l01428"></a>01428 t0(1:idim) = t0yod5(1:idim)
  1518. <a name="l01429"></a>01429 dt(1:idim) = dtyod5(1:idim)
  1519. <a name="l01430"></a>01430 <span class="keyword">else</span> <span class="keyword">if</span> (nyoden == 7) <span class="keyword">then</span>
  1520. <a name="l01431"></a>01431 t0(1:idim) = t0yod7(1:idim)
  1521. <a name="l01432"></a>01432 dt(1:idim) = dtyod7(1:idim)
  1522. <a name="l01433"></a>01433 <span class="keyword">else</span> <span class="keyword">if</span> (nyoden == 8) <span class="keyword">then</span>
  1523. <a name="l01434"></a>01434 t0(1:idim) = t0yod8(1:idim)
  1524. <a name="l01435"></a>01435 dt(1:idim) = dtyod8(1:idim)
  1525. <a name="l01436"></a>01436 <span class="keyword">else</span> <span class="keyword">if</span> (nyoden == 9) <span class="keyword">then</span>
  1526. <a name="l01437"></a>01437 t0(1:idim) = t0yod9(1:idim)
  1527. <a name="l01438"></a>01438 dt(1:idim) = dtyod9(1:idim)
  1528. <a name="l01439"></a>01439 <span class="keyword">endif</span>
  1529. <a name="l01440"></a>01440 <span class="keyword">endif</span>
  1530. <a name="l01441"></a>01441
  1531. <a name="l01442"></a>01442 <span class="keyword">close</span>(13)
  1532. <a name="l01443"></a>01443 <span class="keyword">write</span>(*,inp)
  1533. <a name="l01444"></a>01444
  1534. <a name="l01445"></a>01445 return
  1535. <a name="l01446"></a>01446 <span class="keyword"> end</span>
  1536. <a name="l01447"></a>01447
  1537. <a name="l01448"></a>01448 <span class="comment">! =====================</span>
  1538. <a name="l01449"></a>01449 <span class="comment">! * SET VERTICAL GRID *</span>
  1539. <a name="l01450"></a>01450 <span class="comment">! =====================</span>
  1540. <a name="l01451"></a>01451
  1541. <a name="l01452"></a><a class="code" href="ppp_8f90.html#a00e3481744c3185f0f91d35c101f28e4">01452</a> <span class="keyword">subroutine </span><a class="code" href="ppp_8f90.html#a00e3481744c3185f0f91d35c101f28e4">set_vertical_grid</a>
  1542. <a name="l01453"></a>01453
  1543. <a name="l01454"></a>01454 use <span class="keywordflow">pumamod</span>
  1544. <a name="l01455"></a>01455
  1545. <a name="l01456"></a>01456 <span class="keyword">if</span> (sigmah(nlev) /= 0.0) return <span class="comment">! Already read in from namelist INP</span>
  1546. <a name="l01457"></a>01457
  1547. <a name="l01458"></a>01458 <span class="keyword">if</span> (nvg == 1) <span class="keyword">then</span> <span class="comment">! Scinocca &amp; Haynes sigma levels</span>
  1548. <a name="l01459"></a>01459
  1549. <a name="l01460"></a>01460 <span class="keyword">if</span> (nlevt &gt;= nlev) <span class="keyword">then</span> <span class="comment">! Security check for &#39;nlevt&#39;</span>
  1550. <a name="l01461"></a>01461 <span class="keyword">write</span> (*,*) <span class="stringliteral">&#39;*** ERROR *** nlevt &gt;= nlev&#39;</span>
  1551. <a name="l01462"></a>01462 <span class="keyword">write</span> (*,*) <span class="stringliteral">&#39;Number of levels (nlev): &#39;</span>,nlev
  1552. <a name="l01463"></a>01463 <span class="keyword">write</span> (*,*) <span class="stringliteral">&#39;Number of tropospheric levels (nlevt): &#39;</span>,nlevt
  1553. <a name="l01464"></a>01464 <span class="keyword">endif</span>
  1554. <a name="l01465"></a>01465
  1555. <a name="l01466"></a>01466 <span class="comment">! troposphere: linear spacing in sigma</span>
  1556. <a name="l01467"></a>01467 <span class="comment">! stratosphere: linear spacing in log(sigma)</span>
  1557. <a name="l01468"></a>01468 <span class="comment">! after (see their Appendix):</span>
  1558. <a name="l01469"></a>01469 <span class="comment">! Scinocca, J. F. and P. H. Haynes (1998): Dynamical forcing of</span>
  1559. <a name="l01470"></a>01470 <span class="comment">! stratospheric planetary waves by tropospheric baroclinic eddies.</span>
  1560. <a name="l01471"></a>01471 <span class="comment">! J. Atmos. Sci., 55 (14), 2361-2392</span>
  1561. <a name="l01472"></a>01472
  1562. <a name="l01473"></a>01473 <span class="comment">! Here, zsigtran is set to sigma at dtrop (tropopause height for</span>
  1563. <a name="l01474"></a>01474 <span class="comment">! construction of restoration temperature field). If tgr=288.15K,</span>
  1564. <a name="l01475"></a>01475 <span class="comment">! ALR=0.0065K/km and dtrop=11.km, then zsigtran=0.223 (=0.1 in</span>
  1565. <a name="l01476"></a>01476 <span class="comment">! Scinocca and Haynes (1998)).</span>
  1566. <a name="l01477"></a>01477 <span class="comment">! A smoothing of the transition between linear and logarithmic</span>
  1567. <a name="l01478"></a>01478 <span class="comment">! spacing, as noted in Scinocca and Haynes (1998), is not yet</span>
  1568. <a name="l01479"></a>01479 <span class="comment">! implemented.</span>
  1569. <a name="l01480"></a>01480
  1570. <a name="l01481"></a>01481 zsigtran = (1. - ALR * dtrop / tgr)**(GA/(GASCON*ALR))
  1571. <a name="l01482"></a>01482 zsigmin = 1. - (1. - zsigtran) / <span class="keywordtype">real</span>(nlevt)
  1572. <a name="l01483"></a>01483
  1573. <a name="l01484"></a>01484 <span class="keyword">do</span> jlev=1,nlev
  1574. <a name="l01485"></a>01485 <span class="keyword">if</span> (jlev == 1) <span class="keyword">then</span>
  1575. <a name="l01486"></a>01486 sigmah(jlev) = 0.000001
  1576. <a name="l01487"></a>01487 sigmah(jlev) = sigmax
  1577. <a name="l01488"></a>01488 elseif (jlev &gt; 1 .and. jlev &lt; nlev - nlevt) <span class="keyword">then</span>
  1578. <a name="l01489"></a>01489 sigmah(jlev) = exp((log(sigmax) - log(zsigtran)) &amp;
  1579. <a name="l01490"></a>01490 &amp; / <span class="keywordtype">real(nlev - nlevt - 1)</span> * <span class="keywordtype">real(nlev - nlevt - jlev)</span>
  1580. <a name="l01491"></a>01491 + log(zsigtran))
  1581. <a name="l01492"></a>01492 elseif (jlev &gt;= nlev - nlevt .and. jlev &lt; nlev - 1) then
  1582. <a name="l01493"></a>01493 sigmah(jlev) = (zsigtran - zsigmin) / <span class="keywordtype">real(nlevt - 1)</span>
  1583. <a name="l01494"></a>01494 * real(nlev - 1 - jlev) + zsigmin
  1584. <a name="l01495"></a>01495 elseif (jlev == nlev - 1) then
  1585. <a name="l01496"></a>01496 sigmah(jlev) = zsigmin
  1586. <a name="l01497"></a>01497 elseif (jlev == nlev) <span class="keyword">then</span>
  1587. <a name="l01498"></a>01498 sigmah(jlev) = 1.
  1588. <a name="l01499"></a>01499 <span class="keyword">endif</span>
  1589. <a name="l01500"></a>01500 <span class="keyword">enddo</span>
  1590. <a name="l01501"></a>01501 return
  1591. <a name="l01502"></a>01502 <span class="keyword">endif</span> <span class="comment">! (nvg == 1)</span>
  1592. <a name="l01503"></a>01503
  1593. <a name="l01504"></a>01504 <span class="keyword">if</span> (nvg == 2) <span class="keyword">then</span> <span class="comment">! Polvani &amp; Kushner sigma levels</span>
  1594. <a name="l01505"></a>01505 inl = int(<span class="keywordtype">real</span>(nlev)/(1.0 - sigmax**(1.0/5.0)))
  1595. <a name="l01506"></a>01506 <span class="keyword">do</span> jlev=1,nlev
  1596. <a name="l01507"></a>01507 sigmah(jlev) = (<span class="keywordtype">real(jlev + inl - nlev)</span> / <span class="keywordtype">real</span>(inl))**5
  1597. <a name="l01508"></a>01508 <span class="keyword">enddo</span>
  1598. <a name="l01509"></a>01509 return
  1599. <a name="l01510"></a>01510 <span class="keyword">endif</span> <span class="comment">! (nvg == 2)</span>
  1600. <a name="l01511"></a>01511
  1601. <a name="l01512"></a>01512 <span class="comment">! Default: equidistant sigma levels</span>
  1602. <a name="l01513"></a>01513
  1603. <a name="l01514"></a>01514 <span class="keyword">if</span> (nvg == 0) <span class="keyword">then</span>
  1604. <a name="l01515"></a>01515 <span class="keyword">do</span> jlev = 1 , nlev
  1605. <a name="l01516"></a>01516 sigmah(jlev) = <span class="keywordtype">real(jlev)</span> / <span class="keywordtype">real</span>(nlev)
  1606. <a name="l01517"></a>01517 <span class="keyword">enddo</span>
  1607. <a name="l01518"></a>01518 <span class="keyword">endif</span> <span class="comment">! (nvg == 0)</span>
  1608. <a name="l01519"></a>01519
  1609. <a name="l01520"></a>01520 return
  1610. <a name="l01521"></a>01521 <span class="keyword"> end</span>
  1611. <a name="l01522"></a>01522
  1612. <a name="l01523"></a>01523 <span class="comment">! =================</span>
  1613. <a name="l01524"></a>01524 <span class="comment">! SUBROUTINE INITPM</span>
  1614. <a name="l01525"></a>01525 <span class="comment">! =================</span>
  1615. <a name="l01526"></a>01526
  1616. <a name="l01527"></a><a class="code" href="ppp_8f90.html#a5087a1dafe7b39d03c6547fde711b55a">01527</a> <span class="keyword">subroutine </span><a class="code" href="ppp_8f90.html#a5087a1dafe7b39d03c6547fde711b55a">initpm</a>
  1617. <a name="l01528"></a>01528 use <span class="keywordflow">pumamod</span>
  1618. <a name="l01529"></a>01529
  1619. <a name="l01530"></a>01530 <span class="keywordtype">real (kind=8)</span> radea,zakk,zzakk
  1620. <a name="l01531"></a>01531 radea = PLARAD_EARTH <span class="comment">! Planet radius in high precision</span>
  1621. <a name="l01532"></a>01532 plavor = EZ * rotspd <span class="comment">! Planetary vorticity</span>
  1622. <a name="l01533"></a>01533
  1623. <a name="l01534"></a>01534 <span class="comment">! *************************************************************</span>
  1624. <a name="l01535"></a>01535 <span class="comment">! * carries out all initialisation of model prior to running. *</span>
  1625. <a name="l01536"></a>01536 <span class="comment">! * major sections identified with comments. *</span>
  1626. <a name="l01537"></a>01537 <span class="comment">! * this s/r sets the model parameters and all resolution *</span>
  1627. <a name="l01538"></a>01538 <span class="comment">! * dependent quantities. *</span>
  1628. <a name="l01539"></a>01539 <span class="comment">! *************************************************************</span>
  1629. <a name="l01540"></a>01540
  1630. <a name="l01541"></a>01541 <span class="comment">! *********************</span>
  1631. <a name="l01542"></a>01542 <span class="comment">! * set vertical grid *</span>
  1632. <a name="l01543"></a>01543 <span class="comment">! *********************</span>
  1633. <a name="l01544"></a>01544
  1634. <a name="l01545"></a>01545 call <a class="code" href="ppp_8f90.html#a00e3481744c3185f0f91d35c101f28e4">set_vertical_grid</a>
  1635. <a name="l01546"></a>01546
  1636. <a name="l01547"></a>01547 dsigma(1 ) = sigmah(1)
  1637. <a name="l01548"></a>01548 dsigma(2:nlev) = sigmah(2:nlev) - sigmah(1:NLEM)
  1638. <a name="l01549"></a>01549
  1639. <a name="l01550"></a>01550 rdsig(:) = 0.5 / dsigma(:)
  1640. <a name="l01551"></a>01551
  1641. <a name="l01552"></a>01552 sigma(1 ) = 0.5 * sigmah(1)
  1642. <a name="l01553"></a>01553 sigma(2:nlev) = 0.5 * (sigmah(1:NLEM) + sigmah(2:nlev))
  1643. <a name="l01554"></a>01554
  1644. <a name="l01555"></a>01555 <span class="comment">! annual cycle period and phase in timesteps</span>
  1645. <a name="l01556"></a>01556
  1646. <a name="l01557"></a>01557 <span class="keyword">if</span> (tac &gt; 0.0) tac = TWOPI / (ntspd * tac)
  1647. <a name="l01558"></a>01558 pac = pac * ntspd
  1648. <a name="l01559"></a>01559
  1649. <a name="l01560"></a>01560 <span class="comment">! compute internal diffusion parameter</span>
  1650. <a name="l01561"></a>01561
  1651. <a name="l01562"></a>01562 jdelh = ndel/2
  1652. <a name="l01563"></a>01563 <span class="keyword">if</span> (tdiss &gt; 0.0) <span class="keyword">then</span>
  1653. <a name="l01564"></a>01564 zakk = WW*(radea**ndel)/(TWOPI*tdiss*((ntru*(ntru+1.))**jdelh))
  1654. <a name="l01565"></a>01565 <span class="keyword">else</span>
  1655. <a name="l01566"></a>01566 zakk = 0.0
  1656. <a name="l01567"></a>01567 <span class="keyword">endif</span>
  1657. <a name="l01568"></a>01568 zzakk = zakk / (WW*(radea**ndel))
  1658. <a name="l01569"></a>01569
  1659. <a name="l01570"></a>01570 <span class="comment">! set coefficients which depend on wavenumber</span>
  1660. <a name="l01571"></a>01571
  1661. <a name="l01572"></a>01572 zrsq2 = 1.0 / sqrt(2.0)
  1662. <a name="l01573"></a>01573
  1663. <a name="l01574"></a>01574 jr=-1
  1664. <a name="l01575"></a>01575 <span class="keyword">do</span> jm=0,ntru
  1665. <a name="l01576"></a>01576 <span class="keyword">do</span> jn=jm,ntru
  1666. <a name="l01577"></a>01577 jr=jr+2
  1667. <a name="l01578"></a>01578 ji=jr+1
  1668. <a name="l01579"></a>01579 spnorm(jr)=zrsq2
  1669. <a name="l01580"></a>01580 spnorm(ji)=zrsq2
  1670. <a name="l01581"></a>01581 <span class="keyword">enddo</span>
  1671. <a name="l01582"></a>01582 zrsq2=-zrsq2
  1672. <a name="l01583"></a>01583 <span class="keyword">enddo</span>
  1673. <a name="l01584"></a>01584
  1674. <a name="l01585"></a>01585 return
  1675. <a name="l01586"></a>01586 <span class="keyword"> end</span>
  1676. <a name="l01587"></a>01587
  1677. <a name="l01588"></a><a class="code" href="ppp_8f90.html#a57e32ca0b91b99739b892a459ec40953">01588</a> <span class="keyword">subroutine </span><a class="code" href="ppp_8f90.html#a57e32ca0b91b99739b892a459ec40953">printparameter</a>
  1678. <a name="l01589"></a>01589 use <span class="keywordflow">pumamod</span>
  1679. <a name="l01590"></a>01590
  1680. <a name="l01591"></a>01591 print 8000
  1681. <a name="l01592"></a>01592 print 8050
  1682. <a name="l01593"></a>01593 print 8000
  1683. <a name="l01594"></a>01594 print 8010,nlev
  1684. <a name="l01595"></a>01595 print 8020,ntru
  1685. <a name="l01596"></a>01596 print 8030,nlat
  1686. <a name="l01597"></a>01597 print 8040,nlon
  1687. <a name="l01598"></a>01598 print 8000
  1688. <a name="l01599"></a>01599 print 8120
  1689. <a name="l01600"></a>01600 return
  1690. <a name="l01601"></a>01601 8000 format(<span class="stringliteral">&#39; *****************************************&#39;</span>)
  1691. <a name="l01602"></a>01602 8010 format(<span class="stringliteral">&#39; * nlev = &#39;</span>,i6,<span class="stringliteral">&#39; Number of levels *&#39;</span>)
  1692. <a name="l01603"></a>01603 8020 format(<span class="stringliteral">&#39; * ntru = &#39;</span>,i6,<span class="stringliteral">&#39; Triangular truncation *&#39;</span>)
  1693. <a name="l01604"></a>01604 8030 format(<span class="stringliteral">&#39; * nlat = &#39;</span>,i6,<span class="stringliteral">&#39; Number of latitudes *&#39;</span>)
  1694. <a name="l01605"></a>01605 8040 format(<span class="stringliteral">&#39; * nlon = &#39;</span>,i6,<span class="stringliteral">&#39; Number of longitues *&#39;</span>)
  1695. <a name="l01606"></a>01606 8050 format(<span class="stringliteral">&#39; * PPP - Puma Pre Processor *&#39;</span>)
  1696. <a name="l01607"></a>01607 8120 format(/)
  1697. <a name="l01608"></a>01608 <span class="keyword"> end</span>
  1698. <a name="l01609"></a>01609
  1699. <a name="l01610"></a>01610
  1700. <a name="l01611"></a>01611 <span class="comment">! ===================</span>
  1701. <a name="l01612"></a>01612 <span class="comment">! SUBROUTINE GPROFILE</span>
  1702. <a name="l01613"></a>01613 <span class="comment">! ===================</span>
  1703. <a name="l01614"></a><a class="code" href="ppp_8f90.html#a2da275fb5e4fcd6df1126d74539963cb">01614</a> <span class="keyword">subroutine </span><a class="code" href="ppp_8f90.html#a2da275fb5e4fcd6df1126d74539963cb">gprofile</a>(ptgr,prgrad,pgpm)
  1704. <a name="l01615"></a>01615 use <span class="keywordflow">pumamod</span>
  1705. <a name="l01616"></a>01616
  1706. <a name="l01617"></a>01617 <span class="comment">! *************************************************************</span>
  1707. <a name="l01618"></a>01618 <span class="comment">! * Set up the restoration temperature profiles for gradient *</span>
  1708. <a name="l01619"></a>01619 <span class="comment">! * modes DTNS - mode[0,1] and DTEP - mode[0,2] *</span>
  1709. <a name="l01620"></a>01620 <span class="comment">! * The lapse rate of ALR K/m is assumed under the tropopause *</span>
  1710. <a name="l01621"></a>01621 <span class="comment">! * and zero above. The tropopause is defined by &lt;dtrop&gt;. *</span>
  1711. <a name="l01622"></a>01622 <span class="comment">! * The profile is a sine wave with 0 at tropopause sigma and *</span>
  1712. <a name="l01623"></a>01623 <span class="comment">! * 1 at sigma = 1. *</span>
  1713. <a name="l01624"></a>01624 <span class="comment">! ************************************************************* </span>
  1714. <a name="l01625"></a>01625
  1715. <a name="l01626"></a>01626 dimension prgrad(nlev)
  1716. <a name="l01627"></a>01627
  1717. <a name="l01628"></a>01628 ztpheight = dtrop - pgpm <span class="comment">! Tropopause height over ground</span>
  1718. <a name="l01629"></a>01629 ztptemp = tgr - ALR * dtrop <span class="comment">! Tropopause temperature</span>
  1719. <a name="l01630"></a>01630 ztps = (ztptemp/ptgr)**(GA/(ALR*GASCON)) <span class="comment">! Tropoause sigma</span>
  1720. <a name="l01631"></a>01631
  1721. <a name="l01632"></a>01632 <span class="keyword">do</span> jlev = 1 , nlev
  1722. <a name="l01633"></a>01633 prgrad(jlev) = sin(0.5*PI*(sigma(jlev)-ztps)/(1.0-ztps))
  1723. <a name="l01634"></a>01634 <span class="keyword">if</span> (sigma(jlev) &lt; ztps) prgrad(jlev) = 0.0
  1724. <a name="l01635"></a>01635 <span class="keyword">enddo</span>
  1725. <a name="l01636"></a>01636
  1726. <a name="l01637"></a>01637 return
  1727. <a name="l01638"></a>01638 <span class="keyword"> end</span>
  1728. <a name="l01639"></a>01639
  1729. <a name="l01640"></a>01640 <span class="comment">! ===================</span>
  1730. <a name="l01641"></a>01641 <span class="comment">! SUBROUTINE TPROFILE</span>
  1731. <a name="l01642"></a>01642 <span class="comment">! ===================</span>
  1732. <a name="l01643"></a><a class="code" href="ppp_8f90.html#a109d8c58aa308107712782398903ea71">01643</a> <span class="keyword">subroutine </span><a class="code" href="ppp_8f90.html#a109d8c58aa308107712782398903ea71">tprofile</a>(ptgr,prof,pgpm)
  1733. <a name="l01644"></a>01644 use <span class="keywordflow">pumamod</span>
  1734. <a name="l01645"></a>01645
  1735. <a name="l01646"></a>01646 <span class="comment">! *************************************************************</span>
  1736. <a name="l01647"></a>01647 <span class="comment">! * Set up the restoration temperature profile for one column *</span>
  1737. <a name="l01648"></a>01648 <span class="comment">! * The temperature at sigma = 1 is &lt;ptgr&gt;, entered in kelvin *</span>
  1738. <a name="l01649"></a>01649 <span class="comment">! * The lapse rate of ALR K/m is assumed under the tropopause *</span>
  1739. <a name="l01650"></a>01650 <span class="comment">! * and zero above. The tropopause is defined by &lt;ztpheight&gt;. *</span>
  1740. <a name="l01651"></a>01651 <span class="comment">! * The smoothing ot the tropopause depends on &lt;dttrp&gt;. *</span>
  1741. <a name="l01652"></a>01652 <span class="comment">! ************************************************************* </span>
  1742. <a name="l01653"></a>01653
  1743. <a name="l01654"></a>01654 dimension prof(nlev) <span class="comment">! Resulting temperature profile [K]</span>
  1744. <a name="l01655"></a>01655
  1745. <a name="l01656"></a>01656 zsigprev = 1.0 <span class="comment">! sigma value</span>
  1746. <a name="l01657"></a>01657 ztprev = ptgr <span class="comment">! Temperature [K]</span>
  1747. <a name="l01658"></a>01658 zzprev = 0.0 <span class="comment">! Height [m]</span>
  1748. <a name="l01659"></a>01659 ztpheight = dtrop - pgpm <span class="comment">! Tropopause height over ground</span>
  1749. <a name="l01660"></a>01660 ztptemp = tgr - ALR * dtrop <span class="comment">! Tropopause temperature</span>
  1750. <a name="l01661"></a>01661 zalr = (ptgr - ztptemp) / ztpheight
  1751. <a name="l01662"></a>01662
  1752. <a name="l01663"></a>01663 <span class="keyword">do</span> jlev = nlev , 1 , -1 <span class="comment">! from bottom to top of atmosphere</span>
  1753. <a name="l01664"></a>01664 zlogsig = GASCON / GA * log(zsigprev / sigma(jlev))
  1754. <a name="l01665"></a>01665 zzp = zzprev + ztprev * zlogsig
  1755. <a name="l01666"></a>01666 ztp=ztptemp+sqrt((.5*zalr*(zzp-ztpheight))**2+dttrp**2)
  1756. <a name="l01667"></a>01667 ztp=ztp-.5*zalr*(zzp-ztpheight)
  1757. <a name="l01668"></a>01668 ztpm=.5*(ztprev+ztp)
  1758. <a name="l01669"></a>01669
  1759. <a name="l01670"></a>01670 zzpp = zzprev + ztpm * zlogsig
  1760. <a name="l01671"></a>01671 ztpp=ztptemp+sqrt((.5*zalr*(zzpp-ztpheight))**2+dttrp**2)
  1761. <a name="l01672"></a>01672 ztpp=ztpp-.5*zalr*(zzpp-ztpheight)
  1762. <a name="l01673"></a>01673
  1763. <a name="l01674"></a>01674 prof(jlev)=ztpp
  1764. <a name="l01675"></a>01675 zzprev=zzprev + 0.5 * (ztpp+ztprev) * zlogsig
  1765. <a name="l01676"></a>01676 ztprev=ztpp
  1766. <a name="l01677"></a>01677 zsigprev=sigma(jlev)
  1767. <a name="l01678"></a>01678 <span class="keyword">enddo</span>
  1768. <a name="l01679"></a>01679 return
  1769. <a name="l01680"></a>01680 <span class="keyword"> end</span>
  1770. <a name="l01681"></a>01681
  1771. <a name="l01682"></a>01682 <span class="comment">! ======================</span>
  1772. <a name="l01683"></a>01683 <span class="comment">! SUBROUTINE ppp_write_i</span>
  1773. <a name="l01684"></a>01684 <span class="comment">! ======================</span>
  1774. <a name="l01685"></a>01685
  1775. <a name="l01686"></a><a class="code" href="ppp_8f90.html#adbcdb3579718dc6067a1b2ec4d26e476">01686</a> <span class="keyword">subroutine </span><a class="code" href="ppp_8f90.html#adbcdb3579718dc6067a1b2ec4d26e476">ppp_write_i</a>(yvarname,nvals,ivals)
  1776. <a name="l01687"></a>01687 use <span class="keywordflow">pumamod</span>
  1777. <a name="l01688"></a>01688
  1778. <a name="l01689"></a>01689 <span class="keywordtype">character(*)</span> :: yvarname
  1779. <a name="l01690"></a>01690 <span class="keywordtype">integer</span> :: nvals
  1780. <a name="l01691"></a>01691 <span class="keywordtype">integer</span> :: ivals(nvals)
  1781. <a name="l01692"></a>01692
  1782. <a name="l01693"></a>01693 <span class="keyword">if</span> (mypid == NROOT) <span class="keyword">then</span>
  1783. <a name="l01694"></a>01694 <span class="keyword">write</span>(95,<span class="stringliteral">&#39;(&quot;[&quot;,A,&quot;]&quot;)&#39;</span>) trim(yvarname)
  1784. <a name="l01695"></a>01695 <span class="keyword">write</span>(95,<span class="stringliteral">&#39;(I4)&#39;</span>) nvals
  1785. <a name="l01696"></a>01696 <span class="keyword">write</span>(95,<span class="stringliteral">&#39;(I6)&#39;</span>) ivals(:)
  1786. <a name="l01697"></a>01697 <span class="keyword">endif</span>
  1787. <a name="l01698"></a>01698 return
  1788. <a name="l01699"></a>01699 <span class="keyword"> end</span>
  1789. <a name="l01700"></a>01700
  1790. <a name="l01701"></a>01701 <span class="comment">! ======================</span>
  1791. <a name="l01702"></a>01702 <span class="comment">! SUBROUTINE ppp_write_r </span>
  1792. <a name="l01703"></a>01703 <span class="comment">! ======================</span>
  1793. <a name="l01704"></a>01704
  1794. <a name="l01705"></a><a class="code" href="ppp_8f90.html#a74276344215789d1e8fdce713dd9cd25">01705</a> <span class="keyword">subroutine </span><a class="code" href="ppp_8f90.html#a74276344215789d1e8fdce713dd9cd25">ppp_write_r</a>(yvarname,nvals,pvals)
  1795. <a name="l01706"></a>01706 use <span class="keywordflow">pumamod</span>
  1796. <a name="l01707"></a>01707
  1797. <a name="l01708"></a>01708 <span class="keywordtype">character(*)</span> :: yvarname
  1798. <a name="l01709"></a>01709 <span class="keywordtype">integer</span> :: nvals
  1799. <a name="l01710"></a>01710 <span class="keywordtype">real</span> :: pvals(nvals)
  1800. <a name="l01711"></a>01711
  1801. <a name="l01712"></a>01712 <span class="keyword">if</span> (mypid == NROOT) <span class="keyword">then</span>
  1802. <a name="l01713"></a>01713 <span class="keyword">write</span>(95,<span class="stringliteral">&#39;(&quot;[&quot;,A,&quot;]&quot;)&#39;</span>) trim(yvarname)
  1803. <a name="l01714"></a>01714 <span class="keyword">write</span>(95,<span class="stringliteral">&#39;(I4)&#39;</span>) nvals
  1804. <a name="l01715"></a>01715 <span class="keyword">write</span>(95,<span class="stringliteral">&#39;(E14.8)&#39;</span>) pvals(:)
  1805. <a name="l01716"></a>01716 <span class="keyword">endif</span>
  1806. <a name="l01717"></a>01717 return
  1807. <a name="l01718"></a>01718 <span class="keyword"> end</span>
  1808. <a name="l01719"></a>01719
  1809. <a name="l01720"></a>01720 <span class="comment">! ================</span>
  1810. <a name="l01721"></a>01721 <span class="comment">! SUBROUTINE yoden</span>
  1811. <a name="l01722"></a>01722 <span class="comment">! ================</span>
  1812. <a name="l01723"></a>01723
  1813. <a name="l01724"></a><a class="code" href="ppp_8f90.html#a76e236098c9f27c53d3a8827d11554cf">01724</a> <span class="keyword">subroutine </span><a class="code" href="ppp_8f90.html#a76e236098c9f27c53d3a8827d11554cf">yoden</a>
  1814. <a name="l01725"></a>01725 use <span class="keywordflow">pumamod</span>
  1815. <a name="l01726"></a>01726 <span class="comment">!</span>
  1816. <a name="l01727"></a>01727 <span class="keyword">do</span> jlev=1,nlev
  1817. <a name="l01728"></a>01728 <span class="keyword">do</span> jlat=1,nlat/2
  1818. <a name="l01729"></a>01729 zlat=dla(jlat)
  1819. <a name="l01730"></a>01730 ztres=t0(jlev)+dt(jlev)/2.*(cos(2.*zlat)-1./3.)
  1820. <a name="l01731"></a>01731 <span class="keyword">do</span> jlon=1,nlon
  1821. <a name="l01732"></a>01732 gtc(jlon,jlat,jlev)=ztres
  1822. <a name="l01733"></a>01733 <span class="keyword">enddo</span>
  1823. <a name="l01734"></a>01734 <span class="keyword">enddo</span>
  1824. <a name="l01735"></a>01735 <span class="keyword">enddo</span>
  1825. <a name="l01736"></a>01736 <span class="comment">!</span>
  1826. <a name="l01737"></a>01737 <span class="keyword">do</span> jlat=1,nlat/2
  1827. <a name="l01738"></a>01738 j2=nlat+1-jlat
  1828. <a name="l01739"></a>01739 gtc(:,j2,:)=gtc(:,jlat,:)
  1829. <a name="l01740"></a>01740 <span class="keyword">enddo</span>
  1830. <a name="l01741"></a>01741
  1831. <a name="l01742"></a>01742 <span class="keyword">write</span> (*,*) <span class="stringliteral">&#39; Computed Yoden profile&#39;</span>,nyoden
  1832. <a name="l01743"></a>01743 <span class="comment">!</span>
  1833. <a name="l01744"></a>01744 return
  1834. <a name="l01745"></a>01745 <span class="keyword"> end</span>
  1835. <a name="l01746"></a>01746 <span class="comment">!</span>
  1836. <a name="l01747"></a>01747 <span class="comment">! =======================</span>
  1837. <a name="l01748"></a>01748 <span class="comment">! SUBROUTINE PRINTPROFILE</span>
  1838. <a name="l01749"></a>01749 <span class="comment">! =======================</span>
  1839. <a name="l01750"></a>01750
  1840. <a name="l01751"></a><a class="code" href="ppp_8f90.html#aa92d6879772b364173e13521d835895e">01751</a> <span class="keyword">subroutine </span><a class="code" href="ppp_8f90.html#aa92d6879772b364173e13521d835895e">printprofile</a>
  1841. <a name="l01752"></a>01752 use <span class="keywordflow">pumamod</span>
  1842. <a name="l01753"></a>01753
  1843. <a name="l01754"></a>01754 <span class="comment">! **********************************</span>
  1844. <a name="l01755"></a>01755 <span class="comment">! * write out vertical information *</span>
  1845. <a name="l01756"></a>01756 <span class="comment">! **********************************</span>
  1846. <a name="l01757"></a>01757
  1847. <a name="l01758"></a>01758 dimension ztr(nlev+1)
  1848. <a name="l01759"></a>01759
  1849. <a name="l01760"></a>01760 ztr(nlev+1) = tgr
  1850. <a name="l01761"></a>01761
  1851. <a name="l01762"></a>01762 <span class="keyword">write</span>(*,9001)
  1852. <a name="l01763"></a>01763 <span class="keyword">write</span>(*,9002)
  1853. <a name="l01764"></a>01764 <span class="keyword">write</span>(*,9003)
  1854. <a name="l01765"></a>01765 <span class="keyword">write</span>(*,9002)
  1855. <a name="l01766"></a>01766
  1856. <a name="l01767"></a>01767 <span class="keyword">do</span> jlev=1,nlev
  1857. <a name="l01768"></a>01768 ztr(jlev) = sum(gtc(:,:,jlev)) / (nlon * nlat)
  1858. <a name="l01769"></a>01769 <span class="keyword">enddo</span>
  1859. <a name="l01770"></a>01770
  1860. <a name="l01771"></a>01771 <span class="keyword">do</span> jlev=1,nlev
  1861. <a name="l01772"></a>01772 <span class="keyword">write</span>(*,9004) jlev,sigma(jlev),ztr(jlev),ztr(jlev+1)-ztr(jlev),gra(jlev)
  1862. <a name="l01773"></a>01773 <span class="keyword">enddo</span>
  1863. <a name="l01774"></a>01774
  1864. <a name="l01775"></a>01775 <span class="keyword">write</span>(*,9002)
  1865. <a name="l01776"></a>01776 <span class="keyword">write</span>(*,9001)
  1866. <a name="l01777"></a>01777 return
  1867. <a name="l01778"></a>01778 9001 format(/)
  1868. <a name="l01779"></a>01779 9002 format(1x,45(<span class="stringliteral">&#39;*&#39;</span>))
  1869. <a name="l01780"></a>01780 9003 format(<span class="stringliteral">&#39; * Lv * Sigma Restor-T Delta-T Vfact *&#39;</span>)
  1870. <a name="l01781"></a>01781 9004 format(<span class="stringliteral">&#39; *&#39;</span>,i3,<span class="stringliteral">&#39; * &#39;</span>,4f9.3,<span class="stringliteral">&#39; *&#39;</span>)
  1871. <a name="l01782"></a>01782 <span class="keyword"> end</span>
  1872. <a name="l01783"></a>01783
  1873. <a name="l01784"></a>01784 <span class="comment">! =====================</span>
  1874. <a name="l01785"></a>01785 <span class="comment">! * SUBROUTINE LEGPRI *</span>
  1875. <a name="l01786"></a>01786 <span class="comment">! =====================</span>
  1876. <a name="l01787"></a>01787
  1877. <a name="l01788"></a><a class="code" href="ppp_8f90.html#a03d027a1b5f735efb9bce2396d5fc2b6">01788</a> <span class="keyword">subroutine </span><a class="code" href="ppp_8f90.html#a03d027a1b5f735efb9bce2396d5fc2b6">legpri</a>
  1878. <a name="l01789"></a>01789 use <span class="keywordflow">pumamod</span>
  1879. <a name="l01790"></a>01790
  1880. <a name="l01791"></a>01791 <span class="keyword">write</span> (*,231)
  1881. <a name="l01792"></a>01792 <span class="keyword">write</span> (*,232)
  1882. <a name="l01793"></a>01793 <span class="keyword">write</span> (*,233)
  1883. <a name="l01794"></a>01794 <span class="keyword">write</span> (*,232)
  1884. <a name="l01795"></a>01795 <span class="keyword">do</span> 14 jlat = 1 , nlat
  1885. <a name="l01796"></a>01796 zalat = dla(jlat)*180.0/PI
  1886. <a name="l01797"></a>01797 <span class="keyword">write</span> (*,234) jlat,zalat,csq(jlat),gwd(jlat)
  1887. <a name="l01798"></a>01798 14 continue
  1888. <a name="l01799"></a>01799 <span class="keyword">write</span> (*,232)
  1889. <a name="l01800"></a>01800 <span class="keyword">write</span> (*,231)
  1890. <a name="l01801"></a>01801 return
  1891. <a name="l01802"></a>01802 231 format(/)
  1892. <a name="l01803"></a>01803 232 format(1x,36(<span class="stringliteral">&#39;*&#39;</span>))
  1893. <a name="l01804"></a>01804 233 format(<span class="stringliteral">&#39; * No * Lat * csq weight *&#39;</span>)
  1894. <a name="l01805"></a>01805 234 format(<span class="stringliteral">&#39; *&#39;</span>,i3,<span class="stringliteral">&#39; *&#39;</span>,f6.1,<span class="stringliteral">&#39; *&#39;</span>,2f10.4,<span class="stringliteral">&#39; *&#39;</span>)
  1895. <a name="l01806"></a>01806 <span class="keyword"> end</span>
  1896. <a name="l01807"></a>01807
  1897. <a name="l01808"></a>01808
  1898. <a name="l01809"></a>01809 <span class="comment">! =================</span>
  1899. <a name="l01810"></a>01810 <span class="comment">! SUBROUTINE INILAT</span>
  1900. <a name="l01811"></a>01811 <span class="comment">! =================</span>
  1901. <a name="l01812"></a>01812
  1902. <a name="l01813"></a><a class="code" href="ppp_8f90.html#a7780f6c3a813605c014f7da964ff83d2">01813</a> <span class="keyword">subroutine </span><a class="code" href="ppp_8f90.html#a7780f6c3a813605c014f7da964ff83d2">inilat</a>
  1903. <a name="l01814"></a>01814 use <span class="keywordflow">pumamod</span>
  1904. <a name="l01815"></a>01815 <span class="keywordtype">character(1)</span> :: ch
  1905. <a name="l01816"></a>01816
  1906. <a name="l01817"></a>01817 ch = <span class="stringliteral">&#39;N&#39;</span>
  1907. <a name="l01818"></a>01818 <span class="keyword">do</span> jlat = 1 , nlat
  1908. <a name="l01819"></a>01819 csq(jlat) = 1.0 - sid(jlat) * sid(jlat)
  1909. <a name="l01820"></a>01820 dla(jlat) = asin(sid(jlat))
  1910. <a name="l01821"></a>01821 <span class="keyword">enddo</span>
  1911. <a name="l01822"></a>01822 <span class="keyword">do</span> jlat = 1 , nlat/2
  1912. <a name="l01823"></a>01823 ideg = nint(180.0/PI * asin(sid(jlat)))
  1913. <a name="l01824"></a>01824 <span class="keyword">write</span>(chlat(jlat),<span class="stringliteral">&#39;(i2,a1)&#39;</span>) ideg,<span class="stringliteral">&#39;N&#39;</span>
  1914. <a name="l01825"></a>01825 <span class="keyword">write</span>(chlat(nlat+1-jlat),<span class="stringliteral">&#39;(i2,a1)&#39;</span>) ideg,<span class="stringliteral">&#39;S&#39;</span>
  1915. <a name="l01826"></a>01826 <span class="keyword">enddo</span>
  1916. <a name="l01827"></a>01827 return
  1917. <a name="l01828"></a>01828 <span class="keyword"> end</span>
  1918. <a name="l01829"></a>01829
  1919. <a name="l01830"></a>01830
  1920. <a name="l01831"></a>01831 <span class="comment">! =================</span>
  1921. <a name="l01832"></a>01832 <span class="comment">! SUBROUTINE SETZT2</span>
  1922. <a name="l01833"></a>01833 <span class="comment">! =================</span>
  1923. <a name="l01834"></a><a class="code" href="ppp_8f90.html#aa036704b2d766c3d7b7b48756b972d05">01834</a> <span class="keyword">subroutine </span><a class="code" href="ppp_8f90.html#aa036704b2d766c3d7b7b48756b972d05">setzt2</a>
  1924. <a name="l01835"></a>01835 use <span class="keywordflow">pumamod</span>
  1925. <a name="l01836"></a>01836
  1926. <a name="l01837"></a>01837 <span class="comment">! US standard atmosphere (1976):</span>
  1927. <a name="l01838"></a>01838 parameter(INL = 7) <span class="comment">! number of defined layers</span>
  1928. <a name="l01839"></a>01839 dimension zzus(0:INL) <span class="comment">! height of interfaces between layers</span>
  1929. <a name="l01840"></a>01840 dimension zlus(INL) <span class="comment">! temperature lapse rates of layers</span>
  1930. <a name="l01841"></a>01841 dimension zpus(0:INL) <span class="comment">! pressure at interfaces between layers</span>
  1931. <a name="l01842"></a>01842 dimension ztus(0:INL) <span class="comment">! temperature at interfaces between layers</span>
  1932. <a name="l01843"></a>01843
  1933. <a name="l01844"></a>01844 dimension ztrs(nlev) <span class="comment">! Mean profile</span>
  1934. <a name="l01845"></a>01845 dimension ztpv(nlev) <span class="comment">! Vertical profile of stratospheric polar</span>
  1935. <a name="l01846"></a>01846 <span class="comment">! vortex forcing</span>
  1936. <a name="l01847"></a>01847 dimension zdtep(nlat)
  1937. <a name="l01848"></a>01848 dimension zdtns(nlat)
  1938. <a name="l01849"></a>01849 dimension zff(nlev)
  1939. <a name="l01850"></a>01850 dimension zfw(nlat,nlev)
  1940. <a name="l01851"></a>01851 dimension zfsph(nlat,nlev)
  1941. <a name="l01852"></a>01852 dimension zqc(nlat,nlev)
  1942. <a name="l01853"></a>01853 dimension zphi(nlat)
  1943. <a name="l01854"></a>01854 dimension zgr1(nlon,nlat,nlev)
  1944. <a name="l01855"></a>01855 dimension zgr2(nlon,nlat,nlev)
  1945. <a name="l01856"></a>01856 dimension zfls(nlat,nlev)
  1946. <a name="l01857"></a>01857
  1947. <a name="l01858"></a>01858 <span class="keywordtype">real</span> :: zp
  1948. <a name="l01859"></a>01859 <span class="keywordtype">real</span> :: zsigtp
  1949. <a name="l01860"></a>01860 <span class="keywordtype">real</span> :: pref
  1950. <a name="l01861"></a>01861 <span class="keywordtype">real</span> :: zpmaxsph
  1951. <a name="l01862"></a>01862
  1952. <a name="l01863"></a>01863 sr1(:,:) = 0.0 <span class="comment">! NESP,nlev</span>
  1953. <a name="l01864"></a>01864 sr2(:,:) = 0.0 <span class="comment">! NESP,nlev</span>
  1954. <a name="l01865"></a>01865
  1955. <a name="l01866"></a>01866 <span class="comment">! 1. Mean vertical profile (MVP), approx. US standard atmosphere</span>
  1956. <a name="l01867"></a>01867
  1957. <a name="l01868"></a>01868 zzus(0) = 0.
  1958. <a name="l01869"></a>01869 zzus(1) = dtrop <span class="comment">! US standard atmosphere: zzus(1) = 11000.</span>
  1959. <a name="l01870"></a>01870 zzus(2) = 20000.
  1960. <a name="l01871"></a>01871 zzus(3) = 32000.
  1961. <a name="l01872"></a>01872 zzus(4) = 47000.
  1962. <a name="l01873"></a>01873 zzus(5) = 51000.
  1963. <a name="l01874"></a>01874 zzus(6) = 71000.
  1964. <a name="l01875"></a>01875 zzus(7) = 84852.
  1965. <a name="l01876"></a>01876 zlus(1) = ALR <span class="comment">! US standard atmosphere: zlus(1) = 0.0065</span>
  1966. <a name="l01877"></a>01877 zlus(2) = 0.0
  1967. <a name="l01878"></a>01878 zlus(3) = -0.001
  1968. <a name="l01879"></a>01879 zlus(4) = -0.0028
  1969. <a name="l01880"></a>01880 zlus(5) = 0.0
  1970. <a name="l01881"></a>01881 zlus(6) = 0.0028
  1971. <a name="l01882"></a>01882 zlus(7) = 0.002
  1972. <a name="l01883"></a>01883
  1973. <a name="l01884"></a>01884 <span class="comment">! calculation of pressure and temperature at layer interfaces</span>
  1974. <a name="l01885"></a>01885
  1975. <a name="l01886"></a>01886 zpus(0) = PSURF <span class="comment">! US standard atmosphere: zpus(0) = 1013.25 hPa</span>
  1976. <a name="l01887"></a>01887 ztus(0) = tgr <span class="comment">! US standard atmosphere: ztus(0) = 288.15 K</span>
  1977. <a name="l01888"></a>01888
  1978. <a name="l01889"></a>01889 <span class="keyword">do</span> ji=1,INL
  1979. <a name="l01890"></a>01890 ztus(ji) = ztus(ji-1) - zlus(ji) * (zzus(ji) - zzus(ji-1))
  1980. <a name="l01891"></a>01891 <span class="keyword">if</span> (zlus(ji) == 0.) <span class="keyword">then</span>
  1981. <a name="l01892"></a>01892 zpus(ji) = zpus(ji-1) * exp(-GA * (zzus(ji) - zzus(ji-1)) &amp;
  1982. <a name="l01893"></a>01893 &amp; / (GASCON * ztus(ji-1)))
  1983. <a name="l01894"></a>01894 <span class="keyword">else</span>
  1984. <a name="l01895"></a>01895 zpus(ji) = zpus(ji-1) &amp;
  1985. <a name="l01896"></a>01896 &amp; * (ztus(ji) / ztus(ji-1))**(GA/(GASCON*zlus(ji)))
  1986. <a name="l01897"></a>01897 <span class="keyword">endif</span>
  1987. <a name="l01898"></a>01898 <span class="keyword">enddo</span>
  1988. <a name="l01899"></a>01899
  1989. <a name="l01900"></a>01900 <span class="comment">! calculation of temperature on given sigma full levels, sigma(1:nlev)</span>
  1990. <a name="l01901"></a>01901 <span class="keyword">do</span> jlev=nlev,1,-1
  1991. <a name="l01902"></a>01902 zp = sigma(jlev)*PSURF
  1992. <a name="l01903"></a>01903 <span class="keyword">if</span> (zp &lt;= zpus(0) .and. zp &gt; zpus(1)) <span class="keyword">then</span>
  1993. <a name="l01904"></a>01904 ztrs(jlev) = ztus(0) * (zp / zpus(0))**(GASCON*zlus(1)/GA)
  1994. <a name="l01905"></a>01905 elseif (zp &lt;= zpus(1) .and. zp &gt; zpus(2)) <span class="keyword">then</span>
  1995. <a name="l01906"></a>01906 ztrs(jlev) = ztus(1) * (zp / zpus(1))**(GASCON*zlus(2)/GA)
  1996. <a name="l01907"></a>01907 elseif (zp &lt;= zpus(2) .and. zp &gt; zpus(3)) <span class="keyword">then</span>
  1997. <a name="l01908"></a>01908 ztrs(jlev) = ztus(2) * (zp / zpus(2))**(GASCON*zlus(3)/GA)
  1998. <a name="l01909"></a>01909 elseif (zp &lt;= zpus(3) .and. zp &gt; zpus(4)) <span class="keyword">then</span>
  1999. <a name="l01910"></a>01910 ztrs(jlev) = ztus(3) * (zp / zpus(3))**(GASCON*zlus(4)/GA)
  2000. <a name="l01911"></a>01911 elseif (zp &lt;= zpus(4) .and. zp &gt; zpus(5)) <span class="keyword">then</span>
  2001. <a name="l01912"></a>01912 ztrs(jlev) = ztus(4) * (zp / zpus(4))**(GASCON*zlus(5)/GA)
  2002. <a name="l01913"></a>01913 elseif (zp &lt;= zpus(5) .and. zp &gt; zpus(6)) <span class="keyword">then</span>
  2003. <a name="l01914"></a>01914 ztrs(jlev) = ztus(5) * (zp / zpus(5))**(GASCON*zlus(6)/GA)
  2004. <a name="l01915"></a>01915 elseif (zp &lt;= zpus(6) .and. zp &gt; zpus(7)) <span class="keyword">then</span>
  2005. <a name="l01916"></a>01916 ztrs(jlev) = ztus(6) * (zp / zpus(6))**(GASCON*zlus(7)/GA)
  2006. <a name="l01917"></a>01917 <span class="keyword">else</span>
  2007. <a name="l01918"></a>01918 ztrs(jlev) = ztus(7)
  2008. <a name="l01919"></a>01919 <span class="keyword">endif</span>
  2009. <a name="l01920"></a>01920 <span class="keyword">enddo</span>
  2010. <a name="l01921"></a>01921
  2011. <a name="l01922"></a>01922 <span class="comment">! 2. Symmetric equator-pole forcing mode (DTEP) and</span>
  2012. <a name="l01923"></a>01923 <span class="comment">! 3. Asymmetric Npole-Spole forcing mode (DTNS)</span>
  2013. <a name="l01924"></a>01924
  2014. <a name="l01925"></a>01925 <span class="comment">! sid(nlat) is sine of latitude, taking into account the nonequally</span>
  2015. <a name="l01926"></a>01926 <span class="comment">! spaced Gaussian latitudes.</span>
  2016. <a name="l01927"></a>01927 <span class="keyword">do</span> jlat=1,nlat
  2017. <a name="l01928"></a>01928 zdtep(jlat) = -dtep * (sid(jlat)**2 - 1./3.)
  2018. <a name="l01929"></a>01929 zdtns(jlat) = dtns * sid(jlat) / 2.
  2019. <a name="l01930"></a>01930 <span class="keyword">enddo</span>
  2020. <a name="l01931"></a>01931
  2021. <a name="l01932"></a>01932 <span class="comment">! 4. Factor modulating the DTEP and DTNS modes (f)</span>
  2022. <a name="l01933"></a>01933
  2023. <a name="l01934"></a>01934 zsigtp = zpus(1)/zpus(0) <span class="comment">! sigma at tropopause</span>
  2024. <a name="l01935"></a>01935 zff(:) = 0.
  2025. <a name="l01936"></a>01936 <span class="keyword">do</span> jlev=1,nlev
  2026. <a name="l01937"></a>01937 <span class="keyword">if</span> (sigma(jlev) &gt; zsigtp) <span class="keyword">then</span>
  2027. <a name="l01938"></a>01938 zff(jlev) = sin(0.5*PI * (sigma(jlev) - zsigtp) &amp;
  2028. <a name="l01939"></a>01939 &amp; / (1. - zsigtp))
  2029. <a name="l01940"></a>01940 <span class="keyword">endif</span>
  2030. <a name="l01941"></a>01941 <span class="keyword">enddo</span>
  2031. <a name="l01942"></a>01942
  2032. <a name="l01943"></a>01943 <span class="comment">! 5. Vertical profile of stratospheric polar vortex forcing</span>
  2033. <a name="l01944"></a>01944
  2034. <a name="l01945"></a>01945 ztpv(:) = 0.
  2035. <a name="l01946"></a>01946 <span class="keyword">if</span> (pmaxpv == 0.) <span class="keyword">then</span>
  2036. <a name="l01947"></a>01947 <span class="keyword">do</span> jlev=1,nlev
  2037. <a name="l01948"></a>01948 <span class="keyword">if</span> (sigma(jlev) &lt;= zsigtp) <span class="keyword">then</span>
  2038. <a name="l01949"></a>01949 ztpv(jlev) = ztus(1) * (sigma(jlev)*PSURF / zpus(1)) &amp;
  2039. <a name="l01950"></a>01950 &amp; **(GASCON*alrpv/GA)
  2040. <a name="l01951"></a>01951 <span class="keyword">endif</span>
  2041. <a name="l01952"></a>01952 <span class="keyword">enddo</span>
  2042. <a name="l01953"></a>01953 elseif (pmaxpv &gt; 0.) <span class="keyword">then</span>
  2043. <a name="l01954"></a>01954 <span class="keyword">do</span> jlev=1,nlev
  2044. <a name="l01955"></a>01955 <span class="keyword">if</span> (sigma(jlev) &lt;= pmaxpv/PSURF) <span class="keyword">then</span>
  2045. <a name="l01956"></a>01956 ztpv(jlev) = ztus(1) * (sigma(jlev)*PSURF / pmaxpv) &amp;
  2046. <a name="l01957"></a>01957 &amp; **(GASCON*alrpv/GA)
  2047. <a name="l01958"></a>01958 <span class="keyword">else</span>
  2048. <a name="l01959"></a>01959 ztpv(jlev) = ztus(1)
  2049. <a name="l01960"></a>01960 <span class="keyword">endif</span>
  2050. <a name="l01961"></a>01961 <span class="keyword">enddo</span>
  2051. <a name="l01962"></a>01962 <span class="keyword">endif</span>
  2052. <a name="l01963"></a>01963
  2053. <a name="l01964"></a>01964 <span class="comment">! 6. Factor confining the stratosph. polar vortex to high latitudes</span>
  2054. <a name="l01965"></a>01965
  2055. <a name="l01966"></a>01966 zphi(:) = dla(:) * 180. / PI
  2056. <a name="l01967"></a>01967 zfw(:,:) = 0.
  2057. <a name="l01968"></a>01968 <span class="keyword">if</span> (edgepv &gt; 0.) <span class="keyword">then</span>
  2058. <a name="l01969"></a>01969 <span class="keyword">do</span> jlev=1,nlev
  2059. <a name="l01970"></a>01970 <span class="keyword">if</span> (sigma(jlev) &lt;= pmaxpv/PSURF) <span class="keyword">then</span>
  2060. <a name="l01971"></a>01971 <span class="keyword">do</span> jlat=1,nlat
  2061. <a name="l01972"></a>01972 zfw(jlat,jlev) = &amp;
  2062. <a name="l01973"></a>01973 &amp; 0.5 * (1. - tanh((radpv - zphi(jlat)) / edgepv))
  2063. <a name="l01974"></a>01974 <span class="keyword">enddo</span>
  2064. <a name="l01975"></a>01975 <span class="keyword">endif</span>
  2065. <a name="l01976"></a>01976 <span class="keyword">enddo</span>
  2066. <a name="l01977"></a>01977 <span class="keyword">endif</span>
  2067. <a name="l01978"></a>01978
  2068. <a name="l01979"></a>01979 <span class="comment">! 7. Lower stratospheric forcing</span>
  2069. <a name="l01980"></a>01980
  2070. <a name="l01981"></a>01981 zfls(:,:) = 0.
  2071. <a name="l01982"></a>01982 <span class="keyword">if</span> (nfls == 1) <span class="keyword">then</span>
  2072. <a name="l01983"></a>01983 <span class="keyword">do</span> jlev=1,nlev
  2073. <a name="l01984"></a>01984 zp =sigma(jlev) * PSURF
  2074. <a name="l01985"></a>01985 <span class="keyword">do</span> jlat=1,nlat
  2075. <a name="l01986"></a>01986 <span class="keyword">if</span> (zp &gt; flsp0-flsdp .and. zp &lt; flsp0+flsdp) <span class="keyword">then</span>
  2076. <a name="l01987"></a>01987 zfls(jlat,jlev) = cos(0.5 * PI * (zp - flsp0) / flsdp)&amp;
  2077. <a name="l01988"></a>01988 &amp; * (flsoff - flsamp * cos(2. * zphi(jlat) * PI / 180.))
  2078. <a name="l01989"></a>01989 <span class="keyword">endif</span>
  2079. <a name="l01990"></a>01990 <span class="keyword">enddo</span>
  2080. <a name="l01991"></a>01991 <span class="keyword">enddo</span>
  2081. <a name="l01992"></a>01992 <span class="keyword">endif</span>
  2082. <a name="l01993"></a>01993
  2083. <a name="l01994"></a>01994 <span class="comment">! construct restoration temperature field</span>
  2084. <a name="l01995"></a>01995
  2085. <a name="l01996"></a>01996 <span class="keyword">do</span> jlev=1,nlev
  2086. <a name="l01997"></a>01997 <span class="keyword">do</span> jlat=1,nlat
  2087. <a name="l01998"></a>01998 zgr1(:,jlat,jlev) = ((1. - zfw(jlat,jlev)) * ztrs(jlev) &amp;
  2088. <a name="l01999"></a>01999 &amp; + zfw(jlat,jlev) * ztpv(jlev) + zff(jlev) * zdtep(jlat) &amp;
  2089. <a name="l02000"></a>02000 &amp; + (1. - zfw(jlat,jlev)) * zfls(jlat,jlev) - t0k(jlev)) / CT
  2090. <a name="l02001"></a>02001 zgr2(:,jlat,jlev) = (zff(jlev) * zdtns(jlat)) / CT
  2091. <a name="l02002"></a>02002 <span class="keyword">enddo</span>
  2092. <a name="l02003"></a>02003 <span class="keyword">enddo</span>
  2093. <a name="l02004"></a>02004
  2094. <a name="l02005"></a>02005 <span class="keyword">do</span> jlev = 1 , nlev
  2095. <a name="l02006"></a>02006 gtc(:,:,jlev) = t0k(jlev) + CT * zgr1(:,:,jlev)
  2096. <a name="l02007"></a>02007 gtv(:,:,jlev) = CT * zgr2(:,:,jlev)
  2097. <a name="l02008"></a>02008 <span class="keyword">enddo</span>
  2098. <a name="l02009"></a>02009
  2099. <a name="l02010"></a>02010 <span class="comment">! ---------- test output to control T_r field ----------</span>
  2100. <a name="l02011"></a>02011 <span class="keyword">open</span>(112,file=<span class="stringliteral">&#39;tr_test.srv&#39;</span>,form=<span class="stringliteral">&#39;unformatted&#39;</span>)
  2101. <a name="l02012"></a>02012 <span class="keyword">do</span> jlev=1,nlev
  2102. <a name="l02013"></a>02013 ip = int(sigma(jlev) * PSURF * 1000.)
  2103. <a name="l02014"></a>02014 <span class="keyword">write</span>(112) 121, ip, 0000, 00, nlon, nlat, 0, 0
  2104. <a name="l02015"></a>02015 <span class="keyword">write</span>(112) t0k(jlev) + (zgr1(:,:,jlev) + zgr2(:,:,jlev)) * CT
  2105. <a name="l02016"></a>02016 <span class="keyword">enddo</span>
  2106. <a name="l02017"></a>02017 <span class="keyword">close</span>(112)
  2107. <a name="l02018"></a>02018 <span class="comment">! ---------- test output to control T_r field ----------</span>
  2108. <a name="l02019"></a>02019
  2109. <a name="l02020"></a>02020 print *,<span class="stringliteral">&#39;**************************************************&#39;</span>
  2110. <a name="l02021"></a>02021 print *,<span class="stringliteral">&#39;* Restoration Temperature set up for aqua planet *&#39;</span>
  2111. <a name="l02022"></a>02022 print *,<span class="stringliteral">&#39;* including stratosphere and polar vortex *&#39;</span>
  2112. <a name="l02023"></a>02023 print *,<span class="stringliteral">&#39;**************************************************&#39;</span>
  2113. <a name="l02024"></a>02024 return
  2114. <a name="l02025"></a>02025 <span class="keyword"> end</span>
  2115. </pre></div></div>
  2116. </div>
  2117. <div id="nav-path" class="navpath">
  2118. <ul>
  2119. <li class="navelem"><a class="el" href="ppp_8f90.html">ppp.f90</a> </li>
  2120. <!-- window showing the filter options -->
  2121. <div id="MSearchSelectWindow"
  2122. onmouseover="return searchBox.OnSearchSelectShow()"
  2123. onmouseout="return searchBox.OnSearchSelectHide()"
  2124. onkeydown="return searchBox.OnSearchSelectKey(event)">
  2125. <a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Defines</a></div>
  2126. <!-- iframe showing the search results (closed by default) -->
  2127. <div id="MSearchResultsWindow">
  2128. <iframe src="javascript:void(0)" frameborder="0"
  2129. name="MSearchResults" id="MSearchResults">
  2130. </iframe>
  2131. </div>
  2132. <li class="footer">Generated on Wed Sep 21 2011 12:35:46 for PUMA by
  2133. <a href="http://www.doxygen.org/index.html">
  2134. <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.5.1 </li>
  2135. </ul>
  2136. </div>
  2137. </body>
  2138. </html>