source: trunk/LMDZ.GENERIC/libf/phystd/simpleprof_fn.F90 @ 304

Last change on this file since 304 was 253, checked in by emillour, 13 years ago

Generic GCM

  • Massive update to version 0.7

EM+RW

File size: 1.5 KB
Line 
1      subroutine simpleprof_fn(tsurf,temp,popsk,ISR,psurf)
2!     creates a kasting temperature profile
3use radcommon_h, only: sigma
4      implicit none
5
6#include "dimensions.h"
7#include "dimphys.h"
8#include "comcstfi.h"
9#include "callkeys.h"
10
11!      REAL play(nlayermx)   ! Pressure at the middle of the layers (Pa)
12!      REAL plev(nlayermx+1) ! intermediate pressure levels (pa)
13      REAL psurf,tsurf     
14      REAL temp(nlayermx)   ! temperature at the middle of the layers
15      real ISR, ALB
16
17      real popsk(nlayermx)  ! this is dodgy as in rest of code, zpopsk(ngridmx,nlayermx)
18                            ! but kastprof requires 1D, so its ok I guess
19      integer l,iter
20
21
22      if(startype.eq.1)then
23         ALB=0.2+0.1*log10(psurf/100000.)
24      else
25         ALB=0.15
26      end if
27
28      Tstrat=((1-ALB)*ISR/(2*sigma))**0.25 ! skin temperature (gray approx.)
29      !Tstrat=60.                           ! minimum possible given H2-H2 CIA
30      print*,'psurf',psurf/100000.
31      print*,'ALB',ALB
32      print*,'Tstrat=',Tstrat
33
34      if(ngridmx.gt.1)then
35         print*,'DO NOT RUN KASTPROF IN 3D!!!'
36         call abort
37      end if
38
39      ! 1st, we make pot. temperature constant everywhere
40      do l=1,nlayermx
41            temp(l)=tsurf*popsk(l)
42      enddo
43
44      if(1.eq.1)then
45
46      do l=1,nlayermx-1
47            if (temp(l) .le. Tstrat)then
48               temp(l) = Tstrat           
49            endif
50      enddo
51
52      temp(nlayermx) = Tstrat
53
54      endif
55
56   
57   return
58 end subroutine simpleprof_fn
Note: See TracBrowser for help on using the repository browser.