Changeset 12032 for NEMO/branches/2019/ENHANCE-02_ISF_nemo/src
- Timestamp:
- 2019-12-02T19:08:44+01:00 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
NEMO/branches/2019/ENHANCE-02_ISF_nemo/src/OCE/ISF/isfutils.F90
r11987 r12032 15 15 USE lib_fortran , ONLY: glob_sum, glob_min, glob_max ! compute global value 16 16 USE par_oce , ONLY: jpi,jpj,jpk ! domain size 17 USE in_out_manager, ONLY: wp, lwp, numout ! miscelenious 17 USE dom_oce , ONLY: nldi, nlei, nldj, nlej ! local domain 18 USE in_out_manager, ONLY: i8, wp, lwp, numout ! miscelenious 19 USE lib_mpp 18 20 19 21 IMPLICIT NONE … … 60 62 REAL(wp), DIMENSION(jpi,jpj), INTENT(in ) :: pvar 61 63 !!-------------------------------------------------------------------- 62 REAL(wp) :: zmin, zmax, zsum 64 REAL(wp) :: zmin, zmax, zsum 65 INTEGER(i8) :: imodd, ip 66 INTEGER :: itmps,imods, ji, jj, jk 63 67 !!-------------------------------------------------------------------- 64 68 ! 69 ! global min/max/sum to check data range and NaN 65 70 zsum = glob_sum( 'debug', pvar(:,:) ) 66 71 zmin = glob_min( 'debug', pvar(:,:) ) 67 72 zmax = glob_max( 'debug', pvar(:,:) ) 68 73 ! 69 IF (lwp) WRITE(numout,*) TRIM(cdtxt),' (min, max, sum) : ',zmin, zmax, zsum 74 ! basic check sum to check reproducibility 75 ! TRANSFER function find out the integer corresponding to pvar(i,j) bit pattern 76 ! MOD allow us to keep only the latest digits during the sum 77 ! imod is not choosen to be very large as at the end there is a classic mpp_sum 78 imodd=65521 ! highest prime number < 2**16 with i8 type 79 imods=65521 ! highest prime number < 2**16 with default integer for mpp_sum subroutine 80 itmps=0 81 DO jj=nldj,nlej 82 DO ji=nldi,nlei 83 itmps = MOD(itmps + MOD(TRANSFER(pvar(ji,jj), ip),imodd), imods) 84 END DO 85 END DO 86 CALL mpp_sum('debug',itmps) 87 ! 88 ! print out 89 IF (lwp) WRITE(numout,*) TRIM(cdtxt),' (min, max, sum, tag) : ',zmin, zmax, zsum, itmps 70 90 ! 71 91 CALL FLUSH(numout) … … 84 104 !!-------------------------------------------------------------------- 85 105 REAL(wp) :: zmin, zmax, zsum 106 INTEGER(i8) :: imodd, ip 107 INTEGER :: itmps,imods, ji, jj, jk 86 108 !!-------------------------------------------------------------------- 87 109 ! 110 ! global min/max/sum to check data range and NaN 88 111 zsum = glob_sum( 'debug', pvar(:,:,:) ) 89 112 zmin = glob_min( 'debug', pvar(:,:,:) ) 90 113 zmax = glob_max( 'debug', pvar(:,:,:) ) 91 114 ! 92 IF (lwp) WRITE(numout,*) TRIM(cdtxt),' (min, max, sum) : ',zmin, zmax, zsum 115 ! basic check sum to check reproducibility 116 ! TRANSFER function find out the integer corresponding to pvar(i,j) bit pattern 117 ! MOD allow us to keep only the latest digits during the sum 118 ! imod is not choosen to be very large as at the end there is a classic mpp_sum 119 imodd=65521 ! highest prime number < 2**16 with i8 type 120 imods=65521 ! highest prime number < 2**16 with default integer for mpp_sum subroutine 121 itmps=0 122 DO jk=1,jpk 123 DO jj=nldj,nlej 124 DO ji=nldi,nlei 125 itmps = MOD(itmps + MOD(TRANSFER(pvar(ji,jj,jk), ip),imodd), imods) 126 END DO 127 END DO 128 END DO 129 CALL mpp_sum('debug',itmps) 130 ! 131 ! print out 132 IF (lwp) WRITE(numout,*) TRIM(cdtxt),' (min, max, sum, tag) : ',zmin, zmax, zsum, itmps 93 133 ! 94 134 CALL FLUSH(numout) … … 97 137 98 138 END MODULE isfutils 99
Note: See TracChangeset
for help on using the changeset viewer.