regr_pr_comb_coefoz_m.f90 Source File


This file depends on

sourcefile~~regr_pr_comb_coefoz_m.f90~~EfferentGraph sourcefile~regr_pr_comb_coefoz_m.f90 regr_pr_comb_coefoz_m.f90 sourcefile~dimphy.f90 dimphy.f90 sourcefile~regr_pr_comb_coefoz_m.f90->sourcefile~dimphy.f90 sourcefile~regr_pr_int_m.f90 regr_pr_int_m.f90 sourcefile~regr_pr_comb_coefoz_m.f90->sourcefile~regr_pr_int_m.f90 sourcefile~mod_phys_lmdz_mpi_data.f90 mod_phys_lmdz_mpi_data.f90 sourcefile~regr_pr_comb_coefoz_m.f90->sourcefile~mod_phys_lmdz_mpi_data.f90 sourcefile~regr_pr_time_av_m.f90 regr_pr_time_av_m.f90 sourcefile~regr_pr_comb_coefoz_m.f90->sourcefile~regr_pr_time_av_m.f90 sourcefile~mod_grid_phy_lmdz.f90 mod_grid_phy_lmdz.f90 sourcefile~regr_pr_comb_coefoz_m.f90->sourcefile~mod_grid_phy_lmdz.f90 sourcefile~assert_m.f90 assert_m.f90 sourcefile~regr_pr_comb_coefoz_m.f90->sourcefile~assert_m.f90 sourcefile~press_coefoz_m.f90 press_coefoz_m.f90 sourcefile~regr_pr_comb_coefoz_m.f90->sourcefile~press_coefoz_m.f90 sourcefile~regr_pr_int_m.f90->sourcefile~dimphy.f90 sourcefile~regr_pr_int_m.f90->sourcefile~mod_phys_lmdz_mpi_data.f90 sourcefile~regr_pr_int_m.f90->sourcefile~mod_grid_phy_lmdz.f90 sourcefile~regr_pr_int_m.f90->sourcefile~assert_m.f90 sourcefile~regr_lint_m.f90 regr_lint_m.f90 sourcefile~regr_pr_int_m.f90->sourcefile~regr_lint_m.f90 sourcefile~mod_phys_lmdz_transfert_para.f90 mod_phys_lmdz_transfert_para.f90 sourcefile~regr_pr_int_m.f90->sourcefile~mod_phys_lmdz_transfert_para.f90 sourcefile~lmdz_mpi.f90 lmdz_mpi.F90 sourcefile~mod_phys_lmdz_mpi_data.f90->sourcefile~lmdz_mpi.f90 sourcefile~print_control_mod.f90 print_control_mod.f90 sourcefile~mod_phys_lmdz_mpi_data.f90->sourcefile~print_control_mod.f90 sourcefile~lmdz_cppkeys_wrapper.f90 lmdz_cppkeys_wrapper.F90 sourcefile~mod_phys_lmdz_mpi_data.f90->sourcefile~lmdz_cppkeys_wrapper.f90 sourcefile~regr_pr_time_av_m.f90->sourcefile~dimphy.f90 sourcefile~regr_pr_time_av_m.f90->sourcefile~mod_grid_phy_lmdz.f90 sourcefile~regr_pr_time_av_m.f90->sourcefile~assert_m.f90 sourcefile~mod_phys_lmdz_para.f90 mod_phys_lmdz_para.f90 sourcefile~regr_pr_time_av_m.f90->sourcefile~mod_phys_lmdz_para.f90 sourcefile~yomcst_mod_h.f90 yomcst_mod_h.f90 sourcefile~regr_pr_time_av_m.f90->sourcefile~yomcst_mod_h.f90 sourcefile~regr_conserv_m.f90 regr_conserv_m.f90 sourcefile~regr_pr_time_av_m.f90->sourcefile~regr_conserv_m.f90 sourcefile~regr_pr_time_av_m.f90->sourcefile~regr_lint_m.f90 sourcefile~interpolation.f90 interpolation.f90 sourcefile~regr_pr_time_av_m.f90->sourcefile~interpolation.f90 sourcefile~geometry_mod.f90 geometry_mod.f90 sourcefile~regr_pr_time_av_m.f90->sourcefile~geometry_mod.f90 sourcefile~phys_cal_mod.f90 phys_cal_mod.f90 sourcefile~regr_pr_time_av_m.f90->sourcefile~phys_cal_mod.f90 sourcefile~regr_pr_time_av_m.f90->sourcefile~mod_phys_lmdz_transfert_para.f90 sourcefile~regr_pr_time_av_m.f90->sourcefile~print_control_mod.f90 sourcefile~assert_eq_m.f90 assert_eq_m.f90 sourcefile~regr_pr_time_av_m.f90->sourcefile~assert_eq_m.f90 sourcefile~slopes_m.f90 slopes_m.f90 sourcefile~regr_pr_time_av_m.f90->sourcefile~slopes_m.f90 sourcefile~clesphys_mod_h.f90 clesphys_mod_h.f90 sourcefile~regr_pr_time_av_m.f90->sourcefile~clesphys_mod_h.f90 sourcefile~write_field_phy.f90 write_field_phy.f90 sourcefile~regr_pr_time_av_m.f90->sourcefile~write_field_phy.f90 sourcefile~press_coefoz_m.f90->sourcefile~mod_phys_lmdz_mpi_data.f90 sourcefile~mod_phys_lmdz_mpi_transfert.f90 mod_phys_lmdz_mpi_transfert.f90 sourcefile~press_coefoz_m.f90->sourcefile~mod_phys_lmdz_mpi_transfert.f90 sourcefile~mod_phys_lmdz_para.f90->sourcefile~mod_phys_lmdz_mpi_data.f90 sourcefile~mod_phys_lmdz_para.f90->sourcefile~mod_grid_phy_lmdz.f90 sourcefile~mod_phys_lmdz_para.f90->sourcefile~mod_phys_lmdz_transfert_para.f90 sourcefile~mod_phys_lmdz_para.f90->sourcefile~print_control_mod.f90 sourcefile~mod_phys_lmdz_omp_data.f90 mod_phys_lmdz_omp_data.F90 sourcefile~mod_phys_lmdz_para.f90->sourcefile~mod_phys_lmdz_omp_data.f90 sourcefile~regr_conserv_m.f90->sourcefile~assert_m.f90 sourcefile~regr_conserv_m.f90->sourcefile~interpolation.f90 sourcefile~regr_conserv_m.f90->sourcefile~assert_eq_m.f90 sourcefile~regr_lint_m.f90->sourcefile~assert_m.f90 sourcefile~regr_lint_m.f90->sourcefile~interpolation.f90 sourcefile~regr_lint_m.f90->sourcefile~assert_eq_m.f90 sourcefile~geometry_mod.f90->sourcefile~mod_grid_phy_lmdz.f90 sourcefile~nrtype.f90 nrtype.f90 sourcefile~geometry_mod.f90->sourcefile~nrtype.f90 sourcefile~mod_phys_lmdz_mpi_transfert.f90->sourcefile~mod_phys_lmdz_mpi_data.f90 sourcefile~mod_phys_lmdz_mpi_transfert.f90->sourcefile~mod_grid_phy_lmdz.f90 sourcefile~mod_phys_lmdz_mpi_transfert.f90->sourcefile~lmdz_mpi.f90 sourcefile~phys_cal_mod.f90->sourcefile~mod_phys_lmdz_para.f90 sourcefile~ioipsl_getin_p_mod.f90 ioipsl_getin_p_mod.f90 sourcefile~phys_cal_mod.f90->sourcefile~ioipsl_getin_p_mod.f90 sourcefile~mod_phys_lmdz_transfert_para.f90->sourcefile~mod_phys_lmdz_mpi_data.f90 sourcefile~mod_phys_lmdz_transfert_para.f90->sourcefile~mod_phys_lmdz_mpi_transfert.f90 sourcefile~mod_phys_lmdz_omp_transfert.f90 mod_phys_lmdz_omp_transfert.f90 sourcefile~mod_phys_lmdz_transfert_para.f90->sourcefile~mod_phys_lmdz_omp_transfert.f90 sourcefile~write_field_phy.f90->sourcefile~mod_grid_phy_lmdz.f90 sourcefile~write_field_phy.f90->sourcefile~mod_phys_lmdz_para.f90 sourcefile~write_field.f90 write_field.f90 sourcefile~write_field_phy.f90->sourcefile~write_field.f90 sourcefile~mod_phys_lmdz_omp_transfert.f90->sourcefile~mod_phys_lmdz_mpi_data.f90 sourcefile~mod_phys_lmdz_omp_transfert.f90->sourcefile~mod_phys_lmdz_omp_data.f90 sourcefile~strings_mod.f90 strings_mod.f90 sourcefile~write_field.f90->sourcefile~strings_mod.f90 sourcefile~ioipsl_getin_p_mod.f90->sourcefile~mod_phys_lmdz_para.f90 sourcefile~ioipsl_getin_p_mod.f90->sourcefile~mod_phys_lmdz_transfert_para.f90 sourcefile~ioipsl_getin_p_mod.f90->sourcefile~strings_mod.f90 sourcefile~mod_phys_lmdz_omp_data.f90->sourcefile~dimphy.f90 sourcefile~mod_phys_lmdz_omp_data.f90->sourcefile~mod_phys_lmdz_mpi_data.f90 sourcefile~mod_phys_lmdz_omp_data.f90->sourcefile~print_control_mod.f90

Files dependent on this one

sourcefile~~regr_pr_comb_coefoz_m.f90~~AfferentGraph sourcefile~regr_pr_comb_coefoz_m.f90 regr_pr_comb_coefoz_m.f90 sourcefile~traclmdz_mod.f90 traclmdz_mod.f90 sourcefile~traclmdz_mod.f90->sourcefile~regr_pr_comb_coefoz_m.f90 sourcefile~o3_chem_m.f90 o3_chem_m.f90 sourcefile~traclmdz_mod.f90->sourcefile~o3_chem_m.f90 sourcefile~o3_chem_m.f90->sourcefile~regr_pr_comb_coefoz_m.f90 sourcefile~o3_chem_m.f90~2 o3_chem_m.f90 sourcefile~o3_chem_m.f90~2->sourcefile~regr_pr_comb_coefoz_m.f90 sourcefile~traclmdz_mod.f90~2 traclmdz_mod.f90 sourcefile~traclmdz_mod.f90~2->sourcefile~regr_pr_comb_coefoz_m.f90 sourcefile~traclmdz_mod.f90~2->sourcefile~o3_chem_m.f90 sourcefile~lsc_scav.f90 lsc_scav.f90 sourcefile~lsc_scav.f90->sourcefile~traclmdz_mod.f90 sourcefile~initrrnpb.f90~2 initrrnpb.f90 sourcefile~initrrnpb.f90~2->sourcefile~traclmdz_mod.f90 sourcefile~lsc_scav.f90~2 lsc_scav.f90 sourcefile~lsc_scav.f90~2->sourcefile~traclmdz_mod.f90 sourcefile~lsc_scav_spl.f90 lsc_scav_spl.f90 sourcefile~lsc_scav_spl.f90->sourcefile~traclmdz_mod.f90 sourcefile~cltracrn.f90 cltracrn.f90 sourcefile~cltracrn.f90->sourcefile~traclmdz_mod.f90 sourcefile~initrrnpb.f90 initrrnpb.f90 sourcefile~initrrnpb.f90->sourcefile~traclmdz_mod.f90 sourcefile~lsc_scav_orig.f90 lsc_scav_orig.f90 sourcefile~lsc_scav_orig.f90->sourcefile~traclmdz_mod.f90 sourcefile~radio_decay.f90~2 radio_decay.f90 sourcefile~radio_decay.f90~2->sourcefile~traclmdz_mod.f90 sourcefile~phyredem.f90 phyredem.f90 sourcefile~phyredem.f90->sourcefile~traclmdz_mod.f90 sourcefile~lsc_scav_orig.f90~2 lsc_scav_orig.f90 sourcefile~lsc_scav_orig.f90~2->sourcefile~traclmdz_mod.f90 sourcefile~phyetat0_mod.f90 phyetat0_mod.F90 sourcefile~phyetat0_mod.f90->sourcefile~traclmdz_mod.f90 sourcefile~phytrac_mod.f90 phytrac_mod.f90 sourcefile~phytrac_mod.f90->sourcefile~traclmdz_mod.f90 sourcefile~cltracrn.f90~2 cltracrn.f90 sourcefile~cltracrn.f90~2->sourcefile~traclmdz_mod.f90 sourcefile~lsc_scav_spl.f90~2 lsc_scav_spl.f90 sourcefile~lsc_scav_spl.f90~2->sourcefile~traclmdz_mod.f90 sourcefile~phytrac_mod.f90~2 phytrac_mod.f90 sourcefile~phytrac_mod.f90~2->sourcefile~traclmdz_mod.f90 sourcefile~radio_decay.f90 radio_decay.f90 sourcefile~radio_decay.f90->sourcefile~traclmdz_mod.f90 sourcefile~phys_output_write_mod.f90 phys_output_write_mod.F90 sourcefile~phys_output_write_mod.f90->sourcefile~phytrac_mod.f90 sourcefile~phys_output_write_mod.f90~2 phys_output_write_mod.F90 sourcefile~phys_output_write_mod.f90~2->sourcefile~phytrac_mod.f90 sourcefile~physiqex_mod.f90 physiqex_mod.F90 sourcefile~physiqex_mod.f90->sourcefile~phyetat0_mod.f90 sourcefile~physiq_mod.f90 physiq_mod.F90 sourcefile~physiq_mod.f90->sourcefile~phyetat0_mod.f90 sourcefile~physiq_mod.f90->sourcefile~phytrac_mod.f90 sourcefile~physiq_mod.f90->sourcefile~phys_output_write_mod.f90 sourcefile~physiq_mod.f90->sourcefile~physiqex_mod.f90 sourcefile~diag_slp.f90 diag_slp.f90 sourcefile~physiq_mod.f90->sourcefile~diag_slp.f90 sourcefile~phys_output_mod.f90 phys_output_mod.F90 sourcefile~physiq_mod.f90->sourcefile~phys_output_mod.f90 sourcefile~physiq_mod.f90~2 physiq_mod.F90 sourcefile~physiq_mod.f90~2->sourcefile~phyetat0_mod.f90 sourcefile~physiq_mod.f90~2->sourcefile~phytrac_mod.f90 sourcefile~physiq_mod.f90~2->sourcefile~phys_output_write_mod.f90 sourcefile~physiq_mod.f90~2->sourcefile~physiqex_mod.f90 sourcefile~physiq_mod.f90~2->sourcefile~diag_slp.f90 sourcefile~physiq_mod.f90~2->sourcefile~phys_output_mod.f90 sourcefile~physiqex_mod.f90~2 physiqex_mod.F90 sourcefile~physiqex_mod.f90~2->sourcefile~phyetat0_mod.f90 sourcefile~diag_slp.f90->sourcefile~phys_output_write_mod.f90 sourcefile~phys_output_mod.f90->sourcefile~phys_output_write_mod.f90 sourcefile~old_lmdz1d.f90 old_lmdz1d.f90 sourcefile~old_lmdz1d.f90->sourcefile~physiq_mod.f90 sourcefile~diag_slp.f90~2 diag_slp.f90 sourcefile~diag_slp.f90~2->sourcefile~phys_output_write_mod.f90 sourcefile~callphysiq_mod.f90 callphysiq_mod.f90 sourcefile~callphysiq_mod.f90->sourcefile~physiq_mod.f90 sourcefile~callphysiq_mod.f90~2 callphysiq_mod.f90 sourcefile~callphysiq_mod.f90~2->sourcefile~physiq_mod.f90 sourcefile~scm.f90 scm.f90 sourcefile~scm.f90->sourcefile~physiq_mod.f90 sourcefile~phys_output_mod.f90~2 phys_output_mod.F90 sourcefile~phys_output_mod.f90~2->sourcefile~phys_output_write_mod.f90 sourcefile~recmwf_aero.f90 recmwf_aero.F90 sourcefile~recmwf_aero.f90->sourcefile~phys_output_mod.f90 sourcefile~recmwf_aero.f90~2 recmwf_aero.F90 sourcefile~recmwf_aero.f90~2->sourcefile~phys_output_mod.f90 sourcefile~sw_aeroar4.f90~2 sw_aeroAR4.f90 sourcefile~sw_aeroar4.f90~2->sourcefile~phys_output_mod.f90 sourcefile~calfis.f90 calfis.f90 sourcefile~calfis.f90->sourcefile~callphysiq_mod.f90 sourcefile~sw_aeroar4.f90 sw_aeroAR4.f90 sourcefile~sw_aeroar4.f90->sourcefile~phys_output_mod.f90

Contents


Source Code

! $Id$
module regr_pr_comb_coefoz_m

  implicit none

  ! The five module variables declared here are on the partial
  ! "physics" grid.
  ! The value of each variable for index "(i, k)" is at longitude
  ! "rlon(i)", latitude "rlat(i)" and middle of layer "k".

  real, allocatable, save:: c_Mob(:, :)
  ! (sum of Mobidic terms in the net mass production rate of ozone
  ! by chemistry, per unit mass of air, in s-1)

  real, allocatable, save:: a2(:, :)
  ! (derivative of mass production rate of ozone per unit mass of
  ! air with respect to ozone mass fraction, in s-1)

  real, allocatable, save:: a4_mass(:, :)
  ! (derivative of mass production rate of ozone per unit mass of
  ! air with respect to temperature, in s-1 K-1)

  real, allocatable, save:: a6_mass(:, :)
  ! (derivative of mass production rate of ozone per unit mass of
  ! air with respect to mass column-density of ozone above, in m2 s-1 kg-1)

  real, allocatable, save:: r_het_interm(:, :)
  ! (net mass production rate by heterogeneous chemistry, per unit
  ! mass of ozone, corrected for chlorine content and latitude, but
  ! not for temperature and sun direction, in s-1)

  !$omp threadprivate(c_Mob, a2, a4_mass, a6_mass, r_het_interm)

contains

  subroutine alloc_coefoz

    ! This procedure is called once per run.
    ! It allocates module variables.

    use dimphy, only: klon
    use mod_grid_phy_lmdz, only: nbp_lev

    ! Variables local to the procedure:

    !---------------------------------------

    !$omp master
    print *, "Call sequence information: alloc_coefoz"
    !$omp end master
    allocate(c_Mob(klon, nbp_lev), a2(klon, nbp_lev), a4_mass(klon, nbp_lev))
    allocate(a6_mass(klon, nbp_lev), r_het_interm(klon, nbp_lev))

  end subroutine alloc_coefoz

  !*******************************************************

  subroutine regr_pr_comb_coefoz(julien, rlat, paprs, pplay)

    ! "regr_pr_comb_coefoz" stands for "regrid pressure combine
    ! coefficients ozone".

    ! In this subroutine:
    ! -- the master thread of the root process reads from a file all
    !    eight coefficients for ozone chemistry, at the current day;
    ! -- the coefficients are packed to the "physics" horizontal grid
    !    and scattered to all threads of all processes;
    ! -- in all the threads of all the processes, the coefficients are
    !    regridded in pressure to the LMDZ vertical grid;
    ! -- in all the threads of all the processes, the eight
    !    coefficients are combined to define the five module variables.

    use netcdf95, only: nf95_open, nf95_close
    use netcdf, only: nf90_nowrite
    use assert_m, only: assert
    use dimphy, only: klon
    use mod_phys_lmdz_mpi_data, only: is_mpi_root
    use regr_pr_time_av_m, only: regr_pr_time_av
    use regr_pr_int_m, only: regr_pr_int
    use press_coefoz_m, only: press_in_edg, plev
    use mod_grid_phy_lmdz, only: nbp_lev

    integer, intent(in):: julien ! jour julien, 1 <= julien <= 360

    REAL, intent(in):: rlat(:)
    ! (latitude on the partial "physics" grid, in degrees)

    real, intent(in):: paprs(:, :) ! (klon, nbp_lev + 1)
    ! (pression pour chaque inter-couche, en Pa)

    real, intent(in):: pplay(:, :) ! (klon, nbp_lev)
    ! (pression pour le mileu de chaque couche, en Pa)

    ! Variables local to the procedure:

    integer ncid ! for NetCDF

    real coefoz(klon, nbp_lev, 7)
    ! (temporary storage for 7 ozone coefficients)
    ! (On the partial "physics" grid.
    ! "coefoz(i, k, :)" is at longitude "rlon(i)", latitude "rlat(i)",
    ! middle of layer "k".)

    real a6(klon, nbp_lev)
    ! (derivative of "P_net_Mob" with respect to column-density of ozone
    ! above, in cm2 s-1)
    ! (On the partial "physics" grid.
    ! "a6(i, k)" is at longitude "rlon(i)", latitude "rlat(i)",
    ! middle of layer "k".)

    real, parameter:: amu = 1.6605402e-27 ! atomic mass unit, in kg

    real, parameter:: Clx = 3.8e-9
    ! (total chlorine content in the upper stratosphere)

    integer k

    !------------------------------------

    !!print *, "Call sequence information: regr_pr_comb_coefoz"
    call assert((/size(rlat), size(paprs, 1), size(pplay, 1)/) == klon, &
         "regr_pr_comb_coefoz klon")
    call assert((/size(paprs, 2) - 1, size(pplay, 2)/) == nbp_lev, &
         "regr_pr_comb_coefoz nbp_lev")

    !$omp master
    if (is_mpi_root) call nf95_open("coefoz_LMDZ.nc", nf90_nowrite, ncid)
    !$omp end master

    call regr_pr_time_av(ncid, (/"a2           ", "a4           ", "a6           ", &
         "P_net_Mob    ", "r_Mob        ", "temp_Mob     ", "R_Het        "/),      &
         REAL(julien-1), 'I', press_in_edg, paprs, coefoz)
    a2 = coefoz(:, :, 1)
    a4_mass = coefoz(:, :, 2) * 48. / 29.

    ! Compute "a6_mass" avoiding underflow, do not divide by 1e4
    ! before dividing by molecular mass:
    a6_mass = coefoz(:, :, 3) / (1e4 * 29. * amu)
    ! (factor 1e4: conversion from cm2 to m2)

    ! We can overwrite "coefoz(:, :, 1)", which was saved to "a2":
    call regr_pr_int(ncid, "Sigma_Mob", julien, plev, pplay, top_value=0., &
         v3=coefoz(:, :, 1))

    ! Combine coefficients to get "c_Mob":
    c_mob = (coefoz(:, :, 4) - a2 * coefoz(:, :, 5) &
         - coefoz(:, :, 3) * coefoz(:, :, 1)) * 48. / 29. &
         - a4_mass * coefoz(:, :, 6)

    r_het_interm = coefoz(:, :, 7)
    ! Heterogeneous chemistry is only at high latitudes:
    forall (k = 1: nbp_lev)
       where (abs(rlat) <= 45.) r_het_interm(:, k) = 0.
    end forall
    r_het_interm = r_het_interm * (Clx / 3.8e-9)**2

    !$omp master
    if (is_mpi_root) call nf95_close(ncid)
    !$omp end master

  end subroutine regr_pr_comb_coefoz

end module regr_pr_comb_coefoz_m