SURFEX v8.1
General documentation of Surfex
coupling_surf_topd.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 coupling_surf_topd (DE, DEC, DC, DMI, G, IO, S, K, NK, NP, NPE, UG, U, HPROGRAM, KI)
7 !###################################################################
8 !
9 !!**** *COUPLING_SURF_TOPD*
10 !!
11 !! PURPOSE
12 !! -------
13 !!
14 !! Driver for the coupling between SURFEX and TOPODYN
15 !!
16 !! REFERENCE
17 !! ---------
18 !! *COUPLING_SURF_TRIP from B. Decharme
19 !!
20 !! AUTHOR
21 !! ------
22 !! B. Vincendon
23 !!
24 !! MODIFICATIONS
25 !! -------------
26 !! Original 07/06/11
27 !-------------------------------------------------------------------------------
28 !
29 !* 0. DECLARATIONS
30 ! ------------
31 !
32 !
33 !
34 USE modd_diag_n, ONLY : diag_t
37 USE modd_sfx_grid_n, ONLY : grid_t
38 !
41 !
43 USE modd_surf_atm_n, ONLY : surf_atm_t
44 !
45 USE modi_get_luout
46 USE modi_coupl_topd
47 USE modi_rout_data_isba
48 USE modi_budget_coupl_rout
49 USE modi_write_discharge_file
50 USE modi_write_budget_coupl_rout
51 USE modi_prep_restart_coupl_topd
52 !
56 !
57 !
58 USE yomhook ,ONLY : lhook, dr_hook
59 USE parkind1 ,ONLY : jprb
60 !
61 IMPLICIT NONE
62 !
63 !* 0.1 declarations of arguments
64 !
65 !
66 TYPE(diag_t), INTENT(INOUT) :: DC
67 TYPE(diag_evap_isba_t), INTENT(INOUT) :: DE
68 TYPE(diag_evap_isba_t), INTENT(INOUT) :: DEC
69 TYPE(diag_misc_isba_t), INTENT(INOUT) :: DMI
70 TYPE(grid_t), INTENT(INOUT) :: G
71 TYPE(isba_options_t), INTENT(INOUT) :: IO
72 TYPE(isba_s_t), INTENT(INOUT) :: S
73 TYPE(isba_k_t), INTENT(INOUT) :: K
74 TYPE(isba_nk_t), INTENT(INOUT) :: NK
75 TYPE(isba_np_t), INTENT(INOUT) :: NP
76 TYPE(isba_npe_t), INTENt(INOUT) :: NPE
77 TYPE(surf_atm_grid_t), INTENT(INOUT) :: UG
78 TYPE(surf_atm_t), INTENT(INOUT) :: U
79 !
80  CHARACTER(LEN=6), INTENT(IN) :: HPROGRAM ! program calling surf. schemes
81 INTEGER, INTENT(IN) :: KI ! Surfex grid dimension
82  ! in a forcing iteration
83 !
84 !* 0.2 declarations of local variables
85 !
86  CHARACTER(LEN=3) :: YSTEP ! time stepsurf_tmp/off
87 INTEGER :: ILUOUT ! unit of output listing file
88 INTEGER :: JJ ! loop control
89 !
90 REAL, DIMENSION(KI) :: ZDG_FULL
91 REAL, DIMENSION(KI) :: ZWG2_FULL,ZWG3_FULL,ZDG2_FULL,ZDG3_FULL
92 REAL(KIND=JPRB) :: ZHOOK_HANDLE
93 !-------------------------------------------------------------------------------
94 IF (lhook) CALL dr_hook('COUPLING_SURF_TOPD',0,zhook_handle)
95 !
96  CALL get_luout(hprogram,iluout)
97 !
98 IF ( .NOT.lcoupl_topd ) THEN
99  IF (lhook) CALL dr_hook('COUPLING_SURF_TOPD',1,zhook_handle)
100  RETURN
101 ENDIF
102  !
103 IF ( ltopd_step ) THEN
104  !
105  ! * 1. Calling coupling or routing
106  !
107  IF (ntopd_step<10) THEN
108  WRITE(ystep,'(I1)') ntopd_step
109  ELSEIF (ntopd_step < 100) THEN
110  WRITE(ystep,'(I2)') ntopd_step
111  ELSE
112  WRITE(ystep,'(I3)') ntopd_step
113  ENDIF
114  !
115  write(iluout,*) 'pas de temps coupl ',ystep
116  !
117  IF (io%CRUNOFF=='TOPD') THEN
118  CALL coupl_topd(dec, dc, dmi, g%XMESH_SIZE, io, s, k, nk, np, npe, &
119  ug, u, hprogram, ystep, ki, ntopd_step)
120  ELSE
121  CALL rout_data_isba(dec, dc, dmi, g%XMESH_SIZE, io, np, npe, &
122  ug, u, hprogram, ki, ntopd_step)
123  ENDIF
124  !
125  IF (lbudget_topd) CALL budget_coupl_rout(de, dec, dc, dmi, io, np, npe, u, ki, ntopd_step)
126  !
127 endif! (LCOUPL_TOPD.AND......
128 !
129 IF (lhook) CALL dr_hook('COUPLING_SURF_TOPD',1,zhook_handle)
130 !-------------------------------------------------------------------------------
131 END SUBROUTINE coupling_surf_topd
subroutine coupl_topd(DEC, DC, DMI, PMESH_SIZE, IO, S, K, NK, NP,
Definition: coupl_topd.F90:8
integer, dimension(:), allocatable nm
real, dimension(:,:), allocatable xqb_dr
real, dimension(:,:), allocatable xqb_run
subroutine budget_coupl_rout(DE, DEC, DC, DMI, IO, NP, NPE, U, KN
integer nnb_topd_step
integer, dimension(:), allocatable nyear
subroutine coupling_surf_topd(DE, DEC, DC, DMI, G, IO, S, K, NK, NP, NPE, UG, U, HPROGRAM, KI)
integer, dimension(:), allocatable nh
integer, parameter jprb
Definition: parkind1.F90:32
subroutine get_luout(HPROGRAM, KLUOUT)
Definition: get_luout.F90:7
logical lhook
Definition: yomhook.F90:15
subroutine rout_data_isba(DEC, DC, DMI, PMESH_SIZE, IO, NP, NPE,
integer, dimension(:), allocatable nday
integer, dimension(:), allocatable nmonth
real, dimension(:,:), allocatable xqtot