SURFEX  V8_0
Surfex V8_0 release
 All Classes Files Functions Variables
write_gridtype_lonlatval.F90
Go to the documentation of this file.
1 !SFX_LIC Copyright 1994-2014 CNRS, Meteo-France and Universite Paul Sabatier
2 !SFX_LIC This is part of the SURFEX software governed by the CeCILL-C licence
3 !SFX_LIC version 1. See LICENSE, CeCILL-C_V1-en.txt and CeCILL-C_V1-fr.txt
4 !SFX_LIC for details. version 1.
5 ! #################################################################
6  SUBROUTINE write_gridtype_lonlatval (DGU, U, &
7  hprogram,klu,kgrid_par,pgrid_par,kresp)
8 ! #################################################################
9 !
10 !!**** *WRITE_GRIDTYPE_IGN* - routine to write the horizontal grid
11 !!
12 !! PURPOSE
13 !! -------
14 !!
15 !!** METHOD
16 !! ------
17 !!
18 !! EXTERNAL
19 !! --------
20 !!
21 !!
22 !! IMPLICIT ARGUMENTS
23 !! ------------------
24 !!
25 !! REFERENCE
26 !! ---------
27 !!
28 !!
29 !! AUTHOR
30 !! ------
31 !! V. Masson *Meteo France*
32 !!
33 !! MODIFICATIONS
34 !! -------------
35 !! Original 01/2004
36 !-------------------------------------------------------------------------------
37 !
38 !* 0. DECLARATIONS
39 ! ------------
40 !
41 !
42 !
44 USE modd_surf_atm_n, ONLY : surf_atm_t
45 !
47 !
49 !
50 !
51 USE yomhook ,ONLY : lhook, dr_hook
52 USE parkind1 ,ONLY : jprb
53 !
54 IMPLICIT NONE
55 !
56 !* 0.1 Declarations of arguments
57 ! -------------------------
58 !
59 !
60 TYPE(diag_surf_atm_t), INTENT(INOUT) :: dgu
61 TYPE(surf_atm_t), INTENT(INOUT) :: u
62 !
63  CHARACTER(LEN=6), INTENT(IN) :: hprogram ! calling program
64 INTEGER, INTENT(IN) :: klu ! number of points
65 INTEGER, INTENT(IN) :: kgrid_par ! size of PGRID_PAR
66 REAL, DIMENSION(KGRID_PAR), INTENT(IN) :: pgrid_par ! parameters defining this grid
67 INTEGER, INTENT(OUT) :: kresp ! error return code
68 !
69 !* 0.2 Declarations of local variables
70 ! -------------------------------
71 !
72 REAL, DIMENSION(:), ALLOCATABLE :: zx ! X conformal coordinate of grid mesh (dim IIMAX)
73 REAL, DIMENSION(:), ALLOCATABLE :: zy ! Y conformal coordinate of grid mesh (dim IJMAX)
74 REAL, DIMENSION(:), ALLOCATABLE :: zdx ! X grid mesh size (dim IIMAX)
75 REAL, DIMENSION(:), ALLOCATABLE :: zdy ! Y grid mesh size (dim IJMAX)
76 !
77  CHARACTER(LEN=100) :: ycomment ! comment written in the file
78 REAL(KIND=JPRB) :: zhook_handle
79 !---------------------------------------------------------------------------
80 !
81 !* 1. Projection and 2D grid parameters
82 ! ---------------------------------
83 !
84 IF (lhook) CALL dr_hook('WRITE_GRIDTYPE_LONLATVAL',0,zhook_handle)
85 ALLOCATE(zx(klu))
86 ALLOCATE(zy(klu))
87 ALLOCATE(zdx(klu))
88 ALLOCATE(zdy(klu))
89 !
90  CALL get_gridtype_lonlatval(pgrid_par, &
91  px=zx,py=zy,pdx=zdx,pdy=zdy )
92 !
93 !---------------------------------------------------------------------------
94 !
95 !* 2. Writing of the grid definition parameters
96 ! -----------------------------------------
97 !
98 ycomment='XX'
99  CALL write_surf(dgu, u, &
100  hprogram,'XX',zx,kresp,ycomment)
101 !
102 ycomment='XY'
103  CALL write_surf(dgu, u, &
104  hprogram,'XY',zy,kresp,ycomment)
105 !
106 ycomment='XDX'
107  CALL write_surf(dgu, u, &
108  hprogram,'DX',zdx,kresp,ycomment)
109 !
110 ycomment='XDY'
111  CALL write_surf(dgu, u, &
112  hprogram,'DY',zdy,kresp,ycomment)
113 !
114 !---------------------------------------------------------------------------
115 DEALLOCATE(zx)
116 DEALLOCATE(zy)
117 DEALLOCATE(zdx)
118 DEALLOCATE(zdy)
119 IF (lhook) CALL dr_hook('WRITE_GRIDTYPE_LONLATVAL',1,zhook_handle)
120 !---------------------------------------------------------------------------
121 !
122 END SUBROUTINE write_gridtype_lonlatval
subroutine get_gridtype_lonlatval(PGRID_PAR, KL, PX, PY, PDX, PDY)
subroutine write_gridtype_lonlatval(DGU, U, HPROGRAM, KLU, KGRID_PAR, PGRID_PAR, KRESP)