source: trunk/LMDZ.MARS/libf/phymars/intersp.F @ 473

Last change on this file since 473 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: 1.6 KB
Line 
1c       ***********************************************************************
2        subroutine intersp(yy,zz,m,y,z,n,opt)
3c       interpolation soubroutine. input values: y(n) at z(n).
4c       output values: yy(m) at zz(m). options: 1 -> lineal; 2 -> logarithmic
5
6c       jul 2011 malv+fgg
7c       ***********************************************************************
8
9        implicit none
10
11        integer n,m,i,j,opt
12        real    zz(m),yy(m),z(n),y(n)
13        real    zmin,zzmin,zmax,zzmax
14
15!       write(*,*) ' interpolating'
16        call minsp(z,n,zmin)
17        call minsp(zz,m,zzmin)
18        call maxsp(z,n,zmax)
19        call maxsp(zz,m,zzmax)
20
21        if(zzmin.lt.zmin)then
22          write(*,*) 'from interp: new variable out of limits'
23          write(*,*) zzmin,'must be .ge. ',zmin
24          stop
25!       elseif(zzmax.gt.zmax)then
26!         write(*,*)'from interp: new variable out of limits'
27!         write(*,*)zzmax, 'must be .le. ',zmax
28!         stop
29        end if
30
31        do 1,i=1,m
32
33        do 2,j=1,n-1
34        if(zz(i).ge.z(j).and.zz(i).lt.z(j+1)) goto 3
35 2      continue
36c       in this case (zz(m).ge.z(n)) and j leaves the loop with j=n-1+1=n
37        if(opt.eq.1)then
38          yy(i)=y(n-1)+(y(n)-y(n-1))*(zz(i)-z(n-1))/(z(n)-z(n-1))
39        elseif(opt.eq.2)then
40          if(y(n).eq.0.0.or.y(n-1).eq.0.0)then
41                yy(i)=0.0
42          else
43                yy(i)=exp(log(y(n-1))+log(y(n)/y(n-1))*
44     @          (zz(i)-z(n-1))/(z(n)-z(n-1)))
45          end if
46        else
47          write(*,*)' from interp error: opt must be 1 or 2, opt= ',opt
48        end if
49        goto 1
50 3      continue
51        if(opt.eq.1)then
52          yy(i)=y(j)+(y(j+1)-y(j))*(zz(i)-z(j))/(z(j+1)-z(j))
53        elseif(opt.eq.2)then
54          if(y(j+1).eq.0.0.or.y(j).eq.0.0)then
55                yy(i)=0.0
56          else
57                yy(i)=exp(log(y(j))+log(y(j+1)/y(j))*
58     @          (zz(i)-z(j))/(z(j+1)-z(j)))
59          end if
60        else
61          write(*,*)' from interp error: opt must be 1 or 2, opt= ',opt
62        end if
63 1      continue
64
65        return
66        end
67
68
Note: See TracBrowser for help on using the repository browser.