SURFEX v8.1
General documentation of Surfex
zoom_pgd_seaflux.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 ! ######spl
6  SUBROUTINE zoom_pgd_seaflux (DTCO, DTS, SG, S, UG, U, GCP, &
7  HPROGRAM,HINIFILE,HINIFILETYPE,HFILE,HFILETYPE)
8 ! ##############################################################
9 !
10 !!**** *PGD_SEAFLUX* monitor for averaging and interpolations of SEAFLUX physiographic fields
11 !!
12 !! PURPOSE
13 !! -------
14 !!
15 !! METHOD
16 !! ------
17 !!
18 !
19 !! EXTERNAL
20 !! --------
21 !!
22 !! IMPLICIT ARGUMENTS
23 !! ------------------
24 !!
25 !! REFERENCE
26 !! ---------
27 !!
28 !! AUTHOR
29 !! ------
30 !!
31 !! P. Le Moigne Meteo-France
32 !!
33 !! MODIFICATION
34 !! ------------
35 !!
36 !! Original 09/2008
37 !! G. TANGUY 03/2009 : add reading and interpolation of XDATA_SST and
38 !! TDATA_SST in the case LDATA_SST=T
39 !!
40 !----------------------------------------------------------------------------
41 !
42 !* 0. DECLARATION
43 ! -----------
44 !
47 USE modd_sfx_grid_n, ONLY : grid_t
48 USE modd_seaflux_n, ONLY : seaflux_t
50 USE modd_surf_atm_n, ONLY : surf_atm_t
52 !
53 USE modd_data_cover_par, ONLY : jpcover
55 !
56 !
57 USE modi_get_luout
58 USE modi_open_aux_io_surf
59 USE modi_get_surf_size_n
60 USE modi_pack_pgd
61 USE modi_prep_grid_extern
62 USE modi_prep_output_grid
64 USE modi_hor_interpol
65 USE modi_read_pgd_seaflux_par_n
66 USE modi_close_aux_io_surf
67 USE modi_clean_prep_output_grid
68 !
69 USE yomhook ,ONLY : lhook, dr_hook
70 USE parkind1 ,ONLY : jprb
71 !
72 IMPLICIT NONE
73 !
74 !* 0.1 Declaration of arguments
75 ! ------------------------
76 !
77 !
78 TYPE(data_cover_t), INTENT(INOUT) :: DTCO
79 TYPE(data_seaflux_t), INTENT(INOUT) :: DTS
80 TYPE(grid_t), INTENT(INOUT) :: SG
81 TYPE(seaflux_t), INTENT(INOUT) :: S
82 TYPE(surf_atm_grid_t), INTENT(INOUT) :: UG
83 TYPE(surf_atm_t), INTENT(INOUT) :: U
84 TYPE(grid_conf_proj_t),INTENT(INOUT) :: GCP
85 !
86  CHARACTER(LEN=6), INTENT(IN) :: HPROGRAM ! Type of program
87  CHARACTER(LEN=28), INTENT(IN) :: HINIFILE ! input atmospheric file name
88  CHARACTER(LEN=6), INTENT(IN) :: HINIFILETYPE! input atmospheric file type
89  CHARACTER(LEN=28), INTENT(IN) :: HFILE ! output file name
90  CHARACTER(LEN=6), INTENT(IN) :: HFILETYPE ! output file type
91 !
92 !
93 !* 0.2 Declaration of local variables
94 ! ------------------------------
95 !
96 !* 0.3 Declaration of namelists
97 ! ------------------------
98 !
99 REAL, DIMENSION(:,:), ALLOCATABLE :: ZSEABATHY, ZWORK
100 INTEGER :: ILUOUT
101 INTEGER :: INI
102 INTEGER :: IRESP
103 INTEGER :: JTIME ! loop index
104 INTEGER :: IVERSION, IBUGFIX
105 REAL(KIND=JPRB) :: ZHOOK_HANDLE
106 !
107 !-------------------------------------------------------------------------------
108 !
109 IF (lhook) CALL dr_hook('ZOOM_PGD_SEAFLUX',0,zhook_handle)
110  CALL get_luout(hprogram,iluout)
111 !
112 !* 1. Preparation of IO for reading in the file
113 ! -----------------------------------------
114 !
115 !* Note that all points are read, even those without physical meaning.
116 ! These points will not be used during the horizontal interpolation step.
117 ! Their value must be defined as XUNDEF.
118 !
119 !
120  CALL open_aux_io_surf(hinifile,hinifiletype,'FULL ')
121 !
122 !-------------------------------------------------------------------------------
123 !
124 !* 5. Number of points and packing
125 ! ----------------------------
126 !
127  CALL get_surf_size_n(dtco, u, 'SEA ',sg%NDIM)
128 !
129 ALLOCATE(s%LCOVER (jpcover))
130 ALLOCATE(s%XZS (sg%NDIM))
131 ALLOCATE(sg%XLAT (sg%NDIM))
132 ALLOCATE(sg%XLON (sg%NDIM))
133 ALLOCATE(sg%XMESH_SIZE (sg%NDIM))
134 !
135  CALL pack_pgd(dtco, u, hprogram, 'SEA ', sg, s%LCOVER, s%XCOVER, s%XZS )
136 !
137 !------------------------------------------------------------------------------
138 !
139 !* 2. Reading of grid
140 ! ---------------
141 !
142  CALL prep_output_grid(ug%G, sg, u%NSIZE_FULL, iluout)
143 !
144  CALL prep_grid_extern(gcp, hinifiletype,iluout,cingrid_type,cinterp_type,ini)
145 !
146 !* mask where interpolations must be done
147 !
148 linterp(:) = .true.
149 !
150 !------------------------------------------------------------------------------
151 !
152 !* 3. Reading of fields
153 ! -----------------
154 !
155 ALLOCATE(zseabathy(ini,1))
156  CALL read_surf(hprogram,'BATHY',zseabathy(:,1),iresp,hdir='A')
157 !
158 ALLOCATE(zwork(sg%NDIM,1))
159  CALL hor_interpol(dtco, u, gcp, iluout,zseabathy(:,1:1),zwork(:,1:1))
160 ALLOCATE(s%XSEABATHY (sg%NDIM))
161 s%XSEABATHY(:) = zwork(:,1)
162 DEALLOCATE(zseabathy,zwork)
163 !
164 !============================================================
165 ! G. TANGUY 03/2009
166 ! reading of fields for SST_DATA
167  CALL read_surf(hprogram,'SST_DATA',dts%LSST_DATA,iresp)
168 !
169 IF (dts%LSST_DATA) &
170  CALL read_pgd_seaflux_par_n(dtco, u, gcp, dts, sg%NDIM, hprogram,ini,hdir='A')
171 !
172 !============================================================
173 !
174  CALL close_aux_io_surf(hinifile,hinifiletype)
175 !
176 !============================================================
177 !
179 IF (lhook) CALL dr_hook('ZOOM_PGD_SEAFLUX',1,zhook_handle)
180 !-------------------------------------------------------------------------------
181 !
182 END SUBROUTINE zoom_pgd_seaflux
subroutine get_surf_size_n(DTCO, U, HTYPE, KL)
character(len=10) cingrid_type
Definition: modd_prep.F90:39
subroutine clean_prep_output_grid
subroutine read_pgd_seaflux_par_n(DTCO, U, GCP, DTS, KDIM, HPROGR
character(len=6) cinterp_type
Definition: modd_prep.F90:40
subroutine close_aux_io_surf(HFILE, HFILETYPE)
subroutine prep_grid_extern(GCP, HFILETYPE, KLUOUT, HGRIDTYPE, HINTER
subroutine pack_pgd(DTCO, U, HPROGRAM, HSURF, G, OCOVER, PCOVER,
Definition: pack_pgd.F90:7
logical, dimension(:), allocatable linterp
Definition: modd_prep.F90:43
subroutine hor_interpol(DTCO, U, GCP, KLUOUT, PFIELDIN, PFIELDOUT)
Definition: hor_interpol.F90:7
integer, parameter jprb
Definition: parkind1.F90:32
subroutine prep_output_grid(UG, G, KSIZE_FULL, KLUOUT)
subroutine get_luout(HPROGRAM, KLUOUT)
Definition: get_luout.F90:7
logical lhook
Definition: yomhook.F90:15
subroutine open_aux_io_surf(HFILE, HFILETYPE, HMASK, HDIR)
subroutine zoom_pgd_seaflux(DTCO, DTS, SG, S, UG, U, GCP, HPROGRAM, HINIFILE, HINIFILETYPE, HFILE,