SURFEX v8.1
General documentation of Surfex
read_pgd_seafluxn.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 read_pgd_seaflux_n (DTCO, DTS, SG, S, U, UG, GCP, HPROGRAM)
7 ! #########################################
8 !
9 !!**** *READ_PGD_SEAFLUX_n* - routine to read SEAFLUX physiographic fields
10 !!
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/2003
36 !-------------------------------------------------------------------------------
37 !
38 !* 0. DECLARATIONS
39 ! ------------
40 !
43 USE modd_sfx_grid_n, ONLY : grid_t
44 USE modd_seaflux_n, ONLY : seaflux_t
45 USE modd_surf_atm_n, ONLY : surf_atm_t
48 !
50 !
51 USE modd_data_cover_par, ONLY : jpcover
52 !
54 !
56 USE modi_pack_init
57 USE modi_read_lcover
58 USE modi_read_pgd_seaflux_par_n
59 !
60 USE yomhook ,ONLY : lhook, dr_hook
61 USE parkind1 ,ONLY : jprb
62 !
63 USE modi_get_type_dim_n
64 !
65 IMPLICIT NONE
66 !
67 !* 0.1 Declarations of arguments
68 ! -------------------------
69 !
70 !
71 TYPE(data_cover_t), INTENT(INOUT) :: DTCO
72 TYPE(data_seaflux_t), INTENT(INOUT) :: DTS
73 TYPE(grid_t), INTENT(INOUT) :: SG
74 TYPE(seaflux_t), INTENT(INOUT) :: S
75 TYPE(surf_atm_t), INTENT(INOUT) :: U
76 TYPE(surf_atm_grid_t), INTENT(INOUT) :: UG
77 TYPE(grid_conf_proj_t),INTENT(INOUT) :: GCP
78 !
79  CHARACTER(LEN=6), INTENT(IN) :: HPROGRAM ! calling program
80 !
81 !* 0.2 Declarations of local variables
82 ! -------------------------------
83 !
84 INTEGER :: IRESP ! Error code after redding
85 !
86  CHARACTER(LEN=12) :: YRECFM ! Name of the article to be read
87 !
88 INTEGER :: IVERSION ! surface version
89 REAL(KIND=JPRB) :: ZHOOK_HANDLE
90 !
91 !-------------------------------------------------------------------------------
92 !
93 !* 1D physical dimension
94 !
95 IF (lhook) CALL dr_hook('READ_PGD_SEAFLUX_N',0,zhook_handle)
96 yrecfm='SIZE_SEA'
97  CALL get_type_dim_n(dtco, u, 'SEA ',sg%NDIM)
98 !
99 !
100 !* 2. Physiographic data fields:
101 ! -------------------------
102 !
103 !* cover classes
104 !
105 ALLOCATE(s%LCOVER(jpcover))
106 ALLOCATE(s%XZS(sg%NDIM))
107 ALLOCATE(sg%XLAT (sg%NDIM))
108 ALLOCATE(sg%XLON (sg%NDIM))
109 ALLOCATE(sg%XMESH_SIZE (sg%NDIM))
110  CALL pack_init(dtco,u,ug,hprogram,'SEA ',sg,s%LCOVER,s%XCOVER,s%XZS )
111 !
112 !* orography
113 !
114 s%XZS(:) = 0.
115 !
116 yrecfm='VERSION'
117  CALL read_surf(hprogram,yrecfm,iversion,iresp)
118 !
119 !* bathymetry
120 !
121 ALLOCATE(s%XSEABATHY(sg%NDIM))
122 IF (iversion<=3) THEN
123  s%XSEABATHY(:) = -300.
124 ELSE
125  yrecfm='BATHY'
126  CALL read_surf(hprogram,yrecfm,s%XSEABATHY(:),iresp)
127 END IF
128 !
129 !* sst
130 !
131 !
132 IF (iversion<3) THEN
133  dts%LSST_DATA = .false.
134 ELSE
135  yrecfm='SST_DATA'
136  CALL read_surf(hprogram,yrecfm,dts%LSST_DATA,iresp)
137 END IF
138 !
139 IF (dts%LSST_DATA) CALL read_pgd_seaflux_par_n(dtco, u, gcp, dts, sg%NDIM, hprogram,sg%NDIM)
140 !
141 IF (lhook) CALL dr_hook('READ_PGD_SEAFLUX_N',1,zhook_handle)
142 !
143 !------------------------------------------------------------------------------!
144 END SUBROUTINE read_pgd_seaflux_n
subroutine get_type_dim_n(DTCO, U, HTYPE, KDIM)
subroutine pack_init(DTCO, U, UG, HPROGRAM, HSURF, G, OCOVER, PCOV
Definition: pack_init.F90:7
subroutine read_pgd_seaflux_n(DTCO, DTS, SG, S, U, UG, GCP, HPROG
subroutine read_pgd_seaflux_par_n(DTCO, U, GCP, DTS, KDIM, HPROGR
subroutine read_surf_cov(HPROGRAM, HREC, PFIELD, OFLAG, KRESP, HCOMMENT, HDIR)
integer, parameter jprb
Definition: parkind1.F90:32
logical lhook
Definition: yomhook.F90:15