-
Notifications
You must be signed in to change notification settings - Fork 1
/
vector2tile_driver.f90
55 lines (38 loc) · 1.4 KB
/
vector2tile_driver.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
program vector2tile_driver
use namelist_mod
use vector2tile_restart_mod
use vector2tile_perturbation_mod
implicit none
type(namelist_type) :: namelist
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
! Get namelist file name from command line
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
call get_command_argument(1, namelist%namelist_name)
if(namelist%namelist_name == "") then
print *, "add namelist to the command line: "
stop 10
endif
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
! Read namelist information
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
call ReadNamelist(namelist)
print*, "conversion direction: ",namelist%direction
if(namelist%direction /= "tile2vector" .and. namelist%direction /= "vector2tile" .and. &
namelist%direction /= "lndp2vector" .and. namelist%direction /= "lndp2tile") then
print*, "conversion direction: ",namelist%direction, " not recognized"
stop 10
end if
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
! Decide the pathway
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
select case (namelist%direction)
case ("tile2vector", "vector2tile")
write(*,*) "Option: "//trim(namelist%direction)
call vector2tile_restart(namelist)
case ("lndp2vector", "lndp2tile")
write(*,*) "Option: "//trim(namelist%direction)
call mapping_perturbation(namelist)
case default
write(*,*) "choose a valid conversion direction"
end select
end program vector2tile_driver