- Timestamp:
- 2019-08-05T19:14:52+02:00 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
NEMO/branches/2019/ENHANCE-02_ISF_nemo/src/OCE/ISF/isfutils.F90
r11395 r11403 1 1 MODULE isfutils 2 !!====================================================================== 3 !! *** MODULE isfutils *** 4 !! istutils module : miscelenious useful routines 5 !!====================================================================== 6 !! History : 4.1 ! 2019-09 (P. Mathiot) original code 7 !!---------------------------------------------------------------------- 2 8 3 USE oce 4 USE in_out_manager 5 USE iom 6 USE lib_fortran 7 USE lib_mpp 9 !!---------------------------------------------------------------------- 10 !! isfutils : - read_2dcstdta to read a constant input file with iom_get 11 !! - debug to print array sum, min, max in ocean.output 12 !!---------------------------------------------------------------------- 8 13 9 IMPLICIT NONE 14 USE iom 15 USE lib_fortran 16 USE lib_mpp 10 17 11 PRIVATE18 IMPLICIT NONE 12 19 13 INTERFACE isf_debug 14 MODULE PROCEDURE isf_debug2d, isf_debug3d 15 END INTERFACE isf_debug 20 PRIVATE 16 21 17 PUBLIC read_2dcstdta, isf_debug 22 INTERFACE debug 23 MODULE PROCEDURE debug2d, debug3d 24 END INTERFACE debug 25 26 PUBLIC read_2dcstdta, debug 18 27 19 28 CONTAINS 20 29 21 30 SUBROUTINE read_2dcstdta(cdfile, cdvar, pvar) 22 !!-------------------------------------------------------------------- -31 !!-------------------------------------------------------------------- 23 32 !! *** ROUTINE read_2dcstdta *** 24 33 !! 25 34 !! ** Purpose : read input file 26 35 !! 27 !!-------------------------------------------------------------------- --36 !!-------------------------------------------------------------------- 28 37 !!-------------------------- OUT ------------------------------------- 29 REAL(wp), DIMENSION(jpi,jpj), INTENT( inout) :: pvar38 REAL(wp), DIMENSION(jpi,jpj), INTENT( out) :: pvar ! output variable 30 39 !!-------------------------- IN ------------------------------------- 31 CHARACTER(len=256) , INTENT(in) :: cdfile, cdvar40 CHARACTER(len=256) , INTENT(in ) :: cdfile, cdvar ! input file name and variable name 32 41 !!-------------------------------------------------------------------- 33 42 INTEGER :: inum 43 !!-------------------------------------------------------------------- 34 44 35 45 CALL iom_open( cdfile, inum ) … … 39 49 END SUBROUTINE read_2dcstdta 40 50 41 SUBROUTINE isf_debug2d(cdtxt,pvar) 42 CHARACTER(LEN=256), INTENT(in) :: cdtxt 51 SUBROUTINE debug2d(cdtxt,pvar) 52 !!-------------------------------------------------------------------- 53 !! *** ROUTINE isf_debug2d *** 54 !! 55 !! ** Purpose : add debug print 56 !! 57 !!-------------------------------------------------------------------- 58 !!-------------------------- OUT ------------------------------------- 59 !!-------------------------- IN ------------------------------------- 60 CHARACTER(LEN=256) , INTENT(in ) :: cdtxt 43 61 REAL(wp), DIMENSION(jpi,jpj), INTENT(in ) :: pvar 62 !!-------------------------------------------------------------------- 44 63 REAL(wp) :: zmin, zmax, zsum 45 zsum = glob_sum( 'isf_debug', pvar(:,:) ) 46 zmin = MINVAL( pvar(:,:) ) ; CALL mpp_min( 'isf_debug', zmin ) ! min over the global domain 47 zmax = MAXVAL( pvar(:,:) ) ; CALL mpp_max( 'isf_debug', zmax ) ! max over the global domain 64 !!-------------------------------------------------------------------- 65 ! 66 zsum = glob_sum( 'debug', pvar(:,:) ) 67 zmin = MINVAL( pvar(:,:) ) ; CALL mpp_min( 'debug', zmin ) ! min over the global domain 68 zmax = MAXVAL( pvar(:,:) ) ; CALL mpp_max( 'debug', zmax ) ! max over the global domain 69 ! 48 70 WRITE(numout,*) TRIM(cdtxt),' (min, max, sum) : ',zmin, zmax, zsum 71 ! 49 72 FLUSH(numout) 50 END SUBROUTINE isf_debug2d73 END SUBROUTINE debug2d 51 74 52 SUBROUTINE isf_debug3d(cdtxt,pvar) 53 CHARACTER(LEN=256), INTENT(in) :: cdtxt 75 SUBROUTINE debug3d(cdtxt,pvar) 76 !!-------------------------------------------------------------------- 77 !! *** ROUTINE isf_debug3d *** 78 !! 79 !! ** Purpose : add debug print 80 !! 81 !!-------------------------------------------------------------------- 82 !!-------------------------- OUT ------------------------------------- 83 !!-------------------------- IN ------------------------------------- 84 CHARACTER(LEN=256) , INTENT(in ) :: cdtxt 54 85 REAL(wp), DIMENSION(jpi,jpj,jpk), INTENT(in ) :: pvar 86 !!-------------------------------------------------------------------- 55 87 REAL(wp) :: zmin, zmax, zsum 56 zsum = glob_sum( 'isf_debug', pvar(:,:) ) 57 zmin = MINVAL( pvar(:,:) ) ; CALL mpp_min( 'isf_debug', zmin ) ! min over the global domain 58 zmax = MAXVAL( pvar(:,:) ) ; CALL mpp_max( 'isf_debug', zmax ) ! max over the global domain 88 !!-------------------------------------------------------------------- 89 ! 90 zsum = glob_sum( 'debug', pvar(:,:) ) 91 zmin = MINVAL( pvar(:,:) ) ; CALL mpp_min( 'debug', zmin ) ! min over the global domain 92 zmax = MAXVAL( pvar(:,:) ) ; CALL mpp_max( 'debug', zmax ) ! max over the global domain 93 ! 59 94 WRITE(numout,*) TRIM(cdtxt),' (min, max, sum) : ',zmin, zmax, zsum 95 ! 60 96 FLUSH(numout) 61 END SUBROUTINE isf_debug3d 97 ! 98 END SUBROUTINE debug3d 62 99 63 100 END MODULE isfutils
Note: See TracChangeset
for help on using the changeset viewer.