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