-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_l2dm.F90
More file actions
67 lines (59 loc) · 2.06 KB
/
test_l2dm.F90
File metadata and controls
67 lines (59 loc) · 2.06 KB
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
57
58
59
60
61
62
63
64
65
66
67
!!for global
#include "inc_common.fpp"
program test_l2dm
use utility
use module_local
use module_local2dman
use module_types
implicit none
character(len=*),parameter :: PROCEDURE_NAME="test_l2dm"
integer,parameter :: nx=360, ny=181, nx2=80, ny2=41
real :: dx, dy, dx2, dy2
real :: xcoord(nx), ycoord(ny), x2(nx2), y2(ny2)
type(type_local2dman) :: l2dm, l2dm2
integer :: i
integer :: n_band, n_xmode=50, n_ymode=50
integer, allocatable :: yidx_bgn(:), yidx_end(:)
real,allocatable :: xl0(:), dy_ratio(:)
character(len=100),allocatable :: strline(:)
real :: yl0=7.5 !! in degree
TIME_START(timer_bgn)
dx=360./nx
dy=180./(ny-1)
call fspan(0., 360.-dx, nx, xcoord)
call fspan(-90., 90., ny, ycoord)
call local2dman_set_domain(l2dm, xcoord, ycoord)
call allocread_line("xmodes_xl0.txt", n_band, strline)
print*, "n_band=", n_band
allocate(xl0(n_band), yidx_bgn(n_band), yidx_end(n_band))
do i=1, n_band
read(strline(i), *) yidx_bgn(i), yidx_end(i), xl0(i)
end do
call local2dman_set_xmodes(l2dm, yidx_bgn, yidx_end, xl0, n_xmode, .true.)
allocate(dy_ratio(ny-1))
dy_ratio=1.
call local2dman_set_ymode(l2dm, dy_ratio, yl0, op_nmodes=n_ymode)
print*, "after set x&y"
TIME_CLICK(timer, timer_bgn, timer_last)
call local2dman_rownormalize_xy(l2dm)
print*, "after rownormalize"
TIME_CLICK(timer, timer_bgn, timer_last)
call local2dman_output(l2dm, "2dmodes")
print*, "after output"
TIME_CLICK(timer, timer_bgn, timer_last)
!!
call local2dman_dealloc(l2dm)
call local2dman_input(l2dm, "2dmodes")
print*, "after input"
TIME_CLICK(timer, timer_bgn, timer_last)
dx2=360./nx2
dy2=180./ny2
call fspan(0., 360.-dx2, nx2, x2)
call fspan(-90., 90., ny2, y2)
call local2dman_interp_togrid(l2dm, l2dm2, x2, y2, .true.)
print*, "after interp_togrid"
TIME_CLICK(timer, timer_bgn, timer_last)
call local2dman_output(l2dm2, "2dmodes_2")
print*, "after re-output"
TIME_CLICK(timer, timer_bgn, timer_last)
end program