Run OBSGRID with “lat-lon” projection

Topics related to the OBSGRID utility
Post Reply
Kechen Li
Posts: 2
Joined: Wed Dec 05, 2018 9:54 am

Run OBSGRID with “lat-lon” projection

Post by Kechen Li » Wed Dec 05, 2018 10:15 am

Hello,
Greetings

Recently, I am trying to run OBSGRID with “lat-lon” projection, but it does not work and an error shown up as “We accept 1 through 3, and you tried a 6, map_proj_incorrect”.

When I tried to read the source code of “./src/driver.F90”, I found that only 3 map projections are supported in the code.

So, I am confusing about how can I run OBSGRID and indirect soil nudging in global mode? Does OBSGRID really support the method to run with “lat-lon” projection I did not noticed?

Thanks!
Kechen

kwerner
Posts: 2287
Joined: Wed Feb 14, 2018 9:21 pm

Re: Run OBSGRID with “lat-lon” projection

Post by kwerner » Thu Dec 06, 2018 12:33 am

Hi,
While the driver.F90 file indicates that a lat-lon projection is not allowed, other files (such as map_utils_module.F90) seem to indicate that it is. I'm not sure whether it was intended to be included in the driver, but was mistakenly left out, or if there really is not a capability for the code to handle global simulations. Let me check into this a bit and get back to you.
Thanks,
Kelly
NCAR/MMM

kwerner
Posts: 2287
Joined: Wed Feb 14, 2018 9:21 pm

Re: Run OBSGRID with “lat-lon” projection

Post by kwerner » Thu Dec 06, 2018 9:02 pm

Hi Kechen,
I talked to a couple of people who have worked closely with the OBSGRID code. One seems to think that a global domain should work out okay, as long as you don't use the trim_domain option. The other one is doubtful that the code can handle the fact that there are no real edges in the domain. That being said, neither of them have ever tested using a global domain. I've looked around at the code a bit, and it looks like it's just simply not written in the driver.F90 file. It may be as simple as just adding another section to the if-statement above where you are seeing the error. So find this code:

Code: Select all

    ELSE IF ( map_projection .EQ. 3 ) THEN
               CALL map_set ( PROJ_MERC , latitude_x(1,1) , longitude_x(1,1) , dxd , lon_center , true_lat1 , true_lat2 , projx )
               CALL map_set ( PROJ_MERC , latitude_d(1,1) , longitude_d(1,1) , dxd , lon_center , true_lat1 , true_lat2 , projd )
            ELSE
               PRINT '(A)','Whoa there pardner, what projection yew tryin to pull on us?'
               PRINT '(A,I8,A)','We accept 1 through 3, and you tried a ',map_projection,'.'
               STOP 'map_proj_incorrect'
            END IF
and change it to:

Code: Select all

    ELSE IF ( map_projection .EQ. 3 ) THEN
               CALL map_set ( PROJ_MERC , latitude_x(1,1) , longitude_x(1,1) , dxd , lon_center , true_lat1 , true_lat2 , projx )
               CALL map_set ( PROJ_MERC , latitude_d(1,1) , longitude_d(1,1) , dxd , lon_center , true_lat1 , true_lat2 , projd )
              ELSE IF (map_projection .EQ. 6 ) THEN
                CALL map_set ( PROJ_LATLON , latitude_x(1,1) , longitude_x(1,1) , dxd , lon_center , true_lat1 , true_lat2 , projx )
                CALL map_set ( PROJ_LATLON , latitude_d(1,1) , longitude_d(1,1) , dxd , lon_center , true_lat1 , true_lat2 , projd )
            ELSE
               PRINT '(A)','Whoa there pardner, what projection yew tryin to pull on us?'
               PRINT '(A,I8,A)','We accept 1 through 3, and you tried a ',map_projection,'.'
               STOP 'map_proj_incorrect'
            END IF
If that doesn't work, then it may require that you will need to do a bit more digging and modification of the code, unfortunately.
NCAR/MMM

Kechen Li
Posts: 2
Joined: Wed Dec 05, 2018 9:54 am

Re: Run OBSGRID with “lat-lon” projection

Post by Kechen Li » Fri Dec 07, 2018 9:14 am

Hi,
Thanks for your help!
According to your advice, I changed the code "driver.F90". It is useful!
But another error showed up as "Set true latitude 1 for all projections! MAP_INIT" when I run obsgrid.exe. When I read the code of "map_utils_module.F90" ,I find the code:
IF (ABS(truelat1).GT.90.) THEN
PRINT '(A)', 'Set true latitude 1 for all projections!'
STOP 'MAP_INIT'
ENDIF .
Indeed, the "latitude 1" is "1.e+20f" in my "met_em.* " files. But when Iread the ARWUsersGuide, it seems that truelat1 is not available for "lat-lon" projection. So what should I do?
Thanks!
Ke chen

kwerner
Posts: 2287
Joined: Wed Feb 14, 2018 9:21 pm

Re: Run OBSGRID with “lat-lon” projection

Post by kwerner » Mon Dec 10, 2018 10:10 pm

Hi,
Yeah, it looks like there may be more involved with allowing this to work with a global domain, and that it's not currently able to do so. Unfortunately se don't have the time/resources to spend a lot of time trying to make these modifications since it's not in high demand. I will certainly put it on the long-term "to-do" list and if we are able to get around to it, we will make the effort. In the meantime, you are welcome to try to play around with the code to see if you're able to get it to work for a global domain. If so, and you'd like to share the code back to us, we always welcome user contribution!

I'm not sure what the specifics are regarding your run, but typically the OBSGRID program is only really recommended if you are forced to use a very low-resolution input data type (which isn't that common these days), or if you have gathered some sort of observational data through a field experiment (for example), and you want to feed it into the model. Otherwise, the input data likely have a high-enough resolution that it won't make a large impact to also use OBSGRID.
NCAR/MMM

Post Reply

Return to “OBSGRID”