SURFEX  V8_0
Surfex V8_0 release
 All Classes Files Functions Variables
prep_seaflux_netcdf.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 prep_seaflux_netcdf(HPROGRAM,HSURF,HFILE,KLUOUT,PFIELD)
7 ! #################################################################################
8 !
9 !!**** *PREP_SEAFLUX_NETCDF* - prepares SEAFLUX fields from oceanic analyses in NETCDF
10 !!
11 !! PURPOSE
12 !! -------
13 !
14 !!** METHOD
15 !! ------
16 !!
17 !! REFERENCE
18 !! ---------
19 !!
20 !!
21 !! AUTHOR
22 !! ------
23 !! C. Lebeaupin Brossier
24 !!
25 !! MODIFICATIONS
26 !! -------------
27 !! Original 01/2008
28 !! Modified 09/2013 : S. Senesi : extends to SSS and SIC fields
29 !!------------------------------------------------------------------
30 !
32 !
33 !USE MODD_TYPE_DATE_SURF
34 !
35 USE modd_prep, ONLY : cingrid_type
36 USE modd_grid_latlonregul, ONLY : nilength
37 !
38 !
39 USE yomhook ,ONLY : lhook, dr_hook
40 USE parkind1 ,ONLY : jprb
41 !
42 IMPLICIT NONE
43 !
44 !* 0.1 declarations of arguments
45 !
46  CHARACTER(LEN=6), INTENT(IN) :: hprogram ! program calling surf. schemes
47  CHARACTER(LEN=7), INTENT(IN) :: hsurf ! type of field
48  CHARACTER(LEN=28), INTENT(IN) :: hfile ! name of file
49 INTEGER, INTENT(IN) :: kluout ! logical unit of output listing
50 REAL,DIMENSION(:,:), POINTER :: pfield ! field to interpolate horizontally
51 !
52 !* 0.2 declarations of local variables
53 !
54 !TYPE (DATE_TIME) :: TZTIME_GRIB ! current date and time
55 !CHARACTER(LEN=6) :: YINMODEL ! model from which GRIB file originates
56 REAL, DIMENSION(:), POINTER :: zfield ! field read
57  CHARACTER(LEN=28) :: yncvar
58 REAL(KIND=JPRB) :: zhook_handle
59 !
60 !-------------------------------------------------------------------------------------
61 !
62 !* 1. Grid type
63 ! ---------
64 IF (lhook) CALL dr_hook('PREP_SEAFLUX_NETCDF',0,zhook_handle)
65  cingrid_type='LATLON '
66 !
67 !* 2. Reading of field
68 ! ----------------
69 !-----------------
70 SELECT CASE(hsurf)
71 !-----------------
72 !
73 !* 2.1 Orography
74 ! ---------
75 !
76  CASE('ZS ')
77  yncvar='topo'
78  CALL prep_netcdf_grid(hfile,yncvar)
79  CALL read_netcdf_zs_sea(hfile,yncvar,zfield)
80  ALLOCATE(pfield(max(1,nilength),1))
81  pfield(:,1) = zfield(:)
82  DEALLOCATE(zfield)
83 !
84 !
85 !* 2.2 Temperature profiles
86 ! --------------------
87 !
88  CASE('SST ','SSS ','SIC ')
89  IF ( hsurf == 'SST ') THEN
90  yncvar='temperature'
91  ELSE IF ( hsurf == 'SSS ') THEN
92  yncvar='sss'
93  ELSE IF ( hsurf == 'SIC ') THEN
94  yncvar='sic'
95  END IF
96  CALL prep_netcdf_grid(hfile,yncvar)
97  CALL read_netcdf_sst(hfile,yncvar,zfield)
98  ALLOCATE(pfield(max(1,nilength),1))
99  pfield(:,1) = zfield(:)
100  DEALLOCATE(zfield)
101 !
102 END SELECT
103 IF (lhook) CALL dr_hook('PREP_SEAFLUX_NETCDF',1,zhook_handle)
104 !-------------------------------------------------------------------------------------
105 END SUBROUTINE prep_seaflux_netcdf
subroutine read_netcdf_sst(HFILENAME, HNCVARNAME, PFIELD)
subroutine prep_netcdf_grid(HFILENAME, HNCVARNAME)
subroutine read_netcdf_zs_sea(HFILENAME, HNCVARNAME, PFIELD)
subroutine prep_seaflux_netcdf(HPROGRAM, HSURF, HFILE, KLUOUT, PFIELD)