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" |
---|
10 | C |
---|
11 | C ------------------------------------------------------------------ |
---|
12 | C |
---|
13 | C PURPOSE. |
---|
14 | C -------- |
---|
15 | C |
---|
16 | c This routine loads the longwave matrix of factors Ksi |
---|
17 | c |
---|
18 | c The Ksi matrixes have been computed by Vincent Eymet |
---|
19 | C |
---|
20 | C AUTHOR. |
---|
21 | C ------- |
---|
22 | C Sebastien Lebonnois |
---|
23 | C |
---|
24 | C MODIFICATIONS. |
---|
25 | C -------------- |
---|
26 | C version multimatrice (topographie, sommet nuages): 20/12/2006 |
---|
27 | C ------------------------------------------------------------------ |
---|
28 | C |
---|
29 | C* ARGUMENTS: |
---|
30 | C |
---|
31 | c inputs |
---|
32 | real psurf(klon) ! Surface pressure |
---|
33 | real ztop(klon) ! Altitude of the top of cloud deck (km) |
---|
34 | c outputs |
---|
35 | real ksive(0:kflev+1,0:kflev+1,nnuve,nbmat) ! ksi matrixes in Vincent's file |
---|
36 | |
---|
37 | c 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 | |
---|
47 | c ------------------------ |
---|
48 | c Loading the ksi file |
---|
49 | c ------------------------ |
---|
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 |
---|
87 | c 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 |
---|
94 | c print*,"Matrice ",mat," lue" |
---|
95 | c print*," psurf=",psurfve(mat)," bars, Ztop=",ztopve(mat)," km" |
---|
96 | enddo ! mat |
---|
97 | |
---|
98 | close(10) |
---|
99 | |
---|
100 | c 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 |
---|
104 | c print*,band,lambdamin(band),dlambda,lambdamax(band) |
---|
105 | |
---|
106 | c changement de convention (signe) pour ksi, |
---|
107 | c 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 |
---|
115 | c calcul des coeff al et bl pour luminance Planck |
---|
116 | al(band) = 2.*RHPLA*RCLUM*RCLUM/(lambda(band))**5. |
---|
117 | c cette luminance doit etre en W/m²/sr/µm pour correspondre au calcul |
---|
118 | c 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 | |
---|