Opened 11 years ago

Closed 10 years ago

#331 closed enhancement (fixed)

ropp_fm_abel consistency fix

Reported by: Ian Culverwell Owned by: Ian Culverwell
Priority: minor Milestone: 7.1
Component: ropp_fm Version: 7.0
Keywords: erf_up, ropp_fm_abel Cc: sti, cburrows

Description

An internal ROPP7.0 beta reviewer noted that

However, I noticed a *minor inconsistency* between equation 4.27,
extrapolating above the model, and the actual code in 
ropp_fm_abel.f90:

IF (i == n_lev - 1) THEN
t_upper = SQRT(kval(i) * (nr(i+1) + 1.0d5 - impact(l)))
ELSE
t_upper = SQRT(kval(i) * (nr(i+1) - impact(l)))
ENDIF

This adds 100 km to the uppermost model level, and effectively 
erf(t_upper)~1.0 as stated in the text. However, the code could be 
made consistent with 4.27 by adding a line

IF (i == n_lev - 1) erf_up = 1.0_wp

As noted above, this is minor and is unlikely to have any impact on 
simulated values.

We should remove this inconsistency between code and documentation.

Attachments (1)

ropp_fm_abel_sens_test.png (28.7 KB ) - added by Ian Culverwell 11 years ago.
ropp_fm_abel_sens_test.png

Download all attachments as: .zip

Change history (5)

comment:1 by Ian Culverwell, 11 years ago

Basically, set erf_up = 1.0_wp and erf_up_tl = 0.0_wp if i=nlev-1. See r3786 for details.

Still passes t_fascod, t_fascod_tl, t_fascod_ad tests.

Makes small (but consistent, as expected) difference to bangles generated from standard ropp_fm_bg2ro_1d test dataset bg_cntlr20090401_multi.nc:

ropp_fm_abel_sens_test.png

Sorted?

by Ian Culverwell, 11 years ago

Attachment: ropp_fm_abel_sens_test.png added

ropp_fm_abel_sens_test.png

comment:2 by Ian Culverwell, 11 years ago

Milestone: 8.07.0
Resolution: fixed
Status: newclosed

Included in ROPP7.0.

Closing ticket.

comment:3 by Ian Culverwell, 10 years ago

Cc: cburrows added
Keywords: ropp_fm_abel added
Milestone: 7.07.1
Resolution: fixed
Status: closedreopened

Chris B noticed that erf_up_ad wasn't being set to 0.0_wp in ropp_fm_abel_ad, as it should have been for consistency with this change.

Fixing it (see r3962) changes t_fascod_ad results from

 Checking REFRACTIVITY AD FASCOD_TRO
 ad, x%non_ideal =  F
norm1, norm2, norm1/norm2, (norm1-norm2)/norm2 =   473496185.147  473496185.147 1.0000000    0.00000E+00
 Checking BENDING ANGLE AD FASCOD_TRO
norm1, norm2, norm1/norm2, (norm1-norm2)/norm2 =          76.512         76.512 1.0000000    0.14326E-09
 Checking REFRACTIVITY AD FASCOD_MLS
 ad, x%non_ideal =  F
norm1, norm2, norm1/norm2, (norm1-norm2)/norm2 =   355823536.657  355823536.657 1.0000000   -0.16751E-15
 Checking BENDING ANGLE AD FASCOD_MLS
norm1, norm2, norm1/norm2, (norm1-norm2)/norm2 =         144.439        144.439 1.0000000    0.62949E-10
 Checking REFRACTIVITY AD FASCOD_MLW
 ad, x%non_ideal =  F
norm1, norm2, norm1/norm2, (norm1-norm2)/norm2 =   474645859.385  474645859.385 1.0000000   -0.50231E-15
 Checking BENDING ANGLE AD FASCOD_MLW
norm1, norm2, norm1/norm2, (norm1-norm2)/norm2 =         143.528        143.528 1.0000000    0.19013E-10
 Checking REFRACTIVITY AD FASCOD_SAS
 ad, x%non_ideal =  F
norm1, norm2, norm1/norm2, (norm1-norm2)/norm2 =   379867322.074  379867322.074 1.0000000    0.00000E+00
 Checking BENDING ANGLE AD FASCOD_SAS
norm1, norm2, norm1/norm2, (norm1-norm2)/norm2 =         107.062        107.062 1.0000000    0.54630E-10
 Checking REFRACTIVITY AD FASCOD_SAW
 ad, x%non_ideal =  F
norm1, norm2, norm1/norm2, (norm1-norm2)/norm2 =   475400740.028  475400740.028 1.0000000   -0.25076E-15
 Checking BENDING ANGLE AD FASCOD_SAW
norm1, norm2, norm1/norm2, (norm1-norm2)/norm2 =          79.056         79.056 1.0000000    0.15081E-10

to

 Checking REFRACTIVITY AD FASCOD_TRO
 ad, x%non_ideal =  F
norm1, norm2, norm1/norm2, (norm1-norm2)/norm2 =   473496185.147  473496185.147 1.0000000    0.00000E+00
 Checking BENDING ANGLE AD FASCOD_TRO
norm1, norm2, norm1/norm2, (norm1-norm2)/norm2 =          76.512         76.512 1.0000000   -0.55720E-15
 Checking REFRACTIVITY AD FASCOD_MLS
 ad, x%non_ideal =  F
norm1, norm2, norm1/norm2, (norm1-norm2)/norm2 =   355823536.657  355823536.657 1.0000000   -0.16751E-15
 Checking BENDING ANGLE AD FASCOD_MLS
norm1, norm2, norm1/norm2, (norm1-norm2)/norm2 =         144.439        144.439 1.0000000    0.78709E-15
 Checking REFRACTIVITY AD FASCOD_MLW
 ad, x%non_ideal =  F
norm1, norm2, norm1/norm2, (norm1-norm2)/norm2 =   474645859.385  474645859.385 1.0000000   -0.50231E-15
 Checking BENDING ANGLE AD FASCOD_MLW
norm1, norm2, norm1/norm2, (norm1-norm2)/norm2 =         143.528        143.528 1.0000000   -0.23763E-14
 Checking REFRACTIVITY AD FASCOD_SAS
 ad, x%non_ideal =  F
norm1, norm2, norm1/norm2, (norm1-norm2)/norm2 =   379867322.074  379867322.074 1.0000000    0.00000E+00
 Checking BENDING ANGLE AD FASCOD_SAS
norm1, norm2, norm1/norm2, (norm1-norm2)/norm2 =         107.062        107.062 1.0000000    0.26547E-15
 Checking REFRACTIVITY AD FASCOD_SAW
 ad, x%non_ideal =  F
norm1, norm2, norm1/norm2, (norm1-norm2)/norm2 =   475400740.028  475400740.028 1.0000000   -0.25076E-15
 Checking BENDING ANGLE AD FASCOD_SAW
norm1, norm2, norm1/norm2, (norm1-norm2)/norm2 =          79.056         79.056 1.0000000    0.17976E-15

ie much more like it.

(It 'passed' the t_fascod_ad test previously because the threshold |norm1/norm2-1| was ridiculously big for an adjoint test: 0.1%. It's now (r3950) been set to 1.e-9. In view of the above it could be reduced further still.)

comment:4 by Ian Culverwell, 10 years ago

Resolution: fixed
Status: reopenedclosed

Closing the ticket as this update is in ROPP7.1

Note: See TracTickets for help on using tickets.