<p><b>laura@ucar.edu</b> 2010-12-21 15:38:55 -0700 (Tue, 21 Dec 2010)</p><p>initialization of short- and long-wave radiation codes specific to MPAS. reads input data and distribute data on all processors using dmpar_bcast set of subroutines<br>
</p><hr noshade><pre><font color="gray">Added: branches/atmos_physics/src/core_physics/module_physics_rrtmg_lwinit.F
===================================================================
--- branches/atmos_physics/src/core_physics/module_physics_rrtmg_lwinit.F         (rev 0)
+++ branches/atmos_physics/src/core_physics/module_physics_rrtmg_lwinit.F        2010-12-21 22:38:55 UTC (rev 650)
@@ -0,0 +1,1553 @@
+#define DM_BCAST_MACRO(A) call dmpar_bcast_reals(dminfo,size(A),A)
+
+!=============================================================================================
+ module module_physics_rrtmg_lwinit
+ use dmpar
+ use grid_types
+ use module_physics_constants
+ use module_physics_error
+
+!wrf physics
+ use module_ra_rrtmg_lw
+
+ implicit none
+ private
+ public:: rrtmg_lwinit_forMPAS
+
+ contains
+
+!=============================================================================================
+ subroutine rrtmg_lwinit_forMPAS(dminfo)
+!=============================================================================================
+
+!input arguments:
+ type(dm_info):: dminfo
+
+!---------------------------------------------------------------------------------------------
+
+!read in absorption coefficients and other data:
+ call rrtmg_lwlookuptable(dminfo)
+
+!Perform g-point reduction and other initializations: specific heat of dry air (cp) used in
+!flux to heating rate conversion factor.
+ call rrtmg_lw_ini(cp)
+
+ end subroutine rrtmg_lwinit_forMPAS
+
+!=============================================================================================
+ subroutine rrtmg_lwlookuptable(dminfo)
+!=============================================================================================
+
+!input arguments:
+ type(dm_info),intent(in):: dminfo
+
+!local variables:
+ integer:: i,istat,rrtmg_unit
+ logical:: opened
+ character(len=80):: errmess
+!---------------------------------------------------------------------------------------------
+
+!get a unit to open init file:
+ istat = -999
+ if(dminfo % my_proc_id == IO_NODE) then
+ do i = 10,99
+ inquire(i,opened = opened,iostat=istat)
+ if(.not. opened ) then
+ rrtmg_unit = i
+ exit
+ endif
+ enddo
+ if(istat /= 0) &
+ call physics_error_fatal(istat,'module_ra_rrtmg_lw: rrtm_lwlookuptable: Can not '// &
+ 'find unused fortran unit to read in lookup table.' )
+
+ endif
+
+!distribute unit to other processors:
+ call dmpar_bcast_int(dminfo,rrtmg_unit)
+
+!open init file:
+ if(dminfo % my_proc_id == IO_NODE) then
+ open(rrtmg_unit,file='RRTMG_LW_DATA_DBL',form='UNFORMATTED',status='OLD',iostat=istat)
+
+ if(istat /= 0) then
+ write(errmess,'(A,I4)') 'module_ra_rrtmg_lw: error reading RRTMG_LW_DATA on unit', &
+ rrtmg_unit
+ call physics_error_fatal(istat,errmess)
+ endif
+ endif
+
+ call lw_kgb01(rrtmg_unit,dminfo)
+ call lw_kgb02(rrtmg_unit,dminfo)
+ call lw_kgb03(rrtmg_unit,dminfo)
+ call lw_kgb04(rrtmg_unit,dminfo)
+ call lw_kgb05(rrtmg_unit,dminfo)
+ call lw_kgb06(rrtmg_unit,dminfo)
+ call lw_kgb07(rrtmg_unit,dminfo)
+ call lw_kgb08(rrtmg_unit,dminfo)
+ call lw_kgb09(rrtmg_unit,dminfo)
+ call lw_kgb10(rrtmg_unit,dminfo)
+ call lw_kgb11(rrtmg_unit,dminfo)
+ call lw_kgb12(rrtmg_unit,dminfo)
+ call lw_kgb13(rrtmg_unit,dminfo)
+ call lw_kgb14(rrtmg_unit,dminfo)
+ call lw_kgb15(rrtmg_unit,dminfo)
+ call lw_kgb16(rrtmg_unit,dminfo)
+
+ if(dminfo % my_proc_id == IO_NODE) close(rrtmg_unit)
+
+ end subroutine rrtmg_lwlookuptable
+
+!=============================================================================================
+
+! **************************************************************************
+! RRTMG Longwave Radiative Transfer Model
+! Atmospheric and Environmental Research, Inc., Cambridge, MA
+!
+! Original version: E. J. Mlawer, et al.
+! Revision for GCMs: Michael J. Iacono; October, 2002
+! Revision for F90 formatting: Michael J. Iacono; June 2006
+!
+! This file contains 16 READ statements that include the
+! absorption coefficients and other data for each of the 16 longwave
+! spectral bands used in RRTMG_LW. Here, the data are defined for 16
+! g-points, or sub-intervals, per band. These data are combined and
+! weighted using a mapping procedure in module RRTMG_LW_INIT to reduce
+! the total number of g-points from 256 to 140 for use in the GCM.
+! **************************************************************************
+
+! **************************************************************************
+ subroutine lw_kgb01(rrtmg_unit,dminfo)
+! **************************************************************************
+
+ use rrlw_kg01, only : fracrefao, fracrefbo, kao, kbo, kao_mn2, kbo_mn2, &
+ absa, absb, &
+ selfrefo, forrefo
+ save
+
+!input arguments:
+ type(dm_info),intent(in):: dminfo
+ integer,intent(in):: rrtmg_unit
+
+!local variables:
+ character(len=80):: errmess
+ integer:: istat
+
+! Arrays fracrefao and fracrefbo are the Planck fractions for the lower
+! and upper atmosphere.
+! Planck fraction mapping levels: P = 212.7250 mbar, T = 223.06 K
+
+! The array KAO contains absorption coefs at the 16 chosen g-values
+! for a range of pressure levels > ~100mb and temperatures. The first
+! index in the array, JT, which runs from 1 to 5, corresponds to
+! different temperatures. More specifically, JT = 3 means that the
+! data are for the corresponding TREF for this pressure level,
+! JT = 2 refers to the temperatureTREF-15, JT = 1 is for TREF-30,
+! JT = 4 is for TREF+15, and JT = 5 is for TREF+30. The second
+! index, JP, runs from 1 to 13 and refers to the corresponding
+! pressure level in PREF (e.g. JP = 1 is for a pressure of 1053.63 mb).
+! The third index, IG, goes from 1 to 16, and tells us which
+! g-interval the absorption coefficients are for.
+
+! The array KBO contains absorption coefs at the 16 chosen g-values
+! for a range of pressure levels < ~100mb and temperatures. The first
+! index in the array, JT, which runs from 1 to 5, corresponds to
+! different temperatures. More specifically, JT = 3 means that the
+! data are for the reference temperature TREF for this pressure
+! level, JT = 2 refers to the temperature TREF-15, JT = 1 is for
+! TREF-30, JT = 4 is for TREF+15, and JT = 5 is for TREF+30.
+! The second index, JP, runs from 13 to 59 and refers to the JPth
+! reference pressure level (see taumol.f for the value of these
+! pressure levels in mb). The third index, IG, goes from 1 to 16,
+! and tells us which g-interval the absorption coefficients are for.
+
+! The arrays kao_mn2 and kbo_mn2 contain the coefficients of the
+! nitrogen continuum for the upper and lower atmosphere.
+! Minor gas mapping levels:
+! Lower - n2: P = 142.5490 mbar, T = 215.70 K
+! Upper - n2: P = 142.5490 mbar, T = 215.70 K
+
+! The array FORREFO contains the coefficient of the water vapor
+! foreign-continuum (including the energy term). The first
+! index refers to reference temperature (296,260,224,260) and
+! pressure (970,475,219,3 mbar) levels. The second index
+! runs over the g-channel (1 to 16).
+
+! The array SELFREFO contains the coefficient of the water vapor
+! self-continuum (including the energy term). The first index
+! refers to temperature in 7.2 degree increments. For instance,
+! JT = 1 refers to a temperature of 245.6, JT = 2 refers to 252.8,
+! etc. The second index runs over the g-channel (1 to 16).
+
+ if(dminfo % my_proc_id == IO_NODE) read (unit=rrtmg_unit,iostat=istat) &
+ fracrefao, fracrefbo, kao, kbo, kao_mn2, kbo_mn2, selfrefo, forrefo
+
+ if(istat /= 0) then
+ write(0,*)
+ write(errmess,'(A,I4)') 'module_ra_rrtmg_lw: error reading RRTMG_LW_DATA on unit ', &
+ rrtmg_unit
+ call physics_error_fatal(istat,errmess)
+ endif
+
+ DM_BCAST_MACRO(fracrefao)
+ DM_BCAST_MACRO(fracrefbo)
+ DM_BCAST_MACRO(kao)
+ DM_BCAST_MACRO(kbo)
+ DM_BCAST_MACRO(kao_mn2)
+ DM_BCAST_MACRO(kbo_mn2)
+ DM_BCAST_MACRO(selfrefo)
+ DM_BCAST_MACRO(forrefo)
+
+ end subroutine lw_kgb01
+
+! **************************************************************************
+ subroutine lw_kgb02(rrtmg_unit,dminfo)
+! **************************************************************************
+
+ use rrlw_kg02, only : fracrefao, fracrefbo, kao, kbo, selfrefo, forrefo
+ save
+
+!input arguments:
+ type(dm_info),intent(in):: dminfo
+ integer,intent(in):: rrtmg_unit
+
+!local variables:
+ character(len=80):: errmess
+ integer:: istat
+
+! Arrays fracrefao and fracrefbo are the Planck fractions for the lower
+! and upper atmosphere.
+! Planck fraction mapping levels:
+! Lower: P = 1053.630 mbar, T = 294.2 K
+! Upper: P = 3.206e-2 mb, T = 197.92 K
+
+! The array KAO contains absorption coefs at the 16 chosen g-values
+! for a range of pressure levels > ~100mb and temperatures. The first
+! index in the array, JT, which runs from 1 to 5, corresponds to
+! different temperatures. More specifically, JT = 3 means that the
+! data are for the corresponding TREF for this pressure level,
+! JT = 2 refers to the temperatureTREF-15, JT = 1 is for TREF-30,
+! JT = 4 is for TREF+15, and JT = 5 is for TREF+30. The second
+! index, JP, runs from 1 to 13 and refers to the corresponding
+! pressure level in PREF (e.g. JP = 1 is for a pressure of 1053.63 mb).
+! The third index, IG, goes from 1 to 16, and tells us which
+! g-interval the absorption coefficients are for.
+
+! The array KBO contains absorption coefs at the 16 chosen g-values
+! for a range of pressure levels < ~100mb and temperatures. The first
+! index in the array, JT, which runs from 1 to 5, corresponds to
+! different temperatures. More specifically, JT = 3 means that the
+! data are for the reference temperature TREF for this pressure
+! level, JT = 2 refers to the temperature TREF-15, JT = 1 is for
+! TREF-30, JT = 4 is for TREF+15, and JT = 5 is for TREF+30.
+! The second index, JP, runs from 13 to 59 and refers to the JPth
+! reference pressure level (see taumol.f for the value of these
+! pressure levels in mb). The third index, IG, goes from 1 to 16,
+! and tells us which g-interval the absorption coefficients are for.
+
+! The array FORREFO contains the coefficient of the water vapor
+! foreign-continuum (including the energy term). The first
+! index refers to reference temperature (296,260,224,260) and
+! pressure (970,475,219,3 mbar) levels. The second index
+! runs over the g-channel (1 to 16).
+
+! The array SELFREFO contains the coefficient of the water vapor
+! self-continuum (including the energy term). The first index
+! refers to temperature in 7.2 degree increments. For instance,
+! JT = 1 refers to a temperature of 245.6, JT = 2 refers to 252.8,
+! etc. The second index runs over the g-channel (1 to 16).
+
+ if(dminfo % my_proc_id == IO_NODE) read (unit=rrtmg_unit,iostat=istat) &
+ fracrefao, fracrefbo, kao, kbo, selfrefo, forrefo
+
+ if(istat /= 0) then
+ write(errmess,'(A,I4)') 'module_ra_rrtmg_lw: error reading RRTMG_LW_DATA on unit ', &
+ rrtmg_unit
+ call physics_error_fatal(istat,errmess)
+ endif
+
+ DM_BCAST_MACRO(fracrefao)
+ DM_BCAST_MACRO(fracrefbo)
+ DM_BCAST_MACRO(kao)
+ DM_BCAST_MACRO(kbo)
+ DM_BCAST_MACRO(selfrefo)
+ DM_BCAST_MACRO(forrefo)
+
+ end subroutine lw_kgb02
+
+! **************************************************************************
+ subroutine lw_kgb03(rrtmg_unit,dminfo)
+! **************************************************************************
+
+ use rrlw_kg03, only : fracrefao, fracrefbo, kao, kbo, kao_mn2o, &
+ kbo_mn2o, selfrefo, forrefo
+ save
+
+!input arguments:
+ type(dm_info),intent(in):: dminfo
+ integer,intent(in):: rrtmg_unit
+
+!local variables:
+ character(len=80):: errmess
+ integer:: istat
+
+! Arrays fracrefao and fracrefbo are the Planck fractions for the lower
+! and upper atmosphere.
+! Planck fraction mapping levels:
+! Lower: P = 212.7250 mbar, T = 223.06 K
+! Upper: P = 95.8 mbar, T = 215.7 k
+
+! The array KAO contains absorption coefs for each of the 16 g-intervals
+! for a range of pressure levels > ~100mb, temperatures, and ratios
+! of water vapor to CO2. The first index in the array, JS, runs
+! from 1 to 10, and corresponds to different gas column amount ratios,
+! as expressed through the binary species parameter eta, defined as
+! eta = gas1/(gas1 + (rat) * gas2), where rat is the
+! ratio of the reference MLS column amount value of gas 1
+! to that of gas2.
+! The 2nd index in the array, JT, which runs from 1 to 5, corresponds
+! to different temperatures. More specifically, JT = 3 means that the
+! data are for the reference temperature TREF for this pressure
+! level, JT = 2 refers to the temperature
+! TREF-15, JT = 1 is for TREF-30, JT = 4 is for TREF+15, and JT = 5
+! is for TREF+30. The third index, JP, runs from 1 to 13 and refers
+! to the reference pressure level (e.g. JP = 1 is for a
+! pressure of 1053.63 mb). The fourth index, IG, goes from 1 to 16,
+! and tells us which g-interval the absorption coefficients are for.
+
+! The array KBO contains absorption coefs at the 16 chosen g-values
+! for a range of pressure levels < ~100mb and temperatures. The first
+! index in the array, JT, which runs from 1 to 5, corresponds to
+! different temperatures. More specifically, JT = 3 means that the
+! data are for the reference temperature TREF for this pressure
+! level, JT = 2 refers to the temperature TREF-15, JT = 1 is for
+! TREF-30, JT = 4 is for TREF+15, and JT = 5 is for TREF+30.
+! The second index, JP, runs from 13 to 59 and refers to the JPth
+! reference pressure level (see taumol.f for the value of these
+! pressure levels in mb). The third index, IG, goes from 1 to 16,
+! and tells us which g-interval the absorption coefficients are for.
+! The 2nd index in the array, JT, which runs from 1 to 5, corresponds
+! to different temperatures. More specifically, JT = 3 means that the
+! data are for the reference temperature TREF for this pressure
+! level, JT = 2 refers to the temperature
+! TREF-15, JT = 1 is for TREF-30, JT = 4 is for TREF+15, and JT = 5
+! is for TREF+30. The third index, JP, runs from 1 to 13 and refers
+! to the reference pressure level (e.g. JP = 1 is for a
+! pressure of 1053.63 mb). The fourth index, IG, goes from 1 to 16,
+! and tells us which g-interval the absorption coefficients are for.
+
+! The array KAO_Mxx contains the absorption coefficient for
+! a minor species at the 16 chosen g-values for a reference pressure
+! level below 100~ mb. The first index in the array, JS, runs
+! from 1 to 10, and corresponds to different gas column amount ratios,
+! as expressed through the binary species parameter eta, defined as
+! eta = gas1/(gas1 + (rat) * gas2), where rat is the
+! ratio of the reference MLS column amount value of gas 1
+! to that of gas2. The second index refers to temperature
+! in 7.2 degree increments. For instance, JT = 1 refers to a
+! temperature of 188.0, JT = 2 refers to 195.2, etc. The third index
+! runs over the g-channel (1 to 16).
+
+! The array KBO_Mxx contains the absorption coefficient for
+! a minor species at the 16 chosen g-values for a reference pressure
+! level above 100~ mb. The first index in the array, JS, runs
+! from 1 to 10, and corresponds to different gas column amounts ratios,
+! as expressed through the binary species parameter eta, defined as
+! eta = gas1/(gas1 + (rat) * gas2), where rat is the
+! ratio of the reference MLS column amount value of gas 1 to
+! that of gas2. The second index refers to temperature
+! in 7.2 degree increments. For instance, JT = 1 refers to a
+! temperature of 188.0, JT = 2 refers to 195.2, etc. The third index
+! runs over the g-channel (1 to 16).
+
+! The array FORREFO contains the coefficient of the water vapor
+! foreign-continuum (including the energy term). The first
+! index refers to reference temperature (296,260,224,260) and
+! pressure (970,475,219,3 mbar) levels. The second index
+! runs over the g-channel (1 to 16).
+
+! The array SELFREFO contains the coefficient of the water vapor
+! self-continuum (including the energy term). The first index
+! refers to temperature in 7.2 degree increments. For instance,
+! JT = 1 refers to a temperature of 245.6, JT = 2 refers to 252.8,
+! etc. The second index runs over the g-channel (1 to 16).
+
+ if(dminfo % my_proc_id == IO_NODE) read (unit=rrtmg_unit,iostat=istat) &
+ fracrefao, fracrefbo, kao, kbo, kao_mn2o, kbo_mn2o, selfrefo, forrefo
+
+ if(istat /= 0) then
+ write(errmess,'(A,I4)') 'module_ra_rrtmg_lw: error reading RRTMG_LW_DATA on unit ', &
+ rrtmg_unit
+ call physics_error_fatal(istat,errmess)
+ endif
+
+ DM_BCAST_MACRO(fracrefao)
+ DM_BCAST_MACRO(fracrefbo)
+ DM_BCAST_MACRO(kao)
+ DM_BCAST_MACRO(kbo)
+ DM_BCAST_MACRO(kao_mn2o)
+ DM_BCAST_MACRO(kbo_mn2o)
+ DM_BCAST_MACRO(selfrefo)
+ DM_BCAST_MACRO(forrefo)
+
+ end subroutine lw_kgb03
+
+! **************************************************************************
+ subroutine lw_kgb04(rrtmg_unit,dminfo)
+! **************************************************************************
+
+ use rrlw_kg04, only : fracrefao, fracrefbo, kao, kbo, selfrefo, forrefo
+ save
+
+!input arguments:
+ type(dm_info),intent(in):: dminfo
+ integer,intent(in):: rrtmg_unit
+
+!local variables:
+ character(len=80):: errmess
+ integer:: istat
+
+! Arrays fracrefao and fracrefbo are the Planck fractions for the lower
+! and upper atmosphere.
+! Planck fraction mapping levels:
+! Lower : P = 142.5940 mbar, T = 215.70 K
+! Upper : P = 95.58350 mb, T = 215.70 K
+
+! The array KAO contains absorption coefs for each of the 16 g-intervals
+! for a range of pressure levels > ~100mb, temperatures, and ratios
+! of water vapor to CO2. The first index in the array, JS, runs
+! from 1 to 10, and corresponds to different gas column amount ratios,
+! as expressed through the binary species parameter eta, defined as
+! eta = gas1/(gas1 + (rat) * gas2), where rat is the
+! ratio of the reference MLS column amount value of gas 1
+! to that of gas2.
+! The 2nd index in the array, JT, which runs from 1 to 5, corresponds
+! to different temperatures. More specifically, JT = 3 means that the
+! data are for the reference temperature TREF for this pressure
+! level, JT = 2 refers to the temperature
+! TREF-15, JT = 1 is for TREF-30, JT = 4 is for TREF+15, and JT = 5
+! is for TREF+30. The third index, JP, runs from 1 to 13 and refers
+! to the reference pressure level (e.g. JP = 1 is for a
+! pressure of 1053.63 mb). The fourth index, IG, goes from 1 to 16,
+! and tells us which g-interval the absorption coefficients are for.
+
+! The array KBO contains absorption coefs for each of the 16 g-intervals
+! for a range of pressure levels < ~100mb, temperatures, and ratios
+! of H2O to CO2. The first index in the array, JS, runs
+! from 1 to 10, and corresponds to different gas column amount ratios,
+! as expressed through the binary species parameter eta, defined as
+! eta = gas1/(gas1 + (rat) * gas2), where rat is the
+! ratio of the reference MLS column amount value of gas 1
+! to that of gas2. The second index, JT, which
+! runs from 1 to 5, corresponds to different temperatures. More
+! specifically, JT = 3 means that the data are for the corresponding
+! reference temperature TREF for this pressure level, JT = 2 refers
+! to the TREF-15, JT = 1 is for TREF-30, JT = 4 is for TREF+15, and
+! JT = 5 is for TREF+30. The third index, JP, runs from 13 to 59 and
+! refers to the corresponding pressure level in PREF (e.g. JP = 13 is
+! for a pressure of 95.5835 mb). The fourth index, IG, goes from 1 to
+! 16, and tells us which g-interval the absorption coefficients are for.
+
+! The array FORREFO contains the coefficient of the water vapor
+! foreign-continuum (including the energy term). The first
+! index refers to reference temperature (296,260,224,260) and
+! pressure (970,475,219,3 mbar) levels. The second index
+! runs over the g-channel (1 to 16).
+
+! The array SELFREFO contains the coefficient of the water vapor
+! self-continuum (including the energy term). The first index
+! refers to temperature in 7.2 degree increments. For instance,
+! JT = 1 refers to a temperature of 245.6, JT = 2 refers to 252.8,
+! etc. The second index runs over the g-channel (1 to 16).
+
+ if(dminfo % my_proc_id == IO_NODE) read (unit=rrtmg_unit,iostat=istat) &
+ fracrefao, fracrefbo, kao, kbo, selfrefo, forrefo
+
+ if(istat /= 0) then
+ write(errmess,'(A,I4)') 'module_ra_rrtmg_lw: error reading RRTMG_LW_DATA on unit ', &
+ rrtmg_unit
+ call physics_error_fatal(istat,errmess)
+ endif
+
+ DM_BCAST_MACRO(fracrefao)
+ DM_BCAST_MACRO(fracrefbo)
+ DM_BCAST_MACRO(kao)
+ DM_BCAST_MACRO(kbo)
+ DM_BCAST_MACRO(selfrefo)
+ DM_BCAST_MACRO(forrefo)
+
+ end subroutine lw_kgb04
+
+! **************************************************************************
+ subroutine lw_kgb05(rrtmg_unit,dminfo)
+! **************************************************************************
+
+ use rrlw_kg05, only : fracrefao, fracrefbo, kao, kbo, kao_mo3, &
+ selfrefo, forrefo, ccl4o
+ save
+
+!input arguments:
+ type(dm_info),intent(in):: dminfo
+ integer,intent(in):: rrtmg_unit
+
+!local variables:
+ character(len=80):: errmess
+ integer:: istat
+
+! Arrays fracrefao and fracrefbo are the Planck fractions for the lower
+! and upper atmosphere.
+! Planck fraction mapping levels:
+! Lower: P = 473.42 mb, T = 259.83
+! Upper: P = 0.2369280 mbar, T = 253.60 K
+
+! The arrays kao_mo3 and ccl4o contain the coefficients for
+! ozone and ccl4 in the lower atmosphere.
+! Minor gas mapping level:
+! Lower - o3: P = 317.34 mbar, T = 240.77 k
+! Lower - ccl4:
+
+! The array KAO contains absorption coefs for each of the 16 g-intervals
+! for a range of pressure levels > ~100mb, temperatures, and ratios
+! of water vapor to CO2. The first index in the array, JS, runs
+! from 1 to 10, and corresponds to different gas column amount ratios,
+! as expressed through the binary species parameter eta, defined as
+! eta = gas1/(gas1 + (rat) * gas2), where rat is the
+! ratio of the reference MLS column amount value of gas 1
+! to that of gas2.
+! The 2nd index in the array, JT, which runs from 1 to 5, corresponds
+! to different temperatures. More specifically, JT = 3 means that the
+! data are for the reference temperature TREF for this pressure
+! level, JT = 2 refers to the temperature
+! TREF-15, JT = 1 is for TREF-30, JT = 4 is for TREF+15, and JT = 5
+! is for TREF+30. The third index, JP, runs from 1 to 13 and refers
+! to the reference pressure level (e.g. JP = 1 is for a
+! pressure of 1053.63 mb). The fourth index, IG, goes from 1 to 16,
+! and tells us which g-interval the absorption coefficients are for.
+
+! The array KBO contains absorption coefs for each of the 16 g-intervals
+! for a range of pressure levels < ~100mb, temperatures, and ratios
+! of H2O to CO2. The first index in the array, JS, runs
+! from 1 to 10, and corresponds to different gas column amount ratios,
+! as expressed through the binary species parameter eta, defined as
+! eta = gas1/(gas1 + (rat) * gas2), where rat is the
+! ratio of the reference MLS column amount value of gas 1
+! to that of gas2. The second index, JT, which
+! runs from 1 to 5, corresponds to different temperatures. More
+! specifically, JT = 3 means that the data are for the corresponding
+! reference temperature TREF for this pressure level, JT = 2 refers
+! to the TREF-15, JT = 1 is for TREF-30, JT = 4 is for TREF+15, and
+! JT = 5 is for TREF+30. The third index, JP, runs from 13 to 59 and
+! refers to the corresponding pressure level in PREF (e.g. JP = 13 is
+! for a pressure of 95.5835 mb). The fourth index, IG, goes from 1 to
+! 16, and tells us which g-interval the absorption coefficients are for.
+
+! The array KAO_Mxx contains the absorption coefficient for
+! a minor species at the 16 chosen g-values for a reference pressure
+! level below 100~ mb. The first index in the array, JS, runs
+! from 1 to 10, and corresponds to different gas column amount ratios,
+! as expressed through the binary species parameter eta, defined as
+! eta = gas1/(gas1 + (rat) * gas2), where rat is the
+! ratio of the reference MLS column amount value of gas 1
+! to that of gas2. The second index refers to temperature
+! in 7.2 degree increments. For instance, JT = 1 refers to a
+! temperature of 188.0, JT = 2 refers to 195.2, etc. The third index
+! runs over the g-channel (1 to 16).
+
+! The array FORREFO contains the coefficient of the water vapor
+! foreign-continuum (including the energy term). The first
+! index refers to reference temperature (296,260,224,260) and
+! pressure (970,475,219,3 mbar) levels. The second index
+! runs over the g-channel (1 to 16).
+
+! The array SELFREFO contains the coefficient of the water vapor
+! self-continuum (including the energy term). The first index
+! refers to temperature in 7.2 degree increments. For instance,
+! JT = 1 refers to a temperature of 245.6, JT = 2 refers to 252.8,
+! etc. The second index runs over the g-channel (1 to 16).
+
+ if(dminfo % my_proc_id == IO_NODE) read (unit=rrtmg_unit,iostat=istat) &
+ fracrefao, fracrefbo, kao, kbo, kao_mo3, ccl4o, selfrefo, forrefo
+
+ if(istat /= 0) then
+ write(errmess,'(A,I4)') 'module_ra_rrtmg_lw: error reading RRTMG_LW_DATA on unit ', &
+ rrtmg_unit
+ call physics_error_fatal(istat,errmess)
+ endif
+
+ DM_BCAST_MACRO(fracrefao)
+ DM_BCAST_MACRO(fracrefbo)
+ DM_BCAST_MACRO(kao)
+ DM_BCAST_MACRO(kbo)
+ DM_BCAST_MACRO(kao_mo3)
+ DM_BCAST_MACRO(ccl4o)
+ DM_BCAST_MACRO(selfrefo)
+ DM_BCAST_MACRO(forrefo)
+
+ end subroutine lw_kgb05
+
+! **************************************************************************
+ subroutine lw_kgb06(rrtmg_unit,dminfo)
+! **************************************************************************
+
+ use rrlw_kg06, only : fracrefao, kao, kao_mco2, selfrefo, forrefo, &
+ cfc11adjo, cfc12o
+ save
+
+!input arguments:
+ type(dm_info),intent(in):: dminfo
+ integer,intent(in):: rrtmg_unit
+
+!local variables:
+ character(len=80):: errmess
+ integer:: istat
+
+! Arrays fracrefao and fracrefbo are the Planck fractions for the lower
+! and upper atmosphere.
+! Planck fraction mapping levels:
+! Lower: : P = 473.4280 mb, T = 259.83 K
+
+! The arrays kao_mco2, cfc11adjo and cfc12o contain the coefficients for
+! carbon dioxide in the lower atmosphere and cfc11 and cfc12 in the upper
+! atmosphere.
+! Original cfc11 is multiplied by 1.385 to account for the 1060-1107 cm-1 band.
+! Minor gas mapping level:
+! Lower - co2: P = 706.2720 mb, T = 294.2 k
+! Upper - cfc11, cfc12
+
+! The array KAO contains absorption coefs at the 16 chosen g-values
+! for a range of pressure levels > ~100mb and temperatures. The first
+! index in the array, JT, which runs from 1 to 5, corresponds to
+! different temperatures. More specifically, JT = 3 means that the
+! data are for the corresponding TREF for this pressure level,
+! JT = 2 refers to the temperatureTREF-15, JT = 1 is for TREF-30,
+! JT = 4 is for TREF+15, and JT = 5 is for TREF+30. The second
+! index, JP, runs from 1 to 13 and refers to the corresponding
+! pressure level in PREF (e.g. JP = 1 is for a pressure of 1053.63 mb).
+! The third index, IG, goes from 1 to 16, and tells us which
+! g-interval the absorption coefficients are for.
+
+! The array KAO_Mxx contains the absorption coefficient for
+! a minor species at the 16 chosen g-values for a reference pressure
+! level below 100~ mb. The first index refers to temperature
+! in 7.2 degree increments. For instance, JT = 1 refers to a
+! temperature of 188.0, JT = 2 refers to 195.2, etc. The second index
+! runs over the g-channel (1 to 16).
+
+! The array FORREFO contains the coefficient of the water vapor
+! foreign-continuum (including the energy term). The first
+! index refers to reference temperature (296,260,224,260) and
+! pressure (970,475,219,3 mbar) levels. The second index
+! runs over the g-channel (1 to 16).
+
+! The array SELFREFO contains the coefficient of the water vapor
+! self-continuum (including the energy term). The first index
+! refers to temperature in 7.2 degree increments. For instance,
+! JT = 1 refers to a temperature of 245.6, JT = 2 refers to 252.8,
+! etc. The second index runs over the g-channel (1 to 16).
+
+ if(dminfo % my_proc_id == IO_NODE) read (unit=rrtmg_unit,iostat=istat) &
+ fracrefao, kao, kao_mco2, cfc11adjo, cfc12o, selfrefo, forrefo
+
+ if(istat /= 0) then
+ write(errmess,'(A,I4)') 'module_ra_rrtmg_lw: error reading RRTMG_LW_DATA on unit ', &
+ rrtmg_unit
+ call physics_error_fatal(istat,errmess)
+ endif
+
+ DM_BCAST_MACRO(fracrefao)
+ DM_BCAST_MACRO(kao)
+ DM_BCAST_MACRO(kao_mco2)
+ DM_BCAST_MACRO(cfc11adjo)
+ DM_BCAST_MACRO(cfc12o)
+ DM_BCAST_MACRO(selfrefo)
+ DM_BCAST_MACRO(forrefo)
+
+ end subroutine lw_kgb06
+
+! **************************************************************************
+ subroutine lw_kgb07(rrtmg_unit,dminfo)
+! **************************************************************************
+
+ use rrlw_kg07, only : fracrefao, fracrefbo, kao, kbo, kao_mco2, &
+ kbo_mco2, selfrefo, forrefo
+ save
+
+!input arguments:
+ type(dm_info),intent(in):: dminfo
+ integer,intent(in):: rrtmg_unit
+
+!local variables:
+ character(len=80):: errmess
+ integer:: istat
+
+! Arrays fracrefao and fracrefbo are the Planck fractions for the lower
+! and upper atmosphere.
+! Planck fraction mapping levels:
+! Lower : P = 706.27 mb, T = 278.94 K
+! Upper : P = 95.58 mbar, T= 215.70 K
+
+! The array KAO contains absorption coefs for each of the 16 g-intervals
+! for a range of pressure levels > ~100mb, temperatures, and ratios
+! of water vapor to CO2. The first index in the array, JS, runs
+! from 1 to 10, and corresponds to different gas column amount ratios,
+! as expressed through the binary species parameter eta, defined as
+! eta = gas1/(gas1 + (rat) * gas2), where rat is the
+! ratio of the reference MLS column amount value of gas 1
+! to that of gas2.
+! The 2nd index in the array, JT, which runs from 1 to 5, corresponds
+! to different temperatures. More specifically, JT = 3 means that the
+! data are for the reference temperature TREF for this pressure
+! level, JT = 2 refers to the temperature
+! TREF-15, JT = 1 is for TREF-30, JT = 4 is for TREF+15, and JT = 5
+! is for TREF+30. The third index, JP, runs from 1 to 13 and refers
+! to the reference pressure level (e.g. JP = 1 is for a
+! pressure of 1053.63 mb). The fourth index, IG, goes from 1 to 16,
+! and tells us which g-interval the absorption coefficients are for.
+
+! The array KBO contains absorption coefs at the 16 chosen g-values
+! for a range of pressure levels < ~100mb and temperatures. The first
+! index in the array, JT, which runs from 1 to 5, corresponds to
+! different temperatures. More specifically, JT = 3 means that the
+! data are for the reference temperature TREF for this pressure
+! level, JT = 2 refers to the temperature TREF-15, JT = 1 is for
+! TREF-30, JT = 4 is for TREF+15, and JT = 5 is for TREF+30.
+! The second index, JP, runs from 13 to 59 and refers to the JPth
+! reference pressure level (see taumol.f for the value of these
+! pressure levels in mb). The third index, IG, goes from 1 to 16,
+! and tells us which g-interval the absorption coefficients are for.
+
+! The array KAO_Mxx contains the absorption coefficient for
+! a minor species at the 16 chosen g-values for a reference pressure
+! level below 100~ mb. The first index in the array, JS, runs
+! from 1 to 10, and corresponds to different gas column amount ratios,
+! as expressed through the binary species parameter eta, defined as
+! eta = gas1/(gas1 + (rat) * gas2), where rat is the
+! ratio of the reference MLS column amount value of gas 1
+! to that of gas2. The second index refers to temperature
+! in 7.2 degree increments. For instance, JT = 1 refers to a
+! temperature of 188.0, JT = 2 refers to 195.2, etc. The third index
+! runs over the g-channel (1 to 16).
+
+! The array KBO_Mxx contains the absorption coefficient for
+! a minor species at the 16 chosen g-values for a reference pressure
+! level above 100~ mb. The first index refers to temperature
+! in 7.2 degree increments. For instance, JT = 1 refers to a
+! temperature of 188.0, JT = 2 refers to 195.2, etc. The second index
+! runs over the g-channel (1 to 16).
+
+! The array FORREFO contains the coefficient of the water vapor
+! foreign-continuum (including the energy term). The first
+! index refers to reference temperature (296_rb,260_rb,224,260) and
+! pressure (970,475,219,3 mbar) levels. The second index
+! runs over the g-channel (1 to 16).
+
+! The array SELFREFO contains the coefficient of the water vapor
+! self-continuum (including the energy term). The first index
+! refers to temperature in 7.2 degree increments. For instance,
+! JT = 1 refers to a temperature of 245.6, JT = 2 refers to 252.8,
+! etc. The second index runs over the g-channel (1 to 16).
+
+ if(dminfo % my_proc_id == IO_NODE) read (unit=rrtmg_unit,iostat=istat) &
+ fracrefao, fracrefbo, kao, kbo, kao_mco2, kbo_mco2, selfrefo, forrefo
+
+ if(istat /= 0) then
+ write(errmess,'(A,I4)') 'module_ra_rrtmg_lw: error reading RRTMG_LW_DATA on unit ', &
+ rrtmg_unit
+ call physics_error_fatal(istat,errmess)
+ endif
+
+ DM_BCAST_MACRO(fracrefao)
+ DM_BCAST_MACRO(fracrefbo)
+ DM_BCAST_MACRO(kao)
+ DM_BCAST_MACRO(kbo)
+ DM_BCAST_MACRO(kao_mco2)
+ DM_BCAST_MACRO(kbo_mco2)
+ DM_BCAST_MACRO(selfrefo)
+ DM_BCAST_MACRO(forrefo)
+
+ end subroutine lw_kgb07
+
+! **************************************************************************
+ subroutine lw_kgb08(rrtmg_unit,dminfo)
+! **************************************************************************
+
+ use rrlw_kg08, only : fracrefao, fracrefbo, kao, kao_mco2, kao_mn2o, &
+ kao_mo3, kbo, kbo_mco2, kbo_mn2o, selfrefo, forrefo, &
+ cfc12o, cfc22adjo
+ save
+
+!input arguments:
+ type(dm_info),intent(in):: dminfo
+ integer,intent(in):: rrtmg_unit
+
+!local variables:
+ character(len=80):: errmess
+ integer:: istat
+
+! Arrays fracrefao and fracrefbo are the Planck fractions for the lower
+! and upper atmosphere.
+! Planck fraction mapping levels:
+! Lower: P=473.4280 mb, T = 259.83 K
+! Upper: P=95.5835 mb, T= 215.7 K
+
+! The arrays kao_mco2, kbo_mco2, kao_mn2o, kbo_mn2o contain the coefficients for
+! carbon dioxide and n2o in the lower and upper atmosphere.
+! The array kao_mo3 contains the coefficients for ozone in the lower atmosphere,
+! and arrays cfc12o and cfc12adjo contain the coefficients for cfc12 and cfc22.
+! Original cfc22 is multiplied by 1.485 to account for the 780-850 cm-1
+! and 1290-1335 cm-1 bands.
+! Minor gas mapping level:
+! Lower - co2: P = 1053.63 mb, T = 294.2 k
+! Lower - o3: P = 317.348 mb, T = 240.77 k
+! Lower - n2o: P = 706.2720 mb, T= 278.94 k
+! Lower - cfc12, cfc22
+! Upper - co2: P = 35.1632 mb, T = 223.28 k
+! Upper - n2o: P = 8.716e-2 mb, T = 226.03 k
+
+! The array KAO contains absorption coefs at the 16 chosen g-values
+! for a range of pressure levels > ~100mb and temperatures. The first
+! index in the array, JT, which runs from 1 to 5, corresponds to
+! different temperatures. More specifically, JT = 3 means that the
+! data are for the corresponding TREF for this pressure level,
+! JT = 2 refers to the temperatureTREF-15, JT = 1 is for TREF-30,
+! JT = 4 is for TREF+15, and JT = 5 is for TREF+30. The second
+! index, JP, runs from 1 to 13 and refers to the corresponding
+! pressure level in PREF (e.g. JP = 1 is for a pressure of 1053.63 mb).
+! The third index, IG, goes from 1 to 16, and tells us which
+! g-interval the absorption coefficients are for.
+
+! The array KBO contains absorption coefs at the 16 chosen g-values
+! for a range of pressure levels < ~100mb and temperatures. The first
+! index in the array, JT, which runs from 1 to 5, corresponds to
+! different temperatures. More specifically, JT = 3 means that the
+! data are for the reference temperature TREF for this pressure
+! level, JT = 2 refers to the temperature TREF-15, JT = 1 is for
+! TREF-30, JT = 4 is for TREF+15, and JT = 5 is for TREF+30.
+! The second index, JP, runs from 13 to 59 and refers to the JPth
+! reference pressure level (see taumol.f for the value of these
+! pressure levels in mb). The third index, IG, goes from 1 to 16,
+! and tells us which g-interval the absorption coefficients are for.
+
+! The array KAO_Mxx contains the absorption coefficient for
+! a minor species at the 16 chosen g-values for a reference pressure
+! level below 100~ mb. The first index refers to temperature
+! in 7.2 degree increments. For instance, JT = 1 refers to a
+! temperature of 188.0, JT = 2 refers to 195.2, etc. The second index
+! runs over the g-channel (1 to 16).
+
+! The array KBO_Mxx contains the absorption coefficient for
+! a minor species at the 16 chosen g-values for a reference pressure
+! level above 100~ mb. The first index refers to temperature
+! in 7.2 degree increments. For instance, JT = 1 refers to a
+! temperature of 188.0, JT = 2 refers to 195.2, etc. The second index
+! runs over the g-channel (1 to 16).
+
+! The array FORREFO contains the coefficient of the water vapor
+! foreign-continuum (including the energy term). The first
+! index refers to reference temperature (296,260,224,260) and
+! pressure (970,475,219,3 mbar) levels. The second index
+! runs over the g-channel (1 to 16).
+
+! The array SELFREFO contains the coefficient of the water vapor
+! self-continuum (including the energy term). The first index
+! refers to temperature in 7.2 degree increments. For instance,
+! JT = 1 refers to a temperature of 245.6, JT = 2 refers to 252.8,
+! etc. The second index runs over the g-channel (1 to 16).
+
+ if(dminfo % my_proc_id == IO_NODE) read (unit=rrtmg_unit,iostat=istat) &
+ fracrefao, fracrefbo, kao, kbo, kao_mco2, kbo_mco2, kao_mn2o, &
+ kbo_mn2o, kao_mo3, cfc12o, cfc22adjo, selfrefo, forrefo
+
+ if(istat /= 0) then
+ write(errmess,'(A,I4)') 'module_ra_rrtmg_lw: error reading RRTMG_LW_DATA on unit ', &
+ rrtmg_unit
+ call physics_error_fatal(istat,errmess)
+ endif
+
+ DM_BCAST_MACRO(fracrefao)
+ DM_BCAST_MACRO(fracrefbo)
+ DM_BCAST_MACRO(kao)
+ DM_BCAST_MACRO(kbo)
+ DM_BCAST_MACRO(kao_mco2)
+ DM_BCAST_MACRO(kbo_mco2)
+ DM_BCAST_MACRO(kao_mn2o)
+ DM_BCAST_MACRO(kbo_mn2o)
+ DM_BCAST_MACRO(kao_mo3)
+ DM_BCAST_MACRO(cfc12o)
+ DM_BCAST_MACRO(cfc22adjo)
+ DM_BCAST_MACRO(selfrefo)
+ DM_BCAST_MACRO(forrefo)
+
+ end subroutine lw_kgb08
+
+! **************************************************************************
+ subroutine lw_kgb09(rrtmg_unit,dminfo)
+! **************************************************************************
+
+ use rrlw_kg09, only : fracrefao, fracrefbo, kao, kbo, kao_mn2o, &
+ kbo_mn2o, selfrefo, forrefo
+ save
+
+!input arguments:
+ type(dm_info),intent(in):: dminfo
+ integer,intent(in):: rrtmg_unit
+
+!local variables:
+ character(len=80):: errmess
+ integer:: istat
+
+! Arrays fracrefao and fracrefbo are the Planck fractions for the lower
+! and upper atmosphere.
+! Planck fraction mapping levels:
+! Lower: P=212.7250 mb, T = 223.06 K
+! Upper: P=3.20e-2 mb, T = 197.92 k
+
+! The array KAO contains absorption coefs for each of the 16 g-intervals
+! for a range of pressure levels > ~100mb, temperatures, and ratios
+! of water vapor to CO2. The first index in the array, JS, runs
+! from 1 to 10, and corresponds to different gas column amount ratios,
+! as expressed through the binary species parameter eta, defined as
+! eta = gas1/(gas1 + (rat) * gas2), where rat is the
+! ratio of the reference MLS column amount value of gas 1
+! to that of gas2.
+! The 2nd index in the array, JT, which runs from 1 to 5, corresponds
+! to different temperatures. More specifically, JT = 3 means that the
+! data are for the reference temperature TREF for this pressure
+! level, JT = 2 refers to the temperature
+! TREF-15, JT = 1 is for TREF-30, JT = 4 is for TREF+15, and JT = 5
+! is for TREF+30. The third index, JP, runs from 1 to 13 and refers
+! to the reference pressure level (e.g. JP = 1 is for a
+! pressure of 1053.63 mb). The fourth index, IG, goes from 1 to 16,
+! and tells us which g-interval the absorption coefficients are for.
+
+! The array KBO contains absorption coefs at the 16 chosen g-values
+! for a range of pressure levels < ~100mb and temperatures. The first
+! index in the array, JT, which runs from 1 to 5, corresponds to
+! different temperatures. More specifically, JT = 3 means that the
+! data are for the reference temperature TREF for this pressure
+! level, JT = 2 refers to the temperature TREF-15, JT = 1 is for
+! TREF-30, JT = 4 is for TREF+15, and JT = 5 is for TREF+30.
+! The second index, JP, runs from 13 to 59 and refers to the JPth
+! reference pressure level (see taumol.f for the value of these
+! pressure levels in mb). The third index, IG, goes from 1 to 16,
+! and tells us which g-interval the absorption coefficients are for.
+
+! The array KAO_Mxx contains the absorption coefficient for
+! a minor species at the 16 chosen g-values for a reference pressure
+! level below 100~ mb. The first index in the array, JS, runs
+! from 1 to 10, and corresponds to different gas column amount ratios,
+! as expressed through the binary species parameter eta, defined as
+! eta = gas1/(gas1 + (rat) * gas2), where rat is the
+! ratio of the reference MLS column amount value of gas 1
+! to that of gas2. The second index refers to temperature
+! in 7.2 degree increments. For instance, JT = 1 refers to a
+! temperature of 188.0, JT = 2 refers to 195.2, etc. The third index
+! runs over the g-channel (1 to 16).
+
+! The array KBO_Mxx contains the absorption coefficient for
+! a minor species at the 16 chosen g-values for a reference pressure
+! level above 100~ mb. The first index refers to temperature
+! in 7.2 degree increments. For instance, JT = 1 refers to a
+! temperature of 188.0, JT = 2 refers to 195.2, etc. The second index
+! runs over the g-channel (1 to 16).
+
+! The array FORREFO contains the coefficient of the water vapor
+! foreign-continuum (including the energy term). The first
+! index refers to reference temperature (296,260,224,260) and
+! pressure (970,475,219,3 mbar) levels. The second index
+! runs over the g-channel (1 to 16).
+
+! The array SELFREFO contains the coefficient of the water vapor
+! self-continuum (including the energy term). The first index
+! refers to temperature in 7.2 degree increments. For instance,
+! JT = 1 refers to a temperature of 245.6, JT = 2 refers to 252.8,
+! etc. The second index runs over the g-channel (1 to 16).
+
+ if(dminfo % my_proc_id == IO_NODE) read (unit=rrtmg_unit,iostat=istat) &
+ fracrefao, fracrefbo, kao, kbo, kao_mn2o, kbo_mn2o, selfrefo, forrefo
+
+ if(istat /= 0) then
+ write(errmess,'(A,I4)') 'module_ra_rrtmg_lw: error reading RRTMG_LW_DATA on unit ', &
+ rrtmg_unit
+ call physics_error_fatal(istat,errmess)
+ endif
+
+ DM_BCAST_MACRO(fracrefao)
+ DM_BCAST_MACRO(fracrefbo)
+ DM_BCAST_MACRO(kao)
+ DM_BCAST_MACRO(kbo)
+ DM_BCAST_MACRO(kao_mn2o)
+ DM_BCAST_MACRO(kbo_mn2o)
+ DM_BCAST_MACRO(selfrefo)
+ DM_BCAST_MACRO(forrefo)
+
+ end subroutine lw_kgb09
+
+! **************************************************************************
+ subroutine lw_kgb10(rrtmg_unit,dminfo)
+! **************************************************************************
+
+ use rrlw_kg10, only : fracrefao, fracrefbo, kao, kbo, selfrefo, forrefo
+ save
+
+!input arguments:
+ type(dm_info),intent(in):: dminfo
+ integer,intent(in):: rrtmg_unit
+
+!local variables:
+ character(len=80):: errmess
+ integer:: istat
+
+! Arrays fracrefao and fracrefbo are the Planck fractions for the lower
+! and upper atmosphere.
+! Planck fraction mapping levels:
+! Lower: P = 212.7250 mb, T = 223.06 K
+! Upper: P = 95.58350 mb, T = 215.70 K
+
+! The array KAO contains absorption coefs at the 16 chosen g-values
+! for a range of pressure levels > ~100mb and temperatures. The first
+! index in the array, JT, which runs from 1 to 5, corresponds to
+! different temperatures. More specifically, JT = 3 means that the
+! data are for the corresponding TREF for this pressure level,
+! JT = 2 refers to the temperatureTREF-15, JT = 1 is for TREF-30,
+! JT = 4 is for TREF+15, and JT = 5 is for TREF+30. The second
+! index, JP, runs from 1 to 13 and refers to the corresponding
+! pressure level in PREF (e.g. JP = 1 is for a pressure of 1053.63 mb).
+! The third index, IG, goes from 1 to 16, and tells us which
+! g-interval the absorption coefficients are for.
+
+! The array KBO contains absorption coefs at the 16 chosen g-values
+! for a range of pressure levels < ~100mb and temperatures. The first
+! index in the array, JT, which runs from 1 to 5, corresponds to
+! different temperatures. More specifically, JT = 3 means that the
+! data are for the reference temperature TREF for this pressure
+! level, JT = 2 refers to the temperature TREF-15, JT = 1 is for
+! TREF-30, JT = 4 is for TREF+15, and JT = 5 is for TREF+30.
+! The second index, JP, runs from 13 to 59 and refers to the JPth
+! reference pressure level (see taumol.f for the value of these
+! pressure levels in mb). The third index, IG, goes from 1 to 16,
+! and tells us which g-interval the absorption coefficients are for.
+
+! The array FORREFO contains the coefficient of the water vapor
+! foreign-continuum (including the energy term). The first
+! index refers to reference temperature (296,260,224,260) and
+! pressure (970,475,219,3 mbar) levels. The second index
+! runs over the g-channel (1 to 16).
+
+! The array SELFREFO contains the coefficient of the water vapor
+! self-continuum (including the energy term). The first index
+! refers to temperature in 7.2 degree increments. For instance,
+! JT = 1 refers to a temperature of 245.6, JT = 2 refers to 252.8,
+! etc. The second index runs over the g-channel (1 to 16).
+
+ if(dminfo % my_proc_id == IO_NODE) read (unit=rrtmg_unit,iostat=istat) &
+ fracrefao, fracrefbo, kao, kbo, selfrefo, forrefo
+
+ if(istat /= 0) then
+ write(errmess,'(A,I4)') 'module_ra_rrtmg_lw: error reading RRTMG_LW_DATA on unit ', &
+ rrtmg_unit
+ call physics_error_fatal(istat,errmess)
+ endif
+
+ DM_BCAST_MACRO(fracrefao)
+ DM_BCAST_MACRO(fracrefbo)
+ DM_BCAST_MACRO(kao)
+ DM_BCAST_MACRO(kbo)
+ DM_BCAST_MACRO(selfrefo)
+ DM_BCAST_MACRO(forrefo)
+
+ end subroutine lw_kgb10
+
+! **************************************************************************
+ subroutine lw_kgb11(rrtmg_unit,dminfo)
+! **************************************************************************
+
+ use rrlw_kg11, only : fracrefao, fracrefbo, kao, kbo, kao_mo2, &
+ kbo_mo2, selfrefo, forrefo
+ save
+
+!input arguments:
+ type(dm_info),intent(in):: dminfo
+ integer,intent(in):: rrtmg_unit
+
+!local variables:
+ character(len=80):: errmess
+ integer:: istat
+
+! Arrays fracrefao and fracrefbo are the Planck fractions for the lower
+! and upper atmosphere.
+! Planck fraction mapping levels:
+! Lower: P=1053.63 mb, T= 294.2 K
+! Upper: P=0.353 mb, T = 262.11 K
+
+! The array KAO contains absorption coefs at the 16 chosen g-values
+! for a range of pressure levels > ~100mb and temperatures. The first
+! index in the array, JT, which runs from 1 to 5, corresponds to
+! different temperatures. More specifically, JT = 3 means that the
+! data are for the corresponding TREF for this pressure level,
+! JT = 2 refers to the temperatureTREF-15, JT = 1 is for TREF-30,
+! JT = 4 is for TREF+15, and JT = 5 is for TREF+30. The second
+! index, JP, runs from 1 to 13 and refers to the corresponding
+! pressure level in PREF (e.g. JP = 1 is for a pressure of 1053.63 mb).
+! The third index, IG, goes from 1 to 16, and tells us which
+! g-interval the absorption coefficients are for.
+
+! The array KBO contains absorption coefs at the 16 chosen g-values
+! for a range of pressure levels < ~100mb and temperatures. The first
+! index in the array, JT, which runs from 1 to 5, corresponds to
+! different temperatures. More specifically, JT = 3 means that the
+! data are for the reference temperature TREF for this pressure
+! level, JT = 2 refers to the temperature TREF-15, JT = 1 is for
+! TREF-30, JT = 4 is for TREF+15, and JT = 5 is for TREF+30.
+! The second index, JP, runs from 13 to 59 and refers to the JPth
+! reference pressure level (see taumol.f for the value of these
+! pressure levels in mb). The third index, IG, goes from 1 to 16,
+! and tells us which g-interval the absorption coefficients are for.
+
+! The array KAO_Mxx contains the absorption coefficient for
+! a minor species at the 16 chosen g-values for a reference pressure
+! level below 100~ mb. The first index refers to temperature
+! in 7.2 degree increments. For instance, JT = 1 refers to a
+! temperature of 188.0, JT = 2 refers to 195.2, etc. The second index
+! runs over the g-channel (1 to 16).
+
+! The array KBO_Mxx contains the absorption coefficient for
+! a minor species at the 16 chosen g-values for a reference pressure
+! level above 100~ mb. The first index refers to temperature
+! in 7.2 degree increments. For instance, JT = 1 refers to a
+! temperature of 188.0, JT = 2 refers to 195.2, etc. The second index
+! runs over the g-channel (1 to 16).
+
+! The array FORREFO contains the coefficient of the water vapor
+! foreign-continuum (including the energy term). The first
+! index refers to reference temperature (296,260,224,260) and
+! pressure (970,475,219,3 mbar) levels. The second index
+! runs over the g-channel (1 to 16).
+
+! The array SELFREFO contains the coefficient of the water vapor
+! self-continuum (including the energy term). The first index
+! refers to temperature in 7.2 degree increments. For instance,
+! JT = 1 refers to a temperature of 245.6, JT = 2 refers to 252.8,
+! etc. The second index runs over the g-channel (1 to 16).
+
+ if(dminfo % my_proc_id == IO_NODE) read (unit=rrtmg_unit,iostat=istat) &
+ fracrefao, fracrefbo, kao, kbo, kao_mo2, kbo_mo2, selfrefo, forrefo
+
+ if(istat /= 0) then
+ write(errmess,'(A,I4)') 'module_ra_rrtmg_lw: error reading RRTMG_LW_DATA on unit ', &
+ rrtmg_unit
+ call physics_error_fatal(istat,errmess)
+ endif
+
+ DM_BCAST_MACRO(fracrefao)
+ DM_BCAST_MACRO(fracrefbo)
+ DM_BCAST_MACRO(kao)
+ DM_BCAST_MACRO(kbo)
+ DM_BCAST_MACRO(kao_mo2)
+ DM_BCAST_MACRO(kbo_mo2)
+ DM_BCAST_MACRO(selfrefo)
+ DM_BCAST_MACRO(forrefo)
+
+ end subroutine lw_kgb11
+
+! **************************************************************************
+ subroutine lw_kgb12(rrtmg_unit,dminfo)
+! **************************************************************************
+
+ use rrlw_kg12, only : fracrefao, kao, selfrefo, forrefo
+ save
+
+!input arguments:
+ type(dm_info),intent(in):: dminfo
+ integer,intent(in):: rrtmg_unit
+
+!local variables:
+ character(len=80):: errmess
+ integer:: istat
+
+! Arrays fracrefao and fracrefbo are the Planck fractions for the lower
+! and upper atmosphere.
+! Planck fraction mapping levels:
+! Lower: P = 174.1640 mbar, T= 215.78 K
+
+! The array KAO contains absorption coefs for each of the 16 g-intervals
+! for a range of pressure levels > ~100mb, temperatures, and ratios
+! of water vapor to CO2. The first index in the array, JS, runs
+! from 1 to 10, and corresponds to different gas column amount ratios,
+! as expressed through the binary species parameter eta, defined as
+! eta = gas1/(gas1 + (rat) * gas2), where rat is the
+! ratio of the reference MLS column amount value of gas 1
+! to that of gas2.
+! The 2nd index in the array, JT, which runs from 1 to 5, corresponds
+! to different temperatures. More specifically, JT = 3 means that the
+! data are for the reference temperature TREF for this pressure
+! level, JT = 2 refers to the temperature
+! TREF-15, JT = 1 is for TREF-30, JT = 4 is for TREF+15, and JT = 5
+! is for TREF+30. The third index, JP, runs from 1 to 13 and refers
+! to the reference pressure level (e.g. JP = 1 is for a
+! pressure of 1053.63 mb). The fourth index, IG, goes from 1 to 16,
+! and tells us which g-interval the absorption coefficients are for.
+
+! The array FORREFO contains the coefficient of the water vapor
+! foreign-continuum (including the energy term). The first
+! index refers to reference temperature (296,260,224,260) and
+! pressure (970,475,219,3 mbar) levels. The second index
+! runs over the g-channel (1 to 16).
+
+! The array SELFREFO contains the coefficient of the water vapor
+! self-continuum (including the energy term). The first index
+! refers to temperature in 7.2 degree increments. For instance,
+! JT = 1 refers to a temperature of 245.6, JT = 2 refers to 252.8,
+! etc. The second index runs over the g-channel (1 to 16).
+
+ if(dminfo % my_proc_id == IO_NODE) read (unit=rrtmg_unit,iostat=istat) &
+ fracrefao, kao, selfrefo, forrefo
+
+ if(istat /= 0) then
+ write(errmess,'(A,I4)') 'module_ra_rrtmg_lw: error reading RRTMG_LW_DATA on unit ', &
+ rrtmg_unit
+ call physics_error_fatal(istat,errmess)
+ endif
+
+ DM_BCAST_MACRO(fracrefao)
+ DM_BCAST_MACRO(kao)
+ DM_BCAST_MACRO(selfrefo)
+ DM_BCAST_MACRO(forrefo)
+
+ end subroutine lw_kgb12
+
+! **************************************************************************
+ subroutine lw_kgb13(rrtmg_unit,dminfo)
+! **************************************************************************
+
+ use rrlw_kg13, only : fracrefao, fracrefbo, kao, kao_mco2, kao_mco, &
+ kbo_mo3, selfrefo, forrefo
+ save
+
+!input arguments:
+ type(dm_info),intent(in):: dminfo
+ integer,intent(in):: rrtmg_unit
+
+!local variables:
+ character(len=80):: errmess
+ integer:: istat
+
+! Arrays fracrefao and fracrefbo are the Planck fractions for the lower
+! and upper atmosphere.
+! Planck fraction mapping levels:
+! Lower: P=473.4280 mb, T = 259.83 K
+! Upper: P=4.758820 mb, T = 250.85 K
+
+! The array KAO contains absorption coefs for each of the 16 g-intervals
+! for a range of pressure levels > ~100mb, temperatures, and ratios
+! of water vapor to CO2. The first index in the array, JS, runs
+! from 1 to 10, and corresponds to different gas column amount ratios,
+! as expressed through the binary species parameter eta, defined as
+! eta = gas1/(gas1 + (rat) * gas2), where rat is the
+! ratio of the reference MLS column amount value of gas 1
+! to that of gas2.
+! The 2nd index in the array, JT, which runs from 1 to 5, corresponds
+! to different temperatures. More specifically, JT = 3 means that the
+! data are for the reference temperature TREF for this pressure
+! level, JT = 2 refers to the temperature
+! TREF-15, JT = 1 is for TREF-30, JT = 4 is for TREF+15, and JT = 5
+! is for TREF+30. The third index, JP, runs from 1 to 13 and refers
+! to the reference pressure level (e.g. JP = 1 is for a
+! pressure of 1053.63 mb). The fourth index, IG, goes from 1 to 16,
+! and tells us which g-interval the absorption coefficients are for.
+
+! The array KAO_Mxx contains the absorption coefficient for
+! a minor species at the 16 chosen g-values for a reference pressure
+! level below 100~ mb. The first index in the array, JS, runs
+! from 1 to 10, and corresponds to different gas column amount ratios,
+! as expressed through the binary species parameter eta, defined as
+! eta = gas1/(gas1 + (rat) * gas2), where rat is the
+! ratio of the reference MLS column amount value of gas 1
+! to that of gas2. The second index refers to temperature
+! in 7.2 degree increments. For instance, JT = 1 refers to a
+! temperature of 188.0, JT = 2 refers to 195.2, etc. The third index
+! runs over the g-channel (1 to 16).
+
+! The array KBO_Mxx contains the absorption coefficient for
+! a minor species at the 16 chosen g-values for a reference pressure
+! level above 100~ mb. The first index refers to temperature
+! in 7.2 degree increments. For instance, JT = 1 refers to a
+! temperature of 188.0, JT = 2 refers to 195.2, etc. The second index
+! runs over the g-channel (1 to 16).
+
+! The array FORREFO contains the coefficient of the water vapor
+! foreign-continuum (including the energy term). The first
+! index refers to reference temperature (296,260,224,260) and
+! pressure (970,475,219,3 mbar) levels. The second index
+! runs over the g-channel (1 to 16).
+
+! The array SELFREFO contains the coefficient of the water vapor
+! self-continuum (including the energy term). The first index
+! refers to temperature in 7.2 degree increments. For instance,
+! JT = 1 refers to a temperature of 245.6, JT = 2 refers to 252.8,
+! etc. The second index runs over the g-channel (1 to 16).
+
+ if(dminfo % my_proc_id == IO_NODE) read (unit=rrtmg_unit,iostat=istat) &
+ fracrefao, fracrefbo, kao, kao_mco2, kao_mco, kbo_mo3, selfrefo, forrefo
+
+ if(istat /= 0) then
+ write(errmess,'(A,I4)') 'module_ra_rrtmg_lw: error reading RRTMG_LW_DATA on unit ', &
+ rrtmg_unit
+ call physics_error_fatal(istat,errmess)
+ endif
+
+ DM_BCAST_MACRO(fracrefao)
+ DM_BCAST_MACRO(fracrefbo)
+ DM_BCAST_MACRO(kao)
+ DM_BCAST_MACRO(kao_mco2)
+ DM_BCAST_MACRO(kao_mco)
+ DM_BCAST_MACRO(kbo_mo3)
+ DM_BCAST_MACRO(selfrefo)
+ DM_BCAST_MACRO(forrefo)
+
+ end subroutine lw_kgb13
+
+! **************************************************************************
+ subroutine lw_kgb14(rrtmg_unit,dminfo)
+! **************************************************************************
+
+ use rrlw_kg14, only : fracrefao, fracrefbo, kao, kbo, selfrefo, forrefo
+ save
+
+!input arguments:
+ type(dm_info),intent(in):: dminfo
+ integer,intent(in) :: rrtmg_unit
+
+!local variables:
+ character(len=80):: errmess
+ integer:: istat
+
+! Arrays fracrefao and fracrefbo are the Planck fractions for the lower
+! and upper atmosphere.
+! Planck fraction mapping levels:
+! Lower: P = 142.5940 mb, T = 215.70 K
+! Upper: P = 4.758820 mb, T = 250.85 K
+
+! The array KAO contains absorption coefs for each of the 16 g-intervals
+! for a range of pressure levels > ~100mb, temperatures, and ratios
+! of water vapor to CO2. The first index in the array, JS, runs
+! from 1 to 10, and corresponds to different gas column amount ratios,
+! as expressed through the binary species parameter eta, defined as
+! eta = gas1/(gas1 + (rat) * gas2), where rat is the
+! ratio of the reference MLS column amount value of gas 1
+! to that of gas2.
+! The 2nd index in the array, JT, which runs from 1 to 5, corresponds
+! to different temperatures. More specifically, JT = 3 means that the
+! data are for the reference temperature TREF for this pressure
+! level, JT = 2 refers to the temperature
+! TREF-15, JT = 1 is for TREF-30, JT = 4 is for TREF+15, and JT = 5
+! is for TREF+30. The third index, JP, runs from 1 to 13 and refers
+! to the reference pressure level (e.g. JP = 1 is for a
+! pressure of 1053.63 mb). The fourth index, IG, goes from 1 to 16,
+! and tells us which g-interval the absorption coefficients are for.
+
+! The array KBO contains absorption coefs at the 16 chosen g-values
+! for a range of pressure levels < ~100mb and temperatures. The first
+! index in the array, JT, which runs from 1 to 5, corresponds to
+! different temperatures. More specifically, JT = 3 means that the
+! data are for the reference temperature TREF for this pressure
+! level, JT = 2 refers to the temperature TREF-15, JT = 1 is for
+! TREF-30, JT = 4 is for TREF+15, and JT = 5 is for TREF+30.
+! The second index, JP, runs from 13 to 59 and refers to the JPth
+! reference pressure level (see taumol.f for the value of these
+! pressure levels in mb). The third index, IG, goes from 1 to 16,
+! and tells us which g-interval the absorption coefficients are for.
+
+! The array FORREFO contains the coefficient of the water vapor
+! foreign-continuum (including the energy term). The first
+! index refers to reference temperature (296,260,224,260) and
+! pressure (970,475,219,3 mbar) levels. The second index
+! runs over the g-channel (1 to 16).
+
+! The array SELFREFO contains the coefficient of the water vapor
+! self-continuum (including the energy term). The first index
+! refers to temperature in 7.2 degree increments. For instance,
+! JT = 1 refers to a temperature of 245.6, JT = 2 refers to 252.8,
+! etc. The second index runs over the g-channel (1 to 16).
+
+ if(dminfo % my_proc_id == IO_NODE) read (unit=rrtmg_unit,iostat=istat) &
+ fracrefao, fracrefbo, kao, kbo, selfrefo, forrefo
+
+ if(istat /= 0) then
+ write(errmess,'(A,I4)') 'module_ra_rrtmg_lw: error reading RRTMG_LW_DATA on unit ', &
+ rrtmg_unit
+ call physics_error_fatal(istat,errmess)
+ endif
+
+ DM_BCAST_MACRO(fracrefao)
+ DM_BCAST_MACRO(fracrefbo)
+ DM_BCAST_MACRO(kao)
+ DM_BCAST_MACRO(kbo)
+ DM_BCAST_MACRO(selfrefo)
+ DM_BCAST_MACRO(forrefo)
+
+ end subroutine lw_kgb14
+
+! **************************************************************************
+ subroutine lw_kgb15(rrtmg_unit,dminfo)
+! **************************************************************************
+
+ use rrlw_kg15, only : fracrefao, kao, kao_mn2, selfrefo, forrefo
+ save
+
+!input arguments:
+ type(dm_info),intent(in):: dminfo
+ integer, intent(in) :: rrtmg_unit
+
+!local variables:
+ character(len=80):: errmess
+ integer:: istat
+
+! Arrays fracrefao and fracrefbo are the Planck fractions for the lower
+! and upper atmosphere.
+! Planck fraction mapping levels:
+! Lower: P = 1053. mb, T = 294.2 K
+
+! The array KAO contains absorption coefs for each of the 16 g-intervals
+! for a range of pressure levels > ~100mb, temperatures, and ratios
+! of water vapor to CO2. The first index in the array, JS, runs
+! from 1 to 10, and corresponds to different gas column amount ratios,
+! as expressed through the binary species parameter eta, defined as
+! eta = gas1/(gas1 + (rat) * gas2), where rat is the
+! ratio of the reference MLS column amount value of gas 1
+! to that of gas2.
+! The 2nd index in the array, JT, which runs from 1 to 5, corresponds
+! to different temperatures. More specifically, JT = 3 means that the
+! data are for the reference temperature TREF for this pressure
+! level, JT = 2 refers to the temperature
+! TREF-15, JT = 1 is for TREF-30, JT = 4 is for TREF+15, and JT = 5
+! is for TREF+30. The third index, JP, runs from 1 to 13 and refers
+! to the reference pressure level (e.g. JP = 1 is for a
+! pressure of 1053.63 mb). The fourth index, IG, goes from 1 to 16,
+! and tells us which g-interval the absorption coefficients are for.
+
+! The array KA_Mxx contains the absorption coefficient for
+! a minor species at the 16 chosen g-values for a reference pressure
+! level below 100~ mb. The first index in the array, JS, runs
+! from 1 to 10, and corresponds to different gas column amount ratios,
+! as expressed through the binary species parameter eta, defined as
+! eta = gas1/(gas1 + (rat) * gas2), where rat is the
+! ratio of the reference MLS column amount value of gas 1
+! to that of gas2. The second index refers to temperature
+! in 7.2 degree increments. For instance, JT = 1 refers to a
+! temperature of 188.0, JT = 2 refers to 195.2, etc. The third index
+! runs over the g-channel (1 to 16).
+
+! The array FORREFO contains the coefficient of the water vapor
+! foreign-continuum (including the energy term). The first
+! index refers to reference temperature (296,260,224,260) and
+! pressure (970,475,219,3 mbar) levels. The second index
+! runs over the g-channel (1 to 16).
+
+! The array SELFREFO contains the coefficient of the water vapor
+! self-continuum (including the energy term). The first index
+! refers to temperature in 7.2 degree increments. For instance,
+! JT = 1 refers to a temperature of 245.6, JT = 2 refers to 252.8,
+! etc. The second index runs over the g-channel (1 to 16).
+
+ if(dminfo % my_proc_id == IO_NODE) read (unit=rrtmg_unit,iostat=istat) &
+ fracrefao, kao, kao_mn2, selfrefo, forrefo
+
+ if(istat /= 0) then
+ write(errmess,'(A,I4)') 'module_ra_rrtmg_lw: error reading RRTMG_LW_DATA on unit ', &
+ rrtmg_unit
+ call physics_error_fatal(istat,errmess)
+ endif
+
+ DM_BCAST_MACRO(fracrefao)
+ DM_BCAST_MACRO(kao)
+ DM_BCAST_MACRO(kao_mn2)
+ DM_BCAST_MACRO(selfrefo)
+ DM_BCAST_MACRO(forrefo)
+
+ end subroutine lw_kgb15
+
+! **************************************************************************
+ subroutine lw_kgb16(rrtmg_unit,dminfo)
+! **************************************************************************
+
+ use rrlw_kg16, only : fracrefao, fracrefbo, kao, kbo, selfrefo, forrefo
+ save
+
+!input arguments:
+ type(dm_info),intent(in):: dminfo
+ integer,intent(in) :: rrtmg_unit
+
+!local variables:
+ character(len=80):: errmess
+ integer:: istat
+
+! Arrays fracrefao and fracrefbo are the Planck fractions for the lower
+! and upper atmosphere.
+! Planck fraction mapping levels:
+! Lower: P = 387.6100 mbar, T = 250.17 K
+! Upper: P=95.58350 mb, T = 215.70 K
+
+! The array KAO contains absorption coefs for each of the 16 g-intervals
+! for a range of pressure levels > ~100mb, temperatures, and ratios
+! of water vapor to CO2. The first index in the array, JS, runs
+! from 1 to 10, and corresponds to different gas column amount ratios,
+! as expressed through the binary species parameter eta, defined as
+! eta = gas1/(gas1 + (rat) * gas2), where rat is the
+! ratio of the reference MLS column amount value of gas 1
+! to that of gas2.
+! The 2nd index in the array, JT, which runs from 1 to 5, corresponds
+! to different temperatures. More specifically, JT = 3 means that the
+! data are for the reference temperature TREF for this pressure
+! level, JT = 2 refers to the temperature
+! TREF-15, JT = 1 is for TREF-30, JT = 4 is for TREF+15, and JT = 5
+! is for TREF+30. The third index, JP, runs from 1 to 13 and refers
+! to the reference pressure level (e.g. JP = 1 is for a
+! pressure of 1053.63 mb). The fourth index, IG, goes from 1 to 16,
+! and tells us which g-interval the absorption coefficients are for.
+
+! The array KBO contains absorption coefs at the 16 chosen g-values
+! for a range of pressure levels < ~100mb and temperatures. The first
+! index in the array, JT, which runs from 1 to 5, corresponds to
+! different temperatures. More specifically, JT = 3 means that the
+! data are for the reference temperature TREF for this pressure
+! level, JT = 2 refers to the temperature TREF-15, JT = 1 is for
+! TREF-30, JT = 4 is for TREF+15, and JT = 5 is for TREF+30.
+! The second index, JP, runs from 13 to 59 and refers to the JPth
+! reference pressure level (see taumol.f for the value of these
+! pressure levels in mb). The third index, IG, goes from 1 to 16,
+! and tells us which g-interval the absorption coefficients are for.
+
+! The array FORREFO contains the coefficient of the water vapor
+! foreign-continuum (including the energy term). The first
+! index refers to reference temperature (296,260,224,260) and
+! pressure (970,475,219,3 mbar) levels. The second index
+! runs over the g-channel (1 to 16).
+
+! The array SELFREFO contains the coefficient of the water vapor
+! self-continuum (including the energy term). The first index
+! refers to temperature in 7.2 degree increments. For instance,
+! JT = 1 refers to a temperature of 245.6, JT = 2 refers to 252.8,
+! etc. The second index runs over the g-channel (1 to 16).
+
+ if(dminfo % my_proc_id == IO_NODE) read (unit=rrtmg_unit,iostat=istat) &
+ fracrefao, fracrefbo, kao, kbo, selfrefo, forrefo
+
+ if(istat /= 0) then
+ write(errmess,'(A,I4)') 'module_ra_rrtmg_lw: error reading RRTMG_LW_DATA on unit ', &
+ rrtmg_unit
+ call physics_error_fatal(istat,errmess)
+ endif
+
+ DM_BCAST_MACRO(fracrefao)
+ DM_BCAST_MACRO(fracrefbo)
+ DM_BCAST_MACRO(kao)
+ DM_BCAST_MACRO(kbo)
+ DM_BCAST_MACRO(selfrefo)
+ DM_BCAST_MACRO(forrefo)
+
+ end subroutine lw_kgb16
+
+!=============================================================================================
+ end module module_physics_rrtmg_lwinit
+!=============================================================================================
Added: branches/atmos_physics/src/core_physics/module_physics_rrtmg_swinit.F
===================================================================
--- branches/atmos_physics/src/core_physics/module_physics_rrtmg_swinit.F         (rev 0)
+++ branches/atmos_physics/src/core_physics/module_physics_rrtmg_swinit.F        2010-12-21 22:38:55 UTC (rev 650)
@@ -0,0 +1,1185 @@
+#define DM_BCAST_INTEGER(A) call dmpar_bcast_int(dminfo,A)
+#define DM_BCAST_MACRO(A) call dmpar_bcast_reals(dminfo,size(A),A)
+#define DM_BCAST_REAL(A) call dmpar_bcast_real(dminfo,A)
+
+!=============================================================================================
+ module module_physics_rrtmg_swinit
+ use dmpar
+ use grid_types
+ use module_physics_constants
+ use module_physics_error
+
+!wrf physics
+ use module_ra_rrtmg_sw
+
+ implicit none
+ private
+ public:: rrtmg_swinit_forMPAS
+
+ contains
+
+!=============================================================================================
+ subroutine rrtmg_swinit_forMPAS(dminfo)
+!=============================================================================================
+!input arguments:
+ type(dm_info):: dminfo
+
+!---------------------------------------------------------------------------------------------
+
+!read in absorption coefficients and other data:
+ call rrtmg_swlookuptable(dminfo)
+
+!Perform g-point reduction and other initializations: specific heat of dry air (cp) used in
+!flux to heating rate conversion factor.
+ call rrtmg_sw_ini(cp)
+
+ end subroutine rrtmg_swinit_forMPAS
+
+!=============================================================================================
+ subroutine rrtmg_swlookuptable(dminfo)
+!=============================================================================================
+
+!input arguments:
+ type(dm_info),intent(in):: dminfo
+
+!local variables:
+ integer:: i,istat,rrtmg_unit
+ logical:: opened
+ character(len=80):: errmess
+!---------------------------------------------------------------------------------------------
+
+!get a unit to open init file:
+ if(dminfo % my_proc_id == IO_NODE) then
+ do i = 10,99
+ inquire(i,opened = opened,iostat=istat)
+ if(.not. opened) then
+ rrtmg_unit = i
+ exit
+ endif
+ enddo
+ if(istat /= 0) &
+ call physics_error_fatal(istat,'module_ra_rrtmg_sw: rrtm_swlookuptable: Can not '// &
+ 'find unused fortran unit to read in lookup table.' )
+ endif
+
+!distribute unit to other processors:
+ call dmpar_bcast_int(dminfo,rrtmg_unit)
+
+!open init file:
+ if(dminfo % my_proc_id == IO_NODE) then
+ open(rrtmg_unit,file='RRTMG_SW_DATA_DBL',form='UNFORMATTED',iostat=istat)
+
+ if(istat /= 0) then
+ write(errmess,'(A,I4)') 'module_ra_rrtmg_sw: error reading RRTMG_SW_DATA on unit ', &
+ rrtmg_unit
+ call physics_error_fatal(istat,errmess)
+ endif
+ endif
+
+ call sw_kgb16(rrtmg_unit,dminfo)
+ call sw_kgb17(rrtmg_unit,dminfo)
+ call sw_kgb18(rrtmg_unit,dminfo)
+ call sw_kgb19(rrtmg_unit,dminfo)
+ call sw_kgb20(rrtmg_unit,dminfo)
+ call sw_kgb21(rrtmg_unit,dminfo)
+ call sw_kgb22(rrtmg_unit,dminfo)
+ call sw_kgb23(rrtmg_unit,dminfo)
+ call sw_kgb24(rrtmg_unit,dminfo)
+ call sw_kgb25(rrtmg_unit,dminfo)
+ call sw_kgb26(rrtmg_unit,dminfo)
+ call sw_kgb27(rrtmg_unit,dminfo)
+ call sw_kgb28(rrtmg_unit,dminfo)
+ call sw_kgb29(rrtmg_unit,dminfo)
+
+ if(dminfo % my_proc_id == IO_NODE) close(rrtmg_unit)
+
+ end subroutine rrtmg_swlookuptable
+
+!=============================================================================================
+
+! **************************************************************************
+! RRTMG Shortwave Radiative Transfer Model
+! Atmospheric and Environmental Research, Inc., Cambridge, MA
+!
+! Original by J.Delamere, Atmospheric & Environmental Research.
+! Reformatted for F90: JJMorcrette, ECMWF
+! Revision for GCMs: Michael J. Iacono, AER, July 2002
+! Further F90 reformatting: Michael J. Iacono, AER, June 2006
+!
+! This file contains 14 READ statements that include the
+! absorption coefficients and other data for each of the 14 shortwave
+! spectral bands used in RRTMG_SW. Here, the data are defined for 16
+! g-points, or sub-intervals, per band. These data are combined and
+! weighted using a mapping procedure in module RRTMG_SW_INIT to reduce
+! the total number of g-points from 224 to 112 for use in the GCM.
+! **************************************************************************
+
+! **************************************************************************
+ subroutine sw_kgb16(rrtmg_unit,dminfo)
+! **************************************************************************
+
+ use rrsw_kg16, only : kao, kbo, selfrefo, forrefo, sfluxrefo, &
+ rayl, strrat1, layreffr
+ save
+
+!input arguments:
+ type(dm_info),intent(in):: dminfo
+ integer,intent(in):: rrtmg_unit
+
+!local variables:
+ character(len=80):: errmess
+ integer:: istat
+
+! Array sfluxrefo contains the Kurucz solar source function for this band.
+
+! Array rayl contains the Rayleigh extinction coefficient at v = 2925 cm-1.
+
+! The array KAO contains absorption coefs at the 16 chosen g-values
+! for a range of pressure levels> ~100mb, temperatures, and binary
+! species parameters (see taumol.f for definition). The first
+! index in the array, JS, runs from 1 to 9, and corresponds to
+! different values of the binary species parameter. For instance,
+! JS=1 refers to dry air, JS = 2 corresponds to the paramter value 1/8,
+! JS = 3 corresponds to the parameter value 2/8, etc. The second index
+! in the array, JT, which runs from 1 to 5, corresponds to different
+! temperatures. More specifically, JT = 3 means that the data are for
+! the reference temperature TREF for this pressure level, JT = 2 refers
+! to TREF-15, JT = 1 is for TREF-30, JT = 4 is for TREF+15, and JT = 5
+! is for TREF+30. The third index, JP, runs from 1 to 13 and refers
+! to the JPth reference pressure level (see taumol.f for these levels
+! in mb). The fourth index, IG, goes from 1 to 16, and indicates
+! which g-interval the absorption coefficients are for.
+
+! The array KBO contains absorption coefs at the 16 chosen g-values
+! for a range of pressure levels < ~100mb and temperatures. The first
+! index in the array, JT, which runs from 1 to 5, corresponds to
+! different temperatures. More specifically, JT = 3 means that the
+! data are for the reference temperature TREF for this pressure
+! level, JT = 2 refers to the temperature TREF-15, JT = 1 is for
+! TREF-30, JT = 4 is for TREF+15, and JT = 5 is for TREF+30.
+! The second index, JP, runs from 13 to 59 and refers to the JPth
+! reference pressure level (see taumol.f for the value of these
+! pressure levels in mb). The third index, IG, goes from 1 to 16,
+! and tells us which g-interval the absorption coefficients are for.
+
+! The array FORREFO contains the coefficient of the water vapor
+! foreign-continuum (including the energy term). The first
+! index refers to reference temperature (296,260,224,260) and
+! pressure (970,475,219,3 mbar) levels. The second index
+! runs over the g-channel (1 to 16).
+
+! The array SELFREFO contains the coefficient of the water vapor
+! self-continuum (including the energy term). The first index
+! refers to temperature in 7.2 degree increments. For instance,
+! JT = 1 refers to a temperature of 245.6, JT = 2 refers to 252.8,
+! etc. The second index runs over the g-channel (1 to 16).
+
+ write(0,*)
+ write(0,*) '--- enter subroutine sw_kgb16:'
+ write(0,*) '--- rrtmg_unit= ', rrtmg_unit
+ if(dminfo % my_proc_id == IO_NODE) read (unit=rrtmg_unit,iostat=istat) &
+ rayl, strrat1, layreffr, kao, kbo, selfrefo, forrefo, sfluxrefo
+
+ if(istat /= 0) then
+ write(0,*)
+ write(errmess,'(A,I4)') 'module_ra_rrtmg_sw: error reading RRTMG_SW_DATA on unit ', &
+ rrtmg_unit
+ call physics_error_fatal(istat,errmess)
+ endif
+
+ DM_BCAST_REAL(rayl)
+ DM_BCAST_REAL(strrat1)
+ DM_BCAST_INTEGER(layreffr)
+ DM_BCAST_MACRO(kao)
+ DM_BCAST_MACRO(kbo)
+ DM_BCAST_MACRO(selfrefo)
+ DM_BCAST_MACRO(forrefo)
+ DM_BCAST_MACRO(sfluxrefo)
+
+ write(0,*) rayl
+ write(0,*)
+ write(0,*) strrat1
+ write(0,*)
+ write(0,*) layreffr
+ write(0,*)
+ write(0,*) sfluxrefo
+ write(0,*) '--- end sw_kgb16:'
+
+ end subroutine sw_kgb16
+
+! **************************************************************************
+ subroutine sw_kgb17(rrtmg_unit,dminfo)
+! **************************************************************************
+
+ use rrsw_kg17, only : kao, kbo, selfrefo, forrefo, sfluxrefo, &
+ rayl, strrat, layreffr
+ save
+
+!input arguments:
+ type(dm_info),intent(in):: dminfo
+ integer,intent(in):: rrtmg_unit
+
+!local variables:
+ character(len=80):: errmess
+ integer:: istat
+
+! Array sfluxrefo contains the Kurucz solar source function for this band.
+
+! Array rayl contains the Rayleigh extinction coefficient at v = 3625 cm-1.
+
+! The array KAO contains absorption coefs at the 16 chosen g-values
+! for a range of pressure levels> ~100mb, temperatures, and binary
+! species parameters (see taumol.f for definition). The first
+! index in the array, JS, runs from 1 to 9, and corresponds to
+! different values of the binary species parameter. For instance,
+! JS=1 refers to dry air, JS = 2 corresponds to the paramter value 1/8,
+! JS = 3 corresponds to the parameter value 2/8, etc. The second index
+! in the array, JT, which runs from 1 to 5, corresponds to different
+! temperatures. More specifically, JT = 3 means that the data are for
+! the reference temperature TREF for this pressure level, JT = 2 refers
+! to TREF-15, JT = 1 is for TREF-30, JT = 4 is for TREF+15, and JT = 5
+! is for TREF+30. The third index, JP, runs from 1 to 13 and refers
+! to the JPth reference pressure level (see taumol.f for these levels
+! in mb). The fourth index, IG, goes from 1 to 16, and indicates
+! which g-interval the absorption coefficients are for.
+
+! The array KBO contains absorption coefs at the 16 chosen g-values
+! for a range of pressure levels < ~100mb and temperatures. The first
+! index in the array, JT, which runs from 1 to 5, corresponds to
+! different temperatures. More specifically, JT = 3 means that the
+! data are for the reference temperature TREF for this pressure
+! level, JT = 2 refers to the temperature TREF-15, JT = 1 is for
+! TREF-30, JT = 4 is for TREF+15, and JT = 5 is for TREF+30.
+! The second index, JP, runs from 13 to 59 and refers to the JPth
+! reference pressure level (see taumol.f for the value of these
+! pressure levels in mb). The third index, IG, goes from 1 to 16,
+! and tells us which g-interval the absorption coefficients are for.
+
+! The array FORREFO contains the coefficient of the water vapor
+! foreign-continuum (including the energy term). The first
+! index refers to reference temperature (296,260,224,260) and
+! pressure (970,475,219,3 mbar) levels. The second index
+! runs over the g-channel (1 to 16).
+
+! The array SELFREFO contains the coefficient of the water vapor
+! self-continuum (including the energy term). The first index
+! refers to temperature in 7.2 degree increments. For instance,
+! JT = 1 refers to a temperature of 245.6, JT = 2 refers to 252.8,
+! etc. The second index runs over the g-channel (1 to 16).
+
+ if(dminfo % my_proc_id == IO_NODE) read (unit=rrtmg_unit,iostat=istat) &
+ rayl, strrat, layreffr, kao, kbo, selfrefo, forrefo, sfluxrefo
+
+
+ if(istat /= 0) then
+ write(0,*)
+ write(errmess,'(A,I4)') 'module_ra_rrtmg_sw: error reading RRTMG_SW_DATA on unit ', &
+ rrtmg_unit
+ call physics_error_fatal(istat,errmess)
+ endif
+
+ DM_BCAST_REAL(rayl)
+ DM_BCAST_REAL(strrat)
+ DM_BCAST_INTEGER(layreffr)
+ DM_BCAST_MACRO(kao)
+ DM_BCAST_MACRO(kbo)
+ DM_BCAST_MACRO(selfrefo)
+ DM_BCAST_MACRO(forrefo)
+ DM_BCAST_MACRO(sfluxrefo)
+
+ end subroutine sw_kgb17
+
+! **************************************************************************
+ subroutine sw_kgb18(rrtmg_unit,dminfo)
+! **************************************************************************
+
+ use rrsw_kg18, only : kao, kbo, selfrefo, forrefo, sfluxrefo, &
+ rayl, strrat, layreffr
+ save
+
+!input arguments:
+ type(dm_info),intent(in):: dminfo
+ integer,intent(in):: rrtmg_unit
+
+!local variables:
+ character(len=80):: errmess
+ integer:: istat
+
+! Array sfluxrefo contains the Kurucz solar source function for this band.
+
+! Array rayl contains the Rayleigh extinction coefficient at v = 4325 cm-1.
+
+! The array KAO contains absorption coefs at the 16 chosen g-values
+! for a range of pressure levels> ~100mb, temperatures, and binary
+! species parameters (see taumol.f for definition). The first
+! index in the array, JS, runs from 1 to 9, and corresponds to
+! different values of the binary species parameter. For instance,
+! JS=1 refers to dry air, JS = 2 corresponds to the paramter value 1/8,
+! JS = 3 corresponds to the parameter value 2/8, etc. The second index
+! in the array, JT, which runs from 1 to 5, corresponds to different
+! temperatures. More specifically, JT = 3 means that the data are for
+! the reference temperature TREF for this pressure level, JT = 2 refers
+! to TREF-15, JT = 1 is for TREF-30, JT = 4 is for TREF+15, and JT = 5
+! is for TREF+30. The third index, JP, runs from 1 to 13 and refers
+! to the JPth reference pressure level (see taumol.f for these levels
+! in mb). The fourth index, IG, goes from 1 to 16, and indicates
+! which g-interval the absorption coefficients are for.
+
+! The array KBO contains absorption coefs at the 16 chosen g-values
+! for a range of pressure levels < ~100mb and temperatures. The first
+! index in the array, JT, which runs from 1 to 5, corresponds to
+! different temperatures. More specifically, JT = 3 means that the
+! data are for the reference temperature TREF for this pressure
+! level, JT = 2 refers to the temperature TREF-15, JT = 1 is for
+! TREF-30, JT = 4 is for TREF+15, and JT = 5 is for TREF+30.
+! The second index, JP, runs from 13 to 59 and refers to the JPth
+! reference pressure level (see taumol.f for the value of these
+! pressure levels in mb). The third index, IG, goes from 1 to 16,
+! and tells us which g-interval the absorption coefficients are for.
+
+! The array FORREFO contains the coefficient of the water vapor
+! foreign-continuum (including the energy term). The first
+! index refers to reference temperature (296,260,224,260) and
+! pressure (970,475,219,3 mbar) levels. The second index
+! runs over the g-channel (1 to 16).
+
+! The array SELFREFO contains the coefficient of the water vapor
+! self-continuum (including the energy term). The first index
+! refers to temperature in 7.2 degree increments. For instance,
+! JT = 1 refers to a temperature of 245.6, JT = 2 refers to 252.8,
+! etc. The second index runs over the g-channel (1 to 16).
+
+ if(dminfo % my_proc_id == IO_NODE) read (unit=rrtmg_unit,iostat=istat) &
+ rayl, strrat, layreffr, kao, kbo, selfrefo, forrefo, sfluxrefo
+
+ if(istat /= 0) then
+ write(0,*)
+ write(errmess,'(A,I4)') 'module_ra_rrtmg_sw: error reading RRTMG_SW_DATA on unit ', &
+ rrtmg_unit
+ call physics_error_fatal(istat,errmess)
+ endif
+
+ DM_BCAST_REAL(rayl)
+ DM_BCAST_REAL(strrat)
+ DM_BCAST_INTEGER(layreffr)
+ DM_BCAST_MACRO(kao)
+ DM_BCAST_MACRO(kbo)
+ DM_BCAST_MACRO(selfrefo)
+ DM_BCAST_MACRO(forrefo)
+ DM_BCAST_MACRO(sfluxrefo)
+
+ end subroutine sw_kgb18
+
+! **************************************************************************
+ subroutine sw_kgb19(rrtmg_unit,dminfo)
+! **************************************************************************
+
+ use rrsw_kg19, only : kao, kbo, selfrefo, forrefo, sfluxrefo, &
+ rayl, strrat, layreffr
+ save
+
+!input arguments:
+ type(dm_info),intent(in):: dminfo
+ integer,intent(in):: rrtmg_unit
+
+!local variables:
+ character(len=80):: errmess
+ integer:: istat
+
+! Array sfluxrefo contains the Kurucz solar source function for this band.
+
+! Array rayl contains the Rayleigh extinction coefficient at v = 4900 cm-1.
+
+! The array KAO contains absorption coefs at the 16 chosen g-values
+! for a range of pressure levels> ~100mb, temperatures, and binary
+! species parameters (see taumol.f for definition). The first
+! index in the array, JS, runs from 1 to 9, and corresponds to
+! different values of the binary species parameter. For instance,
+! JS=1 refers to dry air, JS = 2 corresponds to the paramter value 1/8,
+! JS = 3 corresponds to the parameter value 2/8, etc. The second index
+! in the array, JT, which runs from 1 to 5, corresponds to different
+! temperatures. More specifically, JT = 3 means that the data are for
+! the reference temperature TREF for this pressure level, JT = 2 refers
+! to TREF-15, JT = 1 is for TREF-30, JT = 4 is for TREF+15, and JT = 5
+! is for TREF+30. The third index, JP, runs from 1 to 13 and refers
+! to the JPth reference pressure level (see taumol.f for these levels
+! in mb). The fourth index, IG, goes from 1 to 16, and indicates
+! which g-interval the absorption coefficients are for.
+
+! The array KBO contains absorption coefs at the 16 chosen g-values
+! for a range of pressure levels < ~100mb and temperatures. The first
+! index in the array, JT, which runs from 1 to 5, corresponds to
+! different temperatures. More specifically, JT = 3 means that the
+! data are for the reference temperature TREF for this pressure
+! level, JT = 2 refers to the temperature TREF-15, JT = 1 is for
+! TREF-30, JT = 4 is for TREF+15, and JT = 5 is for TREF+30.
+! The second index, JP, runs from 13 to 59 and refers to the JPth
+! reference pressure level (see taumol.f for the value of these
+! pressure levels in mb). The third index, IG, goes from 1 to 16,
+! and tells us which g-interval the absorption coefficients are for.
+
+! The array FORREFO contains the coefficient of the water vapor
+! foreign-continuum (including the energy term). The first
+! index refers to reference temperature (296,260,224,260) and
+! pressure (970,475,219,3 mbar) levels. The second index
+! runs over the g-channel (1 to 16).
+
+! The array SELFREFO contains the coefficient of the water vapor
+! self-continuum (including the energy term). The first index
+! refers to temperature in 7.2 degree increments. For instance,
+! JT = 1 refers to a temperature of 245.6, JT = 2 refers to 252.8,
+! etc. The second index runs over the g-channel (1 to 16).
+
+ if(dminfo % my_proc_id == IO_NODE) read (unit=rrtmg_unit,iostat=istat) &
+ rayl, strrat, layreffr, kao, kbo, selfrefo, forrefo, sfluxrefo
+
+ if(istat /= 0) then
+ write(0,*)
+ write(errmess,'(A,I4)') 'module_ra_rrtmg_sw: error reading RRTMG_SW_DATA on unit ', &
+ rrtmg_unit
+ call physics_error_fatal(istat,errmess)
+ endif
+
+ DM_BCAST_REAL(rayl)
+ DM_BCAST_REAL(strrat)
+ DM_BCAST_INTEGER(layreffr)
+ DM_BCAST_MACRO(kao)
+ DM_BCAST_MACRO(kbo)
+ DM_BCAST_MACRO(selfrefo)
+ DM_BCAST_MACRO(forrefo)
+ DM_BCAST_MACRO(sfluxrefo)
+
+ end subroutine sw_kgb19
+
+! **************************************************************************
+ subroutine sw_kgb20(rrtmg_unit,dminfo)
+! **************************************************************************
+
+ use rrsw_kg20, only : kao, kbo, selfrefo, forrefo, sfluxrefo, &
+ absch4o, rayl, layreffr
+ save
+
+!input arguments:
+ type(dm_info),intent(in):: dminfo
+ integer,intent(in):: rrtmg_unit
+
+!local variables:
+ character(len=80):: errmess
+ integer:: istat
+
+! Array sfluxrefo contains the Kurucz solar source function for this band.
+
+! Array rayl contains the Rayleigh extinction coefficient at v = 5670 cm-1.
+
+! Array absch4o contains the absorption coefficients for methane.
+
+! The array KAO contains absorption coefs at the 16 chosen g-values
+! for a range of pressure levels> ~100mb, temperatures, and binary
+! species parameters (see taumol.f for definition). The first
+! index in the array, JS, runs from 1 to 9, and corresponds to
+! different values of the binary species parameter. For instance,
+! JS=1 refers to dry air, JS = 2 corresponds to the paramter value 1/8,
+! JS = 3 corresponds to the parameter value 2/8, etc. The second index
+! in the array, JT, which runs from 1 to 5, corresponds to different
+! temperatures. More specifically, JT = 3 means that the data are for
+! the reference temperature TREF for this pressure level, JT = 2 refers
+! to TREF-15, JT = 1 is for TREF-30, JT = 4 is for TREF+15, and JT = 5
+! is for TREF+30. The third index, JP, runs from 1 to 13 and refers
+! to the JPth reference pressure level (see taumol.f for these levels
+! in mb). The fourth index, IG, goes from 1 to 16, and indicates
+! which g-interval the absorption coefficients are for.
+
+! The array KBO contains absorption coefs at the 16 chosen g-values
+! for a range of pressure levels < ~100mb and temperatures. The first
+! index in the array, JT, which runs from 1 to 5, corresponds to
+! different temperatures. More specifically, JT = 3 means that the
+! data are for the reference temperature TREF for this pressure
+! level, JT = 2 refers to the temperature TREF-15, JT = 1 is for
+! TREF-30, JT = 4 is for TREF+15, and JT = 5 is for TREF+30.
+! The second index, JP, runs from 13 to 59 and refers to the JPth
+! reference pressure level (see taumol.f for the value of these
+! pressure levels in mb). The third index, IG, goes from 1 to 16,
+! and tells us which g-interval the absorption coefficients are for.
+
+! The array FORREFO contains the coefficient of the water vapor
+! foreign-continuum (including the energy term). The first
+! index refers to reference temperature (296,260,224,260) and
+! pressure (970,475,219,3 mbar) levels. The second index
+! runs over the g-channel (1 to 16).
+
+! The array SELFREFO contains the coefficient of the water vapor
+! self-continuum (including the energy term). The first index
+! refers to temperature in 7.2 degree increments. For instance,
+! JT = 1 refers to a temperature of 245.6, JT = 2 refers to 252.8,
+! etc. The second index runs over the g-channel (1 to 16).
+
+ if(dminfo % my_proc_id == IO_NODE) read (unit=rrtmg_unit,iostat=istat) &
+ rayl, layreffr, absch4o, kao, kbo, selfrefo, forrefo, sfluxrefo
+
+ if(istat /= 0) then
+ write(0,*)
+ write(errmess,'(A,I4)') 'module_ra_rrtmg_sw: error reading RRTMG_SW_DATA on unit ', &
+ rrtmg_unit
+ call physics_error_fatal(istat,errmess)
+ endif
+
+ DM_BCAST_REAL(rayl)
+ DM_BCAST_INTEGER(layreffr)
+ DM_BCAST_MACRO(absch4o)
+ DM_BCAST_MACRO(kao)
+ DM_BCAST_MACRO(kbo)
+ DM_BCAST_MACRO(selfrefo)
+ DM_BCAST_MACRO(forrefo)
+ DM_BCAST_MACRO(sfluxrefo)
+
+ end subroutine sw_kgb20
+
+! **************************************************************************
+ subroutine sw_kgb21(rrtmg_unit,dminfo)
+! **************************************************************************
+
+ use rrsw_kg21, only : kao, kbo, selfrefo, forrefo, sfluxrefo, &
+ rayl, strrat, layreffr
+ save
+
+!input arguments:
+ type(dm_info),intent(in):: dminfo
+ integer,intent(in):: rrtmg_unit
+
+!local variables:
+ character(len=80):: errmess
+ integer:: istat
+
+! Array sfluxrefo contains the Kurucz solar source function for this band.
+
+! Array rayl contains the Rayleigh extinction coefficient at v = 6925 cm-1.
+
+! The array KAO contains absorption coefs at the 16 chosen g-values
+! for a range of pressure levels> ~100mb, temperatures, and binary
+! species parameters (see taumol.f for definition). The first
+! index in the array, JS, runs from 1 to 9, and corresponds to
+! different values of the binary species parameter. For instance,
+! JS=1 refers to dry air, JS = 2 corresponds to the paramter value 1/8,
+! JS = 3 corresponds to the parameter value 2/8, etc. The second index
+! in the array, JT, which runs from 1 to 5, corresponds to different
+! temperatures. More specifically, JT = 3 means that the data are for
+! the reference temperature TREF for this pressure level, JT = 2 refers
+! to TREF-15, JT = 1 is for TREF-30, JT = 4 is for TREF+15, and JT = 5
+! is for TREF+30. The third index, JP, runs from 1 to 13 and refers
+! to the JPth reference pressure level (see taumol.f for these levels
+! in mb). The fourth index, IG, goes from 1 to 16, and indicates
+! which g-interval the absorption coefficients are for.
+
+! The array KBO contains absorption coefs at the 16 chosen g-values
+! for a range of pressure levels < ~100mb and temperatures. The first
+! index in the array, JT, which runs from 1 to 5, corresponds to
+! different temperatures. More specifically, JT = 3 means that the
+! data are for the reference temperature TREF for this pressure
+! level, JT = 2 refers to the temperature TREF-15, JT = 1 is for
+! TREF-30, JT = 4 is for TREF+15, and JT = 5 is for TREF+30.
+! The second index, JP, runs from 13 to 59 and refers to the JPth
+! reference pressure level (see taumol.f for the value of these
+! pressure levels in mb). The third index, IG, goes from 1 to 16,
+! and tells us which g-interval the absorption coefficients are for.
+
+! The array FORREFO contains the coefficient of the water vapor
+! foreign-continuum (including the energy term). The first
+! index refers to reference temperature (296,260,224,260) and
+! pressure (970,475,219,3 mbar) levels. The second index
+! runs over the g-channel (1 to 16).
+
+! The array SELFREFO contains the coefficient of the water vapor
+! self-continuum (including the energy term). The first index
+! refers to temperature in 7.2 degree increments. For instance,
+! JT = 1 refers to a temperature of 245.6, JT = 2 refers to 252.8,
+! etc. The second index runs over the g-channel (1 to 16).
+
+ if(dminfo % my_proc_id == IO_NODE) read (unit=rrtmg_unit,iostat=istat) &
+ rayl, strrat, layreffr, kao, kbo, selfrefo, forrefo, sfluxrefo
+
+ if(istat /= 0) then
+ write(0,*)
+ write(errmess,'(A,I4)') 'module_ra_rrtmg_sw: error reading RRTMG_SW_DATA on unit ', &
+ rrtmg_unit
+ call physics_error_fatal(istat,errmess)
+ endif
+
+ DM_BCAST_REAL(rayl)
+ DM_BCAST_REAL(strrat)
+ DM_BCAST_INTEGER(layreffr)
+ DM_BCAST_MACRO(kao)
+ DM_BCAST_MACRO(kbo)
+ DM_BCAST_MACRO(selfrefo)
+ DM_BCAST_MACRO(forrefo)
+ DM_BCAST_MACRO(sfluxrefo)
+
+ end subroutine sw_kgb21
+
+! **************************************************************************
+ subroutine sw_kgb22(rrtmg_unit,dminfo)
+! **************************************************************************
+
+ use rrsw_kg22, only : kao, kbo, selfrefo, forrefo, sfluxrefo, &
+ rayl, strrat, layreffr
+ save
+
+!input arguments:
+ type(dm_info),intent(in):: dminfo
+ integer,intent(in):: rrtmg_unit
+
+!local variables:
+ character(len=80):: errmess
+ integer:: istat
+
+! Array sfluxrefo contains the Kurucz solar source function for this band.
+
+! Array rayl contains the Rayleigh extinction coefficient at v = 8000 cm-1.
+
+! The array KAO contains absorption coefs at the 16 chosen g-values
+! for a range of pressure levels> ~100mb, temperatures, and binary
+! species parameters (see taumol.f for definition). The first
+! index in the array, JS, runs from 1 to 9, and corresponds to
+! different values of the binary species parameter. For instance,
+! JS=1 refers to dry air, JS = 2 corresponds to the paramter value 1/8,
+! JS = 3 corresponds to the parameter value 2/8, etc. The second index
+! in the array, JT, which runs from 1 to 5, corresponds to different
+! temperatures. More specifically, JT = 3 means that the data are for
+! the reference temperature TREF for this pressure level, JT = 2 refers
+! to TREF-15, JT = 1 is for TREF-30, JT = 4 is for TREF+15, and JT = 5
+! is for TREF+30. The third index, JP, runs from 1 to 13 and refers
+! to the JPth reference pressure level (see taumol.f for these levels
+! in mb). The fourth index, IG, goes from 1 to 16, and indicates
+! which g-interval the absorption coefficients are for.
+
+! The array KBO contains absorption coefs at the 16 chosen g-values
+! for a range of pressure levels < ~100mb and temperatures. The first
+! index in the array, JT, which runs from 1 to 5, corresponds to
+! different temperatures. More specifically, JT = 3 means that the
+! data are for the reference temperature TREF for this pressure
+! level, JT = 2 refers to the temperature TREF-15, JT = 1 is for
+! TREF-30, JT = 4 is for TREF+15, and JT = 5 is for TREF+30.
+! The second index, JP, runs from 13 to 59 and refers to the JPth
+! reference pressure level (see taumol.f for the value of these
+! pressure levels in mb). The third index, IG, goes from 1 to 16,
+! and tells us which g-interval the absorption coefficients are for.
+
+! The array FORREFO contains the coefficient of the water vapor
+! foreign-continuum (including the energy term). The first
+! index refers to reference temperature (296_rb,260_rb,224,260) and
+! pressure (970,475,219,3 mbar) levels. The second index
+! runs over the g-channel (1 to 16).
+
+! The array SELFREFO contains the coefficient of the water vapor
+! self-continuum (including the energy term). The first index
+! refers to temperature in 7.2 degree increments. For instance,
+! JT = 1 refers to a temperature of 245.6, JT = 2 refers to 252.8,
+! etc. The second index runs over the g-channel (1 to 16).
+
+ if(dminfo % my_proc_id == IO_NODE) read (unit=rrtmg_unit,iostat=istat) &
+ rayl, strrat, layreffr, kao, kbo, selfrefo, forrefo, sfluxrefo
+
+ if(istat /= 0) then
+ write(0,*)
+ write(errmess,'(A,I4)') 'module_ra_rrtmg_sw: error reading RRTMG_SW_DATA on unit ', &
+ rrtmg_unit
+ call physics_error_fatal(istat,errmess)
+ endif
+
+ DM_BCAST_REAL(rayl)
+ DM_BCAST_REAL(strrat)
+ DM_BCAST_INTEGER(layreffr)
+ DM_BCAST_MACRO(kao)
+ DM_BCAST_MACRO(kbo)
+ DM_BCAST_MACRO(selfrefo)
+ DM_BCAST_MACRO(forrefo)
+ DM_BCAST_MACRO(sfluxrefo)
+
+ end subroutine sw_kgb22
+
+! **************************************************************************
+ subroutine sw_kgb23(rrtmg_unit,dminfo)
+! **************************************************************************
+
+ use rrsw_kg23, only : kao, selfrefo, forrefo, sfluxrefo, &
+ raylo, givfac, layreffr
+ save
+
+!input arguments:
+ type(dm_info),intent(in):: dminfo
+ integer,intent(in):: rrtmg_unit
+
+!local variables:
+ character(len=80):: errmess
+ integer:: istat
+
+! Array sfluxrefo contains the Kurucz solar source function for this band.
+
+! Array raylo contains the Rayleigh extinction coefficient at all v for this band
+
+! Array givfac is the average Giver et al. correction factor for this band.
+
+! The array KAO contains absorption coefs at the 16 chosen g-values
+! for a range of pressure levels> ~100mb, temperatures, and binary
+! species parameters (see taumol.f for definition). The first
+! index in the array, JS, runs from 1 to 9, and corresponds to
+! different values of the binary species parameter. For instance,
+! JS=1 refers to dry air, JS = 2 corresponds to the paramter value 1/8,
+! JS = 3 corresponds to the parameter value 2/8, etc. The second index
+! in the array, JT, which runs from 1 to 5, corresponds to different
+! temperatures. More specifically, JT = 3 means that the data are for
+! the reference temperature TREF for this pressure level, JT = 2 refers
+! to TREF-15, JT = 1 is for TREF-30, JT = 4 is for TREF+15, and JT = 5
+! is for TREF+30. The third index, JP, runs from 1 to 13 and refers
+! to the JPth reference pressure level (see taumol.f for these levels
+! in mb). The fourth index, IG, goes from 1 to 16, and indicates
+! which g-interval the absorption coefficients are for.
+
+! The array FORREFO contains the coefficient of the water vapor
+! foreign-continuum (including the energy term). The first
+! index refers to reference temperature (296,260,224,260) and
+! pressure (970,475,219,3 mbar) levels. The second index
+! runs over the g-channel (1 to 16).
+
+! The array SELFREFO contains the coefficient of the water vapor
+! self-continuum (including the energy term). The first index
+! refers to temperature in 7.2 degree increments. For instance,
+! JT = 1 refers to a temperature of 245.6, JT = 2 refers to 252.8,
+! etc. The second index runs over the g-channel (1 to 16).
+
+ if(dminfo % my_proc_id == IO_NODE) read (unit=rrtmg_unit,iostat=istat) &
+ raylo, givfac, layreffr, kao, selfrefo, forrefo, sfluxrefo
+
+ if(istat /= 0) then
+ write(0,*)
+ write(errmess,'(A,I4)') 'module_ra_rrtmg_sw: error reading RRTMG_SW_DATA on unit ', &
+ rrtmg_unit
+ call physics_error_fatal(istat,errmess)
+ endif
+
+ DM_BCAST_MACRO(raylo)
+ DM_BCAST_REAL(givfac)
+ DM_BCAST_INTEGER(layreffr)
+ DM_BCAST_MACRO(kao)
+ DM_BCAST_MACRO(selfrefo)
+ DM_BCAST_MACRO(forrefo)
+ DM_BCAST_MACRO(sfluxrefo)
+
+ end subroutine sw_kgb23
+
+! **************************************************************************
+ subroutine sw_kgb24(rrtmg_unit,dminfo)
+! **************************************************************************
+
+ use rrsw_kg24, only : kao, kbo, selfrefo, forrefo, sfluxrefo, &
+ raylao, raylbo, abso3ao, abso3bo, strrat, layreffr
+ save
+
+!input arguments:
+ type(dm_info),intent(in):: dminfo
+ integer,intent(in):: rrtmg_unit
+
+!local variables:
+ character(len=80):: errmess
+ integer:: istat
+
+! Array sfluxrefo contains the Kurucz solar source function for this band.
+
+! Arrays raylao and raylbo contain the Rayleigh extinction coefficient at
+! all v for this band for the upper and lower atmosphere.
+
+! Arrays abso3ao and abso3bo contain the ozone absorption coefficient at
+! all v for this band for the upper and lower atmosphere.
+
+! The array KAO contains absorption coefs at the 16 chosen g-values
+! for a range of pressure levels> ~100mb, temperatures, and binary
+! species parameters (see taumol.f for definition). The first
+! index in the array, JS, runs from 1 to 9, and corresponds to
+! different values of the binary species parameter. For instance,
+! JS=1 refers to dry air, JS = 2 corresponds to the paramter value 1/8,
+! JS = 3 corresponds to the parameter value 2/8, etc. The second index
+! in the array, JT, which runs from 1 to 5, corresponds to different
+! temperatures. More specifically, JT = 3 means that the data are for
+! the reference temperature TREF for this pressure level, JT = 2 refers
+! to TREF-15, JT = 1 is for TREF-30, JT = 4 is for TREF+15, and JT = 5
+! is for TREF+30. The third index, JP, runs from 1 to 13 and refers
+! to the JPth reference pressure level (see taumol.f for these levels
+! in mb). The fourth index, IG, goes from 1 to 16, and indicates
+! which g-interval the absorption coefficients are for.
+
+! The array KBO contains absorption coefs at the 16 chosen g-values
+! for a range of pressure levels < ~100mb and temperatures. The first
+! index in the array, JT, which runs from 1 to 5, corresponds to
+! different temperatures. More specifically, JT = 3 means that the
+! data are for the reference temperature TREF for this pressure
+! level, JT = 2 refers to the temperature TREF-15, JT = 1 is for
+! TREF-30, JT = 4 is for TREF+15, and JT = 5 is for TREF+30.
+! The second index, JP, runs from 13 to 59 and refers to the JPth
+! reference pressure level (see taumol.f for the value of these
+! pressure levels in mb). The third index, IG, goes from 1 to 16,
+! and tells us which g-interval the absorption coefficients are for.
+
+! The array FORREFO contains the coefficient of the water vapor
+! foreign-continuum (including the energy term). The first
+! index refers to reference temperature (296,260,224,260) and
+! pressure (970,475,219,3 mbar) levels. The second index
+! runs over the g-channel (1 to 16).
+
+! The array SELFREFO contains the coefficient of the water vapor
+! self-continuum (including the energy term). The first index
+! refers to temperature in 7.2 degree increments. For instance,
+! JT = 1 refers to a temperature of 245.6, JT = 2 refers to 252.8,
+! etc. The second index runs over the g-channel (1 to 16).
+
+ if(dminfo % my_proc_id == IO_NODE) read (unit=rrtmg_unit,iostat=istat) &
+ raylao, raylbo, strrat, layreffr, abso3ao, abso3bo, kao, kbo, selfrefo, &
+ forrefo, sfluxrefo
+
+ if(istat /= 0) then
+ write(0,*)
+ write(errmess,'(A,I4)') 'module_ra_rrtmg_sw: error reading RRTMG_SW_DATA on unit ', &
+ rrtmg_unit
+ call physics_error_fatal(istat,errmess)
+ endif
+
+ DM_BCAST_MACRO(raylao)
+ DM_BCAST_MACRO(raylbo)
+ DM_BCAST_REAL(strrat)
+ DM_BCAST_INTEGER(layreffr)
+ DM_BCAST_MACRO(abso3ao)
+ DM_BCAST_MACRO(abso3bo)
+ DM_BCAST_MACRO(kao)
+ DM_BCAST_MACRO(kbo)
+ DM_BCAST_MACRO(selfrefo)
+ DM_BCAST_MACRO(forrefo)
+ DM_BCAST_MACRO(sfluxrefo)
+
+ end subroutine sw_kgb24
+
+! **************************************************************************
+ subroutine sw_kgb25(rrtmg_unit,dminfo)
+! **************************************************************************
+
+ use rrsw_kg25, only : kao, sfluxrefo, &
+ raylo, abso3ao, abso3bo, layreffr
+ save
+
+!input arguments:
+ type(dm_info),intent(in):: dminfo
+ integer,intent(in):: rrtmg_unit
+
+!local variables:
+ character(len=80):: errmess
+ integer:: istat
+
+! Array sfluxrefo contains the Kurucz solar source function for this band.
+
+! Array raylo contains the Rayleigh extinction coefficient at all v = 2925 cm-1.
+
+! Arrays abso3ao and abso3bo contain the ozone absorption coefficient at
+! all v for this band for the upper and lower atmosphere.
+
+! The array KAO contains absorption coefs at the 16 chosen g-values
+! for a range of pressure levels> ~100mb, temperatures, and binary
+! species parameters (see taumol.f for definition). The first
+! index in the array, JS, runs from 1 to 9, and corresponds to
+! different values of the binary species parameter. For instance,
+! JS=1 refers to dry air, JS = 2 corresponds to the paramter value 1/8,
+! JS = 3 corresponds to the parameter value 2/8, etc. The second index
+! in the array, JT, which runs from 1 to 5, corresponds to different
+! temperatures. More specifically, JT = 3 means that the data are for
+! the reference temperature TREF for this pressure level, JT = 2 refers
+! to TREF-15, JT = 1 is for TREF-30, JT = 4 is for TREF+15, and JT = 5
+! is for TREF+30. The third index, JP, runs from 1 to 13 and refers
+! to the JPth reference pressure level (see taumol.f for these levels
+! in mb). The fourth index, IG, goes from 1 to 16, and indicates
+! which g-interval the absorption coefficients are for.
+
+ if(dminfo % my_proc_id == IO_NODE) read (unit=rrtmg_unit,iostat=istat) &
+ raylo, layreffr, abso3ao, abso3bo, kao, sfluxrefo
+
+ if(istat /= 0) then
+ write(0,*)
+ write(errmess,'(A,I4)') 'module_ra_rrtmg_sw: error reading RRTMG_SW_DATA on unit ', &
+ rrtmg_unit
+ call physics_error_fatal(istat,errmess)
+ endif
+
+ DM_BCAST_MACRO(raylo)
+ DM_BCAST_INTEGER(layreffr)
+ DM_BCAST_MACRO(abso3ao)
+ DM_BCAST_MACRO(abso3bo)
+ DM_BCAST_MACRO(kao)
+ DM_BCAST_MACRO(sfluxrefo)
+
+ end subroutine sw_kgb25
+
+! **************************************************************************
+ subroutine sw_kgb26(rrtmg_unit,dminfo)
+! **************************************************************************
+
+ use rrsw_kg26, only : sfluxrefo, raylo
+ save
+
+!input arguments:
+ type(dm_info),intent(in):: dminfo
+ integer,intent(in):: rrtmg_unit
+
+!local variables:
+ character(len=80):: errmess
+ integer:: istat
+
+! Array sfluxrefo contains the Kurucz solar source function for this band.
+
+! Array raylo contains the Rayleigh extinction coefficient at all v for this band.
+
+ if(dminfo % my_proc_id == IO_NODE) read (unit=rrtmg_unit,iostat=istat) &
+ raylo, sfluxrefo
+
+ if(istat /= 0) then
+ write(0,*)
+ write(errmess,'(A,I4)') 'module_ra_rrtmg_sw: error reading RRTMG_SW_DATA on unit ', &
+ rrtmg_unit
+ call physics_error_fatal(istat,errmess)
+ endif
+
+ DM_BCAST_MACRO(raylo)
+ DM_BCAST_MACRO(sfluxrefo)
+
+ end subroutine sw_kgb26
+
+! **************************************************************************
+ subroutine sw_kgb27(rrtmg_unit,dminfo)
+! **************************************************************************
+
+ use rrsw_kg27, only : kao, kbo, sfluxrefo, raylo, &
+ scalekur, layreffr
+ save
+
+!input arguments:
+ type(dm_info),intent(in):: dminfo
+ integer,intent(in):: rrtmg_unit
+
+!local variables:
+ character(len=80):: errmess
+ integer:: istat
+
+! Array sfluxrefo contains the Kurucz solar source function for this band.
+! The values in array sfluxrefo were obtained using the "low resolution"
+! version of the Kurucz solar source function. For unknown reasons,
+! the total irradiance in this band differs from the corresponding
+! total in the "high-resolution" version of the Kurucz function.
+! Therefore, these values are scaled by the factor SCALEKUR.
+
+! Array raylo contains the Rayleigh extinction coefficient at all v = 2925 cm-1.
+
+! The array KAO contains absorption coefs at the 16 chosen g-values
+! for a range of pressure levels> ~100mb, temperatures, and binary
+! species parameters (see taumol.f for definition). The first
+! index in the array, JS, runs from 1 to 9, and corresponds to
+! different values of the binary species parameter. For instance,
+! JS=1 refers to dry air, JS = 2 corresponds to the paramter value 1/8,
+! JS = 3 corresponds to the parameter value 2/8, etc. The second index
+! in the array, JT, which runs from 1 to 5, corresponds to different
+! temperatures. More specifically, JT = 3 means that the data are for
+! the reference temperature TREF for this pressure level, JT = 2 refers
+! to TREF-15, JT = 1 is for TREF-30, JT = 4 is for TREF+15, and JT = 5
+! is for TREF+30. The third index, JP, runs from 1 to 13 and refers
+! to the JPth reference pressure level (see taumol.f for these levels
+! in mb). The fourth index, IG, goes from 1 to 16, and indicates
+! which g-interval the absorption coefficients are for.
+
+! The array KBO contains absorption coefs at the 16 chosen g-values
+! for a range of pressure levels < ~100mb and temperatures. The first
+! index in the array, JT, which runs from 1 to 5, corresponds to
+! different temperatures. More specifically, JT = 3 means that the
+! data are for the reference temperature TREF for this pressure
+! level, JT = 2 refers to the temperature TREF-15, JT = 1 is for
+! TREF-30, JT = 4 is for TREF+15, and JT = 5 is for TREF+30.
+! The second index, JP, runs from 13 to 59 and refers to the JPth
+! reference pressure level (see taumol.f for the value of these
+! pressure levels in mb). The third index, IG, goes from 1 to 16,
+! and tells us which g-interval the absorption coefficients are for.
+
+ if(dminfo % my_proc_id == IO_NODE) read (unit=rrtmg_unit,iostat=istat) &
+ raylo, scalekur, layreffr, kao, kbo, sfluxrefo
+
+ if(istat /= 0) then
+ write(0,*)
+ write(errmess,'(A,I4)') 'module_ra_rrtmg_sw: error reading RRTMG_SW_DATA on unit ', &
+ rrtmg_unit
+ call physics_error_fatal(istat,errmess)
+ endif
+
+ DM_BCAST_MACRO(raylo)
+ DM_BCAST_REAL(scalekur)
+ DM_BCAST_INTEGER(layreffr)
+ DM_BCAST_MACRO(kao)
+ DM_BCAST_MACRO(kbo)
+ DM_BCAST_MACRO(sfluxrefo)
+
+ end subroutine sw_kgb27
+
+! **************************************************************************
+ subroutine sw_kgb28(rrtmg_unit,dminfo)
+! **************************************************************************
+
+ use rrsw_kg28, only : kao, kbo, sfluxrefo, &
+ rayl, strrat, layreffr
+ save
+
+!input arguments:
+ type(dm_info),intent(in):: dminfo
+ integer,intent(in):: rrtmg_unit
+
+!local variables:
+ character(len=80):: errmess
+ integer:: istat
+
+! Array sfluxrefo contains the Kurucz solar source function for this band.
+
+! Array raylo contains the Rayleigh extinction coefficient at all v = ???? cm-1.
+
+! The array KAO contains absorption coefs at the 16 chosen g-values
+! for a range of pressure levels> ~100mb, temperatures, and binary
+! species parameters (see taumol.f for definition). The first
+! index in the array, JS, runs from 1 to 9, and corresponds to
+! different values of the binary species parameter. For instance,
+! JS=1 refers to dry air, JS = 2 corresponds to the paramter value 1/8,
+! JS = 3 corresponds to the parameter value 2/8, etc. The second index
+! in the array, JT, which runs from 1 to 5, corresponds to different
+! temperatures. More specifically, JT = 3 means that the data are for
+! the reference temperature TREF for this pressure level, JT = 2 refers
+! to TREF-15, JT = 1 is for TREF-30, JT = 4 is for TREF+15, and JT = 5
+! is for TREF+30. The third index, JP, runs from 1 to 13 and refers
+! to the JPth reference pressure level (see taumol.f for these levels
+! in mb). The fourth index, IG, goes from 1 to 16, and indicates
+! which g-interval the absorption coefficients are for.
+
+! The array KBO contains absorption coefs at the 16 chosen g-values
+! for a range of pressure levels < ~100mb and temperatures. The first
+! index in the array, JT, which runs from 1 to 5, corresponds to
+! different temperatures. More specifically, JT = 3 means that the
+! data are for the reference temperature TREF for this pressure
+! level, JT = 2 refers to the temperature TREF-15, JT = 1 is for
+! TREF-30, JT = 4 is for TREF+15, and JT = 5 is for TREF+30.
+! The second index, JP, runs from 13 to 59 and refers to the JPth
+! reference pressure level (see taumol.f for the value of these
+! pressure levels in mb). The third index, IG, goes from 1 to 16,
+! and tells us which g-interval the absorption coefficients are for.
+
+ if(dminfo % my_proc_id == IO_NODE) read (unit=rrtmg_unit,iostat=istat) &
+ rayl, strrat, layreffr, kao, kbo, sfluxrefo
+
+ if(istat /= 0) then
+ write(0,*)
+ write(errmess,'(A,I4)') 'module_ra_rrtmg_sw: error reading RRTMG_SW_DATA on unit ', &
+ rrtmg_unit
+ call physics_error_fatal(istat,errmess)
+ endif
+
+ DM_BCAST_REAL(rayl)
+ DM_BCAST_REAL(strrat)
+ DM_BCAST_INTEGER(layreffr)
+ DM_BCAST_MACRO(kao)
+ DM_BCAST_MACRO(kbo)
+ DM_BCAST_MACRO(sfluxrefo)
+
+ end subroutine sw_kgb28
+
+! **************************************************************************
+ subroutine sw_kgb29(rrtmg_unit,dminfo)
+! **************************************************************************
+
+ use rrsw_kg29, only : kao, kbo, selfrefo, forrefo, sfluxrefo, &
+ absh2oo, absco2o, rayl, layreffr
+ save
+
+!input arguments:
+ type(dm_info),intent(in):: dminfo
+ integer,intent(in):: rrtmg_unit
+
+!local variables:
+ character(len=80):: errmess
+ integer:: istat
+
+! Array sfluxrefo contains the Kurucz solar source function for this band.
+
+! Array rayl contains the Rayleigh extinction coefficient at all v = 2200 cm-1.
+
+! Array absh2oo contains the water vapor absorption coefficient for this band.
+
+! Array absco2o contains the carbon dioxide absorption coefficient for this band.
+
+! The array KAO contains absorption coefs at the 16 chosen g-values
+! for a range of pressure levels> ~100mb, temperatures, and binary
+! species parameters (see taumol.f for definition). The first
+! index in the array, JS, runs from 1 to 9, and corresponds to
+! different values of the binary species parameter. For instance,
+! JS=1 refers to dry air, JS = 2 corresponds to the paramter value 1/8,
+! JS = 3 corresponds to the parameter value 2/8, etc. The second index
+! in the array, JT, which runs from 1 to 5, corresponds to different
+! temperatures. More specifically, JT = 3 means that the data are for
+! the reference temperature TREF for this pressure level, JT = 2 refers
+! to TREF-15, JT = 1 is for TREF-30, JT = 4 is for TREF+15, and JT = 5
+! is for TREF+30. The third index, JP, runs from 1 to 13 and refers
+! to the JPth reference pressure level (see taumol.f for these levels
+! in mb). The fourth index, IG, goes from 1 to 16, and indicates
+! which g-interval the absorption coefficients are for.
+
+! The array KBO contains absorption coefs at the 16 chosen g-values
+! for a range of pressure levels < ~100mb and temperatures. The first
+! index in the array, JT, which runs from 1 to 5, corresponds to
+! different temperatures. More specifically, JT = 3 means that the
+! data are for the reference temperature TREF for this pressure
+! level, JT = 2 refers to the temperature TREF-15, JT = 1 is for
+! TREF-30, JT = 4 is for TREF+15, and JT = 5 is for TREF+30.
+! The second index, JP, runs from 13 to 59 and refers to the JPth
+! reference pressure level (see taumol.f for the value of these
+! pressure levels in mb). The third index, IG, goes from 1 to 16,
+! and tells us which g-interval the absorption coefficients are for.
+
+! The array FORREFO contains the coefficient of the water vapor
+! foreign-continuum (including the energy term). The first
+! index refers to reference temperature (296,260,224,260) and
+! pressure (970,475,219,3 mbar) levels. The second index
+! runs over the g-channel (1 to 16).
+
+! The array SELFREFO contains the coefficient of the water vapor
+! self-continuum (including the energy term). The first index
+! refers to temperature in 7.2 degree increments. For instance,
+! JT = 1 refers to a temperature of 245.6, JT = 2 refers to 252.8,
+! etc. The second index runs over the g-channel (1 to 16).
+
+ write(0,*)
+ write(0,*) '--- enter subroutine sw_kgb29:'
+ write(0,*) '--- rrtmg_unit= ', rrtmg_unit
+ if(dminfo % my_proc_id == IO_NODE) read (unit=rrtmg_unit,iostat=istat) &
+ rayl, layreffr, absh2oo, absco2o, kao, kbo, selfrefo, forrefo, sfluxrefo
+
+ if(istat /= 0) then
+ write(0,*)
+ write(errmess,'(A,I4)') 'module_ra_rrtmg_sw: error reading RRTMG_SW_DATA on unit ', &
+ rrtmg_unit
+ call physics_error_fatal(istat,errmess)
+ endif
+
+ DM_BCAST_REAL(rayl)
+ DM_BCAST_INTEGER(layreffr)
+ DM_BCAST_MACRO(absh2oo)
+ DM_BCAST_MACRO(absco2o)
+ DM_BCAST_MACRO(kao)
+ DM_BCAST_MACRO(kbo)
+ DM_BCAST_MACRO(selfrefo)
+ DM_BCAST_MACRO(forrefo)
+ DM_BCAST_MACRO(sfluxrefo)
+
+ write(0,*) rayl
+ write(0,*) kbo
+ write(0,*) sfluxrefo
+ write(0,*) '--- end subroutine sw_kgb29:'
+
+ end subroutine sw_kgb29
+
+!=============================================================================================
+ end module module_physics_rrtmg_swinit
+!=============================================================================================
</font>
</pre>