source: trunk/LMDZ.MARS/libf/phymars/suaviza.F @ 481

Last change on this file since 481 was 414, checked in by aslmd, 14 years ago

LMDZ.MARS : NEW NLTE MODEL FROM GRANADA AMIGOS

23/11/11 == FGG + MALV

New parameterization of the NLTE 15 micron cooling. The old parameterization is kept as an option, including or not variable atomic oxygen concentration. A new flag is introduced in callphys.def, nltemodel, to select which parameterization wants to be used (new one, old one with variable [O], or old one with fixed [O], see below). Includes many new subroutines and commons in phymars. Some existing routines are also modified:

-physiq.F. Call to the new subroutine NLTE_leedat in first call. Call to nltecool modified to allow for variable atomic oxygen. Depending on the value of nltemodel, the new subroutine NLTEdlvr09_TCOOL is called instead of nltecool.

-inifis.F. Reading of nltemodel is added.

-callkeys.h Declaration of nltemodel is added.

The following lines should be added to callphys.def (ideally after setting callnlte):

# NLTE 15um scheme to use.
# 0-> Old scheme, static oxygen
# 1-> Old scheme, dynamic oxygen
# 2-> New scheme
nltemodel = 2

A new directory, NLTEDAT, has to be included in datagcm.

Improvements into NLTE NIR heating parameterization to take into account variability with O/CO2 ratio and SZA. A new subroutine, NIR_leedat.F, and a new common, NIRdata.h, are included. A new flag, nircorr, is added in callphys.def, to include or not these corrections. The following files are modified:

-nirco2abs.F: nq and pq are added in the arguments. The corrections factors are interpolated to the GCM grid and included in the clculation. A new subroutine, interpnir, is added at the end of the file.

-physiq.F: Call to NIR_leedat added at first call. Modified call to nirco2abs

-inifis: Reading new flag nircorr.

-callkeys.h: Declaration of nircorr.

The following lines have to be added to callphys.def (ideally after callnirco2):

# NIR NLTE correction for variable SZA and O/CO2?
# matters only if callnirco2=T
# 0-> no correction
# 1-> include correction
nircorr=1

A new data file, NIRcorrection_feb2011.dat, has to be included in datagcm.

Small changes to the molecular diffusion scheme to fix the number of species considered, to avoid problems when compiling with more than 15 tracers (for example, when CH4 is included). Modified subroutines: aeronomars/moldiff.F and aeronomars/moldiffcoeff.F

File size: 2.0 KB
Line 
1c*****************************************************************************
2c
3        subroutine suaviza ( x, n, ismooth, y )
4c
5c       x - input and return values
6c       y - auxiliary vector
7c       ismooth = 0  --> no smoothing is performed
8c       ismooth = 1  --> weak smoothing (5 points, centred weighted)
9c       ismooth = 2  --> normal smoothing (3 points, evenly weighted)
10c       ismooth = 3  --> strong smoothing (5 points, evenly weighted)
11
12
13c       malv  august 1991
14c*****************************************************************************
15
16        implicit none
17
18        integer n, imax, imin, i, ismooth
19        real*8  x(n), y(n)
20c*****************************************************************************
21
22        imin=1
23        imax=n
24
25        if (ismooth.eq.0) then
26
27          return
28
29        elseif (ismooth.eq.1) then       ! 5 points, with central weighting
30
31          do i=imin,imax
32            if(i.eq.imin)then
33              y(i)=x(imin)
34            elseif(i.eq.imax)then
35              y(i)=x(imax-1)+(x(imax-1)-x(imax-3))/2.d0
36            elseif(i.gt.(imin+1) .and. i.lt.(imax-1) )then
37              y(i) = ( x(i+2)/4.d0 + x(i+1)/2.d0 + 2.d0*x(i)/3.d0 +
38        1       x(i-1)/2.d0 + x(i-2)/4.d0 )* 6.d0/13.d0
39            else
40              y(i)=(x(i+1)/2.d0+x(i)+x(i-1)/2.d0)/2.d0
41            end if
42          end do       
43
44        elseif (ismooth.eq.2) then       ! 3 points, evenly spaced
45
46          do i=imin,imax
47            if(i.eq.imin)then
48              y(i)=x(imin)
49            elseif(i.eq.imax)then
50              y(i)=x(imax-1)+(x(imax-1)-x(imax-3))/2.d0
51            else
52              y(i) = ( x(i+1)+x(i)+x(i-1) )/3.d0
53            end if
54          end do       
55         
56        elseif (ismooth.eq.3) then           ! 5 points, evenly spaced
57
58          do i=imin,imax
59            if(i.eq.imin)then
60              y(i) = x(imin)
61            elseif(i.eq.(imin+1) .or. i.eq.(imax-1))then
62              y(i) = ( x(i+1)+x(i)+x(i-1) )/3.d0
63            elseif(i.eq.imax)then
64              y(i) = ( x(imax-1) + x(imax-1) + x(imax-2) ) / 3.d0
65            else
66              y(i) = ( x(i+2)+x(i+1)+x(i)+x(i-1)+x(i-2) )/5.d0
67            end if
68          end do       
69
70        else
71
72          write (*,*) ' Error in suaviza.f   Wrong ismooth value.'
73          stop
74
75        endif
76
77c rehago el cambio, para devolver x(i)
78        do i=imin,imax
79            x(i)=y(i)
80        end do
81
82        return
83        end
Note: See TracBrowser for help on using the repository browser.