Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[QUESTION] FlexGrid with other resolutions #251

Closed
msulprizio opened this issue Mar 19, 2020 · 8 comments
Closed

[QUESTION] FlexGrid with other resolutions #251

msulprizio opened this issue Mar 19, 2020 · 8 comments
Assignees
Labels
category: Question Further information is requested topic: Nested Grid Simulation Related to GEOS-Chem nested model simulations
Milestone

Comments

@msulprizio
Copy link
Contributor

Doug Finch wrote:

I’m looking at possible flexgrid options for a GEOS-Chem run and noted that on your wiki it says: Theoretically, any grid resolution should work, but this has not been validated.

Does this mean I could run a 1x1 global run could be done? I’m comparing GEOS-Chem output to another model at this resolution so being able to do that would be really useful. Its it possible for me to run some validations/bench marking at this resolution or would it be a lot of work? This project is a little tight on time so if its a lot of work then I’ll stick with the 2x2.5 global run.

Thanks in advance!

@msulprizio msulprizio added the category: Question Further information is requested label Mar 19, 2020
@msulprizio
Copy link
Contributor Author

Yes, you should be able to run a 1x1 global simulation with FlexGrid. You should just need to specify the following in the Grid Menu of input.geos:

%%% GRID MENU %%%       :
Grid resolution         : 1.0x1.0
Longitude min/max       : -180.0 180.0
Latitude  min/max       : -90.0 90.0
 Half-sized polar boxes?: T
Number of levels        : 72
Nested grid simulation? : F
 Buffer zone (N S E W ) :  0 0 0 0 

Note: If you're using a tropchem-based mechanism, you can change number of levels to 47 instead of 72.

You would then need to change the met field entries in HEMCO_Config.rc to use the resolution of your choosing. We would recommend using a resolution higher than the resolution that you will use in your simulation. In your case, we'd recommend using the global 0.25x0.3125 (GEOS-FP) or 0.5x0.625 (MERRA-2) met fields, but 2x2.5 and 4x5 may also be used.

You will also need to disable (i.e. comment out) the grid resolution check in GeosCore/input_opt_mod.F:

    ! Make sure grid resolution is valid                                                  
    IF ( TRIM(State_Grid%GridRes) /= '4.0x5.0'       .and. &
         TRIM(State_Grid%GridRes) /= '2.0x2.5'       .and. &
         TRIM(State_Grid%GridRes) /= '0.5x0.625'     .and. &
         TRIM(State_Grid%GridRes) /= '0.25x0.3125' ) THEN

       ErrMsg = 'State_Grid%GridRes = ' // Trim( State_Grid%GridRes)// &
                ' is not a valid grid resolution! Supported'        // &
                ' resoltuions are 4.0x5.0, 2.0x2.5, 0.5x0.625, and' // &
                ' 0.25x0.3125. Please check your "input.geos" file.'
       CALL GC_Error( ErrMsg, RC, ThisLoc )
       RETURN
    ENDIF

That check is there to make sure users are aware of the supported GEOS-Chem grid resolution options and to force users to ensure they know they are using an "unsupported" grid by having to disable that code.

Finally, you can compile GEOS-Chem as usual and run a short test simulation. You should check the GEOS-Chem log file to make sure the grid computed by GEOS-Chem makes sense. This information will be printed to the log file after the input.geos options.

For validation purposes, it may make most sense to run an identical simulation using 2.0x2.5 grid resolution. You should be able to use GCPy to do this comparison, as it has built in regridding options to compare the two simulations on a common grid.

If you do try this out, please share your experience and any issues that you have here.

@dpfinch
Copy link

dpfinch commented Mar 19, 2020

Thanks for the info - I'll try this out and share the outcome!

@sdeastham
Copy link
Contributor

A quick question: what is meant in this case by a "supported" grid resolution? I'm wondering if the forced check for 4x5/2x2.5/etc is warranted.

@msulprizio
Copy link
Contributor Author

@sdeastham You make a good point. I originally added that check because other grid resolutions hadn't been tested with FlexGrid yet, but maybe just a warning to the log file to check the grid parameters in the log file is needed now.

@msulprizio msulprizio self-assigned this Mar 20, 2020
@msulprizio msulprizio added this to the 12.8.1 milestone Apr 15, 2020
@msulprizio
Copy link
Contributor Author

In commit ee90629 (dev/12.8.1 branch), we have removed the error checks for "supported" horizontal and vertical grids to truly allow for flexible grid definitions. When using a custom vertical grid definition, simulations may still stop if certain parameters (e.g. Ap, Bp, MaxTropLev, MaxStratLev) are not defined. In a future update, we will remove the dependency of hardcoded values of MaxTropLev and MaxStratLev. See #284 for status updates.

@msulprizio
Copy link
Contributor Author

@dpfinch Please feel free to follow up here or in a new issue if you do run into any issues running with a different horizontal grid.

@dpfinch
Copy link

dpfinch commented May 13, 2020

Only just got round to trying a 1x1 grid that is running now - results hopefully coming soon!
A few other issues I came across were some hard-coded checks for grid resolution:
In HEMCO/Core/hco_config_mod.F90 :

IF ( FOUND ) THEN
     SELECT CASE( TRIM( GridRes ) )
          CASE( '4x5' )
             GridRes = '4.0x5.0'
          CASE( '2x25', '2x2.5' )
             GridRes = '2.0x2.5'
          CASE( '05x0625' )
             GridRes = '0.5x0.625'
          CASE( '025x03125' )
             GridRes = '0.25x0.3125'
          CASE DEFAULT
             Msg = 'Improperly formatted grid resolution: ' // TRIM( GridRes )
             CALL HCO_Error( HcoConfig%Err, Msg, RC, Loc )
           RETURN
       END SELECT
       HcoConfig%GridRes = TRIM( GridRes )
 ENDIF

And HEMCO/Core/hco_extlist_mod.F90:

IF ( TRIM(CF%GridRes) == '4.0x5.0' ) THEN
       DEF_RES = '4x5'
  ELSE IF ( TRIM(CF%GridRes) == '2.0x2.5' ) THEN
       DEF_RES = '2x25'
  ELSE IF ( TRIM(CF%GridRes) == '0.5x0.625' ) THEN
      DEF_RES = '05x0625'
  ELSE IF ( TRIM(CF%GridRes) == '0.25x0.3125' ) THEN
      DEF_RES = '025x03125'
  ENDIF

In both cases I just had to add in an extra CASE or IF to accept '1.0x1.0' as well.

@r-pound
Copy link
Contributor

r-pound commented May 14, 2020

I've also worked with other resolutions in the past and found the above changes that needed to be made. From the testing I've done the new resolutions seem to run and produce sensible results.

It's a bit of a tangent from this but there's also some hard coding I've had to change when running a nested grid in a different from standard resolution. In GeosCore/pjc_pfix_window_mod.F

        IF ( TRIM(State_Grid%GridRes) == '0.25x0.3125' ) THEN
           dl    = 2.0e+0_fp * PI / 1152.0_fp
           dp    = PI /720e+0_fp
        ELSEIF ( TRIM(State_Grid%GridRes) == '0.5x0.625' ) THEN
           dl    = 2.0e+0_fp * PI / 576.0_fp
           dp    = PI /360e+0_fp
        ENDIF

along with other repeated occurrence throughout.

In GeosCore/tpcore_window_mod.F90

   IF ( TRIM(State_Grid%GridRes) == '0.25x0.3125' ) THEN
     dlon = 2.*pi / float(1152)      !(dan)
  ELSEIF ( TRIM(State_Grid%GridRes) == '0.5x0.625' ) THEN
     dlon = 2.*pi / float(576)       !(dan)
   ENDIF 

With both cases I've just made the addition of the extra resolutions to those IF statements and the model will run and I haven't noticed anything completely out of the ordinary with the results. Although I have been thinking about this and these seem like they could be replaced with values from the global variables that are in the model now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category: Question Further information is requested topic: Nested Grid Simulation Related to GEOS-Chem nested model simulations
Projects
None yet
Development

No branches or pull requests

4 participants