- Timestamp:
- 2011-09-27T14:33:01+02:00 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2011/UKMO_MERCATOR_obc_bdy_merge/NEMOGCM/NEMO/OPA_SRC/SBC/fldread.F90
r2818 r2865 104 104 CONTAINS 105 105 106 SUBROUTINE fld_read( kt, kn_fsbc, sd, map, jit, time shift )106 SUBROUTINE fld_read( kt, kn_fsbc, sd, map, jit, time_offset ) 107 107 !!--------------------------------------------------------------------- 108 108 !! *** ROUTINE fld_read *** … … 121 121 TYPE(MAP_POINTER),INTENT(in), OPTIONAL, DIMENSION(:) :: map ! global-to-local mapping index 122 122 INTEGER , INTENT(in ), OPTIONAL :: jit ! subcycle timestep for timesplitting option 123 INTEGER , INTENT(in ), OPTIONAL :: timeshift ! provide fields at time other than "now" 123 INTEGER , INTENT(in ), OPTIONAL :: time_offset ! provide fields at time other than "now" 124 ! time_offset = -1 => fields at "before" time level 125 ! time_offset = +1 => fields at "after" time levels 126 ! etc. 124 127 !! 125 128 INTEGER :: imf ! size of the structure sd … … 128 131 INTEGER :: isecend ! number of second since Jan. 1st 00h of nit000 year at nitend 129 132 INTEGER :: isecsbc ! number of seconds between Jan. 1st 00h of nit000 year and the middle of sbc time step 133 INTEGER :: time_add ! local time_offset variable 130 134 LOGICAL :: llnxtyr ! open next year file? 131 135 LOGICAL :: llnxtmth ! open next month file? … … 143 147 ENDIF 144 148 149 time_add = 0 150 IF( PRESENT(time_offset) ) THEN 151 time_add = time_offset 152 ENDIF 153 145 154 ! Note that shifting time to be centrered in the middle of sbc time step impacts only nsec_* variables of the calendar 146 155 IF( present(jit) ) THEN 147 156 ! ignore kn_fsbc in this case 148 isecsbc = nsec_year + nsec1jan000 + jit*rdt/REAL(nn_baro,wp) 149 ELSE IF( present(timeshift) ) THEN 150 isecsbc = nsec_year + nsec1jan000 + NINT(0.5 * REAL(kn_fsbc - 1,wp) * rdttra(1)) + timeshift * rdttra(1) ! middle of sbc time step 157 isecsbc = nsec_year + nsec1jan000 + (jit+time_add)*rdt/REAL(nn_baro,wp) 151 158 ELSE 152 isecsbc = nsec_year + nsec1jan000 + NINT(0.5 * REAL(kn_fsbc - 1,wp) * rdttra(1)) ! middle of sbc time step159 isecsbc = nsec_year + nsec1jan000 + NINT(0.5 * REAL(kn_fsbc - 1,wp) * rdttra(1)) + time_add * rdttra(1) ! middle of sbc time step 153 160 ENDIF 154 161 imf = SIZE( sd ) … … 263 270 clfmt = "('fld_read: var ', a, ' kt = ', i8, ' (', f7.2,' days), Y/M/D = ', i4.4,'/', i2.2,'/', i2.2," // & 264 271 & "', records b/a: ', i4.4, '/', i4.4, ' (days ', f7.2,'/', f7.2, ')')" 265 WRITE(numout, clfmt) TRIM( sd(jf)%clvar ), kt, REAL(isecsbc,wp)/rday, nyear, nmonth, nday, & 272 WRITE(numout, clfmt) TRIM( sd(jf)%clvar ), kt, REAL(isecsbc,wp)/rday, nyear, nmonth, nday, & 266 273 & sd(jf)%nrec_b(1), sd(jf)%nrec_a(1), REAL(sd(jf)%nrec_b(2),wp)/rday, REAL(sd(jf)%nrec_a(2),wp)/rday 274 WRITE(numout, *) 'time_add is : ',time_add 267 275 ENDIF 268 276 ! temporal interpolation weights
Note: See TracChangeset
for help on using the changeset viewer.