Re: Possible incorrect code in WRFUserARW.ncl

From: Andrea N. Hahmann <ahah_at_nyahnyahspammersnyahnyah>
Date: Sat Mar 17 2012 - 00:19:38 MDT

I reported on this a few months ago. The code is wrong and itwas confirmed by the wrf group who is responsible for the script. Please check the ncl archives.
Regards, Andrea

Andrea Hahmann
Copenhagen, Denmark

On 17/03/2012, at 03.36, "李嘉鹏" <lijpbasin@126.com<mailto:lijpbasin@126.com>> wrote:

Hi,
The code in "$NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRFUserARW.ncl" lines from 770 to 781 might be incorrect!
 770 cone = 1.
 771 if( map_projection .eq. 1) then ; Lambert Conformal mapping
 772 if( (fabs(true_lat1 - true_lat2) .gt. 0.1) .and. \
 773 (fabs(true_lat2 - 90. ) .gt. 0.1) ) then
 774 cone = 10^(cos(true_lat1*radians_per_degree)) \
 775 -10^(cos(true_lat2*radians_per_degree))
 776 & nbsp; cone = cone/(10^(tan(45. -fabs(true_lat1/2.)*radians_per_degree)) - \
 777 10^(tan(45. -fabs(true_lat2/2.)*radians_per_degree)) )
 778 else
 779 cone = sin(fabs(true_lat1)*radians_per_degree)
 780 end if
 781 end if
lines from 774 to 776 should be
 774 cone = log(cos(true_lat1*radians_per_degree)) \
 775 -log(cos(true_lat2*radians_per_degree))
 776 cone = cone/( log(tan(( 45. -fabs(true_lat1/2.))*radians_per_degree)) - \
 777 log(tan((45. -fabs(true_lat2/2.))*radians_per_degree)) )
according to the following web pages:
http://mathworld.wolfram.com/LambertConformalConicProjection.html
http://en.wikipedia.org/wiki/Lambert_conformal_conic_projection


The code which calculates cone factor in ARWpost V3.1's source file
ARWpost/src/module_map_utils.f90
is also provided (lines 634 to 642)
 634 IF (ABS(truelat1-truelat2) .GT. 0.1) THEN
 635
 636 ! Compute cone fac tor following:
 637 cone=(ALOG(COS(truelat1*rad_per_deg))-ALOG(COS(truelat2*rad_per_deg))) / &
 638 (ALOG(TAN((90.-ABS(truelat1))*rad_per_deg*0.5 ))- &
 639 ALOG(TAN((90.-ABS(truelat2))*rad_per_deg*0.5 )) )
 640 ELSE
 641 cone = SIN(ABS(truelat1)*rad_per_deg )
 642 ENDIF

NCL version: 6.0.0
my system:
Linux balance 3.2.9-1-ARCH #1 SMP PREEMPT Thu Mar 1 09:31:13 CET 2012 x86_64 AMD Phenom(tm) 9150e Quad-Core Processor AuthenticAMD GNU/Linux

--
LiJiapeng (lijpbasin@126.com<mailto:lijpbasin@126.com>)


<名片.vcf>
<ATT00001.c>

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Sat Mar 17 00:19:29 2012

This archive was generated by hypermail 2.1.8 : Tue Mar 20 2012 - 15:27:15 MDT