Opened 9 years ago

Closed 7 years ago

#108 closed Defect (fixed)

Problem with mercator projection

Reported by: adingwell Owned by: adingwell
Priority: major Milestone: FLEXPART_WRF_3.3_FPbase_9
Component: FP other Version: FLEXPART-WRF
Keywords: Cc:

Description

I've tried running FLEXPART-WRF with Mercator projection and got the error:

need orientation longitude (stdlon) as: 
   -180e <= lon1 <= 180w
STOP map_init

This error should not occur if Mercator projection is used. The problem is in the subroutine map_set. The variable 'proj_merc' is referenced before it is defined. I've marked the changes needed to fix the problem below:

      proj_code = proj_code_in
      
      !!! This is where map_init should be called to fix the problem
      call map_init

      ! first, check for validity of mandatory variables in proj
      if ( abs(lat1) .gt. 90.001 ) then
        print '(a)', 'latitude of origin corner required as follows:'
        print '(a)', '    -90n <= lat1 < = 90.n'
        stop 'map_init'
      endif
      if ( abs(lon1) .gt. 180.) then
        print '(a)', 'longitude of origin required as follows:'
        print '(a)', '   -180e <= lon1 <= 180w'
        stop 'map_init'
      endif
      if ((dx .le. 0.).and.(proj_code .ne. proj_latlon)) then
        print '(a)', 'require grid spacing (dx) in meters be positive!'
        stop 'map_init'
      endif
      if ((abs(stdlon) .gt. 180.).and.(proj_code .ne. proj_merc)) then
        print '(a,i3)', 'proj_code: ', proj_code
        print '(a,i3)', 'proj_merc: ', proj_merc
        print '(a)', 'need orientation longitude (stdlon) as: '
        print '(a)', '   -180e <= lon1 <= 180w'
        stop 'map_init'
      endif
      if (abs(truelat1).gt.90.) then
        print '(a)', 'set true latitude 1 for all projections!'
        stop 'map_init'
      endif

      !!! This is where "map_init" is called in 3.2 BETA

It's also rather confusing when the stop code is 'map_init' but the problem occurs in the subroutine 'map_set'.

Change History (5)

comment:1 Changed 9 years ago by DefaultCC Plugin

comment:2 Changed 9 years ago by jbrioude

  • Owner changed from somebody to jbrioude
  • Status changed from new to assigned

Thanks Adam for providing a fix.
I will include it in the new beta version.

comment:3 Changed 9 years ago by jbrioude

  • Status changed from assigned to accepted

comment:4 Changed 7 years ago by adingwell

  • Milestone changed from FLEXPART_WRF_3.2_FPbase_9 to FLEXPART_WRF_3.3_FPbase_9
  • Owner changed from jbrioude to adingwell

comment:5 Changed 7 years ago by adingwell

  • Resolution set to fixed
  • Status changed from accepted to closed

Fix included in version 3.3.

Note: See TracTickets for help on using tickets.
hosted by ZAMG