Skip to content
Snippets Groups Projects
Commit f40612d3 authored by WAUTELET Philippe's avatar WAUTELET Philippe
Browse files

Philippe 14/09/2022: fix: set correct global physical boundaries at non-mass points

parent 58b1614e
No related branches found
No related tags found
No related merge requests found
...@@ -1287,8 +1287,7 @@ ELSE ...@@ -1287,8 +1287,7 @@ ELSE
CALL INTERP_HORGRID_TO_MASSPOINTS( XXHAT, XYHAT, XXHATM, XYHATM ) CALL INTERP_HORGRID_TO_MASSPOINTS( XXHAT, XYHAT, XXHATM, XYHATM )
! Collect global domain boundaries ! Collect global domain boundaries
CALL STORE_HORGRID_BOUNDS( XXHAT, XYHAT, XHAT_BOUND ) CALL STORE_HORGRID_BOUNDS( XXHAT, XYHAT, XXHATM, XYHATM, XHAT_BOUND, XHATM_BOUND )
CALL STORE_HORGRID_BOUNDS( XXHATM, XYHATM, XHATM_BOUND )
END IF END IF
! !
......
...@@ -261,8 +261,7 @@ IF ( .NOT. ASSOCIATED(XHATM_BOUND) ) ALLOCATE( XHATM_BOUND(NHAT_BOUND_SIZE) ) ...@@ -261,8 +261,7 @@ IF ( .NOT. ASSOCIATED(XHATM_BOUND) ) ALLOCATE( XHATM_BOUND(NHAT_BOUND_SIZE) )
CALL INTERP_HORGRID_TO_MASSPOINTS( XXHAT, XYHAT, XXHATM, XYHATM ) CALL INTERP_HORGRID_TO_MASSPOINTS( XXHAT, XYHAT, XXHATM, XYHATM )
! Collect global domain boundaries ! Collect global domain boundaries
CALL STORE_HORGRID_BOUNDS( XXHAT, XYHAT, XHAT_BOUND ) CALL STORE_HORGRID_BOUNDS( XXHAT, XYHAT, XXHATM, XYHATM, XHAT_BOUND, XHATM_BOUND )
CALL STORE_HORGRID_BOUNDS( XXHATM, XYHATM, XHATM_BOUND )
!JUAN REALZ !JUAN REALZ
IF ( CPROGRAM .EQ. "REAL " ) THEN IF ( CPROGRAM .EQ. "REAL " ) THEN
......
...@@ -332,8 +332,7 @@ XZTOP = XZHAT(IKU) ...@@ -332,8 +332,7 @@ XZTOP = XZHAT(IKU)
CALL INTERP_VERGRID_TO_MASSPOINTS( XZHAT, XZHATM ) CALL INTERP_VERGRID_TO_MASSPOINTS( XZHAT, XZHATM )
! Collect global domain boundaries ! Collect global domain boundaries
CALL STORE_VERGRID_BOUNDS( XZHAT, XHAT_BOUND ) CALL STORE_VERGRID_BOUNDS( XZHAT, XZHATM, XHAT_BOUND, XHATM_BOUND )
CALL STORE_VERGRID_BOUNDS( XZHATM, XHATM_BOUND )
!------------------------------------------------------------------------------- !-------------------------------------------------------------------------------
! !
......
...@@ -352,8 +352,7 @@ CALL INTERP_HORGRID_TO_MASSPOINTS( PXHAT, PYHAT, PXHATM, PYHATM ) ...@@ -352,8 +352,7 @@ CALL INTERP_HORGRID_TO_MASSPOINTS( PXHAT, PYHAT, PXHATM, PYHATM )
CALL INTERP_VERGRID_TO_MASSPOINTS( PZHAT, PZHATM ) CALL INTERP_VERGRID_TO_MASSPOINTS( PZHAT, PZHATM )
! Collect global domain boundaries ! Collect global domain boundaries
CALL STORE_GRID_BOUNDS( PXHAT, PYHAT, PZHAT, PHAT_BOUND ) CALL STORE_GRID_BOUNDS( PXHAT, PYHAT, PZHAT, PXHATM, PYHATM, PZHATM, PHAT_BOUND, PHATM_BOUND )
CALL STORE_GRID_BOUNDS( PXHATM, PYHATM, PZHATM, PHATM_BOUND )
IF (LCARTESIAN) THEN IF (LCARTESIAN) THEN
CALL SM_GRIDCART(PXHAT,PYHAT,PZHAT,PZS,OSLEVE,PLEN1,PLEN2,PZSMT,PDXHAT,PDYHAT,PZZ,PJ) CALL SM_GRIDCART(PXHAT,PYHAT,PZHAT,PZS,OSLEVE,PLEN1,PLEN2,PZSMT,PDXHAT,PDYHAT,PZZ,PJ)
...@@ -517,7 +516,7 @@ END SUBROUTINE INTERP_VERGRID_TO_MASSPOINTS ...@@ -517,7 +516,7 @@ END SUBROUTINE INTERP_VERGRID_TO_MASSPOINTS
!----------------------------------------------------------------- !-----------------------------------------------------------------
SUBROUTINE STORE_GRID_1DIR_BOUNDS( HDIR, PHAT, PHAT_BOUND ) SUBROUTINE STORE_GRID_1DIR_BOUNDS( HDIR, PHAT, PHATM, PHAT_BOUND, PHATM_BOUND )
USE MODD_GRID_n USE MODD_GRID_n
USE MODD_PARAMETERS, ONLY: JPHEXT, JPVEXT USE MODD_PARAMETERS, ONLY: JPHEXT, JPVEXT
...@@ -528,94 +527,137 @@ SUBROUTINE STORE_GRID_1DIR_BOUNDS( HDIR, PHAT, PHAT_BOUND ) ...@@ -528,94 +527,137 @@ SUBROUTINE STORE_GRID_1DIR_BOUNDS( HDIR, PHAT, PHAT_BOUND )
IMPLICIT NONE IMPLICIT NONE
CHARACTER(LEN=1), INTENT(IN) :: HDIR ! Direction ('X', 'Y' or 'Z') CHARACTER(LEN=1), INTENT(IN) :: HDIR ! Direction ('X', 'Y' or 'Z')
REAL, DIMENSION(:), TARGET, INTENT(IN) :: PHAT ! Position x, y or z in the conformal or cartesian plane REAL, DIMENSION(:), TARGET, INTENT(IN) :: PHAT ! Position x, y or z in the conformal or cartesian plane
REAL, DIMENSION(NHAT_BOUND_SIZE), INTENT(INOUT) :: PHAT_BOUND ! Boundaries of global domain in the conformal or cartesian plane REAL, DIMENSION(:), TARGET, INTENT(IN) :: PHATM ! id at mass points
REAL, DIMENSION(NHAT_BOUND_SIZE), INTENT(INOUT) :: PHAT_BOUND ! Boundaries of global domain in the conformal or cartesian plane
REAL, DIMENSION(NHAT_BOUND_SIZE), INTENT(INOUT) :: PHATM_BOUND ! id at mass points
INTEGER :: IERR INTEGER :: IERR
LOGICAL :: GALLOC LOGICAL :: GALLOC, GALLOCM
REAL, DIMENSION(:), POINTER :: ZHAT_GLOB REAL, DIMENSION(:), POINTER :: ZHAT_GLOB
REAL, DIMENSION(:), POINTER :: ZHATM_GLOB
ZHAT_GLOB => NULL() ZHAT_GLOB => NULL()
ZHATM_GLOB => NULL()
SELECT CASE (HDIR) SELECT CASE (HDIR)
CASE ( 'X' ) CASE ( 'X' )
CALL ALLOCBUFFER_ll( ZHAT_GLOB, PHAT, 'XX', GALLOC ) CALL ALLOCBUFFER_ll( ZHAT_GLOB, PHAT, 'XX', GALLOC )
CALL GATHERALL_FIELD_ll( 'XX', PHAT, ZHAT_GLOB, IERR ) CALL ALLOCBUFFER_ll( ZHATM_GLOB, PHATM, 'XX', GALLOCM )
CALL GATHERALL_FIELD_ll( 'XX', PHAT, ZHAT_GLOB, IERR )
CALL GATHERALL_FIELD_ll( 'XX', PHATM, ZHATM_GLOB, IERR )
! Global boundaries on u points
PHAT_BOUND(NEXTE_XMIN) = ZHAT_GLOB( 1 ) PHAT_BOUND(NEXTE_XMIN) = ZHAT_GLOB( 1 )
PHAT_BOUND(NEXTE_XMAX) = ZHAT_GLOB( UBOUND( ZHAT_GLOB, 1 ) ) PHAT_BOUND(NEXTE_XMAX) = ZHAT_GLOB( UBOUND( ZHAT_GLOB, 1 ) )
PHAT_BOUND(NPHYS_XMIN) = ZHAT_GLOB( JPHEXT + 1 ) PHAT_BOUND(NPHYS_XMIN) = ZHAT_GLOB( JPHEXT + 1 )
PHAT_BOUND(NPHYS_XMAX) = ZHAT_GLOB( UBOUND( ZHAT_GLOB, 1 ) - JPHEXT ) PHAT_BOUND(NPHYS_XMAX) = ZHAT_GLOB( UBOUND( ZHAT_GLOB, 1 ) )
! Global boundaries on m points
PHATM_BOUND(NEXTE_XMIN) = ZHATM_GLOB( 1 )
PHATM_BOUND(NEXTE_XMAX) = ZHATM_GLOB( UBOUND( ZHATM_GLOB, 1 ) )
PHATM_BOUND(NPHYS_XMIN) = ZHATM_GLOB( JPHEXT + 1 )
PHATM_BOUND(NPHYS_XMAX) = ZHATM_GLOB( UBOUND( ZHATM_GLOB, 1 ) - JPHEXT )
CASE ( 'Y' ) CASE ( 'Y' )
CALL ALLOCBUFFER_ll( ZHAT_GLOB, PHAT, 'YY', GALLOC ) CALL ALLOCBUFFER_ll( ZHAT_GLOB, PHAT, 'YY', GALLOC )
CALL GATHERALL_FIELD_ll( 'YY', PHAT, ZHAT_GLOB, IERR ) CALL ALLOCBUFFER_ll( ZHATM_GLOB, PHATM, 'YY', GALLOCM )
CALL GATHERALL_FIELD_ll( 'YY', PHAT, ZHAT_GLOB, IERR )
CALL GATHERALL_FIELD_ll( 'YY', PHATM, ZHATM_GLOB, IERR )
! Global boundaries on v points
PHAT_BOUND(NEXTE_YMIN) = ZHAT_GLOB( 1 ) PHAT_BOUND(NEXTE_YMIN) = ZHAT_GLOB( 1 )
PHAT_BOUND(NEXTE_YMAX) = ZHAT_GLOB( UBOUND( ZHAT_GLOB, 1 ) ) PHAT_BOUND(NEXTE_YMAX) = ZHAT_GLOB( UBOUND( ZHAT_GLOB, 1 ) )
PHAT_BOUND(NPHYS_YMIN) = ZHAT_GLOB( JPHEXT + 1 ) PHAT_BOUND(NPHYS_YMIN) = ZHAT_GLOB( JPHEXT + 1 )
PHAT_BOUND(NPHYS_YMAX) = ZHAT_GLOB( UBOUND( ZHAT_GLOB, 1 ) - JPHEXT ) PHAT_BOUND(NPHYS_YMAX) = ZHAT_GLOB( UBOUND( ZHAT_GLOB, 1 ) )
! Global boundaries on m points
PHATM_BOUND(NEXTE_YMIN) = ZHATM_GLOB( 1 )
PHATM_BOUND(NEXTE_YMAX) = ZHATM_GLOB( UBOUND( ZHATM_GLOB, 1 ) )
PHATM_BOUND(NPHYS_YMIN) = ZHATM_GLOB( JPHEXT + 1 )
PHATM_BOUND(NPHYS_YMAX) = ZHATM_GLOB( UBOUND( ZHATM_GLOB, 1 ) - JPHEXT )
CASE ( 'Z' ) CASE ( 'Z' )
ZHAT_GLOB => PHAT ZHAT_GLOB => PHAT
ZHATM_GLOB => PHATM
! Global boundaries on w points
PHAT_BOUND(NEXTE_ZMIN) = ZHAT_GLOB( 1 ) PHAT_BOUND(NEXTE_ZMIN) = ZHAT_GLOB( 1 )
PHAT_BOUND(NEXTE_ZMAX) = ZHAT_GLOB( UBOUND( ZHAT_GLOB, 1 ) ) PHAT_BOUND(NEXTE_ZMAX) = ZHAT_GLOB( UBOUND( ZHAT_GLOB, 1 ) )
PHAT_BOUND(NPHYS_ZMIN) = ZHAT_GLOB( JPVEXT + 1 ) PHAT_BOUND(NPHYS_ZMIN) = ZHAT_GLOB( JPVEXT + 1 )
PHAT_BOUND(NPHYS_ZMAX) = ZHAT_GLOB( UBOUND( ZHAT_GLOB, 1 ) - JPVEXT ) PHAT_BOUND(NPHYS_ZMAX) = ZHAT_GLOB( UBOUND( ZHAT_GLOB, 1 ) )
! Global boundaries on m points
PHATM_BOUND(NEXTE_ZMIN) = ZHATM_GLOB( 1 )
PHATM_BOUND(NEXTE_ZMAX) = ZHATM_GLOB( UBOUND( ZHATM_GLOB, 1 ) )
PHATM_BOUND(NPHYS_ZMIN) = ZHATM_GLOB( JPVEXT + 1 )
PHATM_BOUND(NPHYS_ZMAX) = ZHATM_GLOB( UBOUND( ZHATM_GLOB, 1 ) - JPVEXT )
CASE DEFAULT CASE DEFAULT
CALL PRINT_MSG( NVERB_ERROR, 'GEN', 'STORE_GRID_1DIR_BOUNDS', 'invalid direction (valid: X, Y or Z)' ) CALL PRINT_MSG( NVERB_ERROR, 'GEN', 'STORE_GRID_1DIR_BOUNDS', 'invalid direction (valid: X, Y or Z)' )
END SELECT END SELECT
IF ( GALLOC ) DEALLOCATE( ZHAT_GLOB ) IF ( GALLOC ) DEALLOCATE( ZHAT_GLOB )
IF ( GALLOCM ) DEALLOCATE( ZHATM_GLOB )
END SUBROUTINE STORE_GRID_1DIR_BOUNDS END SUBROUTINE STORE_GRID_1DIR_BOUNDS
!----------------------------------------------------------------- !-----------------------------------------------------------------
!----------------------------------------------------------------- !-----------------------------------------------------------------
SUBROUTINE STORE_GRID_BOUNDS( PXHAT, PYHAT, PZHAT, PHAT_BOUND ) SUBROUTINE STORE_GRID_BOUNDS( PXHAT, PYHAT, PZHAT, PXHATM, PYHATM, PZHATM, PHAT_BOUND, PHATM_BOUND )
IMPLICIT NONE IMPLICIT NONE
REAL, DIMENSION(:), INTENT(IN) :: PXHAT ! Position x in the conformal or cartesian plane REAL, DIMENSION(:), INTENT(IN) :: PXHAT ! Position x in the conformal or cartesian plane
REAL, DIMENSION(:), INTENT(IN) :: PYHAT ! Position y in the conformal or cartesian plane REAL, DIMENSION(:), INTENT(IN) :: PYHAT ! Position y in the conformal or cartesian plane
REAL, DIMENSION(:), INTENT(IN) :: PZHAT ! Position y in the conformal or cartesian plane REAL, DIMENSION(:), INTENT(IN) :: PZHAT ! Position y in the conformal or cartesian plane
REAL, DIMENSION(:), INTENT(INOUT) :: PHAT_BOUND ! Boundaries of global domain in the conformal or cartesian plane REAL, DIMENSION(:), INTENT(IN) :: PXHATM ! id at mass points
REAL, DIMENSION(:), INTENT(IN) :: PYHATM ! id at mass points
REAL, DIMENSION(:), INTENT(IN) :: PZHATM ! id at mass points
REAL, DIMENSION(:), INTENT(INOUT) :: PHAT_BOUND ! Boundaries of global domain in the conformal or cartesian plane
REAL, DIMENSION(:), INTENT(INOUT) :: PHATM_BOUND ! id at mass points
CALL STORE_GRID_1DIR_BOUNDS( 'X', PXHAT, PHAT_BOUND ) CALL STORE_GRID_1DIR_BOUNDS( 'X', PXHAT, PXHATM, PHAT_BOUND, PHATM_BOUND )
CALL STORE_GRID_1DIR_BOUNDS( 'Y', PYHAT, PHAT_BOUND ) CALL STORE_GRID_1DIR_BOUNDS( 'Y', PYHAT, PYHATM, PHAT_BOUND, PHATM_BOUND )
CALL STORE_GRID_1DIR_BOUNDS( 'Z', PZHAT, PHAT_BOUND ) CALL STORE_GRID_1DIR_BOUNDS( 'Z', PZHAT, PZHATM, PHAT_BOUND, PHATM_BOUND )
END SUBROUTINE STORE_GRID_BOUNDS END SUBROUTINE STORE_GRID_BOUNDS
!----------------------------------------------------------------- !-----------------------------------------------------------------
!----------------------------------------------------------------- !-----------------------------------------------------------------
SUBROUTINE STORE_HORGRID_BOUNDS( PXHAT, PYHAT, PHAT_BOUND ) SUBROUTINE STORE_HORGRID_BOUNDS( PXHAT, PYHAT, PXHATM, PYHATM, PHAT_BOUND, PHATM_BOUND )
IMPLICIT NONE IMPLICIT NONE
REAL, DIMENSION(:), INTENT(IN) :: PXHAT ! Position x in the conformal or cartesian plane REAL, DIMENSION(:), INTENT(IN) :: PXHAT ! Position x in the conformal or cartesian plane
REAL, DIMENSION(:), INTENT(IN) :: PYHAT ! Position y in the conformal or cartesian plane REAL, DIMENSION(:), INTENT(IN) :: PYHAT ! Position y in the conformal or cartesian plane
REAL, DIMENSION(:), INTENT(INOUT) :: PHAT_BOUND ! Boundaries of global domain in the conformal or cartesian plane REAL, DIMENSION(:), INTENT(IN) :: PXHATM ! id at mass points
REAL, DIMENSION(:), INTENT(IN) :: PYHATM ! id at mass points
REAL, DIMENSION(:), INTENT(INOUT) :: PHAT_BOUND ! Boundaries of global domain in the conformal or cartesian plane
REAL, DIMENSION(:), INTENT(INOUT) :: PHATM_BOUND ! id at mass points
CALL STORE_GRID_1DIR_BOUNDS( 'X', PXHAT, PHAT_BOUND ) CALL STORE_GRID_1DIR_BOUNDS( 'X', PXHAT, PXHATM, PHAT_BOUND, PHATM_BOUND )
CALL STORE_GRID_1DIR_BOUNDS( 'Y', PYHAT, PHAT_BOUND ) CALL STORE_GRID_1DIR_BOUNDS( 'Y', PYHAT, PYHATM, PHAT_BOUND, PHATM_BOUND )
END SUBROUTINE STORE_HORGRID_BOUNDS END SUBROUTINE STORE_HORGRID_BOUNDS
!----------------------------------------------------------------- !-----------------------------------------------------------------
!----------------------------------------------------------------- !-----------------------------------------------------------------
SUBROUTINE STORE_VERGRID_BOUNDS( PZHAT, PHAT_BOUND ) SUBROUTINE STORE_VERGRID_BOUNDS( PZHAT, PZHATM, PHAT_BOUND, PHATM_BOUND )
IMPLICIT NONE IMPLICIT NONE
REAL, DIMENSION(:), INTENT(IN) :: PZHAT ! Position y in the conformal or cartesian plane REAL, DIMENSION(:), INTENT(IN) :: PZHAT ! Position y in the conformal or cartesian plane
REAL, DIMENSION(:), INTENT(INOUT) :: PHAT_BOUND ! Boundaries of global domain in the conformal or cartesian plane REAL, DIMENSION(:), INTENT(IN) :: PZHATM ! id at mass points
REAL, DIMENSION(:), INTENT(INOUT) :: PHAT_BOUND ! Boundaries of global domain in the conformal or cartesian plane
REAL, DIMENSION(:), INTENT(INOUT) :: PHATM_BOUND ! id at mass points
CALL STORE_GRID_1DIR_BOUNDS( 'Z', PZHAT, PHAT_BOUND ) CALL STORE_GRID_1DIR_BOUNDS( 'Z', PZHAT, PZHATM, PHAT_BOUND, PHATM_BOUND )
END SUBROUTINE STORE_VERGRID_BOUNDS END SUBROUTINE STORE_VERGRID_BOUNDS
!----------------------------------------------------------------- !-----------------------------------------------------------------
......
...@@ -464,8 +464,7 @@ PLEN2 = XLEN21 ...@@ -464,8 +464,7 @@ PLEN2 = XLEN21
CALL INTERP_HORGRID_TO_MASSPOINTS( PXHAT, PYHAT, PXHATM, PYHATM ) CALL INTERP_HORGRID_TO_MASSPOINTS( PXHAT, PYHAT, PXHATM, PYHATM )
! Collect global domain boundaries ! Collect global domain boundaries
CALL STORE_GRID_BOUNDS( PXHAT, PYHAT, PZHAT, PHAT_BOUND ) CALL STORE_GRID_BOUNDS( PXHAT, PYHAT, PZHAT, PXHATM, PYHATM, PZHATM, PHAT_BOUND, PHATM_BOUND )
CALL STORE_GRID_BOUNDS( PXHATM, PYHATM, PZHATM, PHATM_BOUND )
!!$======= !!$=======
!!$ IXSIZE1=SIZE(XXHAT1) !!$ IXSIZE1=SIZE(XXHAT1)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment