ROMS
Loading...
Searching...
No Matches
mod_netcdf::netcdf_get_time Interface Reference

Public Member Functions

subroutine netcdf_get_time_0d (ng, model, ncname, myvarname, rdate, a, ncid, start, total, min_val, max_val)
 
subroutine netcdf_get_time_1d (ng, model, ncname, myvarname, rdate, a, ncid, start, total, min_val, max_val)
 

Detailed Description

Definition at line 77 of file mod_netcdf.F.

Member Function/Subroutine Documentation

◆ netcdf_get_time_0d()

subroutine mod_netcdf::netcdf_get_time::netcdf_get_time_0d ( integer, intent(in) ng,
integer, intent(in) model,
character (len=*), intent(in) ncname,
character (len=*), intent(in) myvarname,
real(dp), dimension(2), intent(in) rdate,
real(dp), intent(out) a,
integer, intent(in), optional ncid,
integer, dimension(:), intent(in), optional start,
integer, dimension(:), intent(in), optional total,
real(dp), intent(out), optional min_val,
real(dp), intent(out), optional max_val )

Definition at line 5829 of file mod_netcdf.F.

5833!
5834!=======================================================================
5835! !
5836! This routine reads requested time scalar variable from specified !
5837! NetCDF file. If the "units" attribute of the form: !
5838! !
5839! 'time-units since YYYY-MM-DD hh:mm:ss' !
5840! !
5841! is different than provided reference date "Rdate", it converts to !
5842! elapsed time since "Rdate". !
5843! !
5844! On Input: !
5845! !
5846! ng Nested grid number (integer) !
5847! model Calling model identifier (integer) !
5848! ncname NetCDF file name (string) !
5849! myVarName Variable name (string) !
5850! Rdate Reference date (real; [1] seconds, [2] days) !
5851! ncid NetCDF file ID (integer, OPTIONAL) !
5852! start Starting index where the first of the data values !
5853! will be read along each dimension (integer, !
5854! OPTIONAL) !
5855! total Number of data values to be read along each !
5856! dimension (integer, OPTIONAL) !
5857! !
5858! On Ouput: !
5859! !
5860! A Read scalar variable (real) !
5861! min_val Read data minimum value (real, OPTIONAL) !
5862! max_val Read data maximum value (real, OPTIONAL) !
5863! !
5864! Examples: !
5865! !
5866! CALL netcdf_get_fvar (ng, iNLM, 'file.nc', 'VarName', fvar) !
5867! CALL netcdf_get_fvar (ng, iNLM, 'file.nc', 'VarName', fvar(1)) !
5868! !
5869!=======================================================================
5870!
5872 USE strings_mod, ONLY : lowercase
5873!
5874! Imported variable declarations.
5875!
5876 integer, intent(in) :: ng, model
5877
5878 integer, intent(in), optional :: ncid
5879 integer, intent(in), optional :: start(:)
5880 integer, intent(in), optional :: total(:)
5881!
5882 character (len=*), intent(in) :: ncname
5883 character (len=*), intent(in) :: myVarName
5884!
5885 real(dp), intent(in) :: Rdate(2)
5886
5887 real(dp), intent(out), optional :: min_val
5888 real(dp), intent(out), optional :: max_val
5889
5890 real(dp), intent(out) :: A
5891!
5892! Local variable declarations.
5893!
5894 logical :: JulianOffset = .false.
5895 logical :: Ldebug = .false.
5896
5897 logical, dimension(1) :: got_units
5898 logical, dimension(2) :: foundit
5899!
5900 integer :: ind, lstr, my_ncid, status, varid
5901 integer :: year, month, day, hour, minutes
5902
5903#if !defined PARALLEL_IO && defined DISTRIBUTE
5904 integer, dimension(2) :: ibuffer
5905#endif
5906 real(dp) :: Afactor, Aoffset, my_Rdate(2), seconds
5907 real(dp) :: dnum_old, dnum_new, scale
5908
5909 real(dp), dimension(1) :: my_A
5910 real(r8), dimension(2) :: AttValue
5911!
5912 character (len=12) :: AttName(2)
5913 character (len=22) :: dstr_old, dstr_new
5914 character (len=40) :: UnitsAtt(1), UnitsValue(1)
5915 character (len=40) :: Units, Ustring
5916
5917 character (len=*), parameter :: MyFile = &
5918 & __FILE__//", netcdf_get_time_0d"
5919!
5920!-----------------------------------------------------------------------
5921! Read in a floating-point scalar variable.
5922!-----------------------------------------------------------------------
5923!
5924! If NetCDF file ID is not provided, open NetCDF for reading.
5925!
5926 IF (.not.PRESENT(ncid)) THEN
5927 CALL netcdf_open (ng, model, trim(ncname), 0, my_ncid)
5928 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
5929 ELSE
5930 my_ncid=ncid
5931 END IF
5932!
5933! Read in variable.
5934!
5935 IF (inpthread) THEN
5936 status=nf90_inq_varid(my_ncid, trim(myvarname), varid)
5937 IF (status.eq.nf90_noerr) THEN
5938 IF (PRESENT(start).and.PRESENT(total)) THEN
5939 status=nf90_get_var(my_ncid, varid, my_a, start, total)
5940 a=my_a(1)
5941 ELSE
5942 status=nf90_get_var(my_ncid, varid, a)
5943 END IF
5944 IF (founderror(status, nf90_noerr, __line__, myfile)) THEN
5945 WRITE (stdout,10) trim(myvarname), trim(ncname), &
5946 & trim(sourcefile), nf90_strerror(status)
5947 exit_flag=2
5948 ioerror=status
5949 END IF
5950 ELSE
5951 WRITE (stdout,20) trim(myvarname), trim(ncname), &
5952 & trim(sourcefile), nf90_strerror(status)
5953 exit_flag=2
5954 ioerror=status
5955 END IF
5956 END IF
5957
5958#if !defined PARALLEL_IO && defined DISTRIBUTE
5959!
5960! Broadcast read variable to all processors in the group.
5961!
5962 ibuffer(1)=exit_flag
5963 ibuffer(2)=ioerror
5964 CALL mp_bcasti (ng, model, ibuffer)
5965 exit_flag=ibuffer(1)
5966 ioerror=ibuffer(2)
5967 IF (exit_flag.eq.noerror) THEN
5968 CALL mp_bcastf (ng, model, a)
5969 END IF
5970#endif
5971!
5972! Check if the following attributes: "scale_factor", "add_offset", and
5973! "_FillValue" are present in the input NetCDF variable:
5974!
5975! If the "scale_value" attribute is present, the data is multiplied by
5976! this factor after reading.
5977! If the "add_offset" attribute is present, this value is added to the
5978! data after reading.
5979! If both "scale_factor" and "add_offset" attributes are present, the
5980! data are first scaled before the offset is added.
5981! If the "_FillValue" attribute is present, the data having this value
5982! is treated as missing and it is replaced with zero. This feature it
5983! is usually related with the land/sea masking.
5984!
5985 attname(1)='scale_factor'
5986 attname(2)='add_offset '
5987
5988 CALL netcdf_get_fatt (ng, model, ncname, varid, attname, &
5989 & attvalue, foundit, &
5990 & ncid = my_ncid)
5991
5992 IF (exit_flag.eq.noerror) THEN
5993 IF (.not.foundit(1)) THEN
5994 afactor=1.0_r8
5995 ELSE
5996 afactor=real(attvalue(1),dp)
5997 END IF
5998
5999 IF (.not.foundit(2)) THEN
6000 aoffset=0.0_r8
6001 ELSE
6002 aoffset=real(attvalue(2),dp)
6003 END IF
6004
6005 IF (foundit(1)) THEN ! scale data
6006 a=afactor*a
6007 END IF
6008
6009 IF (foundit(2)) THEN ! add data offset
6010 a=a+aoffset
6011 IF (time_ref.eq.-2) julianoffset=.true.
6012 END IF
6013 END IF
6014!
6015! Get time variable "units" attribute and convert to elapsed time
6016! since reference date. If Julian Day Number (days or seconds) and
6017! 'add_offset' attribute,
6018!
6019 unitsatt(1)='units'
6020
6021 CALL netcdf_get_satt (ng, model, ncname, varid, unitsatt, &
6022 & unitsvalue, got_units, &
6023 & ncid = my_ncid)
6024
6025 IF (exit_flag.eq.noerror) THEN
6026 IF (got_units(1)) THEN
6027 units=trim(lowercase(unitsvalue(1)))
6028 lstr=len_trim(units)
6029 ind=index(units,'since')
6030 IF (ind.gt.0) THEN
6031 CALL time_units (trim(units), year, month, day, hour, &
6032 & minutes, seconds)
6033 CALL datenum (my_rdate, year, month, day, hour, minutes, &
6034 & seconds)
6035 IF (rdate(1).ne.my_rdate(1)) THEN
6036 ustring=units(1:ind-2)
6037 SELECT CASE (trim(ustring))
6038 CASE ('second', 'seconds')
6039 IF (ldebug) THEN
6040 IF (julianoffset) THEN
6041 dnum_old=a
6042 ELSE
6043 dnum_old=my_rdate(2)+a
6044 END IF
6045 CALL datestr (dnum_old, .false., dstr_old)
6046 END IF
6047 IF (julianoffset) THEN
6048 a=a-rdate(2) ! 'add_offset' added above
6049 ELSE
6050 a=(my_rdate(2)+a)-rdate(2)
6051 END IF
6052 IF (ldebug) THEN
6053 dnum_new=rdate(2)+a
6054 CALL datestr (dnum_new, .false., dstr_new)
6055 END IF
6056 CASE ('hour', 'hours') ! convert to seconds
6057 IF (ldebug) THEN
6058 scale=3600.0_dp ! hours to seconds
6059 IF (julianoffset) THEN
6060 dnum_old=a*scale
6061 ELSE
6062 dnum_old=my_rdate(2)+a*scale
6063 END IF
6064 CALL datestr (dnum_old, .false., dstr_old)
6065 END IF
6066 scale=24.0_dp ! time reference to hours
6067 IF (julianoffset) THEN
6068 a=a-rdate(1)*scale ! 'add_offset' added above
6069 ELSE
6070 a=(my_rdate(1)*scale+a)-rdate(1)*scale
6071 END IF
6072 IF (ldebug) THEN
6073 scale=3600.0_dp ! convert to seconds
6074 dnum_new=rdate(2)+a*scale
6075 CALL datestr (dnum_new, .false., dstr_new)
6076 END IF
6077 CASE ('day', 'days')
6078 IF (ldebug) THEN
6079 IF (julianoffset) THEN
6080 dnum_old=a
6081 ELSE
6082 dnum_old=my_rdate(1)+a
6083 END IF
6084 CALL datestr (dnum_old, .true., dstr_old)
6085 END IF
6086 IF (julianoffset) THEN
6087 a=a-rdate(1) ! 'add_offset' added above
6088 ELSE
6089 a=(my_rdate(1)+a)-rdate(1)
6090 END IF
6091 IF (ldebug) THEN
6092 dnum_new=rdate(1)+a
6093 CALL datestr (dnum_new, .true., dstr_new)
6094 END IF
6095 END SELECT
6096 END IF
6097 END IF
6098 END IF
6099 END IF
6100!
6101! Compute minimum and maximum values of read variable. Notice that
6102! the same read value is assigned since a scalar variable was
6103! processed.
6104!
6105 IF (PRESENT(min_val)) THEN
6106 min_val=a
6107 END IF
6108 IF (PRESENT(max_val)) THEN
6109 max_val=a
6110 END IF
6111!
6112! If NetCDF file ID is not provided, close input NetCDF file.
6113!
6114 IF (.not.PRESENT(ncid)) THEN
6115 CALL netcdf_close (ng, model, my_ncid, ncname, .false.)
6116 END IF
6117!
6118 10 FORMAT (/,' NETCDF_GET_TIME_0D - error while reading variable:', &
6119 & 2x,a,/,22x,'in input file:',2x,a,/,22x,'call from:',2x,a, &
6120 & /,22x,a)
6121 20 FORMAT (/,' NETCDF_GET_TIME_0D - error while inquiring ID for ', &
6122 & 'variable:',2x,a,/,22x,'in input file:',2x,a,/,22x, &
6123 & 'call from:',2x,a,/,22x,a)
6124!
6125 RETURN
subroutine, public datestr(datenumber, isdayunits, datestring)
Definition dateclock.F:447
subroutine, public time_units(ustring, year, month, day, hour, minutes, seconds)
Definition dateclock.F:1347
subroutine, public datenum(datenumber, year, month, day, hour, minutes, seconds)
Definition dateclock.F:243
character(len(sinp)) function, public lowercase(sinp)
Definition strings.F:531
logical function, public founderror(flag, noerr, line, routine)
Definition strings.F:52

References dateclock_mod::datenum(), dateclock_mod::datestr(), mod_scalars::exit_flag, strings_mod::founderror(), mod_parallel::inpthread, mod_iounits::ioerror, strings_mod::lowercase(), mod_netcdf::netcdf_close(), mod_netcdf::netcdf_get_satt(), mod_netcdf::netcdf_open(), mod_scalars::noerror, mod_iounits::sourcefile, mod_iounits::stdout, mod_scalars::time_ref, and dateclock_mod::time_units().

Here is the call graph for this function:

◆ netcdf_get_time_1d()

subroutine mod_netcdf::netcdf_get_time::netcdf_get_time_1d ( integer, intent(in) ng,
integer, intent(in) model,
character (len=*), intent(in) ncname,
character (len=*), intent(in) myvarname,
real(dp), dimension(2), intent(in) rdate,
real(dp), dimension(:), intent(out) a,
integer, intent(in), optional ncid,
integer, dimension(:), intent(in), optional start,
integer, dimension(:), intent(in), optional total,
real(dp), intent(out), optional min_val,
real(dp), intent(out), optional max_val )

Definition at line 6128 of file mod_netcdf.F.

6132!
6133!=======================================================================
6134! !
6135! This routine reads requested time 1D-array variable from specified !
6136! NetCDF file. If the "units" attribute of the form: !
6137! !
6138! 'time-units since YYYY-MM-DD hh:mm:ss' !
6139! !
6140! is different than provided reference date "Rdate", it converts to !
6141! elapsed time since "Rdate". !
6142! !
6143! On Input: !
6144! !
6145! ng Nested grid number (integer) !
6146! model Calling model identifier (integer) !
6147! ncname NetCDF file name (string) !
6148! myVarName time variable name (string) !
6149! Rdate Reference date (real; [1] seconds, [2] days) !
6150! ncid NetCDF file ID (integer, OPTIONAL) !
6151! start Starting index where the first of the data values !
6152! will be read along each dimension (integer, !
6153! OPTIONAL) !
6154! total Number of data values to be read along each !
6155! dimension (integer, OPTIONAL) !
6156! !
6157! On Ouput: !
6158! !
6159! A Read 1D-array time variable (real) !
6160! min_val Read data minimum value (real, OPTIONAL) !
6161! max_val Read data maximum value (real, OPTIONAL) !
6162! !
6163! Examples: !
6164! !
6165! CALL netcdf_get_fvar (ng, iNLM, 'file.nc', 'VarName', fvar) !
6166! CALL netcdf_get_fvar (ng, iNLM, 'file.nc', 'VarName', fvar(0:)) !
6167! CALL netcdf_get_fvar (ng, iNLM, 'file.nc', 'VarName', fvar(:,1)) !
6168! !
6169!=======================================================================
6170!
6172 USE strings_mod, ONLY : lowercase
6173!
6174! Imported variable declarations.
6175!
6176 integer, intent(in) :: ng, model
6177
6178 integer, intent(in), optional :: ncid
6179 integer, intent(in), optional :: start(:)
6180 integer, intent(in), optional :: total(:)
6181!
6182 character (len=*), intent(in) :: ncname
6183 character (len=*), intent(in) :: myVarName
6184!
6185 real(dp), intent(in) :: Rdate(2)
6186
6187 real(dp), intent(out), optional :: min_val
6188 real(dp), intent(out), optional :: max_val
6189
6190 real(dp), intent(out) :: A(:)
6191!
6192! Local variable declarations.
6193!
6194 logical :: JulianOffset = .false.
6195 logical :: Ldebug = .false.
6196
6197 logical, dimension(1) :: got_units
6198 logical, dimension(2) :: foundit
6199!
6200 integer :: i, ind, lstr, my_ncid, status, varid
6201 integer :: year, month, day, hour, minutes
6202
6203 integer, dimension(1) :: Asize
6204#if !defined PARALLEL_IO && defined DISTRIBUTE
6205 integer, dimension(2) :: ibuffer
6206#endif
6207!
6208 real(dp) :: Afactor, Aoffset, my_Rdate(2), seconds
6209 real(dp) :: dnum_old, dnum_new, scale
6210
6211 real(r8), dimension(2) :: AttValue
6212!
6213 character (len=12) :: AttName(2)
6214 character (len=22) :: dstr_old, dstr_new
6215 character (len=40) :: UnitsAtt(1), UnitsValue(1)
6216 character (len=40) :: Units, Ustring
6217
6218 character (len=*), parameter :: MyFile = &
6219 & __FILE__//", netcdf_get_time_1d"
6220!
6221!-----------------------------------------------------------------------
6222! Read in a time 1D-array variable.
6223!-----------------------------------------------------------------------
6224!
6225 IF (PRESENT(start).and.PRESENT(total)) THEN
6226 asize(1)=1
6227 DO i=1,SIZE(total) ! this logic is for the case
6228 asize(1)=asize(1)*total(i) ! of reading multidimensional
6229 END DO ! data into a compact 1D array
6230 ELSE
6231 asize(1)=ubound(a, dim=1)
6232 END IF
6233!
6234! If NetCDF file ID is not provided, open NetCDF for reading.
6235!
6236 IF (.not.PRESENT(ncid)) THEN
6237 CALL netcdf_open (ng, model, trim(ncname), 0, my_ncid)
6238 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
6239 ELSE
6240 my_ncid=ncid
6241 END IF
6242!
6243! Read in time variable.
6244!
6245 IF (inpthread) THEN
6246 status=nf90_inq_varid(my_ncid, trim(myvarname), varid)
6247 IF (status.eq.nf90_noerr) THEN
6248 IF (PRESENT(start).and.PRESENT(total)) THEN
6249 status=nf90_get_var(my_ncid, varid, a, start, total)
6250 ELSE
6251 status=nf90_get_var(my_ncid, varid, a)
6252 END IF
6253 IF (founderror(status, nf90_noerr, __line__, myfile)) THEN
6254 WRITE (stdout,10) trim(myvarname), trim(ncname), &
6255 & trim(sourcefile), nf90_strerror(status)
6256 exit_flag=2
6257 ioerror=status
6258 END IF
6259 ELSE
6260 WRITE (stdout,20) trim(myvarname), trim(ncname), &
6261 & trim(sourcefile), nf90_strerror(status)
6262 exit_flag=2
6263 ioerror=status
6264 END IF
6265 END IF
6266
6267#if !defined PARALLEL_IO && defined DISTRIBUTE
6268!
6269! Broadcast read variable to all processors in the group.
6270!
6271 ibuffer(1)=exit_flag
6272 ibuffer(2)=ioerror
6273 CALL mp_bcasti (ng, model, ibuffer)
6274 exit_flag=ibuffer(1)
6275 ioerror=ibuffer(2)
6276 IF (exit_flag.eq.noerror) THEN
6277 CALL mp_bcastf (ng, model, a)
6278 END IF
6279#endif
6280!
6281! Check if the following attributes: "scale_factor", "add_offset", and
6282! "_FillValue" are present in the input NetCDF variable:
6283!
6284! If the "scale_value" attribute is present, the data is multiplied by
6285! this factor after reading.
6286! If the "add_offset" attribute is present, this value is added to the
6287! data after reading.
6288! If both "scale_factor" and "add_offset" attributes are present, the
6289! data are first scaled before the offset is added.
6290! If the "_FillValue" attribute is present, the data having this value
6291! is treated as missing and it is replaced with zero. This feature it
6292! is usually related with the land/sea masking.
6293!
6294 attname(1)='scale_factor'
6295 attname(2)='add_offset '
6296
6297 CALL netcdf_get_fatt (ng, model, ncname, varid, attname, &
6298 & attvalue, foundit, &
6299 & ncid = my_ncid)
6300
6301 IF (exit_flag.eq.noerror) THEN
6302 IF (.not.foundit(1)) THEN
6303 afactor=1.0_r8
6304 ELSE
6305 afactor=real(attvalue(1),dp)
6306 END IF
6307
6308 IF (.not.foundit(2)) THEN
6309 aoffset=0.0_r8
6310 ELSE
6311 aoffset=real(attvalue(2),dp)
6312 END IF
6313
6314 IF (foundit(1)) THEN ! scale data
6315 DO i=1,asize(1)
6316 a(i)=afactor*a(i)
6317 END DO
6318 END IF
6319
6320 IF (foundit(2)) THEN ! add data offset
6321 DO i=1,asize(1)
6322 a(i)=a(i)+aoffset
6323 END DO
6324 IF (time_ref.eq.-2) julianoffset=.true.
6325 END IF
6326 END IF
6327!
6328! Get time variable "units" attribute and convert to elapsed time
6329! since reference date.
6330!
6331 unitsatt(1)='units'
6332
6333 CALL netcdf_get_satt (ng, model, ncname, varid, unitsatt, &
6334 & unitsvalue, got_units, &
6335 & ncid = my_ncid)
6336
6337 IF (exit_flag.eq.noerror) THEN
6338 IF (got_units(1)) THEN
6339 units=trim(lowercase(unitsvalue(1)))
6340 lstr=len_trim(units)
6341 ind=index(units,'since')
6342 IF (ind.gt.0) THEN
6343 CALL time_units (trim(units), year, month, day, hour, &
6344 & minutes, seconds)
6345 CALL datenum (my_rdate, year, month, day, hour, minutes, &
6346 & seconds)
6347 IF (rdate(1).ne.my_rdate(1)) THEN
6348 ustring=units(1:ind-2)
6349 SELECT CASE (trim(ustring))
6350 CASE ('second', 'seconds')
6351 IF (ldebug) THEN
6352 IF (julianoffset) THEN
6353 dnum_old=a(1)
6354 ELSE
6355 dnum_old=my_rdate(2)+a(1)
6356 END IF
6357 CALL datestr (dnum_old, .false., dstr_old)
6358 END IF
6359 IF (julianoffset) THEN
6360 DO i=1,asize(1)
6361 a(i)=a(i)-rdate(2) ! 'add_offset' added above
6362 END DO
6363 ELSE
6364 DO i=1,asize(1)
6365 a(i)=(my_rdate(2)+a(i))-rdate(2)
6366 END DO
6367 END IF
6368 IF (ldebug) THEN
6369 dnum_new=rdate(2)+a(1)
6370 CALL datestr (dnum_new, .false., dstr_new)
6371 END IF
6372 CASE ('hour', 'hours')
6373 scale=3600.0_dp ! convert to seconds
6374 IF (ldebug) THEN
6375 IF (julianoffset) THEN
6376 dnum_old=a(1)*scale
6377 ELSE
6378 dnum_old=my_rdate(2)+a(1)*scale
6379 END IF
6380 CALL datestr (dnum_old, .false., dstr_old)
6381 END IF
6382 scale=24.0_dp ! time reference to hours
6383 IF (julianoffset) THEN
6384 DO i=1,asize(1)
6385 a(i)=a(i)-rdate(1)*scale ! add_offset added above
6386 END DO
6387 ELSE
6388 DO i=1,asize(1)
6389 a(i)=(my_rdate(1)*scale+a(i))-rdate(1)*scale
6390 END DO
6391 END IF
6392 IF (ldebug) THEN
6393 scale=3600.0_dp ! convert to seconds
6394 dnum_new=rdate(2)+a(1)*scale
6395 CALL datestr (dnum_new, .false., dstr_new)
6396 END IF
6397 CASE ('day', 'days')
6398 IF (ldebug) THEN
6399 IF (julianoffset) THEN
6400 dnum_old=a(1)
6401 ELSE
6402 dnum_old=my_rdate(1)+a(1)
6403 END IF
6404 CALL datestr (dnum_old, .true., dstr_old)
6405 END IF
6406 IF (julianoffset) THEN
6407 DO i=1,asize(1)
6408 a(i)=a(i)-rdate(1) ! 'add_offset' added above
6409 END DO
6410 ELSE
6411 DO i=1,asize(1)
6412 a(i)=(my_rdate(1)+a(i))-rdate(1)
6413 END DO
6414 END IF
6415 IF (ldebug) THEN
6416 dnum_new=rdate(1)+a(1)
6417 CALL datestr (dnum_new, .true., dstr_new)
6418 END IF
6419 END SELECT
6420 END IF
6421 END IF
6422 END IF
6423 END IF
6424!
6425! Compute minimum and maximum values of read variable.
6426!
6427 IF (PRESENT(min_val)) THEN
6428 min_val=minval(a)
6429 END IF
6430 IF (PRESENT(max_val)) THEN
6431 max_val=maxval(a)
6432 END IF
6433!
6434! If NetCDF file ID is not provided, close input NetCDF file.
6435!
6436 IF (.not.PRESENT(ncid)) THEN
6437 CALL netcdf_close (ng, model, my_ncid, ncname, .false.)
6438 END IF
6439!
6440 10 FORMAT (/,' NETCDF_GET_TIME_1D - error while reading variable:', &
6441 & 2x,a,/,22x,'in input file:',2x,a,/,22x,'call from:',2x,a, &
6442 & /,22x,a)
6443 20 FORMAT (/,' NETCDF_GET_TIME_1D - error while inquiring ID for ', &
6444 & 'variable:',2x,a,/,22x,'in input file:',2x,a,/,22x, &
6445 & 'call from:',2x,a,/,22x,a)
6446!
6447 RETURN

References dateclock_mod::datenum(), dateclock_mod::datestr(), mod_scalars::exit_flag, strings_mod::founderror(), mod_parallel::inpthread, mod_iounits::ioerror, strings_mod::lowercase(), mod_netcdf::netcdf_close(), mod_netcdf::netcdf_get_satt(), mod_netcdf::netcdf_open(), mod_scalars::noerror, mod_iounits::sourcefile, mod_iounits::stdout, mod_scalars::time_ref, and dateclock_mod::time_units().

Here is the call graph for this function:

The documentation for this interface was generated from the following file: