source: trunk/LMDZ.VENUS/libf/phyvenus/nlthermeq.F @ 3884

Last change on this file since 3884 was 3835, checked in by ikovalenko, 5 months ago
File size: 2.1 KB
Line 
1      subroutine nlthermeq(nlon, nlayer, pplev, pplay)
2c
3c  Compute the number of layers nlaylte (stored in common yomlw.h)
4c  over which local thermodynamic equilibrium
5c  radiation scheme should be run to be sure of covering at least to a
6c  height greater than (pressure lower than) p=pminte, set in nlteparams.h.
7c  The maximum layer needed is found for the worst possible case.
8c  Stephen Lewis 6/2000
9c  Modified Y. Wanherdrick/ F. Forget 09/2000
10      use dimphy
11      use clesphys_mod
12      implicit none
13c#include "dimradmars.h"
14#include "nlteparams.h"
15c#include "yomlw.h"
16c#include "clesphys.h"
17
18c
19c     Input:
20      integer nlon, nlayer
21      real pplev(nlon, nlayer+1)
22      real pplay(nlon, nlayer)
23c
24c     Local:
25      integer igpmax, ismax
26      logical firstcall
27      data firstcall /.true./
28      save firstcall, igpmax
29
30
31      INTEGER i,ix
32      real sxmax
33
34ccc     
35      if(firstcall) then
36c     Find the location of maximum surface pressure.
37c     Location won't vary much so only do it at the start;
38c     with no topography location would vary, but this is only
39c     needed for an estimate so any point would do in that case.
40      ismax=1 
41      sxmax=pplev(1,1)
42      ix=1
43        do i=1,nlon-1
44         if(pplev(i,ix).gt.sxmax) then
45           sxmax=pplev(i,ix)
46           ismax=i+1
47         endif
48       enddo
49
50
51         igpmax = ismax            ! longitude/ latitude where pression is maximum
52         write(*, 10) ptrans
53         write(*, 20) zw
54         write(*, 30) pminte
55         firstcall = .false.
56      endif
57
58      IF(callnlte .or. callnirco2) THEN
59c       Find first layer above pminte at this location
60        do nlaylte = nlayer, 1, -1
61      if (pplay(igpmax, nlaylte).gt.pminte)  go to 100
62        enddo
63      ELSE
64        nlaylte=nlayer       
65      END IF
66
67c
68 100    return
69c
70
71   10 format(' nlthermeq: transition to NLTE centred at ',f6.2,'Pa')
72   20 format('               half-width (scale heights) ',f6.2)
73   30 format('          suggested LTE coverage at least ',f6.2,'Pa')
74   40 format(' nlthermeq: purely NLTE contribution over (nlayer) ',f6.4)
75
76      end
Note: See TracBrowser for help on using the repository browser.