source: trunk/LMDZ.VENUS/libf/phyvenus/sw_venus_rh.F @ 1704

Last change on this file since 1704 was 1621, checked in by emillour, 8 years ago

Further work on full dynamics/physics separation.

LMDZ.COMMON:

  • added phy_common/vertical_layers_mod.F90 to store information on vertical grid. This is where routines in the physics should get the information.
  • The contents of vertical_layers_mod intialized via dynphy_lonlat/inigeomphy_mod.F90.

LMDZ.MARS:

  • physics now completely decoupled from dynamics; the physics package may now be compiled as a library (-libphy option of makelmdz_fcm).
  • created an "ini_tracer_mod" routine in module "tracer_mod" for a cleaner initialization of the later.
  • removed some purely dynamics-related outputs (etot0, zoom parameters, etc.) from diagfi.nc and stats.nc outputs as these informations are not available in the physics.

LMDZ.GENERIC:

  • physics now completely decoupled from dynamics; the physics package may now be compiled as a library (-libphy option of makelmdz_fcm).
  • added nqtot to tracer_h.F90.
  • removed some purely dynamics-related outputs (etot0, zoom parameters, etc.) from diagfi.nc and stats.nc outputs as these informations are not available in the physics.

LMDZ.VENUS:

  • physics now completely decoupled from dynamics; the physics package may now be compiled as a library (-libphy option of makelmdz_fcm).
  • added infotrac_phy.F90 to store information on tracers in the physics. Initialized via iniphysiq.
  • added cpdet_phy_mod.F90 to store t2tpot etc. functions to be used in the physics. Initialized via iniphysiq. IMPORTANT: there are some hard-coded constants! These should match what is in cpdet_mod.F90 in the dynamics.
  • got rid of references to moyzon_mod module within the physics. The required variables (tmoy, plevmoy) are passed to the physics as arguments to physiq.

LMDZ.TITAN:

  • added infotrac_phy.F90 to store information on tracers in the physics. Initialized via iniphysiq.
  • added cpdet_phy_mod.F90 to store t2tpot etc. functions to be used in the physics.
  • Extra work required to completely decouple physics and dynamics: moyzon_mod should be cleaned up and information passed from dynamics to physics as as arguments. Likewise moyzon_ch and moyzon_mu should not be queried from logic_mod (which is in the dynamics).

EM

File size: 6.1 KB
RevLine 
[1591]1      SUBROUTINE SW_venus_rh(PRMU0, PFRAC, latdeg,
2     S              PPB, pt,
3     S              PHEAT,
4     S              PTOPSW,PSOLSW,ZFSNET)
5     
6      use dimphy
[1621]7      use cpdet_phy_mod, only: cpdet
[1591]8      IMPLICIT none
9
10#include "YOMCST.h"
11C
12C     ------------------------------------------------------------------
13C
14C     PURPOSE.
15C     --------
16C
17c      this routine loads and interpolates the shortwave radiation
18c     fluxes taken from Rainer Haus calculations for Venus.
19c     Ref: Haus et al. 2016
20C
21C     AUTHOR.
22C     -------
23C        Sebastien Lebonnois
24C
25C     MODIFICATIONS.
26C     --------------
27C        ORIGINAL : 5/2016
28C     ------------------------------------------------------------------
29C
30C* ARGUMENTS:
31C
32c inputs
33
34      REAL   PRMU0  ! COSINE OF ZENITHAL ANGLE
35      REAL   PFRAC  ! fraction de la journee
36      REAL   latdeg ! |latitude| (in degrees)
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 nlrh,nszarh,nlatrh
51      parameter (nlrh=118)  ! fichiers Rainer Haus
52      parameter (nszarh=7) ! fichiers Rainer Haus
53      parameter (nlatrh=19) ! fichiers Rainer Haus
54     
55      integer i,j,lat,nsza,nsza0(2),nl0,nlat0
56      real   zsnet(nlrh+1,nszarh+1,nlatrh+1)! net solar flux (W/m**2) (+ vers bas)
57      real   solza(nszarh,nlatrh)       ! solar zenith angles in table
58      real   presrh(nlrh+1)             ! pressure in table (bar)
59      real   altrh(nlrh+1)              ! altitude in table (km)
60      real   latrh(nlatrh)              ! latitude in table (degrees)
61      character*22 nullchar
62      real   sza0,factsza(2),factflux,factlat
63      real   zsnetmoy
64      logical firstcall
65      data    firstcall/.true./
66      save   solza,zsnet,altrh,latrh,presrh
67      save   firstcall
68     
69c ------------------------
70c Loading the file
71c ------------------------
72
73      if (firstcall) then
74
75       zsnet=0.
76
77       open(11,file='SolarNetFlux_RH.dat')
78
79       do i=1,nlrh+1
80          read(11,'(E5.1,4x,F8.2)') altrh(i),presrh(i)
81       enddo
82
83       do lat=1,nlatrh
84         latrh(lat)=5.*(lat-1)
85         read(11,*) nullchar
86         read(11,*) nullchar
87         read(11,'(3x,7(5x,E8.5))') solza(:,lat)
88         read(11,*) nullchar
89
90         do i=1,nlrh+1
91          read(11,'(E6.1,7(2x,F11.5),7x,F11.5)')
92     .          altrh(i),zsnet(i,1:nszarh,lat),zsnetmoy
93         enddo
94         read(11,*) nullchar
95       enddo
96       latrh(nlatrh)=89.
97
98c Correction of factor 2 in the table...
99       zsnet=zsnet*2.
100
101       close(11)
102
103       firstcall=.false.
104      endif
105
106c --------------------------------------
107c Interpolation in the GCM vertical grid
108c --------------------------------------
109
110c Latitude
111c ---------
112     
113      do lat=1,nlatrh
114         if (latrh(lat).le.latdeg) then
115              nlat0 = lat+1
116         endif
117      enddo
118     
119      if (nlat0.ne.nlatrh+1) then
120        factlat = (latdeg-latrh(nlat0-1))/(latrh(nlat0)-latrh(nlat0-1))
121      else
122        factlat = min((latdeg-latrh(nlatrh))/(90.-latrh(nlatrh)), 1.)
123      endif
124
125c Zenith angle
126c ------------
127     
128      sza0 = acos(PRMU0)/3.1416*180.
129c        print*,'Angle Zenithal =',sza0,' PFRAC=',PFRAC
130      nsza0(:)=2
131
132      do nsza=1,nszarh
133         if (solza(nsza,nlat0-1).le.sza0) then
134              nsza0(1) = nsza+1
135         endif
136      enddo
137     
138      if (nsza0(1).ne.nszarh+1) then
139          factsza(1) = (sza0-solza(nsza0(1)-1,nlat0-1))/
140     .        (solza(nsza0(1),nlat0-1)-solza(nsza0(1)-1,nlat0-1))
141      else
142          factsza(1) = min((sza0-solza(nszarh,nlat0-1))/
143     .         (90.-solza(nszarh,nlat0-1)), 1.)
144      endif
145
146      if (nlat0.ne.nlatrh+1) then
147       do nsza=1,nszarh
148         if (solza(nsza,nlat0).le.sza0) then
149              nsza0(2) = nsza+1
150         endif
151       enddo
152     
153       if (nsza0(2).eq.nszarh+1) then
154          factsza(2) = min((sza0-solza(nszarh,nlat0))/
155     .         (90.-solza(nszarh,nlat0)), 1.)
156       elseif ((nsza0(2).eq.2).and.(solza(1,nlat0).gt.sza0)) then
157          factsza(2) = 0.
158       else
159          factsza(2) = (sza0-solza(nsza0(2)-1,nlat0))/
160     .        (solza(nsza0(2),nlat0)-solza(nsza0(2)-1,nlat0))
161       endif
162      else
163        nsza0(2)   = nszarh+1
164        factsza(2) = 1.
165      endif
166
167c Pressure levels
168c ---------------
169
170      do j=1,klev+1
171        nl0 = nlrh
172        do i=nlrh+1,2,-1
173           if (presrh(i).ge.PPB(j)) then
174                nl0 = i-1
175           endif
176        enddo
177
178        factflux = (log10(max(PPB(j),presrh(1)))-log10(presrh(nl0+1)))
179     .            /(log10(presrh(nl0))-log10(presrh(nl0+1)))
180
181        ZFSNET(j) =  factlat*(
182     .      factflux   *  factsza(2)   *zsnet(nl0,nsza0(2),nlat0)
183     . +   factflux   *(1.-factsza(2))*zsnet(nl0,nsza0(2)-1,nlat0)
184     . + (1.-factflux)*  factsza(2)   *zsnet(nl0+1,nsza0(2),nlat0)
185     . + (1.-factflux)*(1.-factsza(2))*zsnet(nl0+1,nsza0(2)-1,nlat0) )
186     .            + (1.-factlat)*(
187     .      factflux   *  factsza(1)   *zsnet(nl0,nsza0(1),nlat0-1)
188     . +   factflux   *(1.-factsza(1))*zsnet(nl0,nsza0(1)-1,nlat0-1)
189     . + (1.-factflux)*  factsza(1)   *zsnet(nl0+1,nsza0(1),nlat0-1)
190     . + (1.-factflux)*(1.-factsza(1))*zsnet(nl0+1,nsza0(1)-1,nlat0-1) )
191
192        ZFSNET(j) = ZFSNET(j)*PFRAC
193       
194      enddo
195
196      PTOPSW = ZFSNET(klev+1)
197      PSOLSW = ZFSNET(1)
198     
199c Heating rates
200c -------------
201c On utilise le gradient du flux pour calculer le taux de chauffage:
202c   heat(K/s) = d(fluxnet)  (W/m2)
203c              *g           (m/s2)
204c              /(-dp)  (epaisseur couche, en Pa=kg/m/s2)
205c              /cp  (J/kg/K)
206
207      do j=1,klev
208! ADAPTATION GCM POUR CP(T)
209        PHEAT(j) = (ZFSNET(j+1)-ZFSNET(j))
210     .            *RG/cpdet(pt(j)) / ((PPB(j)-PPB(j+1))*1.e5)
211c-----TEST-------
212c tayloring the solar flux...
213        if ((PPB(j).gt.1.4).and.(PPB(j).le.10.)) then
214          PHEAT(j) = PHEAT(j)*3
215        endif
216c----------------
217      enddo
218
219      return
220      end
221
Note: See TracBrowser for help on using the repository browser.