SURFEX v8.1
General documentation of Surfex
compare_orography.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 compare_orography (DTCO, U, HPROGRAM, OSURFZS, PDELT_ZSMAX )
7 !**************************************************************************
8 !
9 !! PURPOSE
10 !! -------
11 !! Check consistency orographies read from forcing file and from initial file
12 !!
13 !!** METHOD
14 !! ------
15 !!
16 !! EXTERNAL
17 !! --------
18 !!
19 !! IMPLICIT ARGUMENTS
20 !! ------------------
21 !!
22 !! REFERENCE
23 !! ---------
24 !!
25 !!
26 !! AUTHOR
27 !! ------
28 !! P. Le Moigne *Meteo France*
29 !!
30 !
32 USE modd_surf_atm_n, ONLY : surf_atm_t
33 !
34 USE modi_init_io_surf_n
36 USE modi_end_io_surf_n
37 USE modi_get_luout
38 USE modd_surf_par, ONLY : xundef
39 USE modd_forc_atm, ONLY : xzs
40 USE modd_surf_conf, ONLY : cprogname
41 !
42 USE modi_set_surfex_filein
43 !
44 USE yomhook ,ONLY : lhook, dr_hook
45 USE parkind1 ,ONLY : jprb
46 !
47 USE modi_abor1_sfx
48 !
49 IMPLICIT NONE
50 !
51 ! global variables
52 !
53 TYPE(data_cover_t), INTENT(INOUT) :: DTCO
54 TYPE(surf_atm_t), INTENT(INOUT) :: U
55 !
56  CHARACTER(LEN=6) ,INTENT(IN) :: HPROGRAM
57 REAL ,INTENT(IN) :: PDELT_ZSMAX
58 LOGICAL ,INTENT(IN) :: OSURFZS
59 
60 ! local variables
61 INTEGER :: ILUOUT
62 INTEGER :: IRET
63 REAL, DIMENSION(SIZE(XZS,1)) :: ZS1 ! orography read from FORCING.nc
64 REAL(KIND=JPRB) :: ZHOOK_HANDLE
65 !
66 IF (lhook) CALL dr_hook('COMPARE_OROGRAPHY',0,zhook_handle)
67 cprogname = hprogram
68 !
69 ! read orography
70 !
71 ! orography from initial file
72  CALL set_surfex_filein(hprogram,'PGD ') ! change input file name to pgd name
73  CALL init_io_surf_n(dtco, u, hprogram,'FULL ','SURF ','READ ')
74  CALL read_surf(hprogram,'ZS', zs1, iret)
75  CALL end_io_surf_n(hprogram)
76  CALL set_surfex_filein(hprogram,'PREP') ! restore input file name
77 !
78 IF (osurfzs) THEN
79  CALL get_luout('ASCII ',iluout)
80  WRITE(iluout,*)' OROGRAPHY READ FROM INITIAL FILE'
81  xzs(:) = zs1(:)
82 ELSEIF (maxval(abs(xzs(:)-zs1(:))) > pdelt_zsmax) THEN
83  CALL get_luout('ASCII ',iluout)
84  WRITE(iluout,*)' DIFFERENCE OF OROGRAPHY TOO BIG BETWEEN FORCING AND INITIAL FILE'
85  WRITE(iluout,*)' Maximum orography difference allowed (m) : ', pdelt_zsmax
86  WRITE(iluout,*)' Maximum orography difference (m) : ', maxval(abs(xzs(:)-zs1(:)))
87  CALL abor1_sfx('COMPARE_OROGRAPHY: DIFFERENCE OF OROGRAPHY TOO BIG BETWEEN FORCING AND INITIAL FILE')
88 ENDIF
89 !
90 IF (lhook) CALL dr_hook('COMPARE_OROGRAPHY',1,zhook_handle)
91 !
92 END SUBROUTINE compare_orography
subroutine set_surfex_filein(HPROGRAM, HMASK)
real, dimension(:), allocatable xzs
subroutine abor1_sfx(YTEXT)
Definition: abor1_sfx.F90:7
real, parameter xundef
integer, parameter jprb
Definition: parkind1.F90:32
character(len=6) cprogname
subroutine end_io_surf_n(HPROGRAM)
Definition: end_io_surfn.F90:7
subroutine get_luout(HPROGRAM, KLUOUT)
Definition: get_luout.F90:7
logical lhook
Definition: yomhook.F90:15
subroutine compare_orography(DTCO, U, HPROGRAM, OSURFZS, PDELT_ZSMAX)
subroutine init_io_surf_n(DTCO, U, HPROGRAM, HMASK, HSCHEME, HACTION