source: trunk/LMDZ.MARS/libf/phymars/dust_scaling_mod.F90 @ 2642

Last change on this file since 2642 was 2634, checked in by abierjon, 3 years ago

Mars GCM:
Changes on dust_rad_adjust for GCM6:

  • put an upper limit on dust_rad_adjust to avoid skyrocketing values when there are strong diurnal variations of opacity
  • move the condition to compute dust_rad_adjust only once per time step before the whole call to compute_dust_rad_adjust, instead of repetitive local checks
  • some cleaning

AB

File size: 3.6 KB
Line 
1module dust_scaling_mod
2
3implicit none
4
5contains
6
7  subroutine compute_dustscaling(ngrid,nlayer,naerkind,naerdust, &
8                                 zday,pplev, &
9                                 tau_pref_scenario,tauscaling, &
10                                 dust_rad_adjust,aerosol)
11   
12    use dust_param_mod, only: dustscaling_mode, odpref
13    use dust_rad_adjust_mod, only: compute_dust_rad_adjust
14    use dimradmars_mod, only: iaerdust ! dust aerosol indexes
15   
16    implicit none
17   
18    integer,intent(in) :: ngrid ! number of atmospheric columns
19    integer,intent(in) :: nlayer ! number of atmospheric layers
20    integer,intent(in) :: naerkind ! total number of aerosols
21    integer,intent(in) :: naerdust ! number of dust aerosols
22    real,intent(in) :: zday
23    real,intent(in) :: pplev(ngrid,nlayer+1) ! inter-layer pressure (Pa)
24    real,intent(in) :: tau_pref_scenario(ngrid) ! prescribed visible dust
25                       ! opacity column at odpref reference pressure
26    real,intent(out) :: tauscaling(ngrid) ! dust scaling factor
27    real,intent(inout) :: dust_rad_adjust(ngrid) ! Radiative adjustment
28                          ! factor for dust
29    real,intent(inout) :: aerosol(ngrid,nlayer,naerkind) ! opacities
30   
31    integer :: ig, l , iaer
32    real :: taudust(ngrid)
33    real,save :: zday_prev_call=-666. ! stored value of zday from previous call
34!$OMP THREADPRIVATE(zday_prev_call)
35
36  ! 1. compute/set tauscaling
37
38    if (dustscaling_mode /= 1) then
39      ! simple "freedust" case, no effective rescaling using tauscaling, ever
40      tauscaling(:) = 1
41    endif
42   
43    if (dustscaling_mode == 1) then
44      ! Compute dust column opacity using aerosol() dusts
45      taudust(:) = 0
46      do iaer=1,naerdust ! loop on all dust aerosols
47        do l=1,nlayer
48          do ig=1,ngrid
49              taudust(ig)=taudust(ig)+aerosol(ig,l,iaerdust(iaer))
50          enddo
51        enddo
52      enddo
53
54    elseif (dustscaling_mode == 2) then
55      ! Compute dust column opacity using only background dust
56      taudust(:) = 0
57      do l=1,nlayer
58        do ig=1,ngrid
59            taudust(ig)=taudust(ig)+aerosol(ig,l,iaerdust(1))
60        enddo
61      enddo
62
63    endif ! of if (dustscaling_mode == 1) elseif (dustscaling_mode == 2)
64     
65  ! 2. compute the scaling factors (tauscaling or dust_rad_adjust)
66    if (dustscaling_mode==1) then
67      ! GCM v5.3 style: tauscaling is computed so that
68      ! aerosol() opacities correspond to the prescribed tau_pref_scenario()
69      tauscaling(:)=tau_pref_scenario(:)*pplev(:,1)/odpref/taudust(:)
70    elseif (dustscaling_mode==2) then
71      ! GCM v6 style, compute dust_rad_adjust
72      ! only when this routine is called for the first time
73      ! during this time step
74      if (zday/=zday_prev_call) then
75        call compute_dust_rad_adjust(ngrid,nlayer,zday,pplev, &
76                                     taudust,dust_rad_adjust)
77       endif ! of if (zday/=zday_prev_call)
78                                     
79      ! update zday_prev_call
80      zday_prev_call=zday
81    endif
82
83  ! 3. Apply dust aerosol opacities rescaling
84    if (dustscaling_mode <=1) then
85      do iaer=1,naerdust
86        do l=1,nlayer
87          do ig=1,ngrid
88            aerosol(ig,l,iaerdust(iaer)) = max(1E-20, &
89                      aerosol(ig,l,iaerdust(iaer))* tauscaling(ig))
90          enddo
91        enddo
92      enddo
93    else ! duscaling_mode==2, use dust_rad_adjust
94      do iaer=1,naerdust
95        do l=1,nlayer
96          do ig=1,ngrid
97            aerosol(ig,l,iaerdust(iaer)) = max(1E-20, &
98                      aerosol(ig,l,iaerdust(iaer))*dust_rad_adjust(ig))
99          enddo
100        enddo
101      enddo
102    endif
103  end subroutine compute_dustscaling
104
105end module dust_scaling_mod
Note: See TracBrowser for help on using the repository browser.