source: trunk/libf/phyvenus/load_ksi.F @ 91

Last change on this file since 91 was 3, checked in by slebonnois, 15 years ago

Creation de repertoires:

  • chantiers : pour communiquer sur nos projets de modifs
  • documentation : pour stocker les docs

Ajout de:

  • libf/phytitan : physique de Titan
  • libf/chimtitan: chimie de Titan
  • libf/phyvenus : physique de Venus
File size: 3.8 KB
RevLine 
[3]1      SUBROUTINE load_ksi(ksive)
2     
3      IMPLICIT none
4
5#include "dimensions.h"
6#include "dimphy.h"
7#include "raddim.h"
8#include "YOMCST.h"
9#include "comcstVE.h"
10C
11C     ------------------------------------------------------------------
12C
13C     PURPOSE.
14C     --------
15C
16c     This routine loads the longwave matrix of factors Ksi
17c     
18c     The Ksi matrixes have been computed by Vincent Eymet
19C
20C     AUTHOR.
21C     -------
22C        Sebastien Lebonnois
23C
24C     MODIFICATIONS.
25C     --------------
26C        version multimatrice (topographie, sommet nuages): 20/12/2006
27C     ------------------------------------------------------------------
28C
29C* ARGUMENTS:
30C
31c inputs
32      real   psurf(klon)           ! Surface pressure
33      real   ztop(klon)            ! Altitude of the top of cloud deck (km)
34c outputs
35      real   ksive(0:kflev+1,0:kflev+1,nnuve,nbmat)  ! ksi matrixes in Vincent's file
36
37c local variables
38      integer i,j,ig,band,pve
39      integer mat,Nb,m,Nmat,nl_init,mat0
40      parameter(nl_init=8)
41      character*9 tmp1
42      character*100 file
43      real   lambda(nnuve)            ! wavelenght in table (mu->m, middle of interval)
44      real   lambdamin(nnuve),lambdamax(nnuve) ! in microns
45      real   dlambda                  ! cm-1 
46
47c ------------------------
48c Loading the ksi file
49c ------------------------
50 
51       file = "ksi_global.txt"
52      open(10,file=file)
53     
54      do i=1,nl_init-1
55         read(10,*)
56      enddo
57      read(10,*) (tmp1,i=1,4),Nmat
58
59      if (nbmat.ne.Nmat) then
60         write(*,*) 'This is subroutine load_ksi'
61         print*,'Probleme de dimension entre ksi.txt et le param nbmat'
62         print*,'Nb matrices = ',nbmat,Nmat
63         stop
64      endif
65
66      do mat=1,nbmat
67        read(10,*)
68        read(10,*)
69        read(10,*) (tmp1,j=1,2),pve
70        psurfve(mat) = pve*1.e5  ! pve en bar, psurfve en Pa
71        read(10,*) (tmp1,j=1,7),ztopve(mat)
72        ztopve(mat) = ztopve(mat)*1.e-3 ! passage en km
73        read(10,*)
74        read(10,*) m,Nb
75        if (m.ne.nlve) then
76         write(*,*) 'This is subroutine load_ksi'
77         print*,'Probleme de dimension entre ksi.txt et le param nlve'
78         print*,'N levels = ',m,nlve
79         stop
80        endif
81        if (Nb.ne.nnuve) then
82         write(*,*) 'This is subroutine load_ksi'
83         print*,'Probleme de dimension entre ksi.txt et le param nnuve'
84         print*,'N freq = ',Nb,nnuve
85         stop
86        endif
87c     Now reading ksi matrix index "mat"
88        do band=1,Nb
89         read(10,*) lambdamin(band),lambdamax(band)
90         do i=0,m+1
91            read(10,'(100e17.9)') (ksive(i,j,band,mat),j=0,m+1) ! sr/µm/cm¯¹
92         enddo                  ! i
93        enddo                     ! band
94c       print*,"Matrice ",mat," lue"
95c       print*,"   psurf=",psurfve(mat)," bars, Ztop=",ztopve(mat)," km"
96      enddo  ! mat
97     
98      close(10)
99
100c longueur d'onde centrale et largeur de chaque bande
101      do band=1,nnuve
102         lambda(band)=(lambdamin(band)+lambdamax(band))/2.*1.e-6   ! en m
103         dlambda     =(1./lambdamin(band)-1./lambdamax(band))*1.e4 ! en cm-1
104c        print*,band,lambdamin(band),dlambda,lambdamax(band)
105
106c changement de convention (signe) pour ksi,
107c et prise en compte de la largeur de bande (en cm-1):
108         do mat=1,nbmat
109         do i=0,nlve+1
110           do j=0,nlve+1
111              ksive(i,j,band,mat) = -ksive(i,j,band,mat)*dlambda
112           enddo
113         enddo
114         enddo
115c calcul des coeff al et bl pour luminance Planck
116         al(band) = 2.*RHPLA*RCLUM*RCLUM/(lambda(band))**5.
117c cette luminance doit etre en W/m²/sr/µm pour correspondre au calcul
118c des ksi. Ici, elle est en W/m²/sr/m donc il faut mettre un facteur 1.e-6
119     .                * 1.e-6
120         bl(band) = RHPLA*RCLUM/(RKBOL*lambda(band))
121      enddo
122     
123      print*,"LOAD_KSI OK"
124
125      return
126      end
127
Note: See TracBrowser for help on using the repository browser.