Scheduled Downtime
On Friday 21 April 2023 @ 5pm MT, this website will be down for maintenance and expected to return online the morning of 24 April 2023 at the latest

Run OBSGRID with “lat-lon” projection

This post was from a previous version of the WRF&MPAS-A Support Forum. New replies have been disabled and if you have follow up questions related to this post, then please start a new thread from the forum home page.

Kechen Li

New member
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
 
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
 
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:
    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:
    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.
 
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
 
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.
 
Top