SURFEX  V8_0
Surfex V8_0 release
 All Classes Files Functions Variables
write_gridtype_ign.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_ign (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 INTEGER :: ilambert ! Lambert type
73 REAL, DIMENSION(:), ALLOCATABLE :: zx ! X conformal coordinate of grid mesh (dim IIMAX)
74 REAL, DIMENSION(:), ALLOCATABLE :: zy ! Y conformal coordinate of grid mesh (dim IJMAX)
75 REAL, DIMENSION(:), ALLOCATABLE :: zdx ! X grid mesh size (dim IIMAX)
76 REAL, DIMENSION(:), ALLOCATABLE :: zdy ! Y grid mesh size (dim IJMAX)
77 !
78  CHARACTER(LEN=100) :: ycomment ! comment written in the file
79 REAL(KIND=JPRB) :: zhook_handle
80 !---------------------------------------------------------------------------
81 !
82 !* 1. Projection and 2D grid parameters
83 ! ---------------------------------
84 !
85 IF (lhook) CALL dr_hook('WRITE_GRIDTYPE_IGN',0,zhook_handle)
86 ALLOCATE(zx(klu))
87 ALLOCATE(zy(klu))
88 ALLOCATE(zdx(klu))
89 ALLOCATE(zdy(klu))
90 !
91  CALL get_gridtype_ign(pgrid_par,klambert=ilambert, &
92  px=zx,py=zy,pdx=zdx,pdy=zdy )
93 !
94 !---------------------------------------------------------------------------
95 !
96 
97 !* 2. Writing of the grid definition parameters
98 ! -----------------------------------------
99 !
100 SELECT CASE (ilambert)
101  CASE (1)
102  ycomment='LAMBERT 1'
103  CASE (2)
104  ycomment='LAMBERT 2'
105  CASE (3)
106  ycomment='LAMBERT 3'
107  CASE (4)
108  ycomment='LAMBERT 4'
109  CASE (5)
110  ycomment='LAMBERT 2 ETENDU'
111  CASE (6)
112  ycomment='LAMBERT 93'
113 END SELECT
114  CALL write_surf(dgu, u, &
115  hprogram,'LAMBERT ',ilambert, kresp,ycomment)
116 !
117 ycomment='XX'
118  CALL write_surf(dgu, u, &
119  hprogram,'XX',zx,kresp,ycomment)
120 !
121 ycomment='XY'
122  CALL write_surf(dgu, u, &
123  hprogram,'XY',zy,kresp,ycomment)
124 !
125 ycomment='XDX'
126  CALL write_surf(dgu, u, &
127  hprogram,'DX',zdx,kresp,ycomment)
128 !
129 ycomment='XDY'
130  CALL write_surf(dgu, u, &
131  hprogram,'DY',zdy,kresp,ycomment)
132 !
133 !---------------------------------------------------------------------------
134 DEALLOCATE(zx)
135 DEALLOCATE(zy)
136 DEALLOCATE(zdx)
137 DEALLOCATE(zdy)
138 IF (lhook) CALL dr_hook('WRITE_GRIDTYPE_IGN',1,zhook_handle)
139 !---------------------------------------------------------------------------
140 !
141 END SUBROUTINE write_gridtype_ign
subroutine get_gridtype_ign(PGRID_PAR, KLAMBERT, KL, PX, PY, PDX, PDY, KDIMX, KDIMY, PXALL, PYALL)
subroutine write_gridtype_ign(DGU, U, HPROGRAM, KLU, KGRID_PAR, PGRID_PAR, KRESP)