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