Changeset 4772
- Timestamp:
- 2014-09-17T19:19:59+02:00 (10 years ago)
- Location:
- branches/2014/dev_r4650_UKMO7_STARTHOUR/NEMOGCM/NEMO/OPA_SRC
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2014/dev_r4650_UKMO7_STARTHOUR/NEMOGCM/NEMO/OPA_SRC/ASM/asminc.F90
r4624 r4772 17 17 !!---------------------------------------------------------------------- 18 18 !! asm_inc_init : Initialize the increment arrays and IAU weights 19 !! calc_date : Compute the calendar date YYYYMMDD on a given step19 !! calc_date : Compute the calendar date YYYYMMDDHH on a given step 20 20 !! tra_asm_inc : Apply the tracer (T and S) increments 21 21 !! dyn_asm_inc : Apply the dynamic (u and v) increments … … 45 45 46 46 PUBLIC asm_inc_init !: Initialize the increment arrays and IAU weights 47 PUBLIC calc_date !: Compute the calendar date YYYYMMDD on a given step47 PUBLIC calc_date !: Compute the calendar date YYYYMMDDHH on a given step 48 48 PUBLIC tra_asm_inc !: Apply the tracer (T and S) increments 49 49 PUBLIC dyn_asm_inc !: Apply the dynamic (u and v) increments … … 115 115 INTEGER :: iiauper ! Number of time steps in the IAU period 116 116 INTEGER :: icycper ! Number of time steps in the cycle 117 INTEGER :: iitend_date ! Date YYYYMMDD of final time step118 INTEGER :: iitbkg_date ! Date YYYYMMDD of background time step for Jb term119 INTEGER :: iitdin_date ! Date YYYYMMDD of background time step for DI120 INTEGER :: iitiaustr_date ! Date YYYYMMDD of IAU interval start time step121 INTEGER :: iitiaufin_date ! Date YYYYMMDD of IAU interval final time step117 INTEGER :: iitend_date ! Date YYYYMMDDHH of final time step 118 INTEGER :: iitbkg_date ! Date YYYYMMDDHH of background time step for Jb term 119 INTEGER :: iitdin_date ! Date YYYYMMDDHH of background time step for DI 120 INTEGER :: iitiaustr_date ! Date YYYYMMDDHH of IAU interval start time step 121 INTEGER :: iitiaufin_date ! Date YYYYMMDDHH of IAU interval final time step 122 122 INTEGER :: ios ! Local integer output status for namelist read 123 123 … … 556 556 !! *** ROUTINE calc_date *** 557 557 !! 558 !! ** Purpose : Compute the calendar date YYYYMMDD at a given time step.559 !! 560 !! ** Method : Compute the calendar date YYYYMMDD at a given time step.558 !! ** Purpose : Compute the calendar date YYYYMMDDHH at a given time step. 559 !! 560 !! ** Method : Compute the calendar date YYYYMMDDHH at a given time step. 561 561 !! 562 562 !! ** Action : … … 570 570 INTEGER :: imon0 ! Initial month 571 571 INTEGER :: iday0 ! Initial day 572 INTEGER :: ihou0 ! Initial hour 572 573 INTEGER :: iyea ! Current year 573 574 INTEGER :: imon ! Current month 574 575 INTEGER :: iday ! Current day 576 INTEGER :: ihou ! Current hour 575 577 INTEGER :: idaystp ! Number of days between initial and current date 578 INTEGER :: ihoustp ! Number of hours 576 579 INTEGER :: idaycnt ! Day counter 577 580 … … 579 582 580 583 !----------------------------------------------------------------------- 581 ! Compute the calendar date YYYYMMDD 584 ! Compute the calendar date YYYYMMDDHH 582 585 !----------------------------------------------------------------------- 583 586 … … 585 588 iyea0 = kdate0 / 10000 586 589 imon0 = ( kdate0 - ( iyea0 * 10000 ) ) / 100 587 iday0 = kdate0 - ( iyea0 * 10000 ) - ( imon0 * 100 ) 590 iday0 = kdate0 - ( iyea0 * 10000 ) - ( imon0 * 100 ) 591 ihou0 = nn_time0 588 592 589 593 ! Check that kt >= kit000 - 1 590 594 IF ( kt < kit000 - 1 ) CALL ctl_stop( ' kt must be >= kit000 - 1') 591 595 592 ! If kt = kit000 - 1 then set the date to the restart date593 IF ( kt == kit000 - 1 ) THEN594 595 kdate = ndastp596 RETURN597 598 ENDIF599 600 596 ! Compute the number of days from the initial date 601 597 idaystp = INT( REAL( kt - kit000 ) * rdt / 86400. ) 602 598 ihoustp = INT( REAL( kt - kit000 ) * rdt / 3600. ) - ( idaystp * 24 ) 599 603 600 iday = iday0 604 601 imon = imon0 605 602 iyea = iyea0 603 ihou = ihou0 606 604 idaycnt = 0 605 606 ! Increment hours 607 ihou = ihou + ihoustp 608 IF ( ihou >= 24 ) THEN 609 ihou = ihou - 24 610 iday = iday + 1 611 ENDIF 607 612 608 613 CALL calc_month_len( iyea, imonth_len ) … … 611 616 iday = iday + 1 612 617 IF ( iday > imonth_len(imon) ) THEN 613 iday = 1618 iday = iday - imonth_len(imon) 614 619 imon = imon + 1 615 620 ENDIF … … 622 627 END DO 623 628 ! 624 kdate = iyea * 10000 + imon * 100 + iday629 kdate = iyea * 1000000 + imon * 10000 + iday * 100 + ihou 625 630 ! 626 631 END SUBROUTINE -
branches/2014/dev_r4650_UKMO7_STARTHOUR/NEMOGCM/NEMO/OPA_SRC/DOM/daymod.F90
r4162 r4772 84 84 IF( .NOT. lk_offline ) CALL day_rst( nit000, 'READ' ) 85 85 86 ! If we are starting at 00Z then need to wind back to previous day for calendar initialisation 87 IF( nn_time0 .eq. 0 ) ndastp = ndastp - 1 88 86 89 ! set the calandar from ndastp (read in restart file and namelist) 87 90 … … 90 93 nday = ndastp - (nyear * 10000) - ( nmonth * 100 ) 91 94 92 CALL ymds2ju( nyear, nmonth, nday, 0.0, fjulday ) ! we assume that we start run at 00:0095 CALL ymds2ju( nyear, nmonth, nday, nn_time0*3600._wp, fjulday ) ! we assume that we start run at 00:00 93 96 IF( ABS(fjulday - REAL(NINT(fjulday),wp)) < 0.1 / rday ) fjulday = REAL(NINT(fjulday),wp) ! avoid truncation error 94 fjulday = fjulday + 1.! move back to the day at nit000 (and not at nit000 - 1)97 IF( nn_time0 == 0 ) fjulday = fjulday + 1. ! move back to the day at nit000 (and not at nit000 - 1) 95 98 96 99 nsec1jan000 = 0 … … 117 120 118 121 ! number of seconds since the beginning of current year/month/week/day at the middle of the time-step 119 nsec_year = nday_year * nsecd - ndt05 ! 1 time step before the middle of the first time step 120 nsec_month = nday * nsecd - ndt05 ! because day will be called at the beginning of step 121 nsec_week = idweek * nsecd - ndt05 122 nsec_day = nsecd - ndt05 123 122 nsec_year = nday_year * nsecd + nn_time0*3600._wp - ndt05 ! 1 time step before the middle of the first time step 123 nsec_month = nday * nsecd + nn_time0*3600._wp - ndt05 ! because day will be called at the beginning of step 124 nsec_week = idweek * nsecd + nn_time0*3600._wp - ndt05 125 nsec_day = nsecd + nn_time0*3600._wp - ndt05 126 IF( nsec_day .lt. 0 ) nsec_day = nsec_day + nsecd 127 124 128 ! control print 125 129 IF(lwp) WRITE(numout,'(a,i6,a,i2,a,i2,a,i6)')' ==============>> 1/2 time step before the start of the run DATE Y/M/D = ', & … … 327 331 ! define ndastp and adatrj 328 332 IF ( nrstdt == 2 ) THEN 329 ! read the parameters correspond ting to nit000 - 1 (last time step of previous run)333 ! read the parameters corresponding to nit000 - 1 (last time step of previous run) 330 334 CALL iom_get( numror, 'ndastp', zndastp ) 331 335 ndastp = NINT( zndastp ) 332 336 CALL iom_get( numror, 'adatrj', adatrj ) 333 337 ELSE 334 ! parameters correspond ting to nit000 - 1 (as we start the step loop with a call to day)335 ndastp = ndate0 - 1 ! ndate0 read in the namelist in dom_nam, we assume that we start run at 00:00338 ! parameters corresponding to nit000 - 1 (as we start the step loop with a call to day) 339 ndastp = ndate0 ! ndate0 read in the namelist in dom_nam 336 340 adatrj = ( REAL( nit000-1, wp ) * rdttra(1) ) / rday 337 341 ! note this is wrong if time step has changed during run 338 342 ENDIF 339 343 ELSE 340 ! parameters correspond ting to nit000 - 1 (as we start the step loop with a call to day)341 ndastp = ndate0 - 1 ! ndate0 read in the namelist in dom_nam, we assume that we start run at 00:00344 ! parameters corresponding to nit000 - 1 (as we start the step loop with a call to day) 345 ndastp = ndate0 ! ndate0 read in the namelist in dom_nam 342 346 adatrj = ( REAL( nit000-1, wp ) * rdttra(1) ) / rday 343 347 ENDIF -
branches/2014/dev_r4650_UKMO7_STARTHOUR/NEMOGCM/NEMO/OPA_SRC/DOM/domain.F90
r4624 r4772 135 135 !!---------------------------------------------------------------------- 136 136 USE ioipsl 137 NAMELIST/namrun/ nn_no , cn_exp , cn_ocerst_in, cn_ocerst_out, ln_rstart , nn_rstctl, & 138 & nn_it000, nn_itend , nn_date0 , nn_leapy , nn_istate , nn_stock , & 139 & nn_write, ln_dimgnnn, ln_mskland , ln_clobber , nn_chunksz, nn_euler 137 NAMELIST/namrun/ nn_no , cn_exp , cn_ocerst_in, cn_ocerst_out, ln_rstart , nn_rstctl , & 138 & nn_it000, nn_itend, nn_date0 , nn_time0 , nn_leapy , nn_istate , & 139 & nn_stock, nn_write, ln_dimgnnn , ln_mskland , ln_clobber, nn_chunksz, & 140 & nn_euler 140 141 NAMELIST/namdom/ nn_bathy, rn_bathy , rn_e3zps_min, rn_e3zps_rat, nn_msh, rn_hmin, & 141 142 & nn_acc , rn_atfp , rn_rdt , rn_rdtmin , & … … 176 177 WRITE(numout,*) ' number of the last time step nn_itend = ', nn_itend 177 178 WRITE(numout,*) ' initial calendar date aammjj nn_date0 = ', nn_date0 179 WRITE(numout,*) ' initial time of day in hours nn_time0 = ', nn_time0 178 180 WRITE(numout,*) ' leap year calendar (0/1) nn_leapy = ', nn_leapy 179 181 WRITE(numout,*) ' initial state output nn_istate = ', nn_istate -
branches/2014/dev_r4650_UKMO7_STARTHOUR/NEMOGCM/NEMO/OPA_SRC/IOM/in_out_manager.F90
r4624 r4772 34 34 INTEGER :: nn_itend !: index of the last time step 35 35 INTEGER :: nn_date0 !: initial calendar date aammjj 36 INTEGER :: nn_time0 !: initial time of day in hours 36 37 INTEGER :: nn_leapy !: Leap year calendar flag (0/1 or 30) 37 38 INTEGER :: nn_istate !: initial state output flag (0/1) -
branches/2014/dev_r4650_UKMO7_STARTHOUR/NEMOGCM/NEMO/OPA_SRC/OBS/diaobs.F90
r4624 r4772 1414 1414 END SUBROUTINE dia_obs_dealloc 1415 1415 1416 SUBROUTINE ini_date( ddobsini)1417 !!---------------------------------------------------------------------- 1418 !! *** ROUTINE ini_date ***1416 SUBROUTINE calc_date( kstp, ddobs ) 1417 !!---------------------------------------------------------------------- 1418 !! *** ROUTINE calc_date *** 1419 1419 !! 1420 !! ** Purpose : Get initial datain double precision YYYYMMDD.HHMMSS format1421 !! 1422 !! ** Method : Get initial datain double precision YYYYMMDD.HHMMSS format1423 !! 1424 !! ** Action : Get initial datain double precision YYYYMMDD.HHMMSS format1420 !! ** Purpose : Get date in double precision YYYYMMDD.HHMMSS format 1421 !! 1422 !! ** Method : Get date in double precision YYYYMMDD.HHMMSS format 1423 !! 1424 !! ** Action : Get date in double precision YYYYMMDD.HHMMSS format 1425 1425 !! 1426 1426 !! History : … … 1430 1430 !! ! 06-10 (G. Smith) Calculates initial date the same as method for final date 1431 1431 !! ! 10-05 (D. Lea) Update to month length calculation for NEMO vn3.2 1432 !! ! 2014-09 (D. Lea) New generic routine now deals with arbitrary start hour 1432 1433 !!---------------------------------------------------------------------- 1433 1434 USE phycst, ONLY : & ! Physical constants … … 1441 1442 1442 1443 !! * Arguments 1443 REAL(KIND=dp), INTENT(OUT) :: ddobsini ! Initial date in YYYYMMDD.HHMMSS 1444 REAL(KIND=dp), INTENT(OUT) :: ddobs ! Date in YYYYMMDD.HHMMSS 1445 INTEGER :: kstp 1444 1446 1445 1447 !! * Local declarations … … 1456 1458 !!---------------------------------------------------------------------- 1457 1459 !! Initial date initialization (year, month, day, hour, minute) 1458 !! (This assumes that the initial date is for 00z))1459 1460 !!---------------------------------------------------------------------- 1460 1461 iyea = ndate0 / 10000 1461 1462 imon = ( ndate0 - iyea * 10000 ) / 100 1462 1463 iday = ndate0 - iyea * 10000 - imon * 100 1463 ihou = 01464 ihou = nn_time0 1464 1465 imin = 0 1465 1466 … … 1467 1468 !! Compute number of days + number of hours + min since initial time 1468 1469 !!---------------------------------------------------------------------- 1469 iday = iday + ( nit000 -1 ) * rdt / rday 1470 zdayfrc = ( nit000 -1 ) * rdt / rday 1470 zdayfrc = kstp * rdt / rday 1471 1471 zdayfrc = zdayfrc - aint(zdayfrc) 1472 ihou = int( zdayfrc * 24 ) 1473 imin = int( (zdayfrc * 24 - ihou) * 60 ) 1472 imin = imin + int( zdayfrc * 24 * 60 ) 1473 DO WHILE (imin >= 60) 1474 imin=imin-60 1475 ihou=ihou+1 1476 END DO 1477 DO WHILE (ihou >= 24) 1478 ihou=ihou-24 1479 iday=iday+1 1480 END DO 1481 iday = iday + kstp * rdt / rday 1474 1482 1475 1483 !!----------------------------------------------------------------------- … … 1492 1500 !! Convert it into YYYYMMDD.HHMMSS format. 1493 1501 !!---------------------------------------------------------------------- 1494 ddobsini = iyea * 10000_dp + imon * 100_dp + & 1495 & iday + ihou * 0.01_dp + imin * 0.0001_dp 1496 1497 1498 END SUBROUTINE ini_date 1499 1500 SUBROUTINE fin_date( ddobsfin ) 1501 !!---------------------------------------------------------------------- 1502 !! *** ROUTINE fin_date *** 1502 ddobs = iyea * 10000_dp + imon * 100_dp + & 1503 & iday + ihou * 0.01_dp + imin * 0.0001_dp 1504 1505 END SUBROUTINE calc_date 1506 1507 SUBROUTINE ini_date( ddobsini ) 1508 !!---------------------------------------------------------------------- 1509 !! *** ROUTINE ini_date *** 1503 1510 !! 1504 !! ** Purpose : Get final datain double precision YYYYMMDD.HHMMSS format1505 !! 1506 !! ** Method : Get final data in double precision YYYYMMDD.HHMMSS format1507 !! 1508 !! ** Action : Get final data in double precision YYYYMMDD.HHMMSS format1511 !! ** Purpose : Get initial date in double precision YYYYMMDD.HHMMSS format 1512 !! 1513 !! ** Method : 1514 !! 1515 !! ** Action : 1509 1516 !! 1510 1517 !! History : … … 1513 1520 !! ! 06-10 (A. Weaver) Cleaning 1514 1521 !! ! 10-05 (D. Lea) Update to month length calculation for NEMO vn3.2 1515 !!---------------------------------------------------------------------- 1516 USE phycst, ONLY : & ! Physical constants 1517 & rday 1518 ! USE daymod, ONLY : & ! Time variables 1519 ! & nmonth_len 1520 USE dom_oce, ONLY : & ! Ocean space and time domain variables 1521 & rdt 1522 !! ! 2014-09 (D. Lea) Change to call generic routine calc_date 1523 !!---------------------------------------------------------------------- 1524 1525 IMPLICIT NONE 1526 1527 !! * Arguments 1528 REAL(KIND=dp), INTENT(OUT) :: ddobsini ! Initial date in YYYYMMDD.HHMMSS 1529 1530 CALL calc_date( nit000 - 1, ddobsini ) 1531 1532 END SUBROUTINE ini_date 1533 1534 SUBROUTINE fin_date( ddobsfin ) 1535 !!---------------------------------------------------------------------- 1536 !! *** ROUTINE fin_date *** 1537 !! 1538 !! ** Purpose : Get final date in double precision YYYYMMDD.HHMMSS format 1539 !! 1540 !! ** Method : 1541 !! 1542 !! ** Action : 1543 !! 1544 !! History : 1545 !! ! 06-03 (K. Mogensen) Original code 1546 !! ! 06-05 (K. Mogensen) Reformatted 1547 !! ! 06-10 (A. Weaver) Cleaning 1548 !! ! 10-05 (D. Lea) Update to month length calculation for NEMO vn3.2 1549 !! ! 2014-09 (D. Lea) Change to call generic routine calc_date 1550 !!---------------------------------------------------------------------- 1522 1551 1523 1552 IMPLICIT NONE … … 1526 1555 REAL(KIND=dp), INTENT(OUT) :: ddobsfin ! Final date in YYYYMMDD.HHMMSS 1527 1556 1528 !! * Local declarations 1529 INTEGER :: iyea ! date - (year, month, day, hour, minute) 1530 INTEGER :: imon 1531 INTEGER :: iday 1532 INTEGER :: ihou 1533 INTEGER :: imin 1534 INTEGER :: imday ! Number of days in month. 1535 REAL(KIND=wp) :: zdayfrc ! Fraction of day 1536 1537 INTEGER, DIMENSION(12) :: imonth_len !: length in days of the months of the current year 1538 1539 !----------------------------------------------------------------------- 1540 ! Initial date initialization (year, month, day, hour, minute) 1541 ! (This assumes that the initial date is for 00z) 1542 !----------------------------------------------------------------------- 1543 iyea = ndate0 / 10000 1544 imon = ( ndate0 - iyea * 10000 ) / 100 1545 iday = ndate0 - iyea * 10000 - imon * 100 1546 ihou = 0 1547 imin = 0 1548 1549 !----------------------------------------------------------------------- 1550 ! Compute number of days + number of hours + min since initial time 1551 !----------------------------------------------------------------------- 1552 iday = iday + nitend * rdt / rday 1553 zdayfrc = nitend * rdt / rday 1554 zdayfrc = zdayfrc - AINT( zdayfrc ) 1555 ihou = INT( zdayfrc * 24 ) 1556 imin = INT( ( zdayfrc * 24 - ihou ) * 60 ) 1557 1558 !----------------------------------------------------------------------- 1559 ! Convert number of days (iday) into a real date 1560 !---------------------------------------------------------------------- 1561 1562 CALL calc_month_len( iyea, imonth_len ) 1563 1564 DO WHILE ( iday > imonth_len(imon) ) 1565 iday = iday - imonth_len(imon) 1566 imon = imon + 1 1567 IF ( imon > 12 ) THEN 1568 imon = 1 1569 iyea = iyea + 1 1570 CALL calc_month_len( iyea, imonth_len ) ! update month lengths 1571 ENDIF 1572 END DO 1573 1574 !----------------------------------------------------------------------- 1575 ! Convert it into YYYYMMDD.HHMMSS format 1576 !----------------------------------------------------------------------- 1577 ddobsfin = iyea * 10000_dp + imon * 100_dp + iday & 1578 & + ihou * 0.01_dp + imin * 0.0001_dp 1579 1580 END SUBROUTINE fin_date 1581 1557 CALL calc_date( nitend, ddobsfin ) 1558 1559 END SUBROUTINE fin_date 1560 1582 1561 END MODULE diaobs -
branches/2014/dev_r4650_UKMO7_STARTHOUR/NEMOGCM/NEMO/OPA_SRC/OBS/obs_prep.F90
r4292 r4772 125 125 imon0 = ( ndate0 - iyea0 * 10000 ) / 100 126 126 iday0 = ndate0 - iyea0 * 10000 - imon0 * 100 127 ihou0 = 0127 ihou0 = nn_time0 128 128 imin0 = 0 129 129 … … 397 397 imon0 = ( ndate0 - iyea0 * 10000 ) / 100 398 398 iday0 = ndate0 - iyea0 * 10000 - imon0 * 100 399 ihou0 = 0399 ihou0 = nn_time0 400 400 imin0 = 0 401 401 … … 585 585 imon0 = ( ndate0 - iyea0 * 10000 ) / 100 586 586 iday0 = ndate0 - iyea0 * 10000 - imon0 * 100 587 ihou0 = 0587 ihou0 = nn_time0 588 588 imin0 = 0 589 589 … … 770 770 imon0 = ( ndate0 - iyea0 * 10000 ) / 100 771 771 iday0 = ndate0 - iyea0 * 10000 - imon0 * 100 772 ihou0 = 0772 ihou0 = nn_time0 773 773 imin0 = 0 774 774 … … 968 968 imon0 = ( ndate0 - iyea0 * 10000 ) / 100 969 969 iday0 = ndate0 - iyea0 * 10000 - imon0 * 100 970 ihou0 = 0970 ihou0 = nn_time0 971 971 imin0 = 0 972 972
Note: See TracChangeset
for help on using the changeset viewer.