Newer
Older
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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
!*****************************************************************!
!* *!
!* 4C (FORESEE) Simulation Model *!
!* *!
!* *!
!* Subroutines for: *!
!* *!
!* Contains the following subroutines: *!
!* *!
!* PREPARE_GLOBAL: general preparation of simulation *!
!* contains internal subroutines: *!
!* TOPMENU: main menu *!
!* EDITSIM: edit simulation file names *!
!* *!
!* Copyright (C) 1996-2018 *!
!* Potsdam Institute for Climate Impact Reserach (PIK) *!
!* Authors and contributors see AUTHOR file *!
!* This file is part of 4C and is licensed under BSD-2-Clause *!
!* See LICENSE file or under: *!
!* http://www.https://opensource.org/licenses/BSD-2-Clause *!
!* Contact: *!
!* https://gitlab.pik-potsdam.de/foresee/4C *!
!* *!
!*****************************************************************!
SUBROUTINE prepare_global
use data_simul
use data_out
use data_species
use data_stand
use data_site
use data_tsort
use data_climate
implicit none
character anf
logical ex
! main menu
DO
call topmenu
if (anf == '2') then
call editsim
call testfile(simfile,ex)
if(ex .eqv. .false.) cycle
call readsim
if (flag_mult910) print *,' Check the data from file:'
ELSE if (anf == '1' .or. anf == ' ') then
call testfile(simfile,ex)
if(ex .eqv. .false.) cycle
call readsim
if (flag_mult910) print *,' Check the data from file:'
end if
if (ex .eqv. .true.) exit
end DO
call outtest
contains
!---------------------------------------------------------------
SUBROUTINE topmenu
print *,' ****************************************************'
print *,' **************** Welcome to 4C *******************'
print *,' ****************************************************'
print *,' '
print *,' 1 <Enter>.. Start with default simulation control: ',trim(simfile)
print *,' '
print *,' 2...........Edit simulation control file name'
print *,' '
print *,' ****************************************************'
write(*,'(A)',advance='no') ' Make your choice: '
read(*,'(A)') anf
END subroutine topmenu
!-----------------------------------------------------------------------------
SUBROUTINE editsim
open(1000,file='user')
write(1000,'(A,A,A)',advance='no') ' Simulation control file (default= ',trim(simfile),'): '
read (*,'(A)') simfile
if (simfile == ' ') then
simfile = 'test0.sim'
end if
end subroutine editsim
!-----------------------------------------------------------------------------
END subroutine prepare_global
!**************************************************************