{"id":388,"date":"2023-08-02T19:42:25","date_gmt":"2023-08-02T19:42:25","guid":{"rendered":"https:\/\/itwg.ssec.wisc.edu\/rtsp\/?page_id=388"},"modified":"2023-08-02T19:42:25","modified_gmt":"2023-08-02T19:42:25","slug":"geopotential-subprograms","status":"publish","type":"page","link":"https:\/\/itwg.ssec.wisc.edu\/rtsp\/geopotential-subprograms\/","title":{"rendered":"Geopotential Subprograms"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">GEOPOTENTIAL_HEIGHT<\/h2>\n\n\n\n<pre class=\"wp-block-preformatted\"> NAME:\n       Geopotential_Height\n\n PURPOSE:\n       Function to calculate geopotential height using the hypsometric\n       equation.\n\n CALLING SEQUENCE:\n       Error_Statusz = Geopotential_Height( Pressure,                                          &amp;  ! Input\n                                            Temperature,                                       &amp;  ! Input\n                                            Water_Vapor_Pressure,                              &amp;  ! Input\n                                            Height,                                            &amp;  ! Output\n                                            Surface_Height          =Surface_Height,           &amp;  ! Optional input\n                                            Gravity_Correction      =Gravity_Correction,       &amp;  ! Optional input\n                                            Latitude                =Latitude,                 &amp;  ! Optional input\n                                            Zonal_Wind_Velocity     =Zonal_Wind_Velocity,      &amp;  ! Optional input\n                                            Meridional_Wind_Velocity=Meridional_Wind_Velocity, &amp;  ! Optional input\n                                            RCS_Id                  =RCS_Id,                   &amp;  ! Revision control\n                                            Message_Log             =Message_Log               )  ! Error messaging\n\n INPUT ARGUMENTS:\n       Pressure:                  Pressure of the atmospheric levels.\n                                  UNITS:      hectoPascals, hPa\n                                  TYPE:       REAL(fp)\n                                  DIMENSION:  Rank-1 (K x 1)\n                                  ATTRIBUTES: INTENT(IN)\n\n       Temperature:               Temperature of the atmospheric levels.\n                                  UNITS:      Kelvin, K\n                                  TYPE:       REAL(fp)\n                                  DIMENSION:  Same as Pressure\n                                  ATTRIBUTES: INTENT(IN)\n\n       Water_Vapor_Pressure:      Water vapor partial pressure at the atmospheric levels\n                                  UNITS:      hectoPascals, hPa\n                                  TYPE:       REAL(fp)\n                                  DIMENSION:  Same as Pressure\n                                  ATTRIBUTES: INTENT(IN)\n\n OPTIONAL INPUT ARGUMENTS:\n       Surface_Height:            Height corresponding to the first element of the\n                                  input arrays. If not specified, the default value\n                                  is 0.0m.\n                                  UNITS:      metres, m.\n                                  TYPE:       REAL(fp)\n                                  DIMENSION:  Scalar\n                                  ATTRIBUTES: OPTIONAL, INTENT(IN)\n\n       Gravity_Correction:        Set this argument to use a gravity profile rather\n                                  than standard reference gravity in calculating\n                                  the geopotential Heights. If PRESENT then,\n                                  if = 0, standard gravity used,\n                                     = 1, gravity profile is calculated and used.\n                                  UNITS:      N\/A.\n                                  TYPE:       INTEGER\n                                  DIMENSION:  Scalar\n                                  ATTRIBUTES: OPTIONAL, INTENT(IN)\n\n       Latitude:                  Set this argument to the Latitude corresponding\n                                  to the input profile location. This argument is\n                                  ignored if the Gravity_Correction argument is\n                                  NOT set. If not defined and required, the default\n                                  value is zero.\n                                  UNITS:      Degrees (no N or S hemisphere dep.).\n                                  TYPE:       REAL(fp)\n                                  DIMENSION:  Scalar\n                                  ATTRIBUTES: OPTIONAL, INTENT(IN)\n\n       Zonal_Wind_Velocity:       Set this argument to the zonal wind velocities\n                                  at the input profile levels. This argument is\n                                  ignored if the Gravity_Correction argument is\n                                  not set. If not specified, the default value\n                                  is zero.\n                                  UNITS:      m.s^-1, +ve W'ly, -ve E'ly\n                                  TYPE:       REAL(fp)\n                                  DIMENSION:  Same as Pressure\n                                  ATTRIBUTES: OPTIONAL, INTENT(IN)\n\n       Meridional_Wind_Velocity:  Set this argument to the meridional wind velocities\n                                  at the input profile levels. This argument is\n                                  ignored if the Gravity_Correction argument is\n                                  not set. If not specified, the default value\n                                  is zero.\n                                  UNITS:      m.s^-1, +ve S'ly, -ve N'ly\n                                  TYPE:       REAL(fp)\n                                  DIMENSION:  Same as Pressure\n                                  ATTRIBUTES: OPTIONAL, INTENT(IN)\n\n       Message_Log:               Character string specifying a filename in which any\n                                  Messages will be logged. If not specified, or if an\n                                  error occurs opening the log file, the default action\n                                  is to output Messages to standard output.\n                                  UNITS:      N\/A\n                                  TYPE:       CHARACTER(*)\n                                  DIMENSION:  Scalar\n                                  ATTRIBUTES: OPTIONAL, INTENT(IN)\n\n\n OUTPUT ARGUMENTS:\n       Height:                    Geopotential Heights of the input Pressure levels.\n                                  UNITS:      metres, m\n                                  TYPE:       REAL(fp)\n                                  DIMENSION:  Same as input Pressure\n                                  ATTRIBUTES: INTENT(OUT)\n\n OPTIONAL OUTPUT ARGUMENTS:\n       RCS_Id:                    Character string containing the Revision Control\n                                  System Id field for the module.\n                                  UNITS:      N\/A\n                                  TYPE:       CHARACTER(*)\n                                  DIMENSION:  Scalar\n                                  ATTRIBUTES: OPTIONAL, INTENT(OUT)\n\n FUNCTION RESULT:\n       Error_Status:              The return value is an integer defining the\n                                  error status. The error codes are defined\n                                  in the ERROR_HANDLER module.\n                                  If == SUCCESS the geopotential calculation was\n                                                successful\n                                     == FAILURE an unrecoverable error occurred\n                                  UNITS:      N\/A\n                                  TYPE:       INTEGER\n                                  DIMENSION:  Scalar\n\n PROCEDURE:\n       Geopotential heights are calculated using the hypsometric equation:\n\n                   _   [  p1  ]\n         z2 - z1 = H.ln[ ---- ]     .....(1)\n                       [  p2  ]\n             _\n       where H     = scale height, \n             p1,p2 = layer boundary pressures, and\n             z1,z2 = layer boundary heights.\n\n       and\n              \n         _    R_air * T \n         H = -----------     .....(2)\n                  g     \n\n       where R_air = gas constant for moist air\n             T     = average temperature for an atmospheric layer,\n             g     = acceleration due to gravity\n\n       The gas constant for air is given by:\n\n                  1000 * R\n         R_air = ----------     .....(3)\n                   MW_air\n\n       where R0     = Molar gas constant\n             MW_air = Water vapor weighted molecular weight of air\n\n       and the factor of 1000 is for conversion of the molecular\n       weight from g.mol^-1 to kg.mol^-1.\n\n       Layer values for both R_air and T are determined from a density\n       weighted average of adjacent level values:\n\n                    X(k)*rho(k) + X(k-1)*rho(k-1)\n         layer_X = -------------------------------\n                         rho(k) + rho(k-1)\n\n       The use of an optional gravity profile was introduced to make \n       this code parallel that of the UMBC KLAYERS altitude calculation\n       code.\n\n       Units analysis:\n       ---------------\n\n       Typical units of the quantities are,\n\n         units(T)      = K\n         units(g)      = m.s^-2\n         units(R0)     = J.K^-1.mol^-1 = kg.m^2.s^-2.K^-1.mol^-1\n         units(MW_air) = g.mol^-1\n\n       From eqn(3),\n\n                         kg.m^2.s^-2.K^-1.mol^-1\n         units(R_air) = -------------------------\n                               g.mol^-1\n\n                         1000 kg.m^2.s^-2.K^-1.mol^-1\n                      = ------------------------------\n                                 kg.mol^-1             \n\n                      = 1000 m^2.s^-2.K^-1\n\n       From eqn.(2),\n\n               _     1000 m^2.s^-2.K^-1 . K\n         units(H) = ------------------------\n                            m.s^-2\n\n                   = 1000 m\n\n       So the final heights must be multiplied by 1000 to get units of metres.\n\n\n       If you're wondering why I don't use the virtual temperature rather\n       than calculate MW_air and R_air, the reasons are two-fold:\n         1) To calculate a density using the ideal gas law, you need to\n            know either of these quantities, and\n         2) Eventually, the effect due to ozone will also be included.\n\n CREATION HISTORY:\n       Written by:     Paul van Delst, CIMSS\/SSEC 21-Feb-1999\n                       paul.vandelst@ssec.wisc.edu\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>GEOPOTENTIAL_HEIGHT NAME: Geopotential_Height PURPOSE: Function to calculate geopotential height using the hypsometric equation. CALLING SEQUENCE: Error_Statusz = Geopotential_Height( Pressure, &amp; ! Input Temperature, &amp; ! Input Water_Vapor_Pressure, &amp; ! Input Height, &amp; ! Output Surface_Height =Surface_Height, &amp; ! Optional input Gravity_Correction =Gravity_Correction, &amp; ! Optional input Latitude =Latitude, &amp; ! Optional input Zonal_Wind_Velocity =Zonal_Wind_Velocity, &amp; [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_acf_changed":false,"footnotes":""},"class_list":["post-388","page","type-page","status-publish","hentry"],"acf":[],"_links":{"self":[{"href":"https:\/\/itwg.ssec.wisc.edu\/rtsp\/wp-json\/wp\/v2\/pages\/388","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/itwg.ssec.wisc.edu\/rtsp\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/itwg.ssec.wisc.edu\/rtsp\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/itwg.ssec.wisc.edu\/rtsp\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/itwg.ssec.wisc.edu\/rtsp\/wp-json\/wp\/v2\/comments?post=388"}],"version-history":[{"count":1,"href":"https:\/\/itwg.ssec.wisc.edu\/rtsp\/wp-json\/wp\/v2\/pages\/388\/revisions"}],"predecessor-version":[{"id":389,"href":"https:\/\/itwg.ssec.wisc.edu\/rtsp\/wp-json\/wp\/v2\/pages\/388\/revisions\/389"}],"wp:attachment":[{"href":"https:\/\/itwg.ssec.wisc.edu\/rtsp\/wp-json\/wp\/v2\/media?parent=388"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}