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

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