PUBLIC INTERFACE ~ PUBLIC DATA ~ PUBLIC ROUTINES ~ NAMELIST ~ DIAGNOSTIC FIELDS ~ ERROR MESSAGES ~ REFERENCES ~ NOTES

Module radiative_gases_mod

Contact:  fil
Reviewers:  ds
Change History: WebCVS Log


OVERVIEW

Module that defines mixing ratios of radiatively-active gases to be used in the calculation of longwave and shortwave radiative fluxes and heating rates in the sea_esf_rad radiation package.

Module that defines mixing ratios of radiatively-active gases to be used in the calculation of longwave and shortwave radiative fluxes and heating rates in the sea_esf_rad radiation package.


OTHER MODULES USED

 time_manager_mod
diag_manager_mod
fms_mod
fms_io_mod
time_interp_mod
constants_mod
rad_utilities_mod
ozone_mod

PUBLIC INTERFACE

radiative_gases_init:
Subroutine to initialize radiative_gases module
define_radiative_gases:
Subroutine that returns the current values of the radiative gas mixing ratios to radiation_driver in Rad_gases.
radiative_gases_end:
radiative_gases_end is the destructor for radiative_gases_mod.
radiative_gases_dealloc:
radiative_gases_end is the destructor for radiative_gases_mod.
validate_time_varying_inputs:
validate_time_varying_inputs checks for consistency among the namelist parameters defining the time variation of the input gas. NOTE: THIS IS A PRIVATE SUBROUTINE.

read_restart_radiative_gases:
Subroutine to read the radiative_gases.res file
read_restart_nc:
Subroutine to read the radiative_gases.res.nc file
define_ch4:
Subroutine that provides initial values for ch4 mixing ratio.
define_n2o:
Subroutine that provides initial values for n2o mixing ratio.
define_f11:
Subroutine that provides initial values for f11 mixing ratio.
define_f12:
Subroutine that provides initial values for f12 mixing ratio.
define_f113:
Subroutine that provides initial values for f113 mixing ratio.
define_f22:
Subroutine that provides initial values for f22 mixing ratio.
define_co2:
Subroutine that provides initial values for co2 mixing ratio.
read_gas_timeseries:
Subroutine that reads in data values for well-mixed greenhouse gases at specified times.
define_gas_amount:
define_gas_amount defines the values of the gas mixing ratio needed ! at the current time, when the gas is varying with time.
write_restart_radiative_gases:
Subroutine to write the radiative restart files
write_restart_nc:
Subroutine to write the radiative restart files in netcdf format


PUBLIC DATA

None.


PUBLIC ROUTINES

  1. radiative_gases_init

    call radiative_gases_init (pref, latb, lonb)
    DESCRIPTION
    Subroutine to initialize radiative_gases module


    INPUT
    pref    reference prssure profiles
       [real]
    latb    array of model latitudes at cell boundaries [radians]
       [real]
    lonb    array of model longitudes at cell boundaries [radians]
       [real]

  2. define_radiative_gases

    call define_radiative_gases (is, ie, js, je, Rad_time, lat, & Atmos_input, Time_next, Rad_gases)
    DESCRIPTION
    Subroutine that returns the current values of the radiative gas mixing ratios to radiation_driver in Rad_gases.


    INPUT
    is,ie,js,je    starting/ending subdomain i,j indices of data in the physics_window being integrated
       [integer]
    Rad_time    time at which radiation is to be calculated [ time_type (days, seconds) ]
       [time_type]
    lat    latitude of model points [ radians ]
       [real]
    Atmos_input    Atmospheric input data
       [atmos_input_type]
    Time_next    time on next timestep, used as stamp for diagnostic output [ time_type (days, seconds) ]
       [time_type]

    INPUT/OUTPUT
    Rad_gases    radiative_gases_type variable containing the radi- ative gas input fields needed by the radiation package
       [radiative_gases_type]

  3. radiative_gases_end

    call radiative_gases_end 
    
    DESCRIPTION
    radiative_gases_end is the destructor for radiative_gases_mod.


  4. radiative_gases_dealloc

    call radiative_gases_dealloc (Rad_gases)
    DESCRIPTION
    radiative_gases_end is the destructor for radiative_gases_mod.


    INPUT/OUTPUT
    Rad_gases    radiative_gases_type variable containing the radi- ative gas input fields needed by the radiation package
       [radiative_gases_type]

  5. validate_time_varying_inputs

    !
    !NOTE: THIS IS A PRIVATE SUBROUTINE.
    !
    
    subroutine validate_time_varying_inputs   &
                          (gas, base_time, base_value, specification_type, &
                           change_rate,  gas_dataset_entry,  &
                           negative_offset_gas, Gas_offset, Gas_entry, &
                           variation_type, Gas_time_list, gas_value)
    
    !---------------------------------------------------------------------
    !    validate_time_varying_inputs checks for consistency among the 
    !    namelist parameters defining the time variation of the input gas.
    !--------------------------------------------------------------------
    
    character(len=*),      intent(in)  :: gas
    integer, dimension(6), intent(in)  :: base_time, gas_dataset_entry
    real,                  intent(in)  :: base_value,            &
                                          change_rate
    logical,               intent(inout)  :: negative_offset_gas
    character(len=*),     intent(in)  :: specification_type, variation_type
    type(time_type),dimension(:), intent(inout)  :: Gas_time_list
    type(time_type), intent(inout)  :: Gas_offset, Gas_entry
    real, dimension(:), intent(in) :: gas_value
    
    !--------------------------------------------------------------------
    !   local variables:
    
          integer :: n
    call validate_time_varying_inputs & (gas, base_time, base_value, specification_type, & change_rate, variation_type, Gas_time_list, & gas_value)
    DESCRIPTION
    Subroutine validate_time_varying_inputs performs the following checks of the namelist variables: 1) Verifies that base_time has a non-zero month and day number, indicating a change from the default; 2) Verifies that the base value of gas mixing ratio is non-zero; 3) Verifies that specification_type is valid, either 'base_and_trend' or 'time_series'; 4) Verifies that variation_type is valid, either 'linear' or 'logarithmic'; 5) When specification_type is 'base_and_trend', verifies that change_rate is non-zero;


    INPUT
    gas    name associated with the current gas
    base_time    time at which the base_value is applicable [ year, month, day, hour, minute, second ]
    base_value    base value for vol. mixing ratio of gas [ number / number ]
    specification_type    specification of form of time variation of gas
    change_rate    rate of change of gas; 1.00 + [ percent change / year ]
    variation_type    form of the temporal behavior of gas; either 'linear' or 'logarithmic'
    gas_value    array of values of gas concentrations corresponding to the times in Gas_time_list [ number / number ]

    INPUT/OUTPUT
    Gas_time_list    array of time_type variables defining the data times for the gas; if specification_type is timeseries, then it is the set of times in the daa set, if specification type is base_and_trend, then it is an array of dimension 1 containing the xxx_base_time. [ time_type ]

  6. read_restart_radiative_gases

    call read_restart_radiative_gases 
    
    DESCRIPTION
    Subroutine to read the radiative_gases.res file


  7. read_restart_nc

    call read_restart_nc 
    
    DESCRIPTION
    Subroutine to read the radiative_gases.res.nc file


  8. define_ch4

    call define_ch4 (data_source)
    DESCRIPTION
    Subroutine that provides initial values for ch4 mixing ratio.if ch4 is fixed in time, the value is given by the namelist specification. if ch4 is time-varying, the values are obtained from either a restart or input data file.


    INPUT
    data_source    character string defining source to use to define ch4 initial values
       [character]

  9. define_n2o

    call define_n2o (data_source)
    DESCRIPTION
    Subroutine that provides initial values for n2o mixing ratio.if n2o is fixed in time, the value is given by the namelist specification. if n2o is time-varying, the values are obtained from either a restart or input data file.


    INPUT
    data_source    character string defining source to use to define n2o initial values
       [character]

  10. define_f11

    call define_f11 (data_source)
    DESCRIPTION
    define_f11 provides initial values for f11 mixing ratio. if f11 is fixed in time, the value is given by the namelist specification. if f11 is time-varying, the values are obtained from either a restart or input data file.


    INPUT
    data_source    character string defining source to use to define f11 initial values
       [character]

  11. define_f12

    call define_f12 (data_source)
    DESCRIPTION
    define_f12 provides initial values for f12 mixing ratio. if f12 is fixed in time, the value is given by the namelist specification. if f12 is time-varying, the values are obtained from either a restart or input data file.


    INPUT
    data_source    character string defining source to use to define f12 initial values
       [character]

  12. define_f113

    call define_f113 (data_source)
    DESCRIPTION
    define_f113 provides initial values for f113 mixing ratio. if f113 is fixed in time, the value is given by the namelist specification. if f113 is time-varying, the values are obtained from either a restart or input data file.


    INPUT
    data_source    character string defining source to use to define f113 initial values
       [character]

  13. define_f22

    call define_f22 (data_source)
    DESCRIPTION
    define_f22 provides initial values for f22 mixing ratio. if f22 is fixed in time, the value is given by the namelist specification. if f22 is time-varying, the values are obtained from either a restart or input data file.


    INPUT
    data_source    character string defining source to use to define f22 initial values
       [character]

  14. define_co2

    call define_co2 (data_source)
    DESCRIPTION
    define_co2 provides initial values for co2 mixing ratio. if co2 is fixed in time, the value is given by the namelist specification. if co2 is time-varying, the values are obtained from either a restart or input data file.


    INPUT
    data_source    character string defining source to use to define co2 initial values
       [character]

  15. read_gas_timeseries

    call read_gas_timeseries (gas, gas_value, Gas_time_list, rgas)
    DESCRIPTION
    read_gas_timeseries obtains global values for well-mixed greenhouse gases from observed data sources for gas xxx. the data are obtained from an input file.


    INPUT
    gas    name associated with the current gas

    INPUT/OUTPUT
    gas_value    array of volume mixing ratio of gas 'gas' for each time in Gas_time_list gas_year. [no. /no. ]
    Gas_time_list    list of times (time_type) associated with the gas_value data

    OUTPUT
    rgas    gas volume mixing ratio at the start of the timeseries

  16. define_gas_amount

    !
    !NOTE: THIS IS A PRIVATE SUBROUTINE>
    !
    subroutine define_gas_amount      &
             (gas, Rad_time, gas_specification_type,  &
    !         negative_offset_gas, Gas_offset, gas_variation_type, &
                                               gas_variation_type, &
              gas_floor, gas_ceiling, rgas, gas_uses_tfs, gas_change_rate, &
              rrvgas, Gas_time_list, gas_value, gas_tf_calc_intrvl,  &
              gas_tf_time_displacement, calc_gas_tfs_on_first_step,  &
              calc_gas_tfs_monthly, &
              use_current_gas_for_tf, gas_tf_offset, gas_for_last_tf_calc, &
              gas_for_next_tf_calc,  gas_tfs_needed,  &
              define_gas_for_last_tf_calc)
    
    !--------------------------------------------------------------------
    character(len=*),              intent(in)    :: gas
    type(time_type),               intent(in)    :: Rad_time
    character(len=*),              intent(in)    :: gas_specification_type,&
                                                    gas_variation_type
    real,                          intent(in)    :: gas_floor, gas_ceiling,&
                                                    rgas
    logical,                       intent(in)    :: gas_uses_tfs  
    !logical,                       intent(in)    :: negative_offset_gas  
    real,                          intent(inout) :: gas_change_rate, rrvgas
    
    type(time_type), dimension(:), intent(in)    :: Gas_time_list
    !type(time_type),               intent(inout) :: Gas_offset      
    real, dimension(:),            intent(in)    :: gas_value
    real,               intent(in),    optional  :: gas_tf_calc_intrvl,    &
                                                    gas_tf_time_displacement
    logical,            intent(in),    optional  ::   &
                                               gas_tfs_needed, &
                                              calc_gas_tfs_on_first_step, &
                                              calc_gas_tfs_monthly,  &
                                              use_current_gas_for_tf 
    real,               intent(out),   optional  :: gas_tf_offset, &
                                                    gas_for_last_tf_calc, &
                                                    gas_for_next_tf_calc
    logical,            intent(inout), optional  :: &  
                                              define_gas_for_last_tf_calc
    
    !---------------------------------------------------------------------
    !  local variables:
    
         type(time_type)    :: Gas_yrs   
         integer            :: days, seconds
         real               :: years_of_gas, years_of_gas_till_next
         integer            :: days2, seconds2
         integer            :: days3, seconds3
         real               :: mean_days, calc_time
         character(len=16)  :: chvers7, chvers8, chvers9, chvers11
         integer            :: alarm, minutes_from_start
         integer            :: dum, year
         real               :: percent_of_period
         type(time_type)    :: Tf_offset, Tf_calc_intrvl 
         real               :: rseconds3
         integer            :: index1, index2
         integer            :: yr, mo, dy, hr, mn, sc
         integer            :: days7, seconds7
         type(time_type)    :: Tf_displ, First_of_month, Gas_tf_next, &
                               Time_left
    !---------------------------------------------------------------------
    !  local variables:
    !    
    !     Gas_yrs                 time interval from start of time variation
    !                             until current time [ time_type ]
    !     days                    days component of Gas_yrs  [ days ]   
    !     seconds                 seconds component of Gas_yrs  [ seconds ]
    !     minutes_from_start      time interval from start of time variation
    !                             until current time [ minutes ]
    !     years_of_gas            time interval from start of time variation
    !                             until current time [ years ]
    !     years_of_gas_till_next  time interval from start of time variation
    !                             until next tf calculation [ years ]
    !     days2                   days component of the mean length of year
    !                             time_type variable [ days ]
    !     seconds2                seconds component of the mean length of 
    !                             year time_type variable [ seconds ]
    !     mean_days               average number of days in a year [ days ]
    !     calc_time               time at which tfs were last calculated
    !                             [ years from start of gas time variation ]
    !     chvers7                 character variable used to output model
    !                             variables through error_mesg interface
    !     chvers8                 character variable used to output model
    !                             variables through error_mesg interface
    !     chvers9                 character variable used to output model
    !                             variables through error_mesg interface
    !     chvers11                character variable used to output model
    !                             variables through error_mesg interface
    !     alarm                   time since last tf calculation until
    !                             current time [ minutes ]              
    !
    !--------------------------------------------------------------------
    
    !     type(time_type)  :: Gas_time  ! time for which gas data is desired
    call define_gas_amount & (gas, Rad_time, gas_specification_type, gas_variation_type, & gas_floor, gas_ceiling, rgas, gas_uses_tfs, gas_change_rate, & rrvgas, Gas_time_list, gas_value, gas_tf_calc_intrvl, & gas_tf_time_displacement, calc_gas_tfs_on_first_step, & use_current_gas_for_tf, gas_tf_offset, gas_for_last_tf_calc, & gas_for_next_tf_calc, define_gas_for_last_tf_calc)
    DESCRIPTION
    define_gas_amount performs the following actions: 1) checks for the presence of needed optional arguments; 2) determines how long the gas has been varying with time; 3) calculates values for the gas mixing ratio at the current time; 4) constrains calculated gas values to lie between the specified floor and ceiling;

    if transmission functions are calculated for the gas, then: 1) it is determined if the gas value used when the tfs were last calculated is needed; 2) if the gas does not use its current value at the time when tfs are calculated, the offset from the current time to the time used for tfs is obtained; 3) if the gas value used when the tfs were last calculated is needed, it is calculated along with the time offset of that time from the present time; 4) if the gas value at the time when the tfs are next to be cal- culated is needed, it is calculated; 5) gas values relevant at the time when tfs are next to be calculated are constrained to lie between the specified floor and ceiling;


    INPUT
    gas    character string associated with the gas being processed
    Rad_time    time at which radiation calculation is to apply
    gas_specification_type    indicator as to the form of time variation of vol. mixing ratio; either 'base_and_trend' or 'time_series'.
    gas_variation_type    indicator as to the form of time variation of the vol. mixing ratio of gas; either 'linear' or 'logarithmic'
    gas_floor    smallest value allowed for gas xxx vol. mixing ratio [ no. / no. ]
    gas_ceiling    largest value allowed for gas xxx vol. mixing ratio [ no. / no. ]
    rgas    initially specified gas mixing ratio [ no. / no. ]
    gas_uses_tfs    this gas has transmission functions associated with it ?
    Gas_time_list    list of times in gas timeseries [ time_type ]
    gas_value    gas concentrations [ no. / no. ] associated with the times in Gas_time_list
    gas_tf_calc_intrvl    time interval between calculating gas tfs [ hours ] OPTIONAL: present only when the gas has tfs associated with it
    gas_tf_time_displacement    time displacement from present to the time at which gas values are to be used in the calculation of tfs. may be <0, ==0, or > 0. [ hours ] OPTIONAL: present only when the gas has tfs associated with it, only used when calc_gas_tfs_on_first_step is .true.
    calc_gas_tfs_on_first_step    if true, tfs are calculated ONLY on the first time step of a run, using gas mixing ratios valid gas_tf_time_displacement hours from the start time OPTIONAL: present only when the gas has tfs associated with it
    use_current_gas_for_tf    if true, the gas mixing ratio at the current time is used to cal- culate the gas tfs OPTIONAL: present only when the gas has tfs associated with it

    INPUT/OUTPUT
    gas_change_rate    time rate of change of gas xxx vol. mixing ratio [ 1 +/- % per year ]
    rrvgas    gas mixing ratio at current time [ no. / no. ]
    define_gas_for_last_tf_calc    logical indicating if the gas value used for the last tf calculation must be obtained

    OUTPUT
    gas_tf_offset    time between last tf calculation and present [ hours ] OPTIONAL: present only when the gas has tfs associated with it
    gas_for_last_tf_calc    value of gas mixing ratio used in last tf calculation [ no. / no. ] OPTIONAL: present only when the gas has tfs associated with it
    gas_for_next_tf_calc    value of gas mixing ratio to be used in next tf calculation OPTIONAL: present only when the gas has tfs associated with it [ no. / no. ]

  17. write_restart_radiative_gases

    call write_restart_radiative_gases 
    
    DESCRIPTION
    Subroutine to write the radiative restart files


  18. write_restart_nc

    call write_restart_nc 
    
    DESCRIPTION
    Subroutine to write the radiative restart files in netcdf format



DATA SETS

None.


ERROR MESSAGES

None.


top