Ticket #372: ropp-7.0_SLES11-64bit_intel-ropp-io-read-ncdf.patch

File ropp-7.0_SLES11-64bit_intel-ropp-io-read-ncdf.patch, 20.5 KB (added by Ian Culverwell, 10 years ago)
  • ropp_io/ropp/ropp_io_read_ncdf_get.f90

    a b  
    21032103!  BYTE                         :: readbyte1, readbyte2, readbyte3 ! nagfor doesn't like BYTE
    21042104  INTEGER(OneByteInt)          :: readbyte1, readbyte2, readbyte3
    21052105
    2106   CHARACTER (len = 256)        :: dir
     2106  CHARACTER (len = 256)        :: sdir ! directory to science info in netCDF4
     2107  CHARACTER (len = 256)        :: ddir ! directory to science/data in netCDF4
     2108  CHARACTER (len = 256)        :: tdir ! tmp directory for use
    21072109
    21082110  REAL(wp), PARAMETER          :: g_wmo = 9.80665_wp
    21092111  REAL(wp), PARAMETER          :: epsilon_water = 0.621971_wp
     
    21222124
    21232125  REAL(wp) :: lat
    21242126
    2125 ! 6.2 group path for level 1B data
    2126 ! --------------------------------
    2127   dir = '/level_1b/'//TRIM(resolution)//'/'
     2127! 6.2 group path for science, level 1B data
     2128! -----------------------------------------
     2129  sdir = '/science_data/'
     2130  ddir = TRIM(sdir)//'level_1b/'//TRIM(resolution)//'/'
    21282131
    21292132
    21302133! 6.3 Header variables
     
    21322135
    21332136  ! receiver satellite ID in ROPP format
    21342137  readstr = ' '
    2135   CALL ncdf_getatt('satellite', readstr)
    2136   IF ( readstr == "Metop-A" ) data%leo_id = "META"
    2137   IF ( readstr == "Metop-B" ) data%leo_id = "METB"
    2138   IF ( readstr == "Metop-C" ) data%leo_id = "METC"
     2138  CALL ncdf_getatt("spacecraft", readstr)
     2139  IF ( readstr == "M02" ) data%leo_id = "META"
     2140  IF ( readstr == "M01" ) data%leo_id = "METB"
     2141  IF ( readstr == "M03" ) data%leo_id = "METC"
     2142
    21392143
    21402144  ! occulting GNSS satellite
    2141   CALL ncdf_getvar('/occultation/prn', readint)
     2145  CALL ncdf_getvar(TRIM(sdir)//"occultation/prn", readint)
    21422146  WRITE(data%gns_id,'(A1,I3.3)') 'G', readint
    21432147
    21442148  ! station ID unused for EUMETSAT data
     
    21512155! -------------------
    21522156
    21532157  ! Overall nominal / non-nominal
    2154   CALL ncdf_getvar("/quality_control/fsi_retrieval_available", readbyte1)
     2158  tdir = TRIM(sdir)//'quality_control/'
     2159  CALL ncdf_getvar(TRIM(tdir)//"fsi_retrieval_available", readbyte1)
    21552160
    2156   IF (readbyte1 == 0 ) CALL ncdf_getvar("/quality_control/go_retrieval_available", readbyte1)
     2161  IF (readbyte1 == 0 ) CALL ncdf_getvar(TRIM(tdir)//"go_retrieval_available", readbyte1)
    21572162
    21582163!  data%PCD = (readbyte1 .ne. 1)
    21592164  IF (readbyte1 == 0) THEN
     
    21712176  data%units%overall_qual = "%"
    21722177
    21732178  ! open or closed loop data setting
    2174   CALL ncdf_getvar("/quality_control/rs_data_available", readbyte1)
    2175   CALL ncdf_getvar("/quality_control/ol_data_available", readbyte2)
     2179  CALL ncdf_getvar(TRIM(tdir)//"rs_data_available", readbyte1)
     2180  CALL ncdf_getvar(TRIM(tdir)//"ol_data_available", readbyte2)
    21762181!!  IF ((readbyte1) .OR. (readbyte2)) data%PCD = IBSET(data%PCD, PCD_open_loop)   - right now we only us RS, not OL
    21772182!  IF (readbyte1) data%PCD = IBSET(data%PCD, PCD_open_loop)
    21782183  IF (readbyte1 /= 0) data%PCD = IBSET(data%PCD, PCD_open_loop)
    21792184
    21802185  ! setting or rising
    2181   CALL ncdf_getatt("/occultation/occultation_type", readstr)
     2186  CALL ncdf_getatt(TRIM(sdir)//"occultation/occultation_type", readstr)
    21822187  IF (TRIM(readstr) == "rising") data%PCD = IBSET(data%PCD, PCD_rising)
    21832188
    21842189  ! closed loop phase measurements okay?
    2185   CALL ncdf_getvar("/quality_control/cl_snr_ca_ok", readbyte1)
    2186   CALL ncdf_getvar("/quality_control/cl_snr_p1_ok", readbyte2)
    2187   CALL ncdf_getvar("/quality_control/cl_snr_p2_ok", readbyte3)
     2190  CALL ncdf_getvar(TRIM(tdir)//"cl_snr_ca_ok", readbyte1)
     2191  CALL ncdf_getvar(TRIM(tdir)//"cl_snr_p1_ok", readbyte2)
     2192  CALL ncdf_getvar(TRIM(tdir)//"cl_snr_p2_ok", readbyte3)
    21882193!  IF ((.NOT. readbyte1) .AND. (.NOT. readbyte2) .AND. (.NOT. readbyte3)) data%PCD = IBSET(data%PCD, PCD_phase)
    21892194  IF ((readbyte1 == 0) .AND. (readbyte2 == 0) .AND. (readbyte3 == 0)) data%PCD = IBSET(data%PCD, PCD_phase)
    21902195
     
    21932198! -----------------
    21942199
    21952200  ! start time of occultation
    2196   CALL ncdf_getvar('/level_1b/utc_start_absdate', readint)
    2197   CALL ncdf_getvar('/level_1b/utc_start_abstime', readreal)
     2201  tdir = TRIM(sdir)//"level_1b/"
     2202  CALL ncdf_getvar(TRIM(tdir)//"utc_start_absdate", readint)
     2203  CALL ncdf_getvar(TRIM(tdir)//"utc_start_abstime", readreal)
    21982204
    21992205  ! check that we have the right time
    2200   CALL ncdf_getatt('/level_1b/units', readstr, 'utc_start_absdate')
     2206  CALL ncdf_getatt(TRIM(tdir)//"units", readstr, 'utc_start_absdate')
    22012207  IF ( readstr == "days since 2000-01-01 00:00:00.00" ) THEN
    22022208    CALL abstimetoDT(readint, readreal, data%DTocc)
    22032209  ELSE
     
    22062212  ENDIF
    22072213
    22082214  ! difference between start time to georef time
    2209   CALL ncdf_getvar('/occultation/utc_georef_absdate', readint2)
    2210   CALL ncdf_getvar('/occultation/utc_georef_abstime', readreal2)
     2215  tdir = TRIM(sdir)//"occultation/"
     2216  CALL ncdf_getvar(TRIM(tdir)//"utc_georef_absdate", readint2)
     2217  CALL ncdf_getvar(TRIM(tdir)//"utc_georef_abstime", readreal2)
    22112218
    22122219  ! FIXME: 1. Is there a simple library call to do this in just one call?
    22132220  !        2. This can be negative (georef is determined from orbits, but
     
    22272234! 6.6 Georeferencing
    22282235! ------------------
    22292236   
    2230   CALL ncdf_getvar('/occultation/latitude',             data%georef%lat,        units=data%georef%units%lat)
    2231   CALL ncdf_getvar('/occultation/longitude',            data%georef%lon,        units=data%georef%units%lon)
    2232   CALL ncdf_getvar('/occultation/undulation',           data%georef%Undulation, units=data%georef%units%Undulation)
    2233   CALL ncdf_getvar('/occultation/r_curve',              data%georef%roc,        units=data%georef%units%roc)
    2234   CALL ncdf_getvar('/occultation/r_curve_centre_fixed', data%georef%r_coc,      units=data%georef%units%r_coc)
    2235   CALL ncdf_getvar('/occultation/azimuth_north',        data%georef%azimuth,    units=data%georef%units%azimuth)
     2237  CALL ncdf_getvar(TRIM(tdir)//"latitude",             data%georef%lat,        units=data%georef%units%lat)
     2238  CALL ncdf_getvar(TRIM(tdir)//"longitude",            data%georef%lon,        units=data%georef%units%lon)
     2239  CALL ncdf_getvar(TRIM(tdir)//"undulation",           data%georef%Undulation, units=data%georef%units%Undulation)
     2240  CALL ncdf_getvar(TRIM(tdir)//"r_curve",              data%georef%roc,        units=data%georef%units%roc)
     2241  CALL ncdf_getvar(TRIM(tdir)//"r_curve_centre_fixed", data%georef%r_coc,      units=data%georef%units%r_coc)
     2242  CALL ncdf_getvar(TRIM(tdir)//"azimuth_north",        data%georef%azimuth,    units=data%georef%units%azimuth)
    22362243
    22372244  ! FIXME: Do we need this?
    22382245  data%georef%reference_frame%r_coc = "ECF"
     
    22472254  ! would always have the value 1 when used, but allows to separate data
    22482255  ! at the reference point from the general level 1a data, which covers the
    22492256  ! whole occultation
    2250 
    22512257  IF ((getbufr) .AND. (getlevel1a)) THEN
    22522258
    22532259    CALL message(msg_fatal,"Flags to get bufr and get level 1a data set. This is incompatable.")
     
    22572263    IF (getbufr) THEN
    22582264
    22592265      CALL ropp_io_init(data%Lev1a, 1)
    2260       CALL ncdf_getvar('/occultation/position_rec_fixed', data%Lev1a%r_leo(1,:), &
     2266      CALL ncdf_getvar(TRIM(tdir)//"position_rec_fixed", data%Lev1a%r_leo(1,:), &
    22612267                       units=data%Lev1a%units%r_leo, range = data%Lev1a%range%r_leo)
    2262       CALL ncdf_getvar('/occultation/velocity_rec',       data%Lev1a%v_leo(1,:), &
     2268      CALL ncdf_getvar(TRIM(tdir)//"velocity_rec",       data%Lev1a%v_leo(1,:), &
    22632269                       units=data%Lev1a%units%v_leo, range = data%Lev1a%range%v_leo)
    2264       CALL ncdf_getvar('/occultation/position_gns_fixed', data%Lev1a%r_gns(1,:), &
     2270      CALL ncdf_getvar(TRIM(tdir)//"position_gns_fixed", data%Lev1a%r_gns(1,:), &
    22652271                       units=data%Lev1a%units%r_gns, range = data%Lev1a%range%r_gns)
    2266       CALL ncdf_getvar('/occultation/velocity_gns',       data%Lev1a%v_gns(1,:), &
     2272      CALL ncdf_getvar(TRIM(tdir)//"velocity_gns",       data%Lev1a%v_gns(1,:), &
    22672273                          units=data%Lev1a%units%v_gns, range = data%Lev1a%range%v_gns)
    22682274
    22692275      ! FIXME: Do we need this?
     
    22802286      !          in ROPP netCDF file if required!
    22812287      !        - data appears when doing a bufr2ropp, however seems not to be
    22822288      !          part of the bufr content.
    2283       !CALL ncdf_getvar('/level_1a/closed_loop/snr_ca_mean', data%Lev1a%snr_L1ca(1), units=data%Lev1a%units%snr, range = data%Lev1a%range%snr)
    2284       !CALL ncdf_getvar('/level_1a/closed_loop/snr_p1_mean', data%Lev1a%snr_L1p(1),  units=data%Lev1a%units%snr, range = data%Lev1a%range%snr)
    2285       !CALL ncdf_getvar('/level_1a/closed_loop/snr_p2_mean', data%Lev1a%snr_L2p(1),  units=data%Lev1a%units%snr, range = data%Lev1a%range%snr)
     2289      !tdir = TRIM(sdir)//"level_1a/closed_loop/"
     2290      !CALL ncdf_getvar(TRIM(tdir)//"snr_ca_mean", data%Lev1a%snr_L1ca(1), units=data%Lev1a%units%snr, range = data%Lev1a%range%snr)
     2291      !CALL ncdf_getvar(TRIM(tdir)//"snr_p1_mean", data%Lev1a%snr_L1p(1),  units=data%Lev1a%units%snr, range = data%Lev1a%range%snr)
     2292      !CALL ncdf_getvar(TRIM(tdir)//"snr_p2_mean", data%Lev1a%snr_L2p(1),  units=data%Lev1a%units%snr, range = data%Lev1a%range%snr)
    22862293
    22872294      ! data is available
    22882295      data%Lev1a%Missing = .FALSE.
     
    23042311    ! For now the approach is to read and combine closed loop and raw sampling records.
    23052312    ! This and related stuff is Kjartan's update
    23062313
    2307     IF (ncdf_isvar('/level_1a/closed_loop/dtime')) THEN    ! read CL data
     2314    tdir = TRIM(sdir)//"level_1a/closed_loop/"
     2315    IF (ncdf_isvar(TRIM(tdir)//"dtime")) THEN    ! read CL data
    23082316
    2309       CALL ncdf_getsize('/level_1a/closed_loop/dtime', n_cl, dim = 1)
     2317      CALL ncdf_getsize(TRIM(tdir)//"dtime", n_cl, dim = 1)
    23102318      CALL ropp_io_init(data_cl%Lev1a, n_cl)
    23112319
    23122320      ! Time
     
    23152323      ! with changing values. Since default behaviour is to assume seconds the data are actually read correctly but the problem causes
    23162324      ! a warning
    23172325
    2318       CALL ncdf_getvar('/level_1a/closed_loop/dtime', data_cl%Lev1a%dtime) !, units=data_cl%Lev1a%units%dtime)
     2326      CALL ncdf_getvar(TRIM(tdir)//"dtime", data_cl%Lev1a%dtime) !, units=data_cl%Lev1a%units%dtime)
    23192327
    23202328      ! Position and velocity
    23212329
     
    23242332      ALLOCATE(r_gns(3,n_cl))
    23252333      ALLOCATE(v_gns(3,n_cl))
    23262334
    2327       CALL ncdf_getvar('/level_1a/closed_loop/r_transmitter', r_gns, units=data_cl%Lev1a%units%r_gns)
    2328       CALL ncdf_getvar('/level_1a/closed_loop/v_transmitter', v_gns, units=data_cl%Lev1a%units%v_gns)
    2329       CALL ncdf_getvar('/level_1a/closed_loop/r_receiver',    r_leo, units=data_cl%Lev1a%units%r_leo)
    2330       CALL ncdf_getvar('/level_1a/closed_loop/v_receiver',    v_leo, units=data_cl%Lev1a%units%v_leo)
     2335      CALL ncdf_getvar(TRIM(tdir)//"r_transmitter", r_gns, units=data_cl%Lev1a%units%r_gns)
     2336      CALL ncdf_getvar(TRIM(tdir)//"v_transmitter", v_gns, units=data_cl%Lev1a%units%v_gns)
     2337      CALL ncdf_getvar(TRIM(tdir)//"r_receiver",    r_leo, units=data_cl%Lev1a%units%r_leo)
     2338      CALL ncdf_getvar(TRIM(tdir)//"v_receiver",    v_leo, units=data_cl%Lev1a%units%v_leo)
    23312339
    23322340      DO j=1,n_cl
    23332341        data_cl%Lev1a%r_gns(j,:) = r_gns(:,j)
     
    23432351
    23442352      ! Phase and amplitude
    23452353
    2346       CALL ncdf_getvar('/level_1a/closed_loop/exphase_ca', data_cl%Lev1a%phase_L1, units=data_cl%Lev1a%units%phase)
    2347       CALL ncdf_getvar('/level_1a/closed_loop/exphase_p2', data_cl%Lev1a%phase_L2, units=data_cl%Lev1a%units%phase)
    2348       CALL ncdf_getvar('/level_1a/closed_loop/snr_ca',     data_cl%Lev1a%snr_L1ca, units=data_cl%Lev1a%units%snr)
    2349       CALL ncdf_getvar('/level_1a/closed_loop/snr_p1',     data_cl%Lev1a%snr_L1p,  units=data_cl%Lev1a%units%snr)
    2350       CALL ncdf_getvar('/level_1a/closed_loop/snr_p2',     data_cl%Lev1a%snr_L2p,  units=data_cl%Lev1a%units%snr)
     2354      CALL ncdf_getvar(TRIM(tdir)//"exphase_ca", data_cl%Lev1a%phase_L1, units=data_cl%Lev1a%units%phase)
     2355      CALL ncdf_getvar(TRIM(tdir)//"exphase_p2", data_cl%Lev1a%phase_L2, units=data_cl%Lev1a%units%phase)
     2356      CALL ncdf_getvar(TRIM(tdir)//"snr_ca",     data_cl%Lev1a%snr_L1ca, units=data_cl%Lev1a%units%snr)
     2357      CALL ncdf_getvar(TRIM(tdir)//"snr_p1",     data_cl%Lev1a%snr_L1p,  units=data_cl%Lev1a%units%snr)
     2358      CALL ncdf_getvar(TRIM(tdir)//"snr_p2",     data_cl%Lev1a%snr_L2p,  units=data_cl%Lev1a%units%snr)
    23512359
    23522360      ! Closed loop lost carrier flag (looking for data gaps)
    23532361
     
    23822390
    23832391    n_rs = 0    ! will be set differently if RS data is available
    23842392
    2385     CALL ncdf_getvar("/quality_control/rs_data_available", readbyte1)
     2393    CALL ncdf_getvar(TRIM(sdir)//"quality_control/rs_data_available", readbyte1)
    23862394
    23872395    IF (readbyte1 == 1) THEN
    23882396
    2389       IF (ncdf_isvar('/level_1a/raw_sampling/dtime')) THEN    ! read RS data
     2397      tdir = TRIM(sdir)//"level_1a/raw_sampling/"
     2398      IF (ncdf_isvar(TRIM(tdir)//"dtime")) THEN    ! read RS data
    23902399
    23912400        data%PCD = IBSET(data%PCD, PCD_open_loop)
    2392         CALL ncdf_getsize('/level_1a/raw_sampling/dtime', n_rs, dim = 1)
     2401        CALL ncdf_getsize(TRIM(tdir)//'dtime', n_rs, dim = 1)
    23932402        CALL ropp_io_init(data_rs%Lev1a, n_rs)
    23942403
    23952404        ! Time
     
    23982407        ! with changing values. Since default behaviour is to assume seconds in data are actually read correctly but the problem causes
    23992408        ! a warning
    24002409
    2401         CALL ncdf_getvar('/level_1a/raw_sampling/dtime',  data_rs%Lev1a%dtime) !,  units=data_rs%Lev1a%units%dtime)
     2410        CALL ncdf_getvar(TRIM(tdir)//'dtime',  data_rs%Lev1a%dtime) !,  units=data_rs%Lev1a%units%dtime)
    24022411
    24032412        ! Position and velocity
    24042413
     
    24072416        ALLOCATE(r_gns(3,n_rs))
    24082417        ALLOCATE(v_gns(3,n_rs))
    24092418
    2410         CALL ncdf_getvar('/level_1a/raw_sampling/r_transmitter', r_gns, units=data_rs%Lev1a%units%r_gns)
    2411         CALL ncdf_getvar('/level_1a/raw_sampling/v_transmitter', v_gns, units=data_rs%Lev1a%units%v_gns)
    2412         CALL ncdf_getvar('/level_1a/raw_sampling/r_receiver',    r_leo, units=data_rs%Lev1a%units%r_leo)
    2413         CALL ncdf_getvar('/level_1a/raw_sampling/v_receiver',    v_leo, units=data_rs%Lev1a%units%v_leo)
     2419        CALL ncdf_getvar(TRIM(tdir)//'r_transmitter', r_gns, units=data_rs%Lev1a%units%r_gns)
     2420        CALL ncdf_getvar(TRIM(tdir)//'v_transmitter', v_gns, units=data_rs%Lev1a%units%v_gns)
     2421        CALL ncdf_getvar(TRIM(tdir)//'r_receiver',    r_leo, units=data_rs%Lev1a%units%r_leo)
     2422        CALL ncdf_getvar(TRIM(tdir)//'v_receiver',    v_leo, units=data_rs%Lev1a%units%v_leo)
    24142423
    24152424        DO j=1,n_rs
    24162425          data_rs%Lev1a%r_gns(j,:) = r_gns(:,j)
     
    24302439        ALLOCATE(rs_navbit_ext(n_rs))
    24312440        ALLOCATE(tracking_state(n_rs))
    24322441
    2433         CALL ncdf_getvar('/level_1a/raw_sampling/navbits_internal',      rs_navbit_int)
    2434         CALL ncdf_getvar('/quality_control/rs_external_navbits_applied', have_nb)
    2435         CALL ncdf_getvar('/level_1a/raw_sampling/tracking_state',        tracking_state)
     2442        CALL ncdf_getvar(TRIM(tdir)//'navbits_internal',      rs_navbit_int)
     2443        CALL ncdf_getvar(TRIM(sdir)//'quality_control/rs_external_navbits_applied', have_nb)
     2444        CALL ncdf_getvar(TRIM(tdir)//'tracking_state',        tracking_state)
    24362445
    24372446        IF (have_nb > 0) THEN
    2438           CALL ncdf_getvar('/level_1a/raw_sampling/navbits_external', rs_navbit_ext)
     2447          CALL ncdf_getvar(TRIM(tdir)//'navbits_external', rs_navbit_ext)
    24392448        ELSE
    24402449          rs_navbit_ext(:) = rs_navbit_int(:)
    24412450        ENDIF
     
    24452454        ALLOCATE(rs_q_ca_uncorr(n_rs))
    24462455        ALLOCATE(rs_exphase_l1_nco(n_rs))
    24472456
    2448         CALL ncdf_getvar('/level_1a/raw_sampling/i_ca_uncorr',    rs_i_ca_uncorr)
    2449         CALL ncdf_getvar('/level_1a/raw_sampling/q_ca_uncorr',    rs_q_ca_uncorr)
    2450         CALL ncdf_getvar('/level_1a/raw_sampling/exphase_l1_nco', rs_exphase_l1_nco, units=data_rs%Lev1a%units%phase)
    2451         CALL ncdf_getvar('/level_1a/raw_sampling/snr_ca',         data_rs%Lev1a%snr_L1ca, units=data_rs%Lev1a%units%snr)
     2457        CALL ncdf_getvar(TRIM(tdir)//'i_ca_uncorr',    rs_i_ca_uncorr)
     2458        CALL ncdf_getvar(TRIM(tdir)//'q_ca_uncorr',    rs_q_ca_uncorr)
     2459        CALL ncdf_getvar(TRIM(tdir)//'exphase_l1_nco', rs_exphase_l1_nco, units=data_rs%Lev1a%units%phase)
     2460        CALL ncdf_getvar(TRIM(tdir)//'snr_ca',         data_rs%Lev1a%snr_L1ca, units=data_rs%Lev1a%units%snr)
    24522461
    24532462        DO j=1,n_rs
    24542463          rs_phase_l1_iq(j) = ATAN2(rs_q_ca_uncorr(j), rs_i_ca_uncorr(j)+TINY(1.0_wp))
     
    24612470
    24622471!  Comment in the line below if you wish to read the excess phase directly from the EUMETSAT file
    24632472!  instead of deriving from I and Q
    2464 !       CALL ncdf_getvar('/level_1a/raw_sampling/exphase_ca', data_rs%Lev1a%phase_L1, units=data_rs%Lev1a%units%phase)
     2473!       CALL ncdf_getvar('/science_data/level_1a/raw_sampling/exphase_ca', data_rs%Lev1a%phase_L1, units=data_rs%Lev1a%units%phase)
    24652474
    24662475! For rising profiles remove all data with tracking state = 2 in the beginning of the record as these are not valid.
    24672476
     
    27192728! 6.8 Level1b variables (if any)
    27202729! ------------------------------
    27212730
    2722   IF (ncdf_isvar(TRIM(dir)//'impact')) THEN
    2723     CALL ncdf_getsize(TRIM(dir)//'impact', n, dim = 1)
     2731  IF (ncdf_isvar(TRIM(ddir)//'impact')) THEN
     2732    CALL ncdf_getsize(TRIM(ddir)//'impact', n, dim = 1)
    27242733    CALL ropp_io_init(data%Lev1b, n)
    27252734  ELSE
    27262735    data%Lev1b%Npoints = 0
    27272736  ENDIF
    27282737
    27292738  IF (data%Lev1b%Npoints > 0) THEN
    2730     CALL ncdf_getvar(TRIM(dir)//'lat_tp',             data%Lev1b%lat_tp,       units=data%Lev1b%units%lat_tp)
    2731     CALL ncdf_getvar(TRIM(dir)//'lon_tp',             data%Lev1b%lon_tp,       units=data%Lev1b%units%lon_tp)
    2732     CALL ncdf_getvar(TRIM(dir)//'azimuth_tp',         data%Lev1b%azimuth_tp,   units=data%Lev1b%units%azimuth_tp)
    2733     CALL ncdf_getvar(TRIM(dir)//'impact',             data%Lev1b%impact,       units=data%Lev1b%units%impact)
    2734     CALL ncdf_getvar(TRIM(dir)//'impact',             data%Lev1b%impact_L1,    units=data%Lev1b%units%impact)
    2735     CALL ncdf_getvar(TRIM(dir)//'impact',             data%Lev1b%impact_L2,    units=data%Lev1b%units%impact)
    2736     CALL ncdf_getvar(TRIM(dir)//'bangle',             data%Lev1b%bangle,       units=data%Lev1b%units%bangle)
    2737     CALL ncdf_getvar(TRIM(dir)//'bangle_ca',          data%Lev1b%bangle_L1,    units=data%Lev1b%units%bangle)
    2738     CALL ncdf_getvar(TRIM(dir)//'bangle_p2',          data%Lev1b%bangle_L2,    units=data%Lev1b%units%bangle)
     2739    CALL ncdf_getvar(TRIM(ddir)//'lat_tp',             data%Lev1b%lat_tp,       units=data%Lev1b%units%lat_tp)
     2740    CALL ncdf_getvar(TRIM(ddir)//'lon_tp',             data%Lev1b%lon_tp,       units=data%Lev1b%units%lon_tp)
     2741    CALL ncdf_getvar(TRIM(ddir)//'azimuth_tp',         data%Lev1b%azimuth_tp,   units=data%Lev1b%units%azimuth_tp)
     2742    CALL ncdf_getvar(TRIM(ddir)//'impact',             data%Lev1b%impact,       units=data%Lev1b%units%impact)
     2743    CALL ncdf_getvar(TRIM(ddir)//'impact',             data%Lev1b%impact_L1,    units=data%Lev1b%units%impact)
     2744    CALL ncdf_getvar(TRIM(ddir)//'impact',             data%Lev1b%impact_L2,    units=data%Lev1b%units%impact)
     2745    CALL ncdf_getvar(TRIM(ddir)//'bangle',             data%Lev1b%bangle,       units=data%Lev1b%units%bangle)
     2746    CALL ncdf_getvar(TRIM(ddir)//'bangle_ca',          data%Lev1b%bangle_L1,    units=data%Lev1b%units%bangle)
     2747    CALL ncdf_getvar(TRIM(ddir)//'bangle_p2',          data%Lev1b%bangle_L2,    units=data%Lev1b%units%bangle)
    27392748
    27402749!(idc 24/1/13 pgf95 doesn't like this.
    27412750!    ! remove all NaN from EUM fields
     
    27892798
    27902799  data%FmtVersion = ' '        ; data%FmtVersion       = ThisFmtVer
    27912800  data%processing_centre = ' ' ; CALL ncdf_getatt('institution', data%processing_centre)
    2792   data%pod_method = ' '        ; CALL ncdf_getatt('/occultation/pod_method', data%pod_method)
    2793   data%phase_method = ' '      ; CALL ncdf_getatt('/occultation/phase_method', data%phase_method)
    2794   data%bangle_method = ' '     ; CALL ncdf_getatt('/occultation/retrieval_method', data%bangle_method)
     2801  data%pod_method = ' '        ; CALL ncdf_getatt('/science_data/occultation/pod_method', data%pod_method)
     2802  data%phase_method = ' '      ; CALL ncdf_getatt('/science_data/occultation/phase_method', data%phase_method)
     2803  data%bangle_method = ' '     ; CALL ncdf_getatt('/science_data/occultation/retrieval_method', data%bangle_method)
    27952804  data%refrac_method = ' '     ; data%refrac_method    = "UNKNOWN"
    27962805  data%meteo_method = ' '      ; data%meteo_method     = "UNKNOWN"
    27972806  data%thin_method = ' '       ; data%thin_method      = "UNKNOWN"
    2798   data%software_version = ' '  ; CALL ncdf_getatt('software_version' ,data%software_version)
     2807  data%software_version = ' '  ; CALL ncdf_getatt('processor_version' ,data%software_version)
    27992808 
    28002809  ! Processing time, split up string
    28012810  ! FIXME: Is there a library function for this that does some more format checks?
    2802   CALL ncdf_getatt('processing_time', readstr)
     2811  CALL ncdf_getatt('creation_time', readstr)
    28032812  READ( readstr,   '(i4,1x,i2,1x,i2,1x,i2,1x,i2,1x,i2,1x,i2)' ) data%DTpro%Year, data%DTpro%Month, data%DTpro%Day, &
    28042813             data%DTpro%Hour, data%DTpro%Minute, data%DTpro%Second, data%DTpro%Msec
    28052814