Opened 13 years ago

Closed 13 years ago

Last modified 13 years ago

#258 closed defect (fixed)

Error in GO amplitude calculation

Reported by: Ian Culverwell Owned by: Ian Culverwell
Priority: normal Milestone: 6.0
Component: ropp_pp Version: 5.0
Keywords: ropp_pp, amplitude Cc:

Description

Michael Gorbunov (Russian Academy of Sciences, Russia) has reported an error in the calculation of refractive amplitude in ropp_pp/preprocess/ropp_pp_amplitude_go.f90:

     snr_R(i) = SQRT(ABS( (1.0_wp/(dgns*dleo))*                        &
              (1.0_wp - (ps(i)/(rxgns(i)*dgns))*rvgns(i)/vtheta(i)     &
                 - (ps(i)/(rxgns(i)*dgns))*rvgns(i)/vtheta(i))*        &
                 pv(i)/vtheta(i)))

should be replaced by

     snr_R(i) = SQRT(ABS( (1.0_wp/(dgns*dleo))*                        &
              (1.0_wp - (ps(i)/(rxgns(i)*dgns))*rvgns(i)/vtheta(i)     &
                 - (ps(i)/(rxleo(i)*dleo))*rvleo(i)/vtheta(i))*        &
                 pv(i)/vtheta(i)))

Kjartan Kinch (DMI) agrees.

Test this in ROPP6.0.

Attachments (4)

COSMIC.png (42.5 KB ) - added by Ian Culverwell 13 years ago.
GRAS.png (42.1 KB ) - added by Ian Culverwell 13 years ago.
amp_go_cosmic.png (44.3 KB ) - added by Ian Culverwell 13 years ago.
amp_go_cosmic.png
amp_go_gras.png (48.9 KB ) - added by Ian Culverwell 13 years ago.
amp_go_gras.png

Download all attachments as: .zip

Change history (7)

comment:1 by Ian Culverwell, 13 years ago

ropp_pp_amplitude_go is called by ropp_pp_preprocess, which is called by ropp_pp_occ_tool, so we should see a difference if we pass the before and after versions of the code through tests 2 (COSMIC) & 3 (GRAS) of t_ropp_pp.sh.

We do - but it's very small. |delta BA| < 1e-8 rad and |delta N| < 1e-5 N-units. (See attached for diff plots.) So it seems safe to commit to ropp6.0 devt branch.

by Ian Culverwell, 13 years ago

Attachment: COSMIC.png added

by Ian Culverwell, 13 years ago

Attachment: GRAS.png added

comment:2 by Ian Culverwell, 13 years ago

Resolution: fixed
Status: newclosed

No problems in beta testing, so close ticket.

comment:3 by Ian Culverwell, 13 years ago

While merging ropp6.0 devts to trunk, I noticed that in fact I'd replaced

     snr_R(i) = SQRT(ABS( (1.0_wp/(dgns*dleo))*                        &
              (1.0_wp - (ps(i)/(rxgns(i)*dgns))*rvgns(i)/vtheta(i)     &
                 - (ps(i)/(rxgns(i)*dgns))*rvgns(i)/vtheta(i))*        &
                 pv(i)/vtheta(i)))

by

     snr_R(i) = SQRT(ABS( (1.0_wp/(dgns*dleo))*                        &
              (1.0_wp - (ps(i)/(rxgns(i)*dgns))*rvgns(i)/vtheta(i)     &
                 - (ps(i)/(rxleo(i)*dleo))*rxleo(i)/vtheta(i))*        &
                 pv(i)/vtheta(i)))

ie rxleo/vtheta, not rvleo/vtheta. (The former isn't even dimensionally consistent.)

It turns out that this error is a large component of the difference plotted above. When redone properly, we find differences resulting from the bugfix Michael Gorbunov originally wanted, to be:

COSMIC

amp_go_cosmic.png

GRAS

amp_go_gras.png

Even smaller differences than before, so safe to put in ROPP6.0 and trunk.

by Ian Culverwell, 13 years ago

Attachment: amp_go_cosmic.png added

amp_go_cosmic.png

by Ian Culverwell, 13 years ago

Attachment: amp_go_gras.png added

amp_go_gras.png

Note: See TracTickets for help on using tickets.