/[lmdze]/trunk/phylmd/Mobidic/regr_pr_comb_coefoz.f
ViewVC logotype

Diff of /trunk/phylmd/Mobidic/regr_pr_comb_coefoz.f

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

trunk/libf/phylmd/read_coefoz_m.f90 revision 3 by guez, Wed Feb 27 13:16:39 2008 UTC trunk/phylmd/Mobidic/regr_pr_comb_coefoz.f revision 90 by guez, Wed Mar 12 21:16:36 2014 UTC
# Line 1  Line 1 
1  module read_coefoz_m  module regr_pr_comb_coefoz_m
   
   ! This module is clean: no C preprocessor directive, no include line.  
2    
3    use dimens_m, only: llm    use dimens_m, only: llm
4    use dimphy, only: klon    use dimphy, only: klon
5    
6    implicit none    implicit none
7    
8    real, save:: c_Mob(klon, llm, 12)    ! The five module variables declared here are on the "physics" grid.
9      ! The value of each variable for index "(i, k)" is at longitude
10      ! "rlon(i)", latitude "rlat(i)" and middle of layer "k".
11    
12      real, save:: c_Mob(klon, llm)
13    ! (sum of Mobidic terms in the net mass production rate of ozone    ! (sum of Mobidic terms in the net mass production rate of ozone
14    ! by chemistry, per unit mass of air, in s-1)    ! by chemistry, per unit mass of air, in s-1)
   ! (On the "physics" grid.  
   ! Third dimension is the number of the month in the year.  
   ! "c_Mob(i, k, month)" is at longitude "rlon(i)", latitude "rlat(i)",  
   ! middle of layer "k".)  
15    
16    real, save:: a2(klon, llm, 12)    real, save:: a2(klon, llm)
17    ! (derivative of mass production rate of ozone per unit mass of    ! (derivative of mass production rate of ozone per unit mass of
18    ! air with respect to ozone mass fraction, in s-1)    ! air with respect to ozone mass fraction, in s-1)
   ! (On the "physics" grid.  
   ! Third dimension is the number of the month in the year.  
   ! "a2(i, k, month)" is at longitude "rlon(i)", latitude "rlat(i)",  
   ! middle of layer "k".)  
19    
20    real, save:: a4_mass(klon, llm, 12)    real, save:: a4_mass(klon, llm)
21    ! (derivative of mass production rate of ozone per unit mass of    ! (derivative of mass production rate of ozone per unit mass of
22    ! air with respect to temperature, in s-1 K-1)    ! air with respect to temperature, in s-1 K-1)
   ! (On the "physics" grid.  
   ! Third dimension is the number of the month in the year.  
   ! "a4_mass(i, k, month)" is at longitude "rlon(i)", latitude "rlat(i)",  
   ! middle of layer "k".)  
23    
24    real, save:: a6_mass(klon, llm, 12)    real, save:: a6_mass(klon, llm)
25    ! (derivative of mass production rate of ozone per unit mass of    ! (derivative of mass production rate of ozone per unit mass of
26    ! air with respect to mass column-density of ozone above, in m2 s-1 kg-1)    ! air with respect to mass column-density of ozone above, in m2 s-1 kg-1)
   ! (On the "physics" grid.  
   ! Third dimension is the number of the month in the year.  
   ! "a6_mass(i, k, month)" is at longitude "rlon(i)", latitude "rlat(i)",  
   ! middle of layer "k".)  
27    
28    real, save:: r_het_interm(klon, llm, 12)    real, save:: r_het_interm(klon, llm)
29    ! (net mass production rate by heterogeneous chemistry, per unit    ! (net mass production rate by heterogeneous chemistry, per unit
30    ! mass of ozone, corrected for chlorine content and latitude, but    ! mass of ozone, corrected for chlorine content and latitude, but
31    ! not for temperature and sun direction, in s-1)    ! not for temperature and sun direction, in s-1)
   ! (On the "physics" grid.  
   ! Third dimension is the number of the month in the year.  
   ! "r_het_interm(i, k, month)" is at longitude "rlon(i)", latitude "rlat(i)",  
   ! middle of layer "k".)  
32    
33    private klon, llm    private klon, llm
34    
35  contains  contains
36    
37    subroutine read_coefoz    subroutine regr_pr_comb_coefoz(julien)
38    
39      ! This subroutine reads from a file all eight parameters for ozone      ! "regr_pr_comb_coefoz" stands for "regrid pressure combine
40      ! chemistry, at all months.      ! coefficients ozone".
     ! The parameters are packed to the "physics" grid.  
     ! Finally, the eight parameters are combined to define the five  
     ! module variables.  
41    
42      use netcdf95, only: nf95_open, nf95_close, nf90_nowrite      ! This subroutine :
43      use o3_Mob_ph_m, only: o3_Mob_ph      ! -- reads from a file all eight coefficients for ozone chemistry,
44        !    at the current day ;
45        ! -- regrids the coefficients in pressure to the LMDZ vertical grid ;
46        ! -- packs the coefficients to the "physics" horizontal grid ;
47        ! -- combines the eight coefficients to define the five module variables.
48    
49        use netcdf, only: nf90_nowrite
50        use netcdf95, only: nf95_open, nf95_close
51      use phyetat0_m, only: rlat      use phyetat0_m, only: rlat
52        use regr_pr_av_m, only: regr_pr_av
53        use regr_pr_int_m, only: regr_pr_int
54    
55        integer, intent(in):: julien ! jour julien, 1 <= julien <= 360
56    
57      ! Variables local to the procedure:      ! Variables local to the procedure:
58    
59      integer ncid ! for NetCDF      integer ncid ! for NetCDF
60    
61      real a6(klon, llm, 12)      real coefoz(klon, llm)
62      ! (derivative of P_net_Mob with respect to column-density of ozone      ! (temporary storage for an ozone coefficient)
63        ! (On the "physics" grid.
64        ! "coefoz(i, k)" is at longitude "rlon(i)", latitude "rlat(i)",
65        ! middle of layer "k".)
66    
67        real a6(klon, llm)
68        ! (derivative of "P_net_Mob" with respect to column-density of ozone
69      ! above, in cm2 s-1)      ! above, in cm2 s-1)
70      ! (On the "physics" grid.      ! (On the "physics" grid.
71      ! Third dimension is the number of the month in the year.      ! "a6(i, k)" is at longitude "rlon(i)", latitude "rlat(i)",
     ! "a6(i, k, month)" is at longitude "rlon(i)", latitude "rlat(i)",  
72      ! middle of layer "k".)      ! middle of layer "k".)
73    
74      real, parameter:: amu = 1.6605402e-27 ! atomic mass unit, in kg      real, parameter:: amu = 1.6605402e-27 ! atomic mass unit, in kg
# Line 80  contains Line 76  contains
76      real, parameter:: Clx = 3.8e-9      real, parameter:: Clx = 3.8e-9
77      ! (total chlorine content in the upper stratosphere)      ! (total chlorine content in the upper stratosphere)
78    
79      integer k, month      integer k
80    
81      !------------------------------------      !------------------------------------
82    
83      print *, "Call sequence information: read_coefoz"      print *, "Call sequence information: regr_pr_comb_coefoz"
84    
85      call nf95_open("coefoz_LMDZ.nc", nf90_nowrite, ncid)      call nf95_open("coefoz_LMDZ.nc", nf90_nowrite, ncid)
86    
87      a2 = o3_Mob_ph(ncid, "a2")      call regr_pr_av(ncid, "a2", julien, a2)
88      a4_mass = o3_Mob_ph(ncid, "a4") * 48. / 29.  
89      a6 = o3_Mob_ph(ncid, "a6")      call regr_pr_av(ncid, "a4", julien, a4_mass)
90        a4_mass = a4_mass * 48. / 29.
91    
92        call regr_pr_av(ncid, "a6", julien, a6)
93    
94      ! Compute "a6_mass" avoiding underflow, do not divide by 1e4      ! Compute "a6_mass" avoiding underflow, do not divide by 1e4
95      ! before dividing by molecular mass:      ! before dividing by molecular mass:
96      a6_mass = a6 / (1e4 * 29. * amu)      a6_mass = a6 / (1e4 * 29. * amu)
97      ! (factor 1e4: conversion from cm2 to m2)      ! (factor 1e4: conversion from cm2 to m2)
98    
99      c_Mob = 48. / 29. * (o3_Mob_ph(ncid, "P_net_Mob") &      ! Combine coefficients to get "c_Mob":
100           - a2 * o3_Mob_ph(ncid, "r_Mob") - a6 * o3_Mob_ph(ncid, "Sigma_Mob")) &      ! (We use as few local variables as possible, in order to spare
101           - a4_mass * o3_Mob_ph(ncid, "temp_Mob")      ! main memory.)
102    
103        call regr_pr_av(ncid, "P_net_Mob", julien, c_Mob)
104    
105        call regr_pr_av(ncid, "r_Mob", julien, coefoz)
106        c_mob = c_mob - a2 * coefoz
107    
108        call regr_pr_int(ncid, "Sigma_Mob", julien, top_value=0., v3=coefoz)
109        c_mob = (c_mob - a6 * coefoz) * 48. / 29.
110    
111        call regr_pr_av(ncid, "temp_Mob", julien, coefoz)
112        c_mob = c_mob - a4_mass * coefoz
113    
114      r_het_interm = o3_Mob_ph(ncid, "R_Het") * (Clx / 3.8e-9)**2      call regr_pr_av(ncid, "R_Het", julien, r_het_interm)
115      ! Heterogeneous chemistry is only at high latitudes:      ! Heterogeneous chemistry is only at high latitudes:
116      forall (k = 1: llm, month = 1: 12)      forall (k = 1: llm)
117         where (abs(rlat) <= 45.) r_het_interm(:, k, month) = 0.         where (abs(rlat) <= 45.) r_het_interm(:, k) = 0.
118      end forall      end forall
119        r_het_interm = r_het_interm * (Clx / 3.8e-9)**2
120    
121      call nf95_close(ncid)      call nf95_close(ncid)
122    
123    end subroutine read_coefoz    end subroutine regr_pr_comb_coefoz
124    
125  end module read_coefoz_m  end module regr_pr_comb_coefoz_m

Legend:
Removed from v.3  
changed lines
  Added in v.90

  ViewVC Help
Powered by ViewVC 1.1.21