From 7f27ad18f021bc6d2e950285e786d69d20bac4ca Mon Sep 17 00:00:00 2001 From: Juan Escobar <juan.escobar@aero.obs-mip.fr> Date: Thu, 24 Apr 2014 13:59:06 +0000 Subject: [PATCH] Juan 24/04/2014: bypass CRAY internal compiler error on IIJ computation --- src/MNH/spawn_model2.f90 | 13 ++++++++----- src/MNH/ver_int_thermo.f90 | 13 ++++++++----- src/MNH/ver_interp_to_mixed_grid.f90 | 13 +++++++------ 3 files changed, 23 insertions(+), 16 deletions(-) diff --git a/src/MNH/spawn_model2.f90 b/src/MNH/spawn_model2.f90 index 73c4d213a..1813bb848 100644 --- a/src/MNH/spawn_model2.f90 +++ b/src/MNH/spawn_model2.f90 @@ -181,6 +181,7 @@ END MODULE MODI_SPAWN_MODEL2 !! Modification 06/12 (M.Tomasini) Interpolation of the advective forcing (ADVFRC) !! and of the turbulent fluxes (EDDY_FLUX) !! Modification 07/13 (Bosseur & Filippi) Adds Forefire +!! 24/04/2014 (J.escobar) bypass CRAY internal compiler error on IIJ computation !------------------------------------------------------------------------------- ! !* 0. DECLARATIONS @@ -351,6 +352,7 @@ INTEGER :: IJE1 ! indice J End in y direction LOGICAL :: GNOSON = .TRUE. REAL, DIMENSION(:,:,:), ALLOCATABLE :: ZWORK3D ! working array CHARACTER(LEN=28) :: YDAD_SON +INTEGER,DIMENSION(:,:),ALLOCATABLE :: IJCOUNT !------------------------------------------------------------------------------- ! ! Save model index and switch to model 2 variables @@ -1021,11 +1023,12 @@ IF (.NOT.GNOSON) THEN END IF ! IF (NVERB>=2) THEN - IK4000 = COUNT(XZHAT(:)<4000.) - IIJ = MAXLOC( SUM(ZHUT(IIB:IIE,IJB:IJE,JPVEXT+1:IK4000),3), & - MASK=COUNT(ZHUT(IIB:IIE,IJB:IJE,JPVEXT+1:IKE) & - >=MAXVAL(ZHUT(IIB:IIE,IJB:IJE,JPVEXT+1:IKE))-0.01,DIM=3 ) & - >=1 ) & + ALLOCATE(IJCOUNT(IIU,IJU)) + IK4000 = COUNT(XZHAT(:)<4000.) + IJCOUNT(IIB:IIE,IJB:IJE) = COUNT((ZHUT(IIB:IIE,IJB:IJE,JPVEXT+1:IKE) & + >=MAXVAL(ZHUT(IIB:IIE,IJB:IJE,JPVEXT+1:IKE))-0.01),DIM=3 ) + IIJ = MAXLOC( SUM(ZHUT(IIB:IIE,IJB:IJE,JPVEXT+1:IK4000),3), & + MASK= ( IJCOUNT(IIB:IIE,IJB:IJE) >=1 ) ) & + JPHEXT WRITE(ILUOUT,*) ' ' WRITE(ILUOUT,*) 'humidity (I=',IIJ(1),';J=',IIJ(2),')' diff --git a/src/MNH/ver_int_thermo.f90 b/src/MNH/ver_int_thermo.f90 index c6048f2f0..e86b24015 100644 --- a/src/MNH/ver_int_thermo.f90 +++ b/src/MNH/ver_int_thermo.f90 @@ -132,6 +132,7 @@ END MODULE MODI_VER_INT_THERMO !! 26/08/97 (V. Masson) call to new linear vertical !! interpolation routine !! 26/01/98 (J. Stein) add the LS fields' treatment +!! 24/04/2014 (J.escobar) bypass CRAY internal compiler error on IIJ computation !------------------------------------------------------------------------------- ! !* 0. DECLARATIONS @@ -251,6 +252,7 @@ REAL, DIMENSION(SIZE(XZZ,1),SIZE(XZZ,2),SIZE(XZZ,3))& :: ZHU ! relative humidity of the mass ! ! points in the MESO-NH grid. INTEGER :: JRR ! counter for moist variables +INTEGER,DIMENSION(SIZE(PZMASS_MX,1),SIZE(PZMASS_MX,2)) :: IJCOUNT !------------------------------------------------------------------------------- ! CALL FMLOOK_ll(CLUOUT0,CLUOUT0,ILUOUT0,IRESP) @@ -457,11 +459,12 @@ END IF ! IF (NVERB>=1) THEN IK4000 = COUNT(XZHAT(:)<4000.) - IIJ = MAXLOC( SUM(ZHU_MX(IIB:IIE,IJB:IJE,JPVEXT+1:IK4000),3), & - MASK=COUNT(ZHU_MX(IIB:IIE,IJB:IJE,JPVEXT+1:IKE) & - >=MAXVAL(ZHU_MX(IIB:IIE,IJB:IJE,JPVEXT+1:IKE))-0.01,DIM=3 ) & - >=1 ) & - + JPHEXT + IJCOUNT(IIB:IIE,IJB:IJE) = COUNT((ZHU_MX(IIB:IIE,IJB:IJE,JPVEXT+1:IKE) & + >=MAXVAL(ZHU_MX(IIB:IIE,IJB:IJE,JPVEXT+1:IKE))-0.01),DIM=3 ) + IIJ = MAXLOC( SUM(ZHU_MX(IIB:IIE,IJB:IJE,JPVEXT+1:IK4000),3), & + MASK=( IJCOUNT(IIB:IIE,IJB:IJE) >=1 ) ) & + + JPHEXT + WRITE(ILUOUT0,*) ' ' WRITE(ILUOUT0,*) 'Altitude and humidity on shifted grid (I=',IIJ(1),';J=',IIJ(2),')' DO JK=IKB,IKE diff --git a/src/MNH/ver_interp_to_mixed_grid.f90 b/src/MNH/ver_interp_to_mixed_grid.f90 index d44f63837..2650e760f 100644 --- a/src/MNH/ver_interp_to_mixed_grid.f90 +++ b/src/MNH/ver_interp_to_mixed_grid.f90 @@ -161,6 +161,7 @@ END MODULE MODI_VER_INTERP_TO_MIXED_GRID !! 22/01/01 (D. Gazen) add MODD_NSV for NSV access !! 20/05/06 Remove EPS !! 10/04/2014 (J.Escobar & M.Faivre ) add reprod_sum on XEXNTOP +!! 24/04/2014 (J.escobar) bypass CRAY internal compiler error on IIJ computation !------------------------------------------------------------------------------- ! !* 0. DECLARATIONS @@ -249,6 +250,7 @@ REAL,DIMENSION(:,:,:), ALLOCATABLE:: ZZFLUX_MX,ZZMASS_MX REAL :: ZCOUNT INTEGER :: IINFO_ll !JUAN REALZ +INTEGER,DIMENSION(SIZE(PZMASS_LS,1),SIZE(PZMASS_LS,2)) :: IJCOUNT !------------------------------------------------------------------------------- ! @@ -445,12 +447,11 @@ IF (HFILE=='ATM ') THEN ! IF (NVERB>=1 .AND. ANY(XZHAT>=5000.) ) THEN IK4000 = COUNT(XZHAT(:)<4000.) - IK4000 = COUNT(XZHAT(:)<4000.) - IIJ = MAXLOC( SUM(ZHU_MX(IIB:IIE,IJB:IJE,JPVEXT+1:IK4000),3), & - MASK=COUNT(ZHU_MX(IIB:IIE,IJB:IJE,JPVEXT+1:IKE) & - >=MAXVAL(ZHU_MX(IIB:IIE,IJB:IJE,JPVEXT+1:IKE))-0.01,DIM=3 ) & - >=1 ) & - + JPHEXT + IJCOUNT(IIB:IIE,IJB:IJE) = COUNT((ZHU_MX(IIB:IIE,IJB:IJE,JPVEXT+1:IKE) & + >=MAXVAL(ZHU_MX(IIB:IIE,IJB:IJE,JPVEXT+1:IKE))-0.01),DIM=3 ) + IIJ = MAXLOC( SUM(ZHU_MX(IIB:IIE,IJB:IJE,JPVEXT+1:IK4000),3), & + MASK=( IJCOUNT(IIB:IIE,IJB:IJE) >=1 ) ) & + + JPHEXT WRITE(ILUOUT0,*) ' ' WRITE(ILUOUT0,*) 'Altitude and humidity on large-scale grid (I=',IIJ(1),';J=',IIJ(2),')' DO JK=1,ILU -- GitLab