! source file: /sfs/fs1/work-geomar6/smomw113/UVic_ESCM/2.9_dk_0814/updates/07_aouassim/source/common/sstdata_panik.F subroutine sstdata_panik(locali,localj,sstreturn) return end subroutine getvara_verbose (name, ncid, ln, is, ic, dout, s, o) !======================================================================= ! read data ! input: ! name = name of variable to be written ! ncid = iou unit ! ln = length of data ! is = starting point for read in each dimension ! ic = count (or length) for read in each dimension ! s = data scalar ! o = data offset ! output: ! dout = data (default real) !======================================================================= implicit none include 'netcdf.inc' character(*), intent(in) :: name integer, intent(in) :: is(10), ic(10), ln, ncid integer i, iv, nd real, intent(in) :: o, s real dout(ln) real(kind=8) din(ln), offset, scale i = nf_inq_varid (ncid, name, iv) write(20,*) 'ncid: ', ncid write(20,*) 'name: ', name write(20,*) 'var_id: ', iv if (i .ne. nf_noerr) then print*, '==> Warning: netcdf variable ',trim(name), ' not found' return endif scale = 1.0 offset = 0.0 i = nf_inq_varndims(ncid, iv, nd) write(20,*) 'num dims: ', nd call checkerror (i,'getvara nf_inq_varndims '//name) i = nf_get_att_double (ncid, iv, 'add_offset', offset) write(20,*) 'offset: ', offset i = nf_get_att_double (ncid, iv, 'scale_factor', scale) write(20,*) 'scale factor: ',scale i = nf_get_vara_double (ncid, iv, is(1:nd), ic(1:nd), din) call checkerror(i,'getvara '//name) dout(1:ln) = (din(1:ln)*scale + offset)*s + o write(20,*) 'leaving getvara_verbose ..' return end