source: LMDZ5/branches/LF-private/libf/cosp/load_mie_table.F90 @ 5456

Last change on this file since 5456 was 1279, checked in by Laurent Fairhead, 15 years ago

Merged LMDZ4-dev branch changes r1241:1278 into the trunk
Running trunk and LMDZ4-dev in LMDZOR configuration on local
machine (sequential) and SX8 (4-proc) yields identical results
(restart and restartphy are identical binarily)
Log history from r1241 to r1278 is available by switching to
source:LMDZ4/branches/LMDZ4-dev-20091210

File size: 1.5 KB
Line 
1  subroutine load_mie_table(mie_table_name,mt)
2  use radar_simulator_types
3  implicit none
4 
5! Purpose:
6!   Loads the Mie table data
7!   Part of Quickbeam v1.03
8!   http://reef.atmos.colostate.edu/haynes/radarsim
9!
10! Inputs: 
11!   [mie_table_name]   Mie table input file
12!
13! Outputs:
14!   [mt]            structure of Mie table data
15!
16! Created from Quickbeam v1.02 08/24/2006 by Roger Marchand 
17
18! ----- INPUT -----
19  character*200, intent(in) :: mie_table_name
20
21! ----- OUTPUT -----
22  type(mie), intent(out) :: mt
23
24! ----- INTERNAL ----- 
25  integer :: i
26
27  integer*4 :: dummy_in(4)
28       
29    open(51,file=mie_table_name,action='read')
30 
31    read(51,*) dummy_in
32
33        if(dummy_in(1).ne. mt_nfreq .or. &
34           dummy_in(2).ne. mt_ntt .or. &
35           dummy_in(3).ne. mt_nf .or. &
36           dummy_in(4).ne. mt_nd) then
37
38                print *,'Mie file is of size :',dummy_in(:)
39                print *,'  expected a size of:',mt_nfreq, mt_ntt,mt_nf,mt_nf
40                print *,'  change paramters in radar_simulator_types.f90 ?? '
41                stop
42        endif
43
44    read(51,*) mt%freq
45    read(51,*) mt%tt
46    read(51,*) mt%f
47    read(51,*) mt%phase
48    read(51,*) mt%D
49    read(51,*) mt%qext
50    read(51,*) mt%qbsca
51   
52    close(51)
53
54! // create arrays of liquid/ice temperature
55  cnt_liq = 0
56  cnt_ice = 0
57  do i=1,mt_ntt
58    if (mt%phase(i) == 0) cnt_liq = cnt_liq + 1
59    if (mt%phase(i) == 1) cnt_ice = cnt_ice + 1
60  enddo
61  allocate(mt_ttl(cnt_liq),mt_tti(cnt_ice))
62  do i=1,cnt_liq
63    mt_ttl(i) = mt%tt(i)
64  enddo
65  do i=1,cnt_ice
66    mt_tti(i) = mt%tt(cnt_liq+i)
67  enddo
68
69  end subroutine load_mie_table
Note: See TracBrowser for help on using the repository browser.