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