Juan 2/05/2016 : bug in use of global/local bounds for call of BIKHARDT
authorJuan Escobar <juan.escobar@aero.obs-mip.fr>
Mon, 2 May 2016 13:32:06 +0000 (13:32 +0000)
committerPhilippe WAUTELET <philippe.wautelet@aero.obs-mip.fr>
Thu, 19 May 2016 14:44:49 +0000 (16:44 +0200)
src/MNH/eddyUV_flux_one_wayn.f90
src/MNH/eddy_flux_one_wayn.f90
src/MNH/spawn_surf2_rain.f90

index 9c4a070..121f720 100644 (file)
@@ -55,6 +55,7 @@ END MODULE MODI_EDDYUV_FLUX_ONE_WAY_n
 !!    MODIFICATIONS
 !!    -------------
 !!      Original  07/07/11
+!!      J.Escobar 2/05/2016 : bug in use of global/local bounds for call of BIKHARDT
 !!
 !     ##################################################################################
 !
@@ -98,7 +99,8 @@ REAL, DIMENSION(:,:,:), ALLOCATABLE :: ZFLUX2 ! Work array=Dad interpolated flux
                                               ! on the son grid
 REAL, DIMENSION(:,:,:), ALLOCATABLE :: ZDIV_UV! Work array=DIV of ZFLUX2
 INTEGER :: IKU
-
+!
+INTEGER             :: IDIMX,IDIMY
 !-------------------------------------------------------------------------------
 !
 !
@@ -120,9 +122,11 @@ IF (ISYNCHRO==1 .OR. IDTRATIO_KMI_1 == 1) THEN
 
    ! v'u' (EDDY_FLUX_MODEL(1)%XVU_FLUX_M) of model1 interpolation on the son grid put into ZFLUX2
    ZFLUX2 = 0.
+   IDIMX = SIZE(EDDYUV_FLUX_MODEL(1)%XVU_FLUX_M,1)
+   IDIMY = SIZE(EDDYUV_FLUX_MODEL(1)%XVU_FLUX_M,2)
    CALL BIKHARDT (XBMX1,XBMX2,XBMX3,XBMX4,XBMY1,XBMY2,XBMY3,XBMY4, &
                   XBFX1,XBFX2,XBFX3,XBFX4,XBFY1,XBFY2,XBFY3,XBFY4, &
-                  NXOR_ALL(KMI),NYOR_ALL(KMI),NXEND_ALL(KMI),NYEND_ALL(KMI),KDXRATIO,KDYRATIO,1,&
+                  2,2,IDIMX-1,IDIMY-1,KDXRATIO,KDYRATIO,1,&
                   HLBCX,HLBCY,EDDYUV_FLUX_MODEL(1)%XVU_FLUX_M,ZFLUX2)
 
    ! Lateral boundary conditions 
index 355fceb..f07307d 100644 (file)
@@ -55,6 +55,7 @@ END MODULE MODI_EDDY_FLUX_ONE_WAY_n
 !!    MODIFICATIONS
 !!    -------------
 !!      Original  25/06/11
+!!      J.Escobar 2/05/2016 : bug in use of global/local bounds for call of BIKHARDT
 !!
 !     ##################################################################################
 !
@@ -94,7 +95,8 @@ INTEGER:: IDTRATIO_KMI_1 ! Ratio between the time step of the son and the model
 REAL, DIMENSION(:,:,:), ALLOCATABLE :: ZFLUX2 ! Work array=Dad interpolated flux field
                                               ! on the son grid
 INTEGER :: IKU                                              
-
+!
+INTEGER             :: IDIMX,IDIMY
 !-------------------------------------------------------------------------------
 !
 !
@@ -113,9 +115,11 @@ IF (ISYNCHRO==1 .OR. IDTRATIO_KMI_1 == 1) THEN
 
    ! v'T' (EDDY_FLUX_MODEL(1)%XVTH_FLUX_M) of model1 interpolation on the son grid put into ZFLUX2
    ZFLUX2 = 0.
+   IDIMX = SIZE(EDDY_FLUX_MODEL(1)%XVTH_FLUX_M,1)
+   IDIMY = SIZE(EDDY_FLUX_MODEL(1)%XVTH_FLUX_M,2) 
    CALL BIKHARDT (XBMX1,XBMX2,XBMX3,XBMX4,XBMY1,XBMY2,XBMY3,XBMY4, &
                   XBFX1,XBFX2,XBFX3,XBFX4,XBFY1,XBFY2,XBFY3,XBFY4, &
-                  NXOR_ALL(KMI),NYOR_ALL(KMI),NXEND_ALL(KMI),NYEND_ALL(KMI),KDXRATIO,KDYRATIO,1,&
+                  2,2,IDIMX-1,IDIMY-1,KDXRATIO,KDYRATIO,1,&
                   HLBCX,HLBCY,EDDY_FLUX_MODEL(1)%XVTH_FLUX_M,ZFLUX2)
 
    ! operator GX_U_M used for gradient of v'T' (flux point) placed at a mass point
@@ -125,7 +129,7 @@ IF (ISYNCHRO==1 .OR. IDTRATIO_KMI_1 == 1) THEN
    ZFLUX2 = 0.
    CALL BIKHARDT (XBMX1,XBMX2,XBMX3,XBMX4,XBMY1,XBMY2,XBMY3,XBMY4, &
                   XBFX1,XBFX2,XBFX3,XBFX4,XBFY1,XBFY2,XBFY3,XBFY4, &
-                  NXOR_ALL(KMI),NYOR_ALL(KMI),NXEND_ALL(KMI),NYEND_ALL(KMI),KDXRATIO,KDYRATIO,1,&
+                  2,2,IDIMX-1,IDIMY-1,KDXRATIO,KDYRATIO,1,&
                   HLBCX,HLBCY,EDDY_FLUX_MODEL(1)%XWTH_FLUX_M,ZFLUX2)
 
    ! DIV(W'T') put into the source term
index a3b6b3f..f974f26 100644 (file)
@@ -107,6 +107,7 @@ END MODULE MODI_SPAWN_SURF2_RAIN
 !!      Modification 07/07/05 (D.Barbary) spawn with 2 input files (father+son1)
 !!      Modification    20/05/06 Remove Clark and Farley interpolation
 !!      Modification    2014 (M.Faivre)
+!!      J.Escobar 2/05/2016 : bug in use of global/local bounds for call of BIKHARDT
 !!-------------------------------------------------------------------------------
 !
 !*       0.     DECLARATIONS
@@ -169,6 +170,8 @@ REAL, DIMENSION(:,:), ALLOCATABLE :: ZINPRC1, ZACPRC1,    &
 REAL, DIMENSION(:,:,:), ALLOCATABLE :: ZINPRR3D1, ZEVAP3D1
 CHARACTER (LEN=4):: YGETRCT,YGETRRT,YGETRST,YGETRGT,YGETRHT ! READ,INIT or SKIP variable
 INTEGER             :: ILU                        ! vertical size of arrays
+!
+INTEGER             :: IDIMX,IDIMY
 !-------------------------------------------------------------------------------
 !
 !*       1.    PROLOGUE:
@@ -234,34 +237,38 @@ ELSE
   IF ( YMETHOD == 'BI' ) THEN
 !
     IF (SIZE(PRECIP_MODEL(1)%XINPRC) /= 0 ) THEN
+      IDIMX = SIZE(PRECIP_MODEL(1)%XINPRC,1)
+      IDIMY = SIZE(PRECIP_MODEL(1)%XINPRC,2)
       CALL BIKHARDT(XBMX1,XBMX2,XBMX3,XBMX4,XBMY1,XBMY2,XBMY3,XBMY4, &
                     XBFX1,XBFX2,XBFX3,XBFX4,XBFY1,XBFY2,XBFY3,XBFY4, &
-                    KXOR,KYOR,KXEND,KYEND,KDXRATIO,KDYRATIO,1,       &
+                    2,2,IDIMX-1,IDIMY-1,KDXRATIO,KDYRATIO,1,       &
                     LBC_MODEL(1)%CLBCX,LBC_MODEL(1)%CLBCY,PRECIP_MODEL(1)%XINPRC,PINPRC)
       CALL BIKHARDT(XBMX1,XBMX2,XBMX3,XBMX4,XBMY1,XBMY2,XBMY3,XBMY4, &
                     XBFX1,XBFX2,XBFX3,XBFX4,XBFY1,XBFY2,XBFY3,XBFY4, &
-                    KXOR,KYOR,KXEND,KYEND,KDXRATIO,KDYRATIO,1,       &
+                    2,2,IDIMX-1,IDIMY-1,KDXRATIO,KDYRATIO,1,       &
                     LBC_MODEL(1)%CLBCX,LBC_MODEL(1)%CLBCY,PRECIP_MODEL(1)%XACPRC,PACPRC)
      PINPRC(:,:)=MAX(0.,PINPRC(:,:))
      PACPRC(:,:)=MAX(0.,PACPRC(:,:))
     END IF
 !
     IF (SIZE(PRECIP_MODEL(1)%XINPRR) /= 0 ) THEN
+      IDIMX = SIZE(PRECIP_MODEL(1)%XINPRR,1)
+      IDIMY = SIZE(PRECIP_MODEL(1)%XINPRR,2)
       CALL BIKHARDT(XBMX1,XBMX2,XBMX3,XBMX4,XBMY1,XBMY2,XBMY3,XBMY4, &
                     XBFX1,XBFX2,XBFX3,XBFX4,XBFY1,XBFY2,XBFY3,XBFY4, &
-                    KXOR,KYOR,KXEND,KYEND,KDXRATIO,KDYRATIO,1,       &
+                    2,2,IDIMX-1,IDIMY-1,KDXRATIO,KDYRATIO,1,       &
                     LBC_MODEL(1)%CLBCX,LBC_MODEL(1)%CLBCY,PRECIP_MODEL(1)%XINPRR,PINPRR)
       CALL BIKHARDT(XBMX1,XBMX2,XBMX3,XBMX4,XBMY1,XBMY2,XBMY3,XBMY4, &
                     XBFX1,XBFX2,XBFX3,XBFX4,XBFY1,XBFY2,XBFY3,XBFY4, &
-                    KXOR,KYOR,KXEND,KYEND,KDXRATIO,KDYRATIO,1,       &
+                    2,2,IDIMX-1,IDIMY-1,KDXRATIO,KDYRATIO,1,       &
                     LBC_MODEL(1)%CLBCX,LBC_MODEL(1)%CLBCY,PRECIP_MODEL(1)%XINPRR3D,PINPRR3D)
       CALL BIKHARDT(XBMX1,XBMX2,XBMX3,XBMX4,XBMY1,XBMY2,XBMY3,XBMY4, &
                     XBFX1,XBFX2,XBFX3,XBFX4,XBFY1,XBFY2,XBFY3,XBFY4, &
-                    KXOR,KYOR,KXEND,KYEND,KDXRATIO,KDYRATIO,1,       &
+                    2,2,IDIMX-1,IDIMY-1,KDXRATIO,KDYRATIO,1,       &
                     LBC_MODEL(1)%CLBCX,LBC_MODEL(1)%CLBCY,PRECIP_MODEL(1)%XEVAP3D,PEVAP3D)
       CALL BIKHARDT(XBMX1,XBMX2,XBMX3,XBMX4,XBMY1,XBMY2,XBMY3,XBMY4, &
                     XBFX1,XBFX2,XBFX3,XBFX4,XBFY1,XBFY2,XBFY3,XBFY4, &
-                    KXOR,KYOR,KXEND,KYEND,KDXRATIO,KDYRATIO,1,       &
+                    2,2,IDIMX-1,IDIMY-1,KDXRATIO,KDYRATIO,1,       &
                     LBC_MODEL(1)%CLBCX,LBC_MODEL(1)%CLBCY,PRECIP_MODEL(1)%XACPRR,PACPRR)
      PINPRR(:,:)=MAX(0.,PINPRR(:,:))
      PINPRR3D(:,:,:)=MAX(0.,PINPRR3D(:,:,:))
@@ -270,39 +277,45 @@ ELSE
     END IF
 !
     IF (SIZE(PRECIP_MODEL(1)%XINPRS) /= 0 ) THEN
+      IDIMX = SIZE(PRECIP_MODEL(1)%XINPRS,1)
+      IDIMY = SIZE(PRECIP_MODEL(1)%XINPRS,2)
       CALL BIKHARDT(XBMX1,XBMX2,XBMX3,XBMX4,XBMY1,XBMY2,XBMY3,XBMY4, &
                     XBFX1,XBFX2,XBFX3,XBFX4,XBFY1,XBFY2,XBFY3,XBFY4, &
-                    KXOR,KYOR,KXEND,KYEND,KDXRATIO,KDYRATIO,1,       &
+                    2,2,IDIMX-1,IDIMY-1,KDXRATIO,KDYRATIO,1,       &
                     LBC_MODEL(1)%CLBCX,LBC_MODEL(1)%CLBCY,PRECIP_MODEL(1)%XINPRS,PINPRS)
       CALL BIKHARDT(XBMX1,XBMX2,XBMX3,XBMX4,XBMY1,XBMY2,XBMY3,XBMY4, &
                     XBFX1,XBFX2,XBFX3,XBFX4,XBFY1,XBFY2,XBFY3,XBFY4, &
-                    KXOR,KYOR,KXEND,KYEND,KDXRATIO,KDYRATIO,1,       &
+                    2,2,IDIMX-1,IDIMY-1,KDXRATIO,KDYRATIO,1,       &
                     LBC_MODEL(1)%CLBCX,LBC_MODEL(1)%CLBCY,PRECIP_MODEL(1)%XACPRS,PACPRS)
      PINPRS(:,:)=MAX(0.,PINPRS(:,:))
      PACPRS(:,:)=MAX(0.,PACPRS(:,:))
     END IF
 !
     IF (SIZE(PRECIP_MODEL(1)%XINPRG) /= 0 ) THEN
+      IDIMX = SIZE(PRECIP_MODEL(1)%XINPRG,1)
+      IDIMY = SIZE(PRECIP_MODEL(1)%XINPRG,2)
       CALL BIKHARDT(XBMX1,XBMX2,XBMX3,XBMX4,XBMY1,XBMY2,XBMY3,XBMY4, &
                     XBFX1,XBFX2,XBFX3,XBFX4,XBFY1,XBFY2,XBFY3,XBFY4, &
-                    KXOR,KYOR,KXEND,KYEND,KDXRATIO,KDYRATIO,1,       &
+                    2,2,IDIMX-1,IDIMY-1,KDXRATIO,KDYRATIO,1,       &
                     LBC_MODEL(1)%CLBCX,LBC_MODEL(1)%CLBCY,PRECIP_MODEL(1)%XINPRG,PINPRG)
       CALL BIKHARDT(XBMX1,XBMX2,XBMX3,XBMX4,XBMY1,XBMY2,XBMY3,XBMY4, &
                     XBFX1,XBFX2,XBFX3,XBFX4,XBFY1,XBFY2,XBFY3,XBFY4, &
-                    KXOR,KYOR,KXEND,KYEND,KDXRATIO,KDYRATIO,1,       &
+                    2,2,IDIMX-1,IDIMY-1,KDXRATIO,KDYRATIO,1,       &
                     LBC_MODEL(1)%CLBCX,LBC_MODEL(1)%CLBCY,PRECIP_MODEL(1)%XACPRG,PACPRG)
      PINPRG(:,:)=MAX(0.,PINPRG(:,:))
      PACPRG(:,:)=MAX(0.,PACPRG(:,:))
     END IF
 !
     IF (SIZE(PRECIP_MODEL(1)%XINPRH) /= 0 ) THEN
+      IDIMX = SIZE(PRECIP_MODEL(1)%XINPRH,1)
+      IDIMY = SIZE(PRECIP_MODEL(1)%XINPRH,2)
       CALL BIKHARDT(XBMX1,XBMX2,XBMX3,XBMX4,XBMY1,XBMY2,XBMY3,XBMY4, &
                     XBFX1,XBFX2,XBFX3,XBFX4,XBFY1,XBFY2,XBFY3,XBFY4, &
-                    KXOR,KYOR,KXEND,KYEND,KDXRATIO,KDYRATIO,1,       &
+                    2,2,IDIMX-1,IDIMY-1,KDXRATIO,KDYRATIO,1,       &
                     LBC_MODEL(1)%CLBCX,LBC_MODEL(1)%CLBCY,PRECIP_MODEL(1)%XINPRH,PINPRH)
       CALL BIKHARDT(XBMX1,XBMX2,XBMX3,XBMX4,XBMY1,XBMY2,XBMY3,XBMY4, &
                     XBFX1,XBFX2,XBFX3,XBFX4,XBFY1,XBFY2,XBFY3,XBFY4, &
-                    KXOR,KYOR,KXEND,KYEND,KDXRATIO,KDYRATIO,1,       &
+                    2,2,IDIMX-1,IDIMY-1,KDXRATIO,KDYRATIO,1,       &
                     LBC_MODEL(1)%CLBCX,LBC_MODEL(1)%CLBCY,PRECIP_MODEL(1)%XACPRH,PACPRH)
      PINPRH(:,:)=MAX(0.,PINPRH(:,:))
      PACPRH(:,:)=MAX(0.,PACPRH(:,:))