SURFEX v8.1
General documentation of Surfex
tsz0.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 tsz0 (DTZ, PTIME, PTSTEP, KK, PEK )
7 ! ################################################################
8 !
9 !
10 !!**** *TSZ0*
11 !!
12 !! PURPOSE
13 !! -------
14 ! This subroutine computes the surface fluxes when the soil temperature,
15 ! humidity and rugisty length are prescribed. It uses these values and the
16 ! atmospheric fields at the first level located at dz/2 to compute a
17 ! vertical gradient and a drag coefficient is computed according to a
18 ! stability index ( Richardson number )
19 !
20 !!** METHOD
21 !! ------
22 !!
23 !! EXTERNAL
24 !! --------
25 !!
26 !! IMPLICIT ARGUMENTS
27 !! ------------------
28 !!
29 !! REFERENCE
30 !! ---------
31 !!
32 !!
33 !! AUTHOR
34 !! ------
35 !! J. Stein * Meteo-France *
36 !!
37 !! MODIFICATIONS
38 !! -------------
39 !! Original 25/01/96
40 !! 25/03/96 spatialize the input TS, WG, SST fields
41 !! 22/05/96 correct igrid value for the rain rate
42 !! 27/11/96 set realistic values for z0 fields on sea
43 !! V.Masson 09/07/97 add directional z0 computations and RESA correction
44 !! V.Masson 15/03/99 some computations are now done in GROUND_PARAMn
45 !! V.Masson 04/01/00 all computations are now done in ISBA
46 !! P. Le Moigne 03/2015 tsz0 time management
47 !-------------------------------------------------------------------------------
48 !
49 !* 0. DECLARATIONS
50 ! ------------
51 !
52 USE modd_isba_n, ONLY : isba_k_t, isba_pe_t
53 !
54 USE modd_data_tsz0_n, ONLY : data_tsz0_t
55 !
56 USE modd_csts, ONLY : xpi
57 USE modd_surf_par, ONLY : xundef
58 !
59 USE yomhook ,ONLY : lhook, dr_hook
60 USE parkind1 ,ONLY : jprb
61 !
62 IMPLICIT NONE
63 !
64 !* 0.1 declarations of arguments
65 !
66 !
67 !* general variables
68 ! -----------------
69 !
70 TYPE(isba_k_t), INTENT(INOUT) :: KK
71 TYPE(isba_pe_t), INTENT(INOUT) :: PEK
72 !
73 TYPE(data_tsz0_t), INTENT(INOUT) :: DTZ
74 !
75 REAL, INTENT(IN) :: PTIME ! Current time
76 REAL, INTENT(IN) :: PTSTEP ! timestep of the integration
77 !
78 !
79 !* 0.2 declarations of local variables
80 !
81 !
82 !* local variables for Ts time interpolation
83 ! ----------------------------------------
84 !
85 REAL :: ZA,ZTIMEP ! weigths and instant for the temporal interpolation
86 INTEGER :: IHOURP ! hourly data index for intant t +dt
87 INTEGER :: JPATCH ! loop counter on patches
88 !
89 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
90 ! enter here the temporal variations of the soil fields increments
91 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
92 !
93 ! prescribed values of the surface temperature increment over land (K)
94 REAL :: ZDTS_HOUR
95 ! prescribed values of the soil humidity increment at every hour (fraction)
96 REAL :: ZDHUGRD_HOUR
97 REAL(KIND=JPRB) :: ZHOOK_HANDLE
98 !-------------------------------------------------------------------------------
99 !
100 !* 1. TEMPORAL INTERPOLATION OF THE SURFACE TEMPERATURES AT T+DT
101 ! ----------------------------------------------------------
102 !
103 IF (lhook) CALL dr_hook('TSZ0',0,zhook_handle)
104 !
105 IF (dtz%NTIME==25) THEN
106  ztimep = mod(ptime+ptstep,86400.) ! recover the time from O HTU
107 ELSE
108  ztimep = ptime+ptstep ! accumulated time since beginning of run
109 ENDIF
110 !
111 ihourp = int(ztimep/3600.)+1
112 !
113 IF (dtz%NTIME==1) THEN
114  zdts_hour = dtz%XDATA_DTS (1)
115  zdhugrd_hour = dtz%XDATA_DHUGRD(1)
116 ELSE
117  zdts_hour = dtz%XDATA_DTS (ihourp)
118  zdhugrd_hour = dtz%XDATA_DHUGRD(ihourp)
119 ENDIF
120 !
121 ! temporal interpolation of the surface temperature increment over land at time t
122 za= zdts_hour /3600. * ptstep
123 WHERE (pek%XTG(:,:)/=xundef)
124  pek%XTG(:,:)= pek%XTG(:,:) + za
125 END WHERE
126 !
127 ! temporal interpolation of the soil humidity increment at time t
128 za= zdhugrd_hour /3600.* ptstep
129 WHERE (pek%XWG(:,:)/=xundef)
130  pek%XWG(:,:)= acos( 1. &
131  - 2.* min( 0.5 * (1. - cos( xpi * min(pek%XWG(:,:) /kk%XWFC(:,:),1.) )) + za , 1.) &
132  ) / xpi * kk%XWFC(:,:)
133 END WHERE
134 !
135 IF (lhook) CALL dr_hook('TSZ0',1,zhook_handle)
136 !-------------------------------------------------------------------------------
137 !
138 END SUBROUTINE tsz0
subroutine tsz0(DTZ, PTIME, PTSTEP, KK, PEK)
Definition: tsz0.F90:7
real, save xpi
Definition: modd_csts.F90:43
real, parameter xundef
integer, parameter jprb
Definition: parkind1.F90:32
logical lhook
Definition: yomhook.F90:15