Opened 10 years ago

Closed 9 years ago

#415 closed defect (fixed)

Examine ucar2ropp

Reported by: Ian Culverwell Owned by: Ian Culverwell
Priority: normal Milestone: 9.0
Component: ROPP (all) Version: 8.0
Keywords: Cc:

Description

Axel von Engeln writes:

I was just cross-checking some conversions in ROPP, when I noticed 
that the ropp2ucar tool is not working correctly. It writes out the 
same temp and dry_temp from one ucar input file with only dry 
temperature in it.

This is caused in ropp_io_read_ncdf_get.f90, in lines 1846 and
1865, where the routine tries to "guess" if this is dry or real 
temperature.

The ucar file is attached, if you run it with ucar2ropp, you see 
that temp = dry_temp in the ROPP file. Nothing major, but ROPP 
should better look at the long name to determine if this is dry 
temperature or actual temperature, and not guess it from which 
variables are available.

Agreed. The code says:

! 6.8 Level2a variables (if any)
! -------------------------------


!! include dry temperature in Level 2a - if variable 'Bend_ang' exists, the
!! UCAR file is an atmPrf file, and the 'Temp' variable is actually dry temperature.
    IF (ncdf_isvar('Temp') .AND. ncdf_isvar('Bend_ang')) THEN

      CALL ncdf_getvar('Temp', data%Lev2a%dry_temp)

!      idx => WHERE((data%Lev2a%dry_temp > -999.0), nidx)
!      IF (nidx > 0) THEN
!        data%Lev2a%dry_temp(idx) = data%Lev2a%dry_temp(idx) + 273.15_wp
!      ENDIF
      WHERE(data%Lev2a%dry_temp > -999.0) &
        data%Lev2a%dry_temp = data%Lev2a%dry_temp + 273.15_wp
      data%Lev2a%units%dry_temp = "kelvin"

    END IF

...

! 6.9 Level2b variables (if any)
! -------------------------------

    CALL ncdf_getvar('Temp',        data%Lev2b%temp)
!    idx => WHERE(data%Lev2b%temp > -999.0, nidx)
!    IF (nidx > 0) data%Lev2b%temp(idx) = data%Lev2b%temp(idx) + 273.15_wp
    WHERE (data%Lev2b%temp > -999.0) &
      data%Lev2b%temp = data%Lev2b%temp + 273.15_wp
    data%Lev2b%units%temp = "kelvin"

The first bit look sensible, but the second doesn't. The CDL of the (attached) file says

	float Temp(MSL_alt) ;
		Temp:units = "C" ;
		Temp:valid_range = -200.f, 100.f ;
		Temp:_FillValue = -999.f ;
		Temp:long_name = "Dry temperature" ;

so we could use that to discriminate between temp and dry_temp, as Axel says. (Presumably things are different for a wetPrf file.)

While we're at it, we could look at the whole of the UCAR reading section of ropp_io_read_ncdf_get.f90, as other parts may be clobbered by the same sort of thing as hit us in #414.

Attachments (2)

atmPrf_C001.2013.001.00.20.G28_2013.3520_nc (354.4 KB ) - added by Ian Culverwell 10 years ago.
atmPrf_C001.2013.001.00.20.G28_2013.3520_nc
wetPrf_C001.2011.333.00.03.G18_2010.2640_nc (14.7 KB ) - added by Ian Culverwell 10 years ago.
wetPrf_C001.2011.333.00.03.G18_2010.2640_nc

Download all attachments as: .zip

Change history (5)

by Ian Culverwell, 10 years ago

atmPrf_C001.2013.001.00.20.G28_2013.3520_nc

by Ian Culverwell, 10 years ago

wetPrf_C001.2011.333.00.03.G18_2010.2640_nc

comment:1 by Ian Culverwell, 10 years ago

For info, the attached wetPrf file's CDL says:

	float Temp(MSL_alt) ;
		Temp:long_name = "temperature" ;
		Temp:units = "C" ;
		Temp:missing_value = "-999" ;
		Temp:_FillValue = -999.f ;
		Temp:valid_range = -150.f, 100.f ;

So the long_name should work.

comment:2 by Ian Culverwell, 9 years ago

Change committed at r4755. (Also tidied up a little, by adding some local logicals to help define what sort of file we're reading. These could be refined or generalised if necessary.)

comment:3 by Ian Culverwell, 9 years ago

Resolution: fixed
Status: newclosed

Tests out OK, so close ticket.

Note: See TracTickets for help on using tickets.