Skip to content

Updated hf - #1180

Open
mgharamti wants to merge 2 commits into
NCAR:mainfrom
mgharamti:updated_HF
Open

mgharamti wants to merge 2 commits into
NCAR:mainfrom
mgharamti:updated_HF

Conversation

@mgharamti

Copy link
Copy Markdown
Contributor

Description:

This updates the HFradar ocean obs converter allowing it to ingest frequency radar observation from old and new radar sites. The new radar sites have different file format. The new sites also provide the errors associated with the radial and total velocities, removing the need to parametrize the obs error as function of the radar range.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update

Documentation changes needed?

  • My change requires a change to the documentation.
    • I have updated the documentation accordingly.

Tests

Ran the modified converter with old data files, new ones, and both old and new radar files at the same time.

Checklist for merging

  • Updated changelog entry
  • Documentation updated
  • Update conf.py

Checklist for release

  • Merge into main
  • Create release from the main branch with appropriate tag
  • Delete feature-branch

Testing Datasets

Datasets can be found here: /glade/derecho/scratch/gharamti/inacawo/DART_training/observations/obs_converters/HFradar/data

Modified the converter code to ingest both
legacy radar and newer ones with different format.
@hkershaw-brown
hkershaw-brown self-requested a review September 9, 2026 17:33

@hkershaw-brown hkershaw-brown left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi Moha,

Couple of definite changes:

  • The 'UNKNOWN' for station is not used, if there is no station name the uninitialized station variable is used.
  • A write() statement has the string,* in the wrong order.

Typo and rst syntax:

  • Some titles underlines are too short
  • NetCDF typo

I'm not sure if you need to check for missing values nans in the read_new_totals, like you do in the read_old_totals - I put a comment there.

One thing to maybe think about is currently the formats are called 'old' and 'new'. I'd guess there is a non-zero chance that the formats will update again, then you will have to have a 'new-new'. You could name them v1, v2 or not worry until a 'new-new' version comes out.

Cheers,
Helen

Comment on lines +703 to +712
if (attin) then
call nc_check(nf90_inq_varid(ncid, 'station_name', varid), routine)
call nc_check(nf90_get_var(ncid, varid, station), routine)

call clarify_instrument(station)
else
instrument = 'UNKNOWN'
endif

instrument = station

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

instrument is getting set to station, whatever happens in this if statement. Is instrument = station only supposed to be set if the station_name attribute exists?

Suggested change
if (attin) then
call nc_check(nf90_inq_varid(ncid, 'station_name', varid), routine)
call nc_check(nf90_get_var(ncid, varid, station), routine)
call clarify_instrument(station)
else
instrument = 'UNKNOWN'
endif
instrument = station
if (attin) then
call nc_check(nf90_inq_varid(ncid, 'station_name', varid), routine)
call nc_check(nf90_get_var(ncid, varid, station), routine)
call clarify_instrument(station)
instrument = station
else
instrument = 'UNKNOWN'
endif

phi = phi * rad2deg
if (debug) write(*, '(5X, A)') 'Incoming bearing is in radians.'
else
write(*, string1) 'Unknown angle units: '//trim(adjustl(angle_unit))

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This write statement has the variable, format backwards

Suggested change
write(*, string1) 'Unknown angle units: '//trim(adjustl(angle_unit))
write(string1, *) 'Unknown angle units: '//trim(adjustl(angle_unit))


The converter supports two data families:
The converter supports both **total (vector) currents** and **single-site radial currents**,
and can ingest NerCDF products from both the original and the new HF raadr systems.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
and can ingest NerCDF products from both the original and the new HF raadr systems.
and can ingest NetCDF products from both the original and the new HF raadr systems.

Comment on lines +692 to +696
do ix = 1, nx
do iy = 1, ny
rstd(ix, iy) = obs_err_sd_check(rstd(ix, iy))
enddo
enddo

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For the read_old_totals you have a check for NaN before calling obs_err_sd_check. I am not sure whether you need it with the read_new_totals just noticed the difference:

https://github.com/mgharamti/DART/blob/e90c6aa36a1c02cd97d724c66460f4ee846e5a29/observations/obs_converters/HFradar/hf_to_obs.f90#L432-L445


**Radials files** (curvilinear x/y):
Radials
~~~~~~

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
~~~~~~
~~~~~~~

^^^^^^^^^^^^^^^^^^^^^

Totals
~~~~~

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Getting warnings about all the title underlines:

/Users/hkershaw/DART/pull_requests/pull_1180/observations/obs_converters/HFradar/readme.rst:63: WARNING: Title underline too short.`

Totals
~~~~~
Suggested change
~~~~~
~~~~~~

current observations.

Totals
~~~~~

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
~~~~~
~~~~~~

+ ``nsct_error``: observation-error standard deviation associated with ``nsct``.

Radials
~~~~~~

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
~~~~~~
~~~~~~~

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants