| 1 | subroutine nlthermeq(nlon, nlayer, pplev, pplay) |
|---|
| 2 | c |
|---|
| 3 | c Compute the number of layers nlaylte (stored in common yomlw.h) |
|---|
| 4 | c over which local thermodynamic equilibrium |
|---|
| 5 | c radiation scheme should be run to be sure of covering at least to a |
|---|
| 6 | c height greater than (pressure lower than) p=pminte, set in nlteparams.h. |
|---|
| 7 | c The maximum layer needed is found for the worst possible case. |
|---|
| 8 | c Stephen Lewis 6/2000 |
|---|
| 9 | c Modified Y. Wanherdrick/ F. Forget 09/2000 |
|---|
| 10 | use dimphy |
|---|
| 11 | implicit none |
|---|
| 12 | #include "dimensions.h" |
|---|
| 13 | c#include "dimradmars.h" |
|---|
| 14 | #include "nlteparams.h" |
|---|
| 15 | c#include "yomlw.h" |
|---|
| 16 | #include "clesphys.h" |
|---|
| 17 | |
|---|
| 18 | c |
|---|
| 19 | c Input: |
|---|
| 20 | integer nlon, nlayer |
|---|
| 21 | real pplev(nlon, nlayer+1) |
|---|
| 22 | real pplay(nlon, nlayer) |
|---|
| 23 | c |
|---|
| 24 | c 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 | |
|---|
| 34 | ccc |
|---|
| 35 | if(firstcall) then |
|---|
| 36 | c Find the location of maximum surface pressure. |
|---|
| 37 | c Location won't vary much so only do it at the start; |
|---|
| 38 | c with no topography location would vary, but this is only |
|---|
| 39 | c 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 |
|---|
| 59 | c 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 | |
|---|
| 67 | c write(*,*) 'LTE rad. calculations up to layer ', nlaylte |
|---|
| 68 | |
|---|
| 69 | c |
|---|
| 70 | 100 return |
|---|
| 71 | c |
|---|
| 72 | |
|---|
| 73 | 10 format(' nlthermeq: transition to NLTE centred at ',f6.2,'Pa') |
|---|
| 74 | 20 format(' half-width (scale heights) ',f6.2) |
|---|
| 75 | 30 format(' suggested LTE coverage at least ',f6.2,'Pa') |
|---|
| 76 | 40 format(' nlthermeq: purely NLTE contribution over (nlayer) ',f6.2) |
|---|
| 77 | |
|---|
| 78 | end |
|---|