35 USE modd_isba_par
, ONLY : xwgmin
45 USE modi_read_topd_file
46 USE modi_read_file_isbamap
66 INTEGER,
DIMENSION(:),
INTENT(IN) :: KR_NATURE
68 CHARACTER(LEN=6),
INTENT(IN) :: HPROGRAM
69 INTEGER,
INTENT(IN) :: KI
76 INTEGER :: JSTP,JCAT,JPIX
77 REAL,
DIMENSION(:),
ALLOCATABLE :: ZAS
78 REAL,
DIMENSION(:),
ALLOCATABLE :: ZWTOPT
79 CHARACTER(LEN=50),
DIMENSION(:),
ALLOCATABLE :: YFILETOP
80 LOGICAL :: LSTOCK, LWG, LASAT
82 REAL :: ZCNT_UNDEF,ZSUM1,ZSUM2, ZDENOM
83 REAL(KIND=JPRB) :: ZHOOK_HANDLE
85 IF (
lhook)
CALL dr_hook(
'RESTART_COUPL_TOPD',0,zhook_handle)
94 INQUIRE(file=
'stocks_init.txt', exist=lstock)
95 INQUIRE(file=
'surfcont_init.map', exist=lasat)
98 WRITE(iluout,*)
'You asked to run in restart mode but stock file is missing' 99 CALL abor1_sfx(
"RESTART_COUPL_TOPD_n: stock file is missing")
100 ELSEIF (.NOT.lasat)
THEN 101 WRITE(iluout,*)
'You asked to run in restart mode but contributive area file is missing' 102 CALL abor1_sfx(
"RESTART_COUPL_TOPD_n: contributive area file is missing")
105 CALL open_file(
'ASCII ',
nunit,
'stocks_init.txt',
'FORMATTED',haction=
'READ ')
135 WRITE(*,*)
'Write pixels water content files' 137 ALLOCATE(zwtopt(
npmax))
138 ALLOCATE(yfiletop(
nncat))
142 yfiletop(jcat)=
trim(
ccat(jcat))//
'_xwtop_init.map' 143 INQUIRE(file=yfiletop(jcat), exist=lwg)
146 WRITE(iluout,*)
'You asked to run in restart mode but pixels water content file is missing' 147 WRITE(iluout,*)
'for catchment : ',
ccat(jcat)
148 CALL abor1_sfx(
"RESTART_COUPL_TOPD_n: pixels water content file is missing")
156 DO jpix=1,
SIZE(
nline(jcat,:))
164 IF ( abs(zsum2-zsum1)>100. )
THEN 167 DO jj=1,
SIZE(
nline,2)
168 IF (
nline(jcat,jj)/=0 )
THEN 173 IF (zcnt_undef/=0.)
THEN 174 zdenom = (zsum2-zsum1)/zcnt_undef
175 DO jj=1,
SIZE(
nline,2)
176 IF (
nline(jcat,jj)/=0 )
THEN 193 WRITE(*,*)
'Read Asat files' 195 CALL open_file(
'ASCII ',
nunit,
'surfcont_init.map',
'FORMATTED',haction=
'READ ')
202 IF (
lhook)
CALL dr_hook(
'RESTART_COUPL_TOPD',1,zhook_handle)
subroutine read_topd_file(HPROGRAM, HFILE, HFORM, KNPT, PTOPD_READ)
static const char * trim(const char *name, int *n)
subroutine restart_coupl_topd(UG, KR_NATURE, HPROGRAM, KI)
real, dimension(:,:), allocatable xwtopt
subroutine read_file_isbamap(UG, KUNIT, PVAR, KI)
subroutine open_file(HPROGRAM, KUNIT, HFILE, HFORM, HACTION, HACCESS, KR
character(len=15), dimension(jpcat) ccat
integer, dimension(:,:), allocatable nline
subroutine abor1_sfx(YTEXT)
real, dimension(:), allocatable xas_nature
integer, parameter nundef
subroutine close_file(HPROGRAM, KUNIT)
subroutine get_luout(HPROGRAM, KLUOUT)
intent(out) overrides sub arrays one Sort by the least significant key first sum(iindex(1:n))
real, dimension(:,:), allocatable xdr_torout
integer, dimension(:), allocatable nnpt
real, dimension(:,:), allocatable xrun_torout
integer, dimension(:), allocatable nnmc