SURFEX v7.3
General documentation of Surfex
 All Classes Files Functions Variables Typedefs
/home/dasprezs/EXPORT_v7_3/src/SURFEX/get_mesh_dim_gauss.F90
Go to the documentation of this file.
00001 !     #########
00002       SUBROUTINE GET_MESH_DIM_GAUSS(KGRID_PAR,KL,PGRID_PAR,PMESHSIZE,PDX,PDY)
00003 !     ##############################################################
00004 !
00005 !!**** *GET_MESH_DIM_GAUSS* get the grid mesh dimensions
00006 !!
00007 !!    PURPOSE
00008 !!    -------
00009 !!
00010 !!    METHOD
00011 !!    ------
00012 !!   
00013 !!    REFERENCE
00014 !!    ---------
00015 !!
00016 !!    AUTHOR
00017 !!    ------
00018 !!
00019 !!    V. Masson         Meteo-France
00020 !!
00021 !!    MODIFICATION
00022 !!    ------------
00023 !!
00024 !!    Original    03/2004
00025 !!
00026 !----------------------------------------------------------------------------
00027 !
00028 !*    0.     DECLARATION
00029 !            -----------
00030 !
00031 USE MODD_CSTS, ONLY : XPI, XRADIUS
00032 !
00033 USE MODE_GRIDTYPE_GAUSS
00034 !
00035 !
00036 USE YOMHOOK   ,ONLY : LHOOK,   DR_HOOK
00037 USE PARKIND1  ,ONLY : JPRB
00038 !
00039 IMPLICIT NONE
00040 !
00041 !*    0.1    Declaration of arguments
00042 !            ------------------------
00043 !
00044 INTEGER,                         INTENT(IN)    :: KGRID_PAR ! size of PGRID_PAR
00045 INTEGER,                         INTENT(IN)    :: KL        ! number of points
00046 REAL,    DIMENSION(KGRID_PAR),   INTENT(IN)    :: PGRID_PAR ! grid parameters
00047 REAL,    DIMENSION(KL),          INTENT(IN)    :: PMESHSIZE ! mesh size (m2)
00048 REAL,    DIMENSION(KL),          INTENT(OUT)   :: PDX       ! mean dimension in x dir. (meters)
00049 REAL,    DIMENSION(KL),          INTENT(OUT)   :: PDY       ! mean dimension in y dir. (meters)
00050 !
00051 !*    0.2    Declaration of other local variables
00052 !            ------------------------------------
00053 !
00054 INTEGER :: INLATI    ! number of pseudo-latitudes
00055 REAL    :: ZLAPO     ! latitude of the rotated pole  (deg)
00056 REAL    :: ZLOPO     ! longitude of the rotated pole (deg)
00057 REAL    :: ZCODIL    ! stretching factor (must be greater than or equal to 1)
00058 INTEGER, DIMENSION(:), ALLOCATABLE :: INLOPA ! number of pseudo-longitudes on each
00059                                              ! pseudo-latitude circle
00060 REAL,  DIMENSION(KL) :: ZLAT  ! latitudes
00061 REAL,  DIMENSION(KL) :: ZLON  ! longitudes
00062 REAL,  DIMENSION(KL) :: ZXINF ! minimum pseudo longitude of the grid point (deg)
00063 REAL,  DIMENSION(KL) :: ZXSUP ! maximum pseudo longitude of the grid point (deg)
00064 REAL,  DIMENSION(KL) :: ZYINF ! minimum pseudo latitude  of the grid point (deg)
00065 REAL,  DIMENSION(KL) :: ZYSUP ! maximum pseudo latitude  of the grid point (deg)
00066 REAL,  DIMENSION(KL) :: ZMAP  ! map factor
00067 REAL(KIND=JPRB) :: ZHOOK_HANDLE
00068 !
00069 !----------------------------------------------------------------------------
00070 !
00071 !*       1.    Gets grid definition
00072 !              --------------------
00073 !
00074 IF (LHOOK) CALL DR_HOOK('GET_MESH_DIM_GAUSS',0,ZHOOK_HANDLE)
00075  CALL GET_GRIDTYPE_GAUSS(PGRID_PAR,INLATI)
00076 !
00077 ALLOCATE(INLOPA(INLATI))
00078  CALL GET_GRIDTYPE_GAUSS(PGRID_PAR,INLATI,ZLAPO,ZLOPO,ZCODIL,INLOPA(:),PLAT=ZLAT,PLON=ZLON)
00079 !
00080 !---------------------------------------------------------------------------
00081 !
00082 !*       2.    Computation of pseudo latitude and pseudo longitude limits for each mesh
00083 !              ------------------------------------------------------------------------
00084 !
00085  CALL GAUSS_GRID_LIMITS(INLATI,INLOPA,ZXINF,ZXSUP,ZYINF,ZYSUP)
00086 !
00087 !-----------------------------------------------------------------------------
00088 !
00089 !*       3.    Map factor
00090 !              ----------
00091 !
00092  CALL MAP_FACTOR_GAUSS(ZLAPO,ZLOPO,ZCODIL,ZLAT,ZLON,ZMAP)
00093 !
00094 !-----------------------------------------------------------------------------
00095 !
00096 !*       4.    Compute mean grid dimension in each direction
00097 !              ---------------------------------------------
00098 !
00099 PDY(:) = XRADIUS * XPI/180. * (ZYSUP(:)-ZYINF(:)) * ZMAP(:)
00100 PDX(:) = PMESHSIZE(:) / PDY(:)
00101 !
00102 !-------------------------------------------------------------------------------
00103 !
00104 DEALLOCATE(INLOPA)
00105 IF (LHOOK) CALL DR_HOOK('GET_MESH_DIM_GAUSS',1,ZHOOK_HANDLE)
00106 !
00107 !-------------------------------------------------------------------------------
00108 !
00109 END SUBROUTINE GET_MESH_DIM_GAUSS