SURFEX  V8_0
Surfex V8_0 release
 All Classes Files Functions Variables
read_ideal_flux_conf.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_ideal_flux_conf(HPROGRAM)
7 ! #######################################################
8 !
9 !!**** *READ_IDEAL_FLUX_CONF* - routine to read the configuration for ideal flux option
10 !!
11 !! PURPOSE
12 !! -------
13 !!
14 !!** METHOD
15 !! ------
16 !!
17 !! EXTERNAL
18 !! --------
19 !!
20 !!
21 !! IMPLICIT ARGUMENTS
22 !! ------------------
23 !!
24 !! REFERENCE
25 !! ---------
26 !!
27 !!
28 !! AUTHOR
29 !! ------
30 !! V. Masson *Meteo France*
31 !!
32 !! MODIFICATIONS
33 !! -------------
34 !! Original 01/2003
35 !-------------------------------------------------------------------------------
36 !
37 !* 0. DECLARATIONS
38 ! ------------
39 !
40 USE modd_surf_par, ONLY : xundef
41 USE modd_csts, ONLY : xday, xlvtt
42 !
43 USE mode_pos_surf
44 !
45 USE modi_abor1_sfx
47 USE modi_get_luout
48 USE modi_open_namelist
49 USE modi_close_namelist
50 !
52 !
53 USE yomhook ,ONLY : lhook, dr_hook
54 USE parkind1 ,ONLY : jprb
55 !
56 USE modi_abor1_sfx
57 IMPLICIT NONE
58 !
59 !* 0.1 Declarations of arguments
60 ! -------------------------
61 !
62  CHARACTER(LEN=6), INTENT(IN) :: hprogram ! program calling GROUND
63 !
64 !* 0.2 Declarations of local variables
65 ! -------------------------------
66 !
67 LOGICAL :: gfound ! Return code when searching namelist
68 INTEGER :: iluout ! logical unit of output file
69 INTEGER :: inam ! logical unit of namelist file
70 REAL(KIND=JPRB) :: zhook_handle
71 !-------------------------------------------------------------------------------
72 !
73 !* get output listing file logical unit
74 !
75 IF (lhook) CALL dr_hook('READ_IDEAL_FLUX_CONF',0,zhook_handle)
76  CALL get_luout(hprogram,iluout)
77 !
78 !* open namelist file
79 !
80  CALL open_namelist(hprogram,inam)
81 !
82  csftq='kg/m2/s'
83 !
84 !* reading of namelist
85 ! -------------------
86 !
87  CALL posnam(inam,'NAM_IDEAL_FLUX',gfound,iluout)
88 IF (gfound) READ(unit=inam,nml=nam_ideal_flux)
89 !
90 IF (nforcf.GT.nforc_max .OR. nforct.GT.nforc_max) &
91  CALL abor1_sfx("READ_IDEAL_FLUX_CONF: NFORCF AND NFORCT MUST BE LOWER THAN 48")
92 !
93  CALL test_nam_var_surf(iluout,'CUSTARTYPE',custartype,'Z0 ','USTAR')
94  CALL test_nam_var_surf(iluout,'CSFTQ',csftq,'kg/m2/s','W/m2 ')
95 !
96 !* close namelist file
97 !
98  CALL close_namelist(hprogram,inam)
99 !
100 IF (custartype=='Z0 ' .AND. xz0==xundef) THEN
101  CALL abor1_sfx( &
102  'FATAL ERROR : XZ0 must be prescribed in namelist NAM_IDEAL_FLUX if CUSTARTYPE="Z0 "')
103 END IF
104 
105 IF (csftq=='W/m2 ') THEN
106  xsftq=xsftq/xlvtt
107 END IF
108 !
109 IF (lhook) CALL dr_hook('READ_IDEAL_FLUX_CONF',1,zhook_handle)
110 !-------------------------------------------------------------------------------
111 !
112 END SUBROUTINE read_ideal_flux_conf
subroutine read_ideal_flux_conf(HPROGRAM)
subroutine abor1_sfx(YTEXT)
Definition: abor1_sfx.F90:6
subroutine close_namelist(HPROGRAM, KLUNAM)
subroutine posnam(KULNAM, HDNAML, OFOUND, KLUOUT)
subroutine get_luout(HPROGRAM, KLUOUT)
Definition: get_luout.F90:6
subroutine open_namelist(HPROGRAM, KLUNAM, HFILE)