-
Notifications
You must be signed in to change notification settings - Fork 0
/
fv3interp2latlon.F90
57 lines (43 loc) · 1.46 KB
/
fv3interp2latlon.F90
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
!--------------------------------------------------------------------
PROGRAM fv3interp2latlon
use namelist_module
use tile_module
use latlon_module
IMPLICIT NONE
type tiletype
type(tilegrid), dimension(6) :: tile
end type tiletype
type(tiletype), dimension(max_types) :: types
type(latlongrid) :: latlon
integer :: n
logical :: last
call read_namelist('input.nml')
call initialize_latlongrid(nlon, nlat, npnt, latlon)
do n = 1, num_types
print *, 'dirname: <', trim(dirname), &
'>, data_types(', n, ') = <', trim(data_types(n)), '>'
call initialize_tilegrid(types(n)%tile, trim(dirname), trim(data_types(n)))
latlon%nlev = types(n)%tile(1)%nz
end do
if(generate_weights) then
call generate_weight(types(1)%tile, latlon)
call write_latlongrid(latlon, wgt_flnm)
else
call read_weights(latlon, wgt_flnm)
do n = 1, num_types
last = (n == num_types)
!print *, 'n = ', n
!print *, 'last = ', last
call generate_header(n, types(n)%tile, latlon, &
trim(data_types(n)), output_flnm, last)
end do
do n = 1, num_types
call interp2latlongrid(trim(data_types(n)), types(n)%tile, latlon)
end do
end if
do n = 1, num_types
call finalize_tilegrid(types(n)%tile)
end do
call closefile(latlon)
call finalize_latlongrid(latlon)
END PROGRAM fv3interp2latlon