source: trunk/LMDZ.VENUS/libf/phyvenus/sw_venus_cl_1Dglobave.F @ 1452

Last change on this file since 1452 was 1442, checked in by slebonnois, 10 years ago

SL: update of the Venus GCM, + corrections on routines used for newstart/start2archive for Titan and Venus, + some modifications on tools

File size: 4.4 KB
Line 
1      SUBROUTINE SW_venus_cl_1Dglobave(PRMU0, PFRAC,
2     S              PPB, pt,
3     S              PHEAT,
4     S              PTOPSW,PSOLSW,ZFSNET)
5     
6      use dimphy
7      use cpdet_mod, only: cpdet
8      IMPLICIT none
9
10#include "dimensions.h"
11#include "YOMCST.h"
12C
13C     ------------------------------------------------------------------
14C
15C     PURPOSE.
16C     --------
17C
18c      this routine loads and interpolates the shortwave radiation
19c     fluxes taken from Chris Lee calculations for Venus.
20c     Ref: Lee and Richardson 2011
21C
22C     AUTHOR.
23C     -------
24C        Sebastien Lebonnois
25C
26C     MODIFICATIONS.
27C     --------------
28C        ORIGINAL : 11/2014
29C     ------------------------------------------------------------------
30C
31C* ARGUMENTS:
32C
33c inputs
34
35      REAL   PRMU0  ! COSINE OF ZENITHAL ANGLE
36      REAL   PFRAC  ! fraction de la journee
37      REAL   PPB(klev+1)  ! inter-couches PRESSURE (bar)
38      REAL   pt(klev)     ! mid-layer temperature
39C
40c output
41
42      REAL   PHEAT(klev)  ! SHORTWAVE HEATING (K/s) within each layer
43      REAL   PTOPSW       ! SHORTWAVE FLUX AT T.O.A. (net)
44      REAL   PSOLSW       ! SHORTWAVE FLUX AT SURFACE (net)
45      REAL   ZFSNET(klev+1) ! net solar flux at ppb levels
46
47C
48C* LOCAL VARIABLES:
49C
50      integer nlcl,nszacl
51      parameter (nlcl=80)  ! fichiers Crisp
52      parameter (nszacl=18) ! fichiers Crisp
53     
54      integer i,j,nsza,nsza0,nl0
55      real   solarrate               ! solar heating rate (K/earthday)
56      real   zsnet(nlcl+1,nszacl)    ! net solar flux (W/m**2) (+ vers bas)
57      real   zsdn,zsup               ! downward/upward solar flux (W/m**2)
58      real   solza(nszacl)           ! solar zenith angles in table
59      real   prescl(nlcl+1)          ! pressure levels in table (bar)
60      real   tempcl(nlcl+1)          ! temperature in table (K)
61      real   altcl(nlcl+1)           ! altitude in table (km)
62      real   coolrate                ! IR heating rate (K/earthday) ?
63      real   totalrate               ! total rate (K/earthday)
64      real   zsolnet(nlcl+1)         ! for testing mean net solar flux in CL
65      character*22 nullchar
66      real   sza0,factflux
67      real   zlnet,tmpzsnet(nszacl),deltasza
68      logical firstcall
69      data    firstcall/.true./
70      save   solza,zsnet,prescl,tempcl,altcl,zsolnet
71      save   firstcall
72     
73c ------------------------
74c Loading the file
75c ------------------------
76
77      if (firstcall) then
78
79       do nsza=1,nszacl
80          solza(nsza)=(nsza-1)*5.
81       enddo
82       
83       open(11,file='CLee-SW.dat')
84       read(11,*) nullchar
85       
86       do i=1,nlcl+1
87        read(11,'(4(F10.4,1x),18(F11.4,1x))')
88     .          altcl(i),prescl(i),tempcl(i),zlnet,tmpzsnet
89c change of sign convention:
90        zsnet(i,:)=tmpzsnet*(-1.)
91        prescl(i)=prescl(i)*1.e-5 ! conversion to bars...
92       enddo
93
94       close(11)
95
96c ----------- TEST ------------
97c      Moyenne planetaire
98c -----------------------------
99     
100      deltasza=(solza(2)-solza(1))*RPI/180.
101
102      do j=1,nlcl+1
103        zsolnet(j) = zsnet(j,1)*deltasza*deltasza/16.
104        do nsza=2,nszacl
105        zsolnet(j) = zsolnet(j)+zsnet(j,nsza)*0.5*deltasza*
106     .             sin(solza(nsza)*RPI/180.)
107        enddo
108c        print*,j,altcl(j),zsolnet(j)
109      enddo
110c      stop
111c -----------------------------
112c --------  FIN TEST ----------
113
114       firstcall=.false.
115      endif
116
117c --------------------------------------
118c Interpolation in the GCM vertical grid
119c --------------------------------------
120
121c Pressure levels
122c ---------------
123
124      do j=1,klev+1
125        nl0 = 2
126        do i=1,nlcl
127           if (prescl(i).ge.PPB(j)) then
128                nl0 = i+1
129           endif
130        enddo
131       
132        factflux = (log10(max(PPB(j),prescl(nlcl+1)))
133     .                          -log10(prescl(nl0-1)))
134     .            /(log10(prescl(nl0))-log10(prescl(nl0-1)))
135        ZFSNET(j) =  factflux     *zsolnet(nl0)
136     .             + (1.-factflux)*zsolnet(nl0-1)
137       
138      enddo
139
140      PTOPSW = ZFSNET(klev+1)
141      PSOLSW = ZFSNET(1)
142     
143c Heating rates
144c -------------
145c On utilise le gradient du flux pour calculer le taux de chauffage:
146c   heat(K/s) = d(fluxnet)  (W/m2)
147c              *g           (m/s2)
148c              /(-dp)  (epaisseur couche, en Pa=kg/m/s2)
149c              /cp  (J/kg/K)
150
151      do j=1,klev
152! ADAPTATION GCM POUR CP(T)
153        PHEAT(j) = (ZFSNET(j+1)-ZFSNET(j))
154     .            *RG/cpdet(pt(j)) / ((PPB(j)-PPB(j+1))*1.e5)
155      enddo
156
157      return
158      end
159
Note: See TracBrowser for help on using the repository browser.