Changeset 4144 for palm/trunk/SOURCE/date_and_time_mod.f90
- Timestamp:
- Aug 6, 2019 9:11:47 AM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
palm/trunk/SOURCE/date_and_time_mod.f90
r3839 r4144 25 25 ! ----------------- 26 26 ! $Id$ 27 ! relational operators .EQ., .NE., etc. replaced by ==, /=, etc. 28 ! 29 ! 3839 2019-03-28 21:12:25Z moh.hefny 27 30 ! further tabs removed, unused variables removed 28 31 ! … … 191 194 192 195 !> Condition for printing an error when date_init is not provided when day_of_year_init is not given in the namelist or when the format of the date is not the one required by PALM. 193 IF ( day_of_month .GT. 0 .AND. day_of_month .LE. 31 .AND. month_of_year .GT. 0 .AND. month_of_year .LE.12) THEN196 IF ( day_of_month > 0 .AND. day_of_month <= 31 .AND. month_of_year > 0 .AND. month_of_year <= 12) THEN 194 197 195 198 IF ( month_of_year == 1 ) THEN !!month of year is read in input … … 226 229 227 230 228 IF ( day_of_year .LE.31 ) THEN231 IF ( day_of_year <= 31 ) THEN 229 232 230 233 month_of_year=1 … … 234 237 235 238 DO i_mon=2,12 !january is considered in the first case 236 IF ( day_of_year .LE. SUM(days(1:i_mon)) .AND. day_of_year .GT.SUM(days(1:(i_mon-1))) ) THEN239 IF ( day_of_year <= SUM(days(1:i_mon)) .AND. day_of_year > SUM(days(1:(i_mon-1))) ) THEN 237 240 238 241 month_of_year=i_mon … … 249 252 !> in the second condition both day of month and month_of_year are either given in input (passed to date_init) or we are in some day successive to the initial one, so that day_of_month has already be computed in previous step 250 253 !>TBD: something to calculate the current year is missing 251 ELSEIF ( day_of_month .GT. 0 .AND. day_of_month .LE. 31 .AND. month_of_year .GT. 0 .AND. month_of_year .LE.12) THEN254 ELSEIF ( day_of_month > 0 .AND. day_of_month <= 31 .AND. month_of_year > 0 .AND. month_of_year <= 12) THEN 252 255 253 256 !> calculate month_of_year. TBD: test the condition when day_of_year==31 … … 257 260 month_of_year = 1 258 261 259 ELSE IF (day_of_year .GT. 1 .AND. day_of_year .GT.SUM(days(1:month_of_year))) THEN262 ELSE IF (day_of_year > 1 .AND. day_of_year > SUM(days(1:month_of_year))) THEN 260 263 261 264 month_of_year = month_of_year + 1 … … 319 322 320 323 !> Condition for printing an error when date_init is not provided when day_of_year_init is not given in the namelist or when the format of the date is not the one required by PALM. 321 IF ( day_of_month .GT. 0 .AND. day_of_month .LE. 31 .AND. month_of_year .GT. 0 .AND. month_of_year .LE.12) THEN324 IF ( day_of_month > 0 .AND. day_of_month <= 31 .AND. month_of_year > 0 .AND. month_of_year <= 12) THEN 322 325 323 326 IF ( month_of_year == 1 ) THEN !!month of year is read in input … … 346 349 347 350 !-- Calculate current day of the year !TBD: considetr leap years 348 IF ( (day_of_year_init + days_since_reference_point) .GT.365 ) THEN351 IF ( (day_of_year_init + days_since_reference_point) > 365 ) THEN 349 352 350 353 day_of_year=INT(MOD((day_of_year_init + days_since_reference_point), 365.0_wp)) … … 369 372 !> The first case is when date_init is not provided: we only know day_of_year_init 370 373 !DO i_mon=1,12 371 !IF (day_of_year .LE.SUM(days(1:i_mon))) THEN372 IF ( day_of_year .LE.31 ) THEN374 !IF (day_of_year <= SUM(days(1:i_mon))) THEN 375 IF ( day_of_year <= 31 ) THEN 373 376 374 377 month_of_year=1 … … 378 381 379 382 DO i_mon=2,12 !january is considered in the first case 380 IF ( day_of_year .LE. SUM(days(1:i_mon)) .AND. day_of_year .GT.SUM(days(1:(i_mon-1))) ) THEN383 IF ( day_of_year <= SUM(days(1:i_mon)) .AND. day_of_year > SUM(days(1:(i_mon-1))) ) THEN 381 384 382 385 month_of_year=i_mon … … 393 396 !> in the second condition both day of month and month_of_year are either given in input (passed to date_init) or we are in some day successive to the initial one, so that day_of_month has already be computed in previous step 394 397 !>TBD: something to calculate the current year is missing 395 ELSEIF ( day_of_month .GT. 0 .AND. day_of_month .LE. 31 .AND. month_of_year .GT. 0 .AND. month_of_year .LE.12) THEN398 ELSEIF ( day_of_month > 0 .AND. day_of_month <= 31 .AND. month_of_year > 0 .AND. month_of_year <= 12) THEN 396 399 397 400 !> calculate month_of_year. TBD: test the condition when day_of_year==31 … … 401 404 month_of_year = 1 402 405 403 ELSE IF (day_of_year .GT. 1 .AND. day_of_year .GT.SUM(days(1:month_of_year))) THEN406 ELSE IF (day_of_year > 1 .AND. day_of_year > SUM(days(1:month_of_year))) THEN 404 407 405 408 month_of_year = month_of_year + 1
Note: See TracChangeset
for help on using the changeset viewer.