1 | ! |
---|
2 | ! $Id: getparam.F90 1279 2009-12-10 09:02:56Z ymeurdesoif $ |
---|
3 | ! |
---|
4 | MODULE getparam |
---|
5 | #ifdef CPP_IOIPSL |
---|
6 | USE IOIPSL |
---|
7 | #else |
---|
8 | ! if not using IOIPSL, we still need to use (a local version of) getin |
---|
9 | USE ioipsl_getincom |
---|
10 | #endif |
---|
11 | |
---|
12 | INTERFACE getpar |
---|
13 | MODULE PROCEDURE ini_getparam,fin_getparam,getparamr,getparami,getparaml |
---|
14 | END INTERFACE |
---|
15 | |
---|
16 | INTEGER, PARAMETER :: out_eff=99 |
---|
17 | |
---|
18 | CONTAINS |
---|
19 | SUBROUTINE ini_getparam(fichier) |
---|
20 | ! |
---|
21 | IMPLICIT NONE |
---|
22 | ! |
---|
23 | CHARACTER*(*) :: fichier |
---|
24 | open(out_eff,file=fichier,status='unknown',form='formatted') |
---|
25 | END SUBROUTINE ini_getparam |
---|
26 | |
---|
27 | SUBROUTINE fin_getparam |
---|
28 | ! |
---|
29 | IMPLICIT NONE |
---|
30 | ! |
---|
31 | close(out_eff) |
---|
32 | |
---|
33 | END SUBROUTINE fin_getparam |
---|
34 | |
---|
35 | SUBROUTINE getparamr(TARGET,def_val,ret_val,comment) |
---|
36 | ! |
---|
37 | IMPLICIT NONE |
---|
38 | ! |
---|
39 | ! Get a real scalar. We first check if we find it |
---|
40 | ! in the database and if not we get it from the run.def |
---|
41 | ! |
---|
42 | ! getinr1d and getinr2d are written on the same pattern |
---|
43 | ! |
---|
44 | CHARACTER*(*) :: TARGET |
---|
45 | REAL :: def_val |
---|
46 | REAL :: ret_val |
---|
47 | CHARACTER*(*) :: comment |
---|
48 | |
---|
49 | ret_val=def_val |
---|
50 | call getin(TARGET,ret_val) |
---|
51 | |
---|
52 | write(out_eff,*) '######################################' |
---|
53 | write(out_eff,*) '#### ',comment,' #####' |
---|
54 | write(out_eff,*) TARGET,'=',ret_val |
---|
55 | |
---|
56 | END SUBROUTINE getparamr |
---|
57 | |
---|
58 | SUBROUTINE getparami(TARGET,def_val,ret_val,comment) |
---|
59 | ! |
---|
60 | IMPLICIT NONE |
---|
61 | ! |
---|
62 | ! Get a real scalar. We first check if we find it |
---|
63 | ! in the database and if not we get it from the run.def |
---|
64 | ! |
---|
65 | ! getinr1d and getinr2d are written on the same pattern |
---|
66 | ! |
---|
67 | CHARACTER*(*) :: TARGET |
---|
68 | INTEGER :: def_val |
---|
69 | INTEGER :: ret_val |
---|
70 | CHARACTER*(*) :: comment |
---|
71 | |
---|
72 | ret_val=def_val |
---|
73 | call getin(TARGET,ret_val) |
---|
74 | |
---|
75 | write(out_eff,*) '######################################' |
---|
76 | write(out_eff,*) '#### ',comment,' #####' |
---|
77 | write(out_eff,*) comment |
---|
78 | write(out_eff,*) TARGET,'=',ret_val |
---|
79 | |
---|
80 | END SUBROUTINE getparami |
---|
81 | |
---|
82 | SUBROUTINE getparaml(TARGET,def_val,ret_val,comment) |
---|
83 | ! |
---|
84 | IMPLICIT NONE |
---|
85 | ! |
---|
86 | ! Get a real scalar. We first check if we find it |
---|
87 | ! in the database and if not we get it from the run.def |
---|
88 | ! |
---|
89 | ! getinr1d and getinr2d are written on the same pattern |
---|
90 | ! |
---|
91 | CHARACTER*(*) :: TARGET |
---|
92 | LOGICAL :: def_val |
---|
93 | LOGICAL :: ret_val |
---|
94 | CHARACTER*(*) :: comment |
---|
95 | |
---|
96 | ret_val=def_val |
---|
97 | call getin(TARGET,ret_val) |
---|
98 | |
---|
99 | write(out_eff,*) '######################################' |
---|
100 | write(out_eff,*) '#### ',comment,' #####' |
---|
101 | write(out_eff,*) TARGET,'=',ret_val |
---|
102 | |
---|
103 | END SUBROUTINE getparaml |
---|
104 | |
---|
105 | |
---|
106 | END MODULE getparam |
---|