3 HFILE_FRC,HREADFRC,HDRAIN,HRUNOFF, &
4 KLON,KLAT,PTSTEP_RUN,KNB_TSTEP_RUN,&
43 USE modi_read_forcing_date
53 INTEGER,
INTENT(IN) :: KLISTING
54 INTEGER,
INTENT(IN) :: KYEAR
55 INTEGER,
INTENT(IN) :: KMONTH
56 INTEGER,
INTENT(IN) :: KDAY
57 REAL,
INTENT(IN) :: PTIME
59 CHARACTER(LEN=15),
INTENT(IN) :: HFILE_FRC
60 CHARACTER(LEN=6),
INTENT(IN) :: HREADFRC
61 CHARACTER(LEN=8),
INTENT(IN) :: HDRAIN
62 CHARACTER(LEN=8),
INTENT(IN) :: HRUNOFF
63 INTEGER,
INTENT(IN) :: KLON
64 INTEGER,
INTENT(IN) :: KLAT
65 REAL,
INTENT(IN) :: PTSTEP_RUN
67 INTEGER,
INTENT(OUT) :: KNB_TSTEP_RUN
68 REAL,
INTENT(OUT) :: PRUNTIME
74 INTEGER,
DIMENSION (:),
ALLOCATABLE :: IDIMLEN
80 INTEGER :: IWORK1, IWORK2
87 REAL(KIND=JPRB) :: ZHOOK_HANDLE
92 IF (
lhook)
CALL dr_hook(
'TRIP_FORCING_CONF',0,zhook_handle)
94 IF(hreadfrc==
'VECTOR')
THEN 100 ALLOCATE(idimlen(indim))
103 CALL read_dimlen(klisting,hfile_frc,hdrain,indim,idimlen)
105 IF(hreadfrc==
'VECTOR')
THEN 110 IF(ini/=klon*klat)
THEN 111 WRITE(klisting,*)
'For the variable DRAIN : ' 112 WRITE(klisting,*)
'TRIP_FORCING_CONF : The number of points in the forcing variables (',ini,
')' 113 WRITE(klisting,*)
'are /= of the number of points in the TRIP domain' 114 WRITE(klisting,*)
'NLON = ',klon,
' and NLAT = ',klat,
' so the number of points = ',klon*klat
115 CALL abort_trip(
'TRIP_FORCING_CONF: number of points in the forcing variables are /= than TRIP domain')
125 IF(ini/=klon*klat)
THEN 126 WRITE(klisting,*)
'For the variable DRAIN : ' 127 WRITE(klisting,*)
'TRIP_FORCING_CONF : The number of points in the forcing variables (',ilon*ilat,
')' 128 WRITE(klisting,*)
'are /= of the number of points in the TRIP domain' 129 WRITE(klisting,*)
'NLON = ',klon,
' and NLAT = ',klat,
' while FRC_LON = ',ilon,
' and FRC_LAT = ',ilat
130 CALL abort_trip(
'TRIP_FORCING_CONF: number of points in the forcing variables are /= than TRIP domain')
137 CALL read_dimlen(klisting,hfile_frc,hrunoff,indim,idimlen)
139 IF(hreadfrc==
'VECTOR')
THEN 144 IF(ini/=klon*klat)
THEN 145 WRITE(klisting,*)
'For the variable RUNOFF : ' 146 WRITE(klisting,*)
'TRIP_FORCING_CONF : The number of points in the forcing variables (',ini,
')' 147 WRITE(klisting,*)
'are /= of the number of points in the TRIP domain' 148 WRITE(klisting,*)
'NLON = ',klon,
' and NLAT = ',klat,
' so the number of points = ',klon*klat
149 CALL abort_trip(
'TRIP_FORCING_CONF: number of points in the forcing variables are /= than TRIP domain')
159 IF(ini/=klon*klat)
THEN 160 WRITE(klisting,*)
'For the variable RUNOFF : ' 161 WRITE(klisting,*)
'TRIP_FORCING_CONF : The number of points in the forcing variables (',ilon*ilat,
')' 162 WRITE(klisting,*)
'are different than the number of points in the TRIP domain' 163 WRITE(klisting,*)
'NLON = ',klon,
' and NLAT = ',klat,
' while FRC_LON = ',ilon,
' and FRC_LAT = ',ilat
164 CALL abort_trip(
'TRIP_FORCING_CONF: number of points in the forcing variables are /= than TRIP domain')
177 IF(iwork1/=iwork2)
THEN 178 WRITE(klisting,*)
'TRIP_FORCING_CONF : The number of time step are different for each forcing variable !' 179 WRITE(klisting,*)
'NB_TSTEP for DRAIN = ',iwork1,
' while NB_TSTEP for RUNOFF = ',iwork2
180 CALL abort_trip(
'TRIP_FORCING_CONF: The number of time step are different for each forcing variable')
182 knb_tstep_run = iwork1
185 pruntime =
REAL(KNB_TSTEP_RUN) * PTSTEP_RUN
190 iyear,imonth,iday,ztime )
192 IF ( (kyear /= iyear) .OR. (kmonth /= imonth) .OR. (kday /= iday) .OR. (ptime /= ztime))
THEN 193 WRITE(klisting,*)
' DATE INCONSISTENCY: RESTART FILE = ',kyear,kmonth,kday,ptime
194 WRITE(klisting,*)
' DATE INCONSISTENCY: FORCING FILE = ',iyear,imonth,iday,ztime
195 CALL abort_trip(
'TRIP_FORCING_CONF: DATE INCONSISTENCY')
198 IF (
lhook)
CALL dr_hook(
'TRIP_FORCING_CONF',1,zhook_handle)
subroutine trip_forcing_conf(KLISTING, KYEAR, KMONTH, KDAY, PTIME, HFILE_FRC, HREADFRC, HDRAIN, HRUNOFF, KLON, KLAT, PTSTEP_RUN, KNB_TSTEP_RUN, PRUNTIME)
subroutine read_forcing_date(KLISTING, HFILE, KNB_TSTEP_RUN, KYEAR, KMONTH, KDAY, PTIME)
subroutine read_dimlen(KLUOUT, HFILE, HVAR, KDIM, KDIMLEN)
subroutine abort_trip(YTEXT)