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