{"id":382,"date":"2023-08-02T17:37:35","date_gmt":"2023-08-02T17:37:35","guid":{"rendered":"https:\/\/itwg.ssec.wisc.edu\/rtsp\/?page_id=382"},"modified":"2023-08-02T17:37:36","modified_gmt":"2023-08-02T17:37:36","slug":"units-conversion","status":"publish","type":"page","link":"https:\/\/itwg.ssec.wisc.edu\/rtsp\/units-conversion\/","title":{"rendered":"Units Conversion"},"content":{"rendered":"\n<h1 class=\"wp-block-heading\">Subprogram Descriptions<\/h1>\n\n\n\n<h2 class=\"wp-block-heading\">SA_TO_MR<\/h2>\n\n\n\n<pre class=\"wp-block-preformatted\"> NAME:\n       SA_to_MR\n\n PURPOSE:\n       Function to convert gas specific amounts to mass mixing ratio\n\n CALLING SEQUENCE:\n       Mixing_Ratio = SA_to_MR( Specific_Amount,         &amp;  ! Input\n                                Water_Vapor=Water_Vapor, &amp;  ! Optional input\n                                Message_Log=Message_Log  )  ! Error messaging\n\n INPUT ARGUMENTS:\n       Specific_Amount:   Gas specific amount comcentration.\n                          UNITS:      g\/kg\n                          TYPE:       REAL(fp)\n                          DIMENSION:  Scalar or Rank-1 (K x 1)\n                          ATTRIBUTES: INTENT(IN)\n\n OPTIONAL INPUT ARGUMENTS:\n       Water_Vapor:       Water vapor mass mixing ratio. If this argument is\n                          not supplied, the mandatory input SPECIFIC_AMOUNT\n                          argument is assumed to be water vapor.\n                          UNITS:      g\/kg\n                          TYPE:       REAL(fp)\n                          DIMENSION:  Scalar or Rank-1 (K x 1)\n                          ATTRIBUTES: 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 FUNCTION RESULT:\n       Mixing_Ratio:      The gas mass mixing ratio. If an error occurs,\n                          the value -1.0 is returned.\n                          UNITS:      g\/kg\n                          TYPE:       REAL(fp)\n                          DIMENSION:  Same as input Specific_Amount\n\n PROCEDURE:\n       The specific amount is defined as the ratio of the mass of gas\n       to the total mass of air and water vapor in a given volume:\n\n                  Mg\n         SA = ---------   .......(1)\n               Md + Mw\n\n       where Mg = mass of gas\n             Mw = mass of water vapor\n             Md = mass of dry air (including Mg).\n\n       The gas mass mixing ratio is defined as the ratio of the mass\n       of the gas to the mass of dry air in a given volume:\n\n                Mg\n         MRg = ----    .......(2)\n                Md\n\n       Rearranging (1) and substituting in (2) gives,\n\n          1      Md + Mw\n         ---- = ---------\n          SA       Mg\n\n                 Md     Mw\n              = ---- + ----\n                 Mg     Mg\n\n                 Md     Mw   Md                                      Md\n              = ---- + ----.----    ( multiplying the second term by ---- )\n                 Mg     Md   Mg                                      Md\n\n                  1 \n              = ----- ( 1 + MRw )\n                 MRg\n\n       therefore,\n\n         MRg = SA ( 1 + MRw )\n\n       for input units of g\/g or kg\/kg. For input units of g\/kg then,\n\n         MRg = SA ( 1 + 0.001*MRw )   .......(3)\n\n       If the input specific amount is for water vapor (specific humidity) \n       then (3) becomes,\n\n         MRw = SA ( 1 + 0.001*MRw )\n\n       i.e.\n\n         MRw = SA + 0.001*MRw*SA\n\n       i.e.\n\n         MRw( 1 - 0.001*SA ) = SA\n\n       therefore,\n\n                      SA\n         MRw = ------------------   .......(4)\n                ( 1 - 0.001*SA )\n\n\n CREATION HISTORY:\n       Written by:     Paul van Delst, CIMSS\/SSEC 05-Dec-2003\n                       paul.vandelst@ssec.wisc.edu\n<\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\" \/>\n\n\n\n<h2 class=\"wp-block-heading\">MR_TO_SA<\/h2>\n\n\n\n<pre class=\"wp-block-preformatted\"> NAME:\n       MR_to_SA\n\n PURPOSE:\n       Function to convert gas concentrations from mass mixing ratio to\n       specific amounts.\n\n CATEGORY:\n       Profile Utility\n\n LANGUAGE:\n       Fortran-95\n\n CALLING SEQUENCE:\n       Specific_Amount = MR_to_SA( Mixing_Ratio,            &amp;  ! Input\n                                   Water_Vapor=Water_Vapor, &amp;  ! Optional input\n                                   Message_Log=Message_Log  )  ! Error messaging\n\n INPUT ARGUMENTS:\n       Mixing_Ratio:      Gas mass mixing ratio.\n                          UNITS:      g\/kg\n                          TYPE:       REAL(fp)\n                          DIMENSION:  Scalar or Rank-1 (K x 1)\n                          ATTRIBUTES: INTENT(IN)\n\n OPTIONAL INPUT ARGUMENTS:\n       Water_Vapor:       Water vapor specific humidity. If this argument is\n                          not supplied, the mandatory input MIXING_RATIO\n                          argument is assumed to be water vapor.\n                          UNITS:      g\/kg\n                          TYPE:       REAL(fp)\n                          DIMENSION:  Scalar or Rank-1 (K x 1)\n                          ATTRIBUTES: 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 FUNCTION RESULT:\n       Specific_Amount:   The gas specific amount. If an error occurs,\n                          the value -1.0 is returned.\n                          UNITS:      g\/kg\n                          TYPE:       REAL(fp)\n                          DIMENSION:  Same as input Mixing_Ratio\n\n PROCEDURE:\n       From the SA_to_MR conversion, we know that for input units of\n       g\/kg that,\n\n         MRg = SAg ( 1 + 0.001*MRw )   .......(1)\n\n       and \n                      SAw\n         MRw = -------------------   .......(2)\n                ( 1 - 0.001*SAw )\n\n       where MRg = mass mixing ratio of gas\n             MRw = mass mixing ratio of water vapor\n             SAg = specific amount of gas\n             SAw = specific amount of water vapor (specific humidity)\n\n       Rearranging (1) and (2) gives,\n\n         SAg = MRg ( 1 - 0.001*SAw )\n\n       and for water vapor only,\n\n                       MRw\n         SAw = -------------------\n                ( 1 + 0.001*MRw )\n\n CREATION HISTORY:\n       Written by:     Paul van Delst, CIMSS\/SSEC 05-Dec-2003\n                       paul.vandelst@ssec.wisc.edu\n<\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\" \/>\n\n\n\n<h2 class=\"wp-block-heading\">RH_TO_MR<\/h2>\n\n\n\n<p> NAME:<br>       RH_to_MR<br><br> PURPOSE:<br>       Function to convert relative humidity to water vapor mixing ratio<br><br> CALLING SEQUENCE:<br>       Mixing_Ratio = RH_to_MR( Pressure,                        &amp;  ! Input<br>                                Temperature,                     &amp;  ! Input<br>                                Relative_Humidity,               &amp;  ! Input<br>                                Ice_Temperature=Ice_Temperature, &amp;  ! optional input<br>                                Min_Pressure   =Min_Pressure,    &amp;  ! Optional input<br>                                Message_Log    =Message_Log      )  ! Error messaging<br><br> INPUT ARGUMENTS:<br>       Pressure:          Total atmospheric pressure.<br>                          UNITS:      hectoPascals, hPa<br>                          TYPE:       REAL(fp)<br>                          DIMENSION:  Scalar or Rank-1 (K x 1)<br>                          ATTRIBUTES: INTENT(IN)<br><br>       Temperature:       Atmospheric temperature.<br>                          UNITS:      Kelvin, K<br>                          TYPE:       REAL(fp)<br>                          DIMENSION:  Same as pressure<br>                          ATTRIBUTES: INTENT(IN)<br><br>       Relative_Humidity: Atmospheric relative humidity.<br>                          UNITS:      %<br>                          TYPE:       REAL(fp)<br>                          DIMENSION:  Same as pressure<br>                          ATTRIBUTES: INTENT(IN)<br>   <br> OPTIONAL INPUT ARGUMENTS:<br>       Ice_Temperature:   Temperature below which the saturation vapor<br>                          pressure over ice is used in the conversion.<br>                          By default, only the saturation vapor pressure<br>                          over water is used.<br>                          UNITS:      Kelvin, K<br>                          TYPE:       REAL(fp)<br>                          DIMENSION:  Scalar<br>                          ATTRIBUTES: OPTIONAL, INTENT(IN)<br>   <br>       Min_Pressure:      Pressure value below which the saturation<br>                          mixing ratio is not calculated. The default<br>                          is 50mb. Saturation mixing ratios below the<br>                          minimum pressure are set to zero. This is<br>                          because at pressures less than 50mb, the<br>                          saturation vapour Pressure, which is based<br>                          only on temperature, can exceed the total<br>                          air Pressure.<br>                          UNITS:      hectoPascals, hPa<br>                          TYPE:       REAL(fp)<br>                          DIMENSION:  Scalar<br>                          ATTRIBUTES: OPTIONAL, INTENT(IN)<br>   <br>       Message_Log:       Character string specifying a filename in which any<br>                          Messages will be logged. If not specified, or if an<br>                          error occurs opening the log file, the default action<br>                          is to output Messages to standard output.<br>                          UNITS:      N\/A<br>                          TYPE:       CHARACTER(*)<br>                          DIMENSION:  Scalar<br>                          ATTRIBUTES: OPTIONAL, INTENT(IN)<br><br> FUNCTION RESULT:<br>       Mixing_Ratio:      Water vapor mass mixing ratio. If an error occurs,<br>                          -1.0 is returned.<br>                          UNITS:      g\/kg<br>                          TYPE:       REAL(fp)<br>                          DIMENSION:  Same as input Pressure<br><br> PROCEDURE:<br>       Once the saturation mixing ratio is calculated the mixing ratio<br>       corresponding to the input relative humidity is determined using:<br><br>                       Relative_Humidity * Saturation_Mixing_Ratio<br>       Mixing_Ratio = &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br>                                        100<br><br> CREATION HISTORY:<br>       Written by:     Paul van Delst, CIMSS\/SSEC 02-Mar-1999<br>                       paul.vandelst@ssec.wisc.edu<br><\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\" \/>\n\n\n\n<h2 class=\"wp-block-heading\">MR_TO_RH<\/h2>\n\n\n\n<pre class=\"wp-block-preformatted\"> NAME:\n       MR_to_RH\n\n PURPOSE:\n       Function to convert water vapor mixing ratio to relative humidity\n\n CALLING SEQUENCE:\n       Relative_Humidty = MR_to_RH( Pressure,                        &amp;  ! Input\n                                    Temperature,                     &amp;  ! Input\n                                    Mixing_Ratio,                    &amp;  ! Input\n                                    Ice_Temperature=Ice_Temperature, &amp;  ! optional input\n                                    Min_Pressure   =Min_Pressure,    &amp;  ! Optional input\n                                    Message_Log    =Message_Log      )  ! Error messaging\n\n INPUT ARGUMENTS:\n       Pressure:          Total atmospheric pressure.\n                          UNITS:      hectoPascals, hPa\n                          TYPE:       REAL(fp)\n                          DIMENSION:  Scalar or Rank-1 (K x 1)\n                          ATTRIBUTES: INTENT(IN)\n\n       Temperature:       Atmospheric temperature.\n                          UNITS:      Kelvin, K\n                          TYPE:       REAL(fp)\n                          DIMENSION:  Same as pressure\n                          ATTRIBUTES: INTENT(IN)\n\n       Mixing_Ratio:      Water vapor mixing ratio.\n                          UNITS:      g\/kg\n                          TYPE:       REAL(fp)\n                          DIMENSION:  Same as pressure\n                          ATTRIBUTES: INTENT(IN)\n   \n OPTIONAL INPUT ARGUMENTS:\n       Ice_Temperature:   Temperature below which the saturation vapor\n                          pressure over ice is used in the conversion.\n                          By default, only the saturation vapor pressure\n                          over water is used.\n                          UNITS:      Kelvin, K\n                          TYPE:       REAL(fp)\n                          DIMENSION:  Scalar\n                          ATTRIBUTES: OPTIONAL, INTENT(IN)\n   \n       Min_Pressure:      Pressure value below which the saturation\n                          mixing ratio is not calculated. The default\n                          is 50mb. Saturation mixing ratios below the\n                          minimum pressure are set to zero. This is\n                          because at pressures less than 50mb, the\n                          saturation vapour Pressure, which is based\n                          only on temperature, can exceed the total\n                          air Pressure.\n                          UNITS:      hectoPascals, hPa\n                          TYPE:       REAL(fp)\n                          DIMENSION:  Scalar\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 FUNCTION RESULT:\n       Relative_Humidity: Relative humidity. If an error occurs,\n                          -1.0 is returned.\n                          UNITS:      %\n                          TYPE:       REAL(fp)\n                          DIMENSION:  Same as input Pressure\n\n PROCEDURE:\n       Once the saturation mixing ratio is calculated the relative humidity\n       corresponding to the input mixing ratio is determined using:\n\n                                         Mixing_Ratio\n       Relative_Humidity = 100.0 * -------------------------\n                                    Saturation_Mixing_Ratio\n\n CREATION HISTORY:\n       Written by:     Paul van Delst, CIMSS\/SSEC 02-Mar-1999\n                       paul.vandelst@ssec.wisc.edu\n<\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\" \/>\n\n\n\n<h2 class=\"wp-block-heading\">MR_TO_PPMV<\/h2>\n\n\n\n<p> NAME:<br>       MR_to_PPMV<br><br> PURPOSE:<br>       Function to convert gas concentrations from mass mixing ratio in g\/kg<br>       to volume mixing ratio in ppmv<br><br> CALLING SEQUENCE:<br>       ppmv = MR_to_PPMV( Mixing_Ratio,            &amp;  ! Input<br>                          Molecule_ID=Molecule_ID, &amp;  ! Input<br>                          Message_Log=Message_Log  )  ! Error messaging<br><br> INPUT ARGUMENTS:<br>       Mixing_Ratio:  Mass mixing ratio of gas.<br>                      UNITS:      g\/kg<br>                      TYPE:       REAL(fp)<br>                      DIMENSION:  Scalar or Rank-1 (K x 1)<br>                      ATTRIBUTES: INTENT(IN)<br><br> OPTIONAL INPUT ARGUMENTS:<br>       Molecule_ID:   HITRAN molecular designation identifying the<br>                      molecule for which the concentration units<br>                      conversion is required. If not specified, the<br>                      default value is that for water vapor.<br>                      Valid values are:<br>                        1: H2O       9: SO2      17: HI       25: H2O2<br>                        2: CO2      10: NO2      18: ClO      26: C2H2<br>                        3: O3       11: NH3      19: OCS      27: C2H6<br>                        4: N2O      12: HNO3     20: H2CO     28: PH3<br>                        5: CO       13: OH       21: HOCl     29: COF2<br>                        6: CH4      14: HF       22: N2       30: SF6<br>                        7: O2       15: HCl      23: HCN      31: H2S<br>                        8: NO       16: HBr      24: CH3Cl    32: HCOOH<br>                      UNITS:      N\/A<br>                      TYPE:       INTEGER<br>                      DIMENSION:  Scalar<br>                      ATTRIBUTES: OPTIONAL, INTENT(IN)<br><br>       Message_Log:   Character string specifying a filename in which any<br>                      Messages will be logged. If not specified, or if an<br>                      error occurs opening the log file, the default action<br>                      is to output Messages to standard output.<br>                      UNITS:      N\/A<br>                      TYPE:       CHARACTER(*)<br>                      DIMENSION:  Scalar<br>                      ATTRIBUTES: OPTIONAL, INTENT(IN)<br><br> FUNCTION RESULT:<br>       ppmv:          Volume mixing ratio of gas. If an error occurs,<br>                      -1.0 is returned.<br>                      UNITS:      ppmv<br>                      TYPE:       REAL(fp)<br>                      DIMENSION:  Same as input Mixing_Ratio<br><br> PROCEDURE:<br>       To convert mixing ratio in g\/kg to parts-per-million, the following<br>       is used:<br>                                                 MW(Dry Air)<br>         ppmv(MOL) = 1000 . Mixing_Ratio(MOL) . &#8212;&#8212;&#8212;&#8212;-<br>                                                   MW(MOL)<br><br>       where MW(Dry Air) = Average molecular weight of dry air<br>             MW(MOL)     = Molecular weight of the gas in question.<br><br>       The factor of 1000 derives from the product of the g\/kg to g\/g<br>       scale factor (0.001) and the &#8220;parts-per&#8221; to &#8220;parts-per-million&#8221;<br>       scale factor (1.0e+06)<br><br> CREATION HISTORY:<br>       Written by:     Paul van Delst, CIMSS\/SSEC 03-May-2000<br>                       paul.vandelst@ssec.wisc.edu<br><\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\" \/>\n\n\n\n<h2 class=\"wp-block-heading\">PPMV_TO_MR<\/h2>\n\n\n\n<pre class=\"wp-block-preformatted\"> NAME:\n       PPMV_to_MR\n\n PURPOSE:\n       Function to convert gas concentrations from volume mixing ratio in\n       ppmv to mass mixing ratio in g\/kg.\n\n CALLING SEQUENCE:\n       Mixing_Ratio = PPMV_to_MR( ppmv,                    &amp;  ! Input\n                                  Molecule_ID=Molecule_ID, &amp;  ! Input\n                                  Message_Log=Message_Log  )  ! Error messaging\n\n INPUT ARGUMENTS:\n       ppmv:          Volume mixing ratio of gas.\n                      UNITS:      ppmv\n                      TYPE:       REAL(fp)\n                      DIMENSION:  Scalar or Rank-1 (K x 1)\n                      ATTRIBUTES: INTENT(IN)\n\n OPTIONAL INPUT ARGUMENTS:\n       Molecule_ID:   HITRAN molecular designation identifying the\n                      molecule for which the concentration units\n                      conversion is required. If not specified, the\n                      default value is that for water vapor.\n                      Valid values are:\n                        1: H2O       9: SO2      17: HI       25: H2O2\n                        2: CO2      10: NO2      18: ClO      26: C2H2\n                        3: O3       11: NH3      19: OCS      27: C2H6\n                        4: N2O      12: HNO3     20: H2CO     28: PH3\n                        5: CO       13: OH       21: HOCl     29: COF2\n                        6: CH4      14: HF       22: N2       30: SF6\n                        7: O2       15: HCl      23: HCN      31: H2S\n                        8: NO       16: HBr      24: CH3Cl    32: HCOOH\n                      UNITS:      N\/A\n                      TYPE:       INTEGER\n                      DIMENSION:  Scalar\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 FUNCTION RESULT:\n       Mixing_Ratio:  Mass mixing ratio of gas. If an error occurs,\n                      -1.0 is returned.\n                      UNITS:      g\/kg\n                      TYPE:       REAL(fp)\n                      DIMENSION:  Same as input ppmv\n\n PROCEDURE:\n       To convert ppmv to mixing ratio, the following is used:\n\n                                          MW(MOL)\n         mr(MOL) = 0.001 . ppmv(MOL) . -------------\n                                        MW(Dry Air)\n\n       where MW(Dry Air) = Average molecular weight of dry air\n             MW(MOL)     = Molecular weight of the gas in question.\n\n       The factor of 0.001 derives from the product of the g\/g to g\/kg\n       scale factor (1000) and the \"parts-per-million\" to \"parts-per\"\n       scale factor (1.0e-06)\n\n CREATION HISTORY:\n       Written by:     Paul van Delst, CIMSS\/SSEC 03-May-2000\n                       paul.vandelst@ssec.wisc.edu\n<\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\" \/>\n\n\n\n<h2 class=\"wp-block-heading\">PPMV_TO_PP<\/h2>\n\n\n\n<pre class=\"wp-block-preformatted\"> NAME:\n       PPMV_to_PP\n\n PURPOSE:\n       Function to convert gas concentrations from ppmv to partial pressure\n\n CALLING SEQUENCE:\n       Partial_Pressure = PPMV_to_PP( Pressure,                &amp;  ! Input\n                                      ppmv,                    &amp;  ! Input\n                                      Water_Vapor=Water_Vapor, &amp;  ! Optional Input\n                                      Message_Log=Message_Log  )  ! Error messaging\n\n INPUT ARGUMENTS:\n       Pressure:          Total atmospheric pressure.\n                          UNITS:      hectoPascals, hPa\n                          TYPE:       REAL(fp)\n                          DIMENSION:  Scalar or Rank-1 (K x 1)\n                          ATTRIBUTES: INTENT(IN)\n\n       ppmv:              Gas volume mixing ratio in ppmv.\n                          UNITS:      ppmv\n                          TYPE:       REAL(fp)\n                          DIMENSION:  Same as Pressure\n                          ATTRIBUTES: INTENT(IN)\n   \n OPTIONAL INPUT ARGUMENTS:\n       Water_Vapor:       Water vapor partial pressure. If this argument is\n                          not supplied, the mandatory input PPMV argument is\n                          assumed to be water vapor.\n                          UNITS:      hectoPascals, hPa\n                          TYPE:       REAL(fp)\n                          DIMENSION:  Same as input Pressure\n                          ATTRIBUTES: 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 FUNCTION RESULT:\n       Partial_Pressure:  Gas partial pressure. If an error occurs,\n                          -1.0 is returned.\n                          UNITS:      hectoPascals, hPa\n                          TYPE:       REAL(fp)\n                          DIMENSION:  Same as input Pressure\n\n PROCEDURE:\n       To convert volume mixing ratio in ppmv of a molecular species, \n       designated by MOL, to partial pressure, the following is used,\n\n         pp(MOL) = 1.0e-06 . ppmv(MOL) . ( Pressure - pp(H2O) )\n\n       If the input molecule is water vapor, the partial pressure is\n       determined using,\n                                                                 1\n         pp(H2O) = 1.0e-06 . ppmv(H2O) . Pressure . -----------------------------\n                                                     1 + ( 1.0e-06 . ppmv(H20) )\n\n       This is based on the same methods used in the LBLRTM conversion code\n       in its lblatm.f module where molecular mixing ratios (either ppmv or\n       g\/kg) are always with respect to DRY AIR.\n\n CREATION HISTORY:\n       Written by:     Paul van Delst, CIMSS\/SSEC 03-May-2000\n                       paul.vandelst@ssec.wisc.edu\n<\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\" \/>\n\n\n\n<h2 class=\"wp-block-heading\">PP_TO_PPMV<\/h2>\n\n\n\n<pre class=\"wp-block-preformatted\"> NAME:\n       PP_to_PPMV\n\n PURPOSE:\n       Function to convert gas concentrations from partial pressure to \n       volume mixing ratio in ppmv\n\n CALLING SEQUENCE:\n       ppmv = PP_to_PPMV( Pressure,                &amp;  ! Input\n                          Partial_Pressure,        &amp;  ! Input\n                          Water_Vapor=Water_Vapor, &amp;  ! Optional Input\n                          Message_Log=Message_Log  )  ! Error messaging\n\n INPUT ARGUMENTS:\n       Pressure:          Total atmospheric pressure.\n                          UNITS:      hectoPascals, hPa\n                          TYPE:       REAL(fp)\n                          DIMENSION:  Scalar or Rank-1 (K x 1)\n                          ATTRIBUTES: INTENT(IN)\n\n       Partial_Pressure:  Gas partial pressure\n                          UNITS:      hectoPascals, hPa\n                          TYPE:       REAL(fp)\n                          DIMENSION:  Same as pressure\n                          ATTRIBUTES: INTENT(IN)\n   \n OPTIONAL INPUT ARGUMENTS:\n       Water_Vapor:       Water vapor volume mixing ratio. If this argument is\n                          not supplied, the mandatory Partial_Pressure argument\n                          is assumed to be water vapor.\n                          UNITS:      ppmv\n                          TYPE:       REAL(fp)\n                          DIMENSION:  Same as Pressure\n                          ATTRIBUTES: 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 FUNCTION RESULT:\n       ppmv:              Gas volume mixing ratio. If an error occurs,\n                          -1.0 is returned.\n                          UNITS:      ppmv\n                          TYPE:       REAL(fp)\n                          DIMENSION:  Same as input Pressure\n\n PROCEDURE:\n       To convert the partial pressure of a molecular species, designated\n       by MOL, to volume mixing ratio in ppmv, the following is used,\n\n                                     pp(MOL)\n         ppmv(MOL) = 1.0e+06 . ------------------\n                                Dry_Air_Pressure\n\n       where\n                                                     1\n         Dry_Air_Pressure = Pressure . ----------------------------\n                                        1 + ( ppmv(H2O) . 1.0e-6 )\n\n       If the input molecule is water vapor, the dry air pressure is\n       determined simply using,\n\n         Dry_Air_Pressure = Pressure - pp(H2O)\n\n       This is based on the same methods used in the LBLRTM conversion code\n       in its lblatm.f module where molecular mixing ratios (either ppmv or\n       g\/kg) are always with respect to DRY AIR.\n\n CREATION HISTORY:\n       Written by:     Paul van Delst, CIMSS\/SSEC 03-May-2000\n                       paul.vandelst@ssec.wisc.edu\n<\/pre>\n\n\n\n<p><\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\" \/>\n\n\n\n<h2 class=\"wp-block-heading\">MR_TO_PP<\/h2>\n\n\n\n<pre class=\"wp-block-preformatted\"> NAME:\n       MR_to_PP\n\n PURPOSE:\n       Function to convert gas concentrations from mixing ratio in g\/kg\n       to partial pressure in hectoPascals.\n\n CALLING SEQUENCE:\n       Partial_Pressure = MR_to_PP( Pressure,                &amp;  ! Input\n                                    Mixing_Ratio,            &amp;  ! Input\n                                    Molecule_ID=Molecule_ID, &amp;  ! Optional Input\n                                    Water_Vapor=Water_Vapor, &amp;  ! Optional Input\n                                    Message_Log=Message_Log  )  ! Error messaging\n\n INPUT ARGUMENTS:\n       Pressure:          Total atmospheric pressure.\n                          UNITS:      hectoPascals, hPa\n                          TYPE:       REAL(fp)\n                          DIMENSION:  Scalar or Rank-1 (K x 1)\n                          ATTRIBUTES: INTENT(IN)\n\n       Mixing_Ratio:      Mass mixing ratio of gas.\n                          UNITS:      g\/kg\n                          TYPE:       REAL(fp)\n                          DIMENSION:  Same as pressure\n                          ATTRIBUTES: INTENT(IN)\n\n OPTIONAL INPUT ARGUMENTS:\n       Molecule_ID:       HITRAN molecular designation identifying the\n                          molecule for which the concentration units\n                          conversion is required. If not specified, the\n                          default value is that for water vapor.\n                          Valid values are:\n                            1: H2O       9: SO2      17: HI       25: H2O2\n                            2: CO2      10: NO2      18: ClO      26: C2H2\n                            3: O3       11: NH3      19: OCS      27: C2H6\n                            4: N2O      12: HNO3     20: H2CO     28: PH3\n                            5: CO       13: OH       21: HOCl     29: COF2\n                            6: CH4      14: HF       22: N2       30: SF6\n                            7: O2       15: HCl      23: HCN      31: H2S\n                            8: NO       16: HBr      24: CH3Cl    32: HCOOH\n                          UNITS:      N\/A\n                          TYPE:       INTEGER\n                          DIMENSION:  Scalar\n                          ATTRIBUTES: OPTIONAL, INTENT(IN)\n\n       Water_Vapor:       Water vapor partial pressure. If this argument is\n                          not supplied, the mandatory MIXING_RATIO argument\n                          is assumed to be water vapor.\n                          This argument is ignored if the specified or default\n                          molecule ID is set to 1.\n                          UNITS:      hectoPascals, hPa\n                          TYPE:       REAL(fp)\n                          DIMENSION:  Same as Pressure\n                          ATTRIBUTES: 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 FUNCTION RESULT:\n       Partial_Pressure:  Gas partial pressure. If an error occurs,\n                          -1.0 is returned.\n                          UNITS:      hectoPascals, hPa\n                          TYPE:       REAL(fp)\n                          DIMENSION:  Same as input Pressure\n\n PROCEDURE:\n       First a definition. In this routine, the mass mixing ratio of a gas\n       is defined to be, for a given volume, the ratio of the mass of the gas \n       in question to that of DRY air.\n\n       The ideal gas equation can be written as,\n \n         p = n.R0.T     ................................................(1)\n\n       for unit volume, where \n         n  = number of moles of gas,\n         R0 = universal gas constant\n         T  = temperature.\n\n       The mass mixing ratio of a gas is defined as the mass of the gas with\n       respect to the mass of dry air in the same volume. If we use eqn(1)\n       to construct expressions for the partial pressures of a particular\n       gas and dry air, we get,\n\n         pp(MOL)    = n(MOL).R0.T     .................................(2a)\n\n       and\n\n         pp(DryAir) = n(DryAir).R0.T     ..............................(2b)\n\n\n       Dividing eqn(2a) by (2b) and rearranging we get,\n\n                     n(MOL) \n         pp(MOL) = ----------- . pp(DryAir)     ........................(3)\n                    n(DryAir)\n\n       Replacing the expssion for the number of moles of a substance into\n       eqn(3) gives us,\n\n                     m(MOL)     MW(DryAir)\n         pp(MOL) = --------- . ------------ . pp(DryAir)\n                    MW(MOL)      m(DryAir)\n\n                     m(MOL)       MW(DryAir)\n                 = ----------- . ------------ . pp(DryAir)\n                    m(DryAir)      MW(MOL)\n\n                                     MW(DryAir)\n                 = 0.001 . w(MOL) . ------------ . pp(DryAir)     ......(4)\n                                      MW(MOL)\n\n       where m(MOL)     = mass of gas MOL in grams,\n             m(DryAir)  = mass of dry air in grams,\n             MW(MOL)    = molecular weight of of gas MOL in grams,\n             MW(DryAir) = effective molecular weight of dry air in grams,\n             w(MOL)     = mass mixing ratio of gas MOL in g\/kg.\n\n       The factor of 0.001 in eqn(4) is to convert the units of the mixing\n       ratio from g\/kg to g\/g.\n\n       Two cases need to be addressed:\n\n\n       -------------\n       1) MOL == H2O\n       -------------\n\n       If the gas for which the mixing ratio is to be converted is water\n       vapor, then eqn(4) can be written as,\n\n                   \n         pp(H2O) = WX . ( p(Total) - pp(H2O) )     .....................(5)\n\n                                    MW(DryAir)\n       where WX = 0.001 . w(H2O) . ------------\n                                     MW(H2O)\n\n       Expanding eqn(5) further, we get\n                   \n         pp(H2O) = ( WX . p(Total) ) - ( WX . pp(H2O) )\n\n       and,\n\n         pp(H2O) . ( 1 + WX ) = WX . p(Total)\n\n       and finally,\n\n                        WX\n         pp(H2O) = ------------ . p(Total)     .........................(6)\n                    ( 1 + WX )\n\n       Eqn(6) is used to determine the partial pressure for water vapor\n       input in this routine.\n\n\n       -------------------\n       2) MOL is *not* H2O\n       -------------------\n\n       Using eqn(4) to determine an expression for the non-water vapor\n       gases, we get,\n\n         pp(MOL) = WX . p(DryAir)     ..................................(7)\n\n                                    MW(DryAir)\n       where WX = 0.001 . w(MOL) . ------------\n                                     MW(MOL)\n\n       and w(MOL) is still defined as in eqn(4).\n\n\n       This is based on the same methods used in the LBLRTM conversion code\n       in its lblatm.f module where molecular mixing ratios (either ppmv or\n       g\/kg) are always with respect to DRY AIR.\n\n CREATION HISTORY:\n       Written by:     Paul van Delst, CIMSS\/SSEC 20-Sep-2002\n                       paul.vandelst@ssec.wisc.edu\n<\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\" \/>\n\n\n\n<h2 class=\"wp-block-heading\">PP_TO_MR<\/h2>\n\n\n\n<pre class=\"wp-block-preformatted\"> NAME:\n       PP_to_MR\n\n PURPOSE:\n       Function to convert gas concentrations from partial pressure in\n       hectoPascals to mass mixing ratio in g\/kg.\n\n CALLING SEQUENCE:\n       Mixing_Ratio = PP_to_MR( Pressure,                &amp;  ! Input\n                                Partial_Pressure,        &amp;  ! Input\n                                Molecule_ID=Molecule_ID, &amp;  ! Optional Input\n                                Water_Vapor=Water_Vapor, &amp;  ! Optional Input\n                                Message_Log=Message_Log  )  ! Error messaging\n\n INPUT ARGUMENTS:\n       Pressure:          Total atmospheric pressure.\n                          UNITS:      hectoPascals, hPa\n                          TYPE:       REAL(fp)\n                          DIMENSION:  Scalar or Rank-1 (K x 1)\n                          ATTRIBUTES: INTENT(IN)\n\n       Partial_Pressure:  Partial pressure of gas.\n                          UNITS:      g\/kg\n                          TYPE:       REAL(fp)\n                          DIMENSION:  Same as Pressure\n                          ATTRIBUTES: INTENT(IN)\n\n OPTIONAL INPUT ARGUMENTS:\n       Molecule_ID:       HITRAN molecular designation identifying the\n                          molecule for which the concentration units\n                          conversion is required. If not specified, the\n                          default value is that for water vapor.\n                          Valid values are:\n                            1: H2O       9: SO2      17: HI       25: H2O2\n                            2: CO2      10: NO2      18: ClO      26: C2H2\n                            3: O3       11: NH3      19: OCS      27: C2H6\n                            4: N2O      12: HNO3     20: H2CO     28: PH3\n                            5: CO       13: OH       21: HOCl     29: COF2\n                            6: CH4      14: HF       22: N2       30: SF6\n                            7: O2       15: HCl      23: HCN      31: H2S\n                            8: NO       16: HBr      24: CH3Cl    32: HCOOH\n                          UNITS:      N\/A\n                          TYPE:       INTEGER\n                          DIMENSION:  Scalar\n                          ATTRIBUTES: OPTIONAL, INTENT(IN)\n\n       Water_Vapor:       Water vapor mass mixing ratio. If this argument is\n                          not supplied, the mandatory PARTIAL_PRESSURE argument\n                          is assumed to be water vapor.\n                          This argument is ignored if the specified or default\n                          molecule ID is set to 1.\n                          UNITS:      hectoPascals, hPa\n                          TYPE:       REAL(fp)\n                          DIMENSION:  Same as Pressure\n                          ATTRIBUTES: 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 FUNCTION RESULT:\n       Mixing_Ratio:      Mass mixing ratio of gas. If an error occurs,\n                          -1.0 is returned.\n                          UNITS:      g\/kg\n                          TYPE:       REAL(fp)\n                          DIMENSION:  Same as input Pressure\n\n PROCEDURE:\n       First a definition. In this routine, the mass mixing ratio of a gas\n       is defined to be, for a given volume, the ratio of the mass of the gas \n       in question to that of DRY air.\n\n       The ideal gas equation can be written as,\n \n         p = n.R0.T     ................................................(1)\n\n       for unit volume, where \n         n  = number of moles of gas,\n         R0 = universal gas constant\n         T  = temperature.\n\n       The mass mixing ratio of a gas is defined as the mass of the gas with\n       respect to the mass of dry air in the same volume. If we use eqn(1)\n       to construct expressions for the partial pressures of a particular\n       gas and dry air, we get,\n\n         pp(MOL)    = n(MOL).R0.T     .................................(2a)\n\n       and\n\n         pp(DryAir) = n(DryAir).R0.T     ..............................(2b)\n\n\n       Dividing eqn(2a) by (2b) and rearranging we get,\n\n                     n(MOL) \n         pp(MOL) = ----------- . pp(DryAir)     ........................(3)\n                    n(DryAir)\n\n       Replacing the expssion for the number of moles of a substance into\n       eqn(3) gives us,\n\n                     m(MOL)     MW(DryAir)\n         pp(MOL) = --------- . ------------ . pp(DryAir)\n                    MW(MOL)      m(DryAir)\n\n                     m(MOL)       MW(DryAir)\n                 = ----------- . ------------ . pp(DryAir)\n                    m(DryAir)      MW(MOL)\n\n                                     MW(DryAir)\n                 = 0.001 . w(MOL) . ------------ . pp(DryAir)     ......(4)\n                                      MW(MOL)\n\n       where m(MOL)     = mass of gas MOL in grams,\n             m(DryAir)  = mass of dry air in grams,\n             MW(MOL)    = molecular weight of of gas MOL in grams,\n             MW(DryAir) = effective molecular weight of dry air in grams,\n             w(MOL)     = mass mixing ratio of gas MOL in g\/kg.\n\n       The factor of 0.001 in eqn(4) is to convert the units of the mixing\n       ratio from g\/kg to g\/g.\n\n       Thus to determine the mixing ratio of the gas in question from its\n       partial pressure, eqn(4) is rearranged to give,\n\n                            MW(MOL)        pp(MOL)\n         w(MOL) = 1000 . ------------ . ------------     ...............(5)\n                          MW(DryAir)     pp(DryAir)\n\n\n       Two cases need to be addressed:\n\n\n       -------------\n       1) MOL == H2O\n       -------------\n\n       If the gas for which the partial pressure is to be converted is water\n       vapor, then the dry air partial pressure required in eqn(5) is simply\n       computed using,\n\n         pp(DryAir) = p(Total) - pp(H2O)\n\n       which is then used in eqn(5) to compute the water vapour mixing ratio.\n\n\n       -------------------\n       2) MOL is *not* H2O\n       -------------------\n\n       For this gas, the dry air partial pressure must be computed using the \n       water vapor mixing ratio supplied in the optional Water_Vapor argument.\n\n       Eqn(4) above can be rewritten as,\n\n         pp(H2O) = WX . p(DryAir)     ..................................(6)\n\n                                    MW(DryAir)\n       where WX = 0.001 . w(H2O) . ------------\n                                     MW(H2O)\n\n       Rearranging eqn(6), we then get,\n\n                      pp(H2O)\n         p(DryAir) = ---------     .....................................(7)\n                        WX\n\n       But, eqn(6) can also be written as,\n\n         pp(H2O) = WX . ( p(Total) - pp(H2O) )\n\n                 = ( WX . p(Total) ) - ( WX . pp(H2O) )\n\n       and thus,\n\n         pp(H2O) . ( 1 + WX ) = WX . p(Total)\n\n       with finally,\n\n                        WX\n         pp(H2O) = ------------ . p(Total)     .........................(8)\n                    ( 1 + WX )\n\n       Substituting eqn(8) into eqn(7) gives,\n\n                      p(Total)\n         p(DryAir) = ----------     ....................................(9)\n                      1 + WX \n\n       Eqn(9) is used to compute the dry air partial pressure which is then\n       used in enq(5) to compute the mixing ratio of the gas in question.\n\n\n       This is based on the same methods used in the LBLRTM conversion code\n       in its lblatm.f module where molecular mixing ratios (either ppmv or\n       g\/kg) are always with respect to DRY AIR.\n\n CREATION HISTORY:\n       Written by:     Paul van Delst, CIMSS\/SSEC 20-Sep-2002\n                       paul.vandelst@ssec.wisc.edu\n<\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\" \/>\n\n\n\n<h2 class=\"wp-block-heading\">PP_TO_MD<\/h2>\n\n\n\n<pre class=\"wp-block-preformatted\"> NAME:\n       PP_to_MD\n\n PURPOSE:\n       Function to convert gas concentrations in pressure units to \n       mass density.\n\n CALLING SEQUENCE:\n       Mass_Density = PP_to_MD( Pressure,                &amp;  ! Input\n                                Temperature,             &amp;  ! Input\n                                Molecule_ID=Molecule_ID, &amp;  ! Optional Input\n                                Message_Log=Message_Log  )  ! Error messaging\n\n INPUT ARGUMENTS:\n       Pressure:          Total or partial pressure to provide number\n                          density of air or specific gas species.\n                          UNITS:      hectoPascals, hPa\n                          TYPE:       REAL(fp)\n                          DIMENSION:  Scalar or Rank-1\n                          ATTRIBUTES: INTENT(IN)\n   \n       Temperature:       Atmospheric temperature\n                          UNITS:      Kelvin, K\n                          TYPE:       REAL(fp)\n                          DIMENSION:  Same as pressure\n                          ATTRIBUTES: INTENT(IN)\n   \n OPTIONAL INPUT ARGUMENTS:\n       Molecule_ID:       HITRAN molecular designation identifying the\n                          molecule for which the concentration units\n                          conversion is required. If not specified, the\n                          default value is that for water vapor.\n                          Valid values are:\n                            1: H2O       9: SO2      17: HI       25: H2O2\n                            2: CO2      10: NO2      18: ClO      26: C2H2\n                            3: O3       11: NH3      19: OCS      27: C2H6\n                            4: N2O      12: HNO3     20: H2CO     28: PH3\n                            5: CO       13: OH       21: HOCl     29: COF2\n                            6: CH4      14: HF       22: N2       30: SF6\n                            7: O2       15: HCl      23: HCN      31: H2S\n                            8: NO       16: HBr      24: CH3Cl    32: HCOOH\n                          UNITS:      N\/A\n                          TYPE:       INTEGER\n                          DIMENSION:  Scalar\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 FUNCTION RESULT:\n       Mass_Density:      Number density of gas. If an error occurs,\n                          -1.0 is returned.\n                          UNITS:      g\/m^3\n                          TYPE:       REAL(fp)\n                          DIMENSION:  Same as input Pressure\n\n PROCEDURE:\n       The ideal gas law is\n\n         p.V = n.R.T\n\n       where,\n         p = Pressure\n         V = volume\n         n = number of moles of the gas,\n         R = molar gas constant,\n         T = Temperature.\n\n       This can be written in terms of the number of molecules, N,\n\n                 N\n         p.V = ---- . R.T                  ..............(1)\n                NA\n\n       where NA = Avogadro's constant (number of molecules in 1 mole.)\n\n       Eqn.(1) can be recast to provide the number of molecules in the \n       volume, the number density, nd,\n\n               N     p.NA\n         nd = --- = ------  molecules\/m^3  ..............(2)\n               V     R.T\n\n       The mass density is related to the number density by the simple\n       relation,\n\n                    MW\n         md = nd . ----                    ..............(3)\n                    NA\n\n       Substituting equation (2) into (3) gives,\n\n               p.MW\n         md = ------  g\/m^3                ..............(4)\n               R.T\n\n       The value of p0 used in this routine is expressed in pascals (Pa) whereas\n       the input partial Pressure is expected to be hPa (more common unit). Thus\n       there is a factor of 100 to include,\n\n               100.p.MW\n         md = ----------  g\/m^3\n                 R.T\n\n UNITS ANALYSIS:\n       p  :  kg.m^-1.s^-2  (Pascals)\n       MW :  g.mol^-1\n       R  :  J.mol^-1.K^-1 == kg.m^2.s^-2.mol^-1.K^-1\n       T  :  K\n\n                  kg       g      s^2.mol.K     1\n         md == ------- . ----- . ----------- . ---\n                m.s^2     mol      kg.m^2       K\n\n                 g\n            == -----\n                m^3\n\n CREATION HISTORY:\n       Written by:     Paul van Delst, CIMSS\/SSEC 08-Nov-2004\n                       paul.vandelst@ssec.wisc.edu\n<\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\" \/>\n\n\n\n<h2 class=\"wp-block-heading\">MD_TO_PP<\/h2>\n\n\n\n<pre class=\"wp-block-preformatted\"> NAME:\n       MD_to_PP\n\n PURPOSE:\n       Function to convert gas concentration mass density to partial\n       pressure.\n\n CALLING SEQUENCE:\n       Pressure = MD_to_PP( Mass_Density,            &amp;  ! Input\n                            Temperature,             &amp;  ! Input\n                            Molecule_ID=Molecule_ID, &amp;  ! Optional Input\n                            Message_Log=Message_Log  )  ! Error messaging\n\n INPUT ARGUMENTS:\n       Mass_Density:      Number density of gas.\n                          UNITS:      g\/m^3\n                          TYPE:       REAL(fp)\n                          DIMENSION:  Scalar or Rank-1\n                          ATTRIBUTES: INTENT(IN)\n   \n       Temperature:       Atmospheric temperature\n                          UNITS:      Kelvin, K\n                          TYPE:       REAL(fp)\n                          DIMENSION:  Same as Mass_Density\n                          ATTRIBUTES: INTENT(IN)\n   \n OPTIONAL INPUT ARGUMENTS:\n       Molecule_ID:       HITRAN molecular designation identifying the\n                          molecule for which the concentration units\n                          conversion is required. If not specified, the\n                          default value is that for water vapor.\n                          Valid values are:\n                            1: H2O       9: SO2      17: HI       25: H2O2\n                            2: CO2      10: NO2      18: ClO      26: C2H2\n                            3: O3       11: NH3      19: OCS      27: C2H6\n                            4: N2O      12: HNO3     20: H2CO     28: PH3\n                            5: CO       13: OH       21: HOCl     29: COF2\n                            6: CH4      14: HF       22: N2       30: SF6\n                            7: O2       15: HCl      23: HCN      31: H2S\n                            8: NO       16: HBr      24: CH3Cl    32: HCOOH\n                          UNITS:      N\/A\n                          TYPE:       INTEGER\n                          DIMENSION:  Scalar\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 FUNCTION RESULT:\n       Pressure:          Partial pressure for specified gas species.\n                          UNITS:      hectoPascals, hPa\n                          TYPE:       REAL(fp)\n                          DIMENSION:  Same as input Mass_Density\n\n PROCEDURE:\n       The ideal gas law is\n\n         p.V = n.R.T\n\n       where,\n         p = Pressure\n         V = volume\n         n = number of moles of the gas,\n         R = molar gas constant,\n         T = Temperature.\n\n       This can be written in terms of the number of molecules, N,\n\n                 N\n         p.V = ---- . R.T                  ..............(1)\n                NA\n\n       where NA = Avogadro's constant (number of molecules in 1 mole.)\n\n       Eqn.(1) can be recast to provide the number of molecules in the \n       volume, the number density, nd,\n\n               N     p.NA\n         nd = --- = ------  molecules\/m^3  ..............(2)\n               V     R.T\n\n       The mass density is related to the number density by the simple\n       relation,\n\n                    MW\n         md = nd . ----                    ..............(3)\n                    NA\n\n       Substituting equation (2) into (3) gives,\n\n               p.MW\n         md = ------  g\/m^3                ..............(4)\n               R.T\n\n       and inverting equation (4) gives,\n\n              md.R.T\n         p = -------- Pa\n                MW\n\n       The pressure result above is determined in units of Pascals, so there\n       is a factor of 100 to include to return the pressure in units of\n       hectoPascals,\n\n              md.R.T\n         p = -------- hPa\n              100.MW\n\n UNITS ANALYSIS:\n       md :  g.m^-3\n       R  :  J.mol^-1.K^-1 == kg.m^2.s^-2.mol^-1.K^-1\n       T  :  K\n       MW :  g.mol^-1\n\n                g        kg.m^2          mol\n         p == ----- . ----------- . K . -----\n               m^3     s^2.mol.K          g\n\n                 kg\n           == -------\n               m.s^2\n\n               kg.m.s^-2      F\n           == ----------- == --- == pressure.\n                  m^2         A\n\n CREATION HISTORY:\n       Written by:     Paul van Delst, CIMSS\/SSEC 08-Nov-2004\n                       paul.vandelst@ssec.wisc.edu\n<\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\" \/>\n\n\n\n<h2 class=\"wp-block-heading\">PP_TO_ND<\/h2>\n\n\n\n<pre class=\"wp-block-preformatted\"> NAME:\n       PP_to_ND\n\n PURPOSE:\n       Function to convert gas concentrations in pressure units to \n       number density.\n\n CALLING SEQUENCE:\n       Number_Density = PP_to_ND( Pressure,                 &amp;  ! Input\n                                  Temperature,              &amp;  ! Input\n                                  Message_Log=Message_Log )  ! Error messaging\n\n INPUT ARGUMENTS:\n       Pressure:          Total or partial pressure to provide number\n                          density of air or specific gas species.\n                          UNITS:      hectoPascals, hPa\n                          TYPE:       REAL(fp)\n                          DIMENSION:  Scalar or Rank-1 (K x 1)\n                          ATTRIBUTES: INTENT(IN)\n   \n       Temperature:       Atmospheric temperature\n                          UNITS:      Kelvin, K\n                          TYPE:       REAL(fp)\n                          DIMENSION:  Same as Pressure\n                          ATTRIBUTES: INTENT(IN)\n   \n OPTIONAL INPUT ARGUMENTS:\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 FUNCTION RESULT:\n       Number_Density:    Number density of gas. If an error occurs,\n                          -1.0 is returned.\n                          UNITS:      molecules\/m^3\n                          TYPE:       REAL(fp)\n                          DIMENSION:  Same as input Pressure\n\n PROCEDURE:\n       The ideal gas law is\n\n         p.V = n.R.T\n\n       where,\n         p = Pressure\n         V = volume\n         n = number of moles of the gas,\n         R = molar gas constant,\n         T = Temperature.\n\n       This can be written in terms of the number of molecules, N,\n\n                 N\n         p.V = ---- . R.T                  ..............(1)\n                NA\n\n       where NA = Avogadro's constant (number of molecules in 1 mole.)\n\n       Eqn.(1) can be recast to provide the number of molecules in the \n       volume, the number density, nd,\n\n               N     p.NA\n         nd = --- = ------  molecules\/m^3  ..............(2)\n               V     R.T\n\n       At standard Temperature and Pressure (T0=273.15K, p0=101325Pa), this\n       number density is know as the Loschmidt constant, L0, the molecular\n       density of 1 mole of an ideal gas. Thus we have the generic form of\n       eqn.(2) and the STP form,\n\n               p0.NA\n         L0 = -------  molecules\/m^3       ..............(3)\n               R.T0\n\n       Taking the ratio of eqns.(2) and (3) gives,\n       \n         nd    p.NA     R.T0\n         -- = ------ . -------\n         L0    R.T      p0.NA\n\n       and rearranging gives,\n\n                    p      T0\n         nd = L0 . ---- . ----  molecules\/m^3\n                    p0     T \n\n       The value of p0 used in this routine is expressed in pascals (Pa) whereas\n       the input partial Pressure is expected to be hPa (more common unit). Thus\n       there is a factor of 100 to include,\n\n                    100.p     T0\n         nd = L0 . ------- . ----  molecules\/m^3\n                     p0       T \n\n CREATION HISTORY:\n       Written by:     Paul van Delst, CIMSS\/SSEC 15-Nov-2001\n                       paul.vandelst@ssec.wisc.edu\n<\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\" \/>\n\n\n\n<h2 class=\"wp-block-heading\">ND_TO_PP<\/h2>\n\n\n\n<pre class=\"wp-block-preformatted\"> NAME:\n       ND_to_PP\n\n PURPOSE:\n       Function to convert gas concentrations from number density to\n       pressure units.\n\n CALLING SEQUENCE:\n       Partial_Pressure = ND_to_PP( Number_Density,         &amp;  ! Input\n                                    Temperature,            &amp;  ! Input\n                                    Message_Log=Message_Log )  ! Error messaging\n\n INPUT ARGUMENTS:\n       Number_Density:    Molecular density.\n                          UNITS:      molecules\/m^3\n                          TYPE:       REAL(fp)\n                          DIMENSION:  Scalar or Rank-1 (K x 1)\n                          ATTRIBUTES: INTENT(IN)\n   \n       Temperature:       Atmospheric Temperature\n                          UNITS:      Kelvin, K\n                          TYPE:       REAL(fp)\n                          DIMENSION:  Same as Number_Density\n                          ATTRIBUTES: INTENT(IN)\n   \n OPTIONAL INPUT ARGUMENTS:\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 FUNCTION RESULT:\n       Partial_Pressure:  Gas partial pressure. If an error occurs,\n                          -1.0 is returned.\n                          UNITS:      hectoPascals, hPa\n                          TYPE:       REAL(fp)\n                          DIMENSION:  Same as input Number_Density\n\n PROCEDURE:\n       The ideal gas law is\n\n         p.V = n.R.T\n\n       where,\n         p = Pressure\n         V = volume\n         n = number of moles of the gas,\n         R = molar gas constant,\n         T = Temperature.\n\n       This can be written in terms of the number of molecules, N,\n\n                 N\n         p.V = ---- . R.T                  ..............(1)\n                NA\n\n       where NA = Avogadro's constant (number of molecules in 1 mole.)\n\n       Recasting eqn.(1) to provide the Pressure,\n\n              nd\n         p = ---- . R.T  Pa                ..............(2)\n              NA\n\n       where nd = the number density in molecules\/m^3 = N\/V.\n\n       At standard Temperature and Pressure (T0=273.15K, p0=101325Pa), the\n       number density of eqn.(2) is known as the Loschmidt constant, L0,\n       the molecular density of 1 mole of an ideal gas. Thus we have the\n       generic form of eqn.(2) and the STP form,\n\n               L0\n         p0 = ---- . R.T0  Pa              ..............(3)\n               NA\n\n       Taking the ratio of eqns.(2) and (3) gives,\n       \n          p      nd     T\n         ---- = ---- . ----  Pa\n          p0     L0     T0\n\n       and rearranging gives,\n\n                   nd      T\n         p = p0 . ---- . ----  Pa\n                   L0     T0 \n\n       The value of p0 used in this routine is expressed in pascals (Pa) whereas\n       the output Pressure is returned as hPa (more common unit). Thus there\n       is a factor of 100 to include,\n\n                          nd      T\n         p = 0.01 . p0 . ---- . ----  hPa\n                          L0     T0 \n\n CREATION HISTORY:\n       Written by:     Paul van Delst, CIMSS\/SSEC 15-Nov-2001\n                       paul.vandelst@ssec.wisc.edu\n<\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\" \/>\n\n\n\n<h2 class=\"wp-block-heading\">PPMV_TO_ND<\/h2>\n\n\n\n<pre class=\"wp-block-preformatted\"> NAME:\n       PPMV_to_ND\n\n PURPOSE:\n       Function to convert volume mixing ratio in ppmv to number density.\n\n CALLING SEQUENCE:\n       Number_Density = PPMV_to_ND( Pressure,                &amp;  ! Input\n                                    Temperature,             &amp;  ! Input\n                                    ppmv,                    &amp;  ! Input\n                                    Water_Vapor=Water_Vapor, &amp;  ! Optional Input\n                                    Message_Log=Message_Log  )  ! Error messaging\n\n INPUT ARGUMENTS:\n       Pressure:         Total atmospheric pressure.\n                         UNITS:      hectoPascals, hPa\n                         TYPE:       REAL(fp)\n                         DIMENSION:  Scalar or Rank-1 (K x 1)\n                         ATTRIBUTES: INTENT(IN)\n\n       Temperature:      Atmospheric temperature\n                         UNITS:      Kelvin, K\n                         TYPE:       REAL(fp)\n                         DIMENSION:  Same as Pressure\n                         ATTRIBUTES: INTENT(IN)\n\n       ppmv:             Volume mixing ratio.\n                         UNITS:      ppmv\n                         TYPE:       REAL(fp)\n                         DIMENSION:  Same as Pressure\n                         ATTRIBUTES: INTENT(IN)\n\n OPTIONAL INPUT ARGUMENTS:\n       Water_Vapor:      Water vapor number density. If this argument is\n                         not supplied, the mandatory PPMV input argument\n                         is assumed to be water vapor.\n                         UNITS:      molecules\/m^3\n                         TYPE:       REAL(fp)\n                         DIMENSION:  Scalar or Rank-1 (K x 1)\n                         ATTRIBUTES: 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 FUNCTION RESULT:\n       Number_Density:   Number density of gas. If an error occurs,\n                         -1.0 is returned.\n                         UNITS:      molecules\/m^3\n                         TYPE:       REAL(fp)\n                         DIMENSION:  Same as input Pressure\n\n PROCEDURE:\n       To convert the volume mixing ratio of a molecular species, designated\n       by MOL, to number density, the following is used,\n\n         nd(MOL) = 1.0e-06 . ppmv(MOL) . ( nd(TOT) - nd(H2O) )     .....(1)\n\n       where\n                         Pressure          T0\n         nd(TOT) = L0 . ---------- . -------------  molecules\/m^3\n                            p0        Temperature \n\n       and L0 = Loschmidt number,\n           p0 = Standard pressure,\n           T0 = Standard temperature.\n\n       If the input molecule is water vapor, the number density is\n       determined using,\n\n                        ppmv(H2O) . 1.0e-06\n         nd(H2O) = ----------------------------- . nd(TOT)     .....(2)\n                    1 + ( ppmv(H2O) . 1.0e-06 )\n\n       Rearranging eqn.(2) gives the same form as eqn.(1).\n\n       This is based on the same methods used in the LBLRTM conversion code\n       in its lblatm.f module where molecular mixing ratios (either ppmv or\n       g\/kg) are always with respect to DRY AIR.\n\n CREATION HISTORY:\n       Written by:     Paul van Delst, CIMSS\/SSEC 15-Nov-2001\n                       paul.vandelst@ssec.wisc.edu\n<\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\" \/>\n\n\n\n<h2 class=\"wp-block-heading\">ND_TO_PPMV<\/h2>\n\n\n\n<pre class=\"wp-block-preformatted\"> NAME:\n       ND_to_PPMV\n\n PURPOSE:\n       Function to convert gas concentrations from number density to volume\n       mixing ratio in ppmv.\n\n CALLING SEQUENCE:\n       ppmv = ND_to_PPMV( Pressure,                &amp;  ! Input\n                          Temperature,             &amp;  ! Input\n                          Number_Density,          &amp;  ! Input\n                          Water_Vapor=Water_Vapor, &amp;  ! Optional Input\n                          Message_Log=Message_Log  )  ! Error messaging\n\n INPUT ARGUMENTS:\n       Pressure:          Total atmospheric pressure.\n                          UNITS:      hectoPascals, hPa\n                          TYPE:       REAL(fp)\n                          DIMENSION:  Scalar or Rank-1 (K x 1)\n                          ATTRIBUTES: INTENT(IN)\n   \n       Temperature:       Atmospheric temperature\n                          UNITS:      Kelvin, K\n                          TYPE:       REAL(fp)\n                          DIMENSION:  Same as Pressure\n                          ATTRIBUTES: INTENT(IN)\n   \n       Number_Density:    Molecular number density.\n                          UNITS:      molecules\/m^3\n                          TYPE:       REAL(fp)\n                          DIMENSION:  Same as Pressure\n                          ATTRIBUTES: INTENT(IN)\n   \n OPTIONAL INPUT ARGUMENTS:\n       Water_Vapor:       Water vapor volume mixing ratio. If this argument is\n                          not supplied, the mandatory NUMBER_DENSITY input\n                          argument is assumed to be water vapor.\n                          UNITS:      ppmv\n                          TYPE:       REAL(fp)\n                          DIMENSION:  Same as Pressure\n                          ATTRIBUTES: 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 FUNCTION RESULT:\n       ppmv:              Gas volume mixing ratio. If an error occurs,\n                          -1.0 is returned.\n                          UNITS:      ppmv\n                          TYPE:       REAL(fp)\n                          DIMENSION:  Same as input Pressure\n\n PROCEDURE:\n       To convert the number density of a molecular species, designated\n       by MOL, to volume mixing ratio, the following is used,\n\n                                  nd(MOL)\n         ppmv(MOL) = 1.0e+06 . -------------\n                                nd(DRY_AIR)\n\n       where\n\n         nd(DRY_AIR) = nd(TOT) - nd(H2O)\n\n       and\n                         Pressure          T0\n         nd(TOT) = L0 . ---------- . -------------  molecules\/m^3\n                            p0        Temperature \n\n       with L0 = Loschmidt number,\n            p0 = Standard pressure,\n            T0 = Standard temperature, and\n\n       If the input molecule is NOT water vapor, the dry air number density\n       is determined using,\n\n                                     1\n         nd(DRY_AIR) = ----------------------------- . nd(TOT)\n                        1 + ( ppmv(H2O) . 1.0e-06 )\n\n       This is based on the same methods used in the LBLRTM conversion code\n       in its lblatm.f module where molecular mixing ratios (either ppmv or\n       g\/kg) are always with respect to DRY AIR.\n\n\n CREATION HISTORY:\n       Written by:     Paul van Delst, CIMSS\/SSEC 15-Nov-2001\n                       paul.vandelst@ssec.wisc.edu\n<\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\" \/>\n\n\n\n<h2 class=\"wp-block-heading\">PPMV_TO_KMOL<\/h2>\n\n\n\n<pre class=\"wp-block-preformatted\"> NAME:\n       PPMV_to_KMOL\n\n PURPOSE:\n       Function to convert layer gas concentrations from volume mixing ratio\n       in ppmv to column density in kmol.cm^-2.\n\n CALLING SEQUENCE:\n       kmol_per_cm2 = PPMV_to_KMOL( Pressure,                &amp;  ! Input\n                                    Temperature,             &amp;  ! Input\n                                    Delta_Z,                 &amp;  ! Input\n                                    ppmv,                    &amp;  ! Input\n                                    Water_Vapor=Water_Vapor, &amp;  ! Optional Input\n                                    Message_Log=Message_Log  )  ! Error messaging\n\n INPUT ARGUMENTS:\n       Pressure:          Average layer pressure.\n                          UNITS:      hectoPascals, hPa\n                          TYPE:       REAL(fp)\n                          DIMENSION:  Scalar or Rank-1 (K x 1)\n                          ATTRIBUTES: INTENT(IN)\n\n       Temperature:       Average layer temperature\n                          UNITS:      Kelvin, K (K)\n                          TYPE:       REAL(fp)\n                          DIMENSION:  Same as Pressure\n                          ATTRIBUTES: INTENT(IN)\n\n       Delta_Z:           Layer thickness\n                          UNITS:      metres, m\n                          TYPE:       REAL(fp)\n                          DIMENSION:  Same as Pressure\n                          ATTRIBUTES: INTENT(IN)\n\n       ppmv:              Average layer gas concentration\n                          UNITS:      ppmv\n                          TYPE:       REAL(fp)\n                          DIMENSION:  Same as Pressure\n                          ATTRIBUTES: INTENT(IN)\n   \n OPTIONAL INPUT ARGUMENTS:\n       Water_Vapor:       Water vapor column density. If this argument is\n                          not supplied, the mandatory PPMV input\n                          argument is assumed to be water vapor.\n                          UNITS:      kmol.cm^-2\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 FUNCTION RESULT:\n       kmol_per_cm2:      Layer gas concentration. If an error occurs,\n                          -1.0 is returned.\n                          UNITS:      kmol.cm^-2\n                          TYPE:       REAL(fp)\n                          DIMENSION:  Same input Pressure\n\n PROCEDURE:\n       The column density of a particular molecular species, designated\n       by MOL, given its volume mixing ratio is then given by,\n\n         cd(MOL) = 1.0e-06 . ppmv(MOL) . cd(DRY_AIR)  kmol.cm^-2\n\n       First, the total number density is calculated using,\n\n                         p      T0\n         nd(TOT) = L0 . ---- . ----  molecules.m^-3\n                         p0     T \n\n       and L0 = Loschmidt number,\n           p0 = Standard pressure,\n           T0 = Standard temperature.\n\n       The total column density is calculated by multiplying the number\n       density by the layer thickness in metres, dz,\n\n         cd(TOT) = dz . nd(TOT)  molecules.m^-2\n\n       This result is scaled by:\n         a) 10^-4 to convert molecules.m^-2 to molecules.cm^-2\n         b) 1\/Na to convert molecules.cm^-2 to mol.cm^-2, and\n         c) 10^-3 to convert mol.cm^-2 to kmol.cm^-2\n       giving,\n                    1.0e-07\n         cd(TOT) = --------- . dz . nd(TOT)  kmol.cm^-2\n                      Na\n      \n       The dry air column density is then calculated using,\n\n                                    1\n         cd(DRY_AIR) = ----------------------------- . cd(TOT)  kmol.cm^-2\n                        1 + ( ppmv(H2O) . 1.0e-06 )\n\n       for water vapor ppmv input or,\n\n         cd(DRY_AIR) = cd(TOT) - cd(H2O)\n\n       if cd(H2O) is supplied via the optional Water_Vapor argument.\n\n CREATION HISTORY:\n       Written by:     Paul van Delst, CIMSS\/SSEC 04-Jan-2001\n                       paul.vandelst@ssec.wisc.edu\n<\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\" \/>\n\n\n\n<h2 class=\"wp-block-heading\">KMOL_TO_PPMV<\/h2>\n\n\n\n<pre class=\"wp-block-preformatted\"> NAME:\n       KMOL_to_PPMV\n\n PURPOSE:\n       Function to convert layer gas concentrations from column density in\n       kmol.cm^-2 to volume mixing ratio in ppmv.\n\n CALLING SEQUENCE:\n       ppmv = KMOL_to_PPMV( Pressure,                &amp;  ! Input\n                            Temperature,             &amp;  ! Input\n                            Delta_Z,                 &amp;  ! Input\n                            kmol_per_cm2,            &amp;  ! Input\n                            Water_Vapor=Water_Vapor, &amp;  ! Optional Input\n                            Message_Log=Message_Log  )  ! Error messaging\n\n INPUT ARGUMENTS:\n       Pressure:          Average layer pressure.\n                          UNITS:      hectoPascals, hPa\n                          TYPE:       REAL(fp)\n                          DIMENSION:  Scalar or Rank-1 (K x 1)\n                          ATTRIBUTES: INTENT(IN)\n\n       Temperature:       Average layer temperature\n                          UNITS:      Kelvin, K\n                          TYPE:       REAL(fp)\n                          DIMENSION:  Same as Pressure\n                          ATTRIBUTES: INTENT(IN)\n\n       Delta_Z:           Layer thickness\n                          UNITS:      metres, m\n                          TYPE:       REAL(fp)\n                          DIMENSION:  Same as Pressure\n                          ATTRIBUTES: INTENT(IN)\n\n       kmol_per_cm2:      Column density for molecular species.\n                          UNITS:      kmol.cm^-2\n                          TYPE:       REAL(fp)\n                          DIMENSION:  Same as Pressure\n                          ATTRIBUTES: INTENT(IN)\n   \n OPTIONAL INPUT ARGUMENTS:\n       Water_Vapor:       Water vapor volume mixing ratio. If this argument\n                          is not supplied, the mandatory KMOL_PER_CM2 input\n                          argument is assumed to be water vapor.\n                          UNITS:      ppmv\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 FUNCTION RESULT:\n       ppmv:              Layer gas volume mixing ratio. If an error occurs,\n                          -1.0 is returned.\n                          UNITS:      ppmv\n                          TYPE:       REAL(fp)\n                          DIMENSION:  Same as input Pressure\n\n PROCEDURE:\n       The volume mixing ratio of a particular molecular species, designated\n       by MOL, given it's column density is given by,\n\n                                  cd(MOL)\n         ppmv(MOL) = 1.0e-06 . -------------\n                                cd(DRY_AIR)\n\n       First, the total number density is calculated using,\n\n                         p      T0\n         nd(TOT) = L0 . ---- . ----  molecules.m^-3\n                         p0     T \n\n       and L0 = Loschmidt number,\n           p0 = Standard pressure,\n           T0 = Standard temperature.\n\n       The total column density is calculated by multiplying the number\n       density by the layer thickness in metres, dz,\n\n         cd(TOT) = dz . nd(TOT)  molecules.m^-2\n\n       This result is scaled by:\n         a) 10^-4 to convert molecules.m^-2 to molecules.cm^-2\n         b) 1\/Na to convert molecules.cm^-2 to mol.cm^-2, and\n         c) 10^-3 to convert mol.cm^-2 to kmol.cm^-2\n       giving,\n                    1.0e-07\n         cd(TOT) = --------- . dz . nd(TOT)  kmol.cm^-2\n                      Na\n      \n       The dry air column density is then calculated using,\n\n                                    1\n         cd(DRY_AIR) = ----------------------------- . cd(TOT)  kmol.cm^-2\n                        1 + ( ppmv(H2O) . 1.0e-06 )\n\n       for water vapor ppmv input or,\n\n         cd(DRY_AIR) = cd(TOT) - cd(H2O)\n\n       if cd(H2O) is supplied via the optional Water_Vapor argument.\n\n CREATION HISTORY:\n       Written by:     Paul van Delst, CIMSS\/SSEC 04-Jan-2001\n                       paul.vandelst@ssec.wisc.edu\n<\/pre>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Subprogram Descriptions SA_TO_MR NAME: SA_to_MR PURPOSE: Function to convert gas specific amounts to mass mixing ratio CALLING SEQUENCE: Mixing_Ratio = SA_to_MR( Specific_Amount, &amp; ! Input Water_Vapor=Water_Vapor, &amp; ! Optional input Message_Log=Message_Log ) ! Error messaging INPUT ARGUMENTS: Specific_Amount: Gas specific amount comcentration. UNITS: g\/kg TYPE: REAL(fp) DIMENSION: Scalar or Rank-1 (K x 1) ATTRIBUTES: INTENT(IN) [&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-382","page","type-page","status-publish","hentry"],"acf":[],"_links":{"self":[{"href":"https:\/\/itwg.ssec.wisc.edu\/rtsp\/wp-json\/wp\/v2\/pages\/382","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=382"}],"version-history":[{"count":1,"href":"https:\/\/itwg.ssec.wisc.edu\/rtsp\/wp-json\/wp\/v2\/pages\/382\/revisions"}],"predecessor-version":[{"id":383,"href":"https:\/\/itwg.ssec.wisc.edu\/rtsp\/wp-json\/wp\/v2\/pages\/382\/revisions\/383"}],"wp:attachment":[{"href":"https:\/\/itwg.ssec.wisc.edu\/rtsp\/wp-json\/wp\/v2\/media?parent=382"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}