-
Notifications
You must be signed in to change notification settings - Fork 11
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
Remove cs indg from tile_coord structure #270
Conversation
@weiyuan-jiang : I don't think this is quite right yet:
Perhaps take another look at the write-up in #111 . Also, we need to wait for @saraqzhang to get back and make sure we are testing her assimilation case on the cs grid. |
Sara has tested it before I pulled request.
|
Cut and past from Rolf's doc: Reichle, 10 July 2020 Somewhere early in the code (or in preprocessing?), tile_coord_f is initialized using information from the *.til file (LocationStream) and/or an existing tile_coord file that is consistent with the LocationStream. At this point, the fields %i_indg and %j_indg refer to the grid associated with the tile space. For an EASE-based tile space, this is an EASE grid. For a LatLon-based tile space, this is a LatLon grid. For a cs-based tile space, this is a cs grid. %i_indg and %j_indg should not be re-set or re-defined after initialization. Otherwise, there is potential for misinterpretation later on and s/w maintenance and development becomes unnecessarily complicated. The modifications outlined below suggest simple 1d arrays hash_[x]_indg[_f]. Perhaps it would be best to first create a new branch that removes obsolete subroutines and “use” statements (search for “obsolete” below), without making any of the other changes. This should be very straightforward, easy to test and helpful in any case. Once we have cleaned up, the rest of the modifications may be a little bit easier. src/Components/GEOSldas_GridComp/GEOSmetforce_GridComp/LDAS_Forcing.F90:
(that is, same as in git branch “remove_cs_indg”, but change the name because these arrays will be used for all tile spaces, not just cs-based tile spaces) src/Components/GEOSldas_GridComp/GEOS_LdasGridComp.F90
~595-596: remove the two lines that “save [the] original index” ~line 604, set hash_i_indg_f and hash_j_indg_f via the call to get_ij_ind_from_latlon:
~line 607, the call to get_tile_grid() in case of the c3 grid can presumably be replaced with
(It looks like we always use tile_grid_f with global extent for cs tile spaces. In future, this will require more development, otherwise small cs domains may run too slowly.)
At this point, we should have initialized the “[x]_indg” variables as follows: tile_coord[_f?]%[x]_indg : original meaning relative to grid associated with tile space hash_[x]_indg[_f] : index relative to “hash” grid: The BIG challenge is to identify all instances where “tile_coord[_f]%[x]indg” is used but “hash[x]indg[f]” should now be used, and to change the call statements accordingly. This probably requires changing the interfaces of some of the helper subroutines. src/Components/GEOSldas_GridComp/GEOSlandpert_GridComp/GEOS_LandPertGridComp.F90 ~line 1063-1064 I’m guessing this should change to:
Also, the four calls to “tile2grid_simple()” may need to use “hash_[x]_indg” rather than “%[x]_indg”. Likewise for the eight calls to “grid2tile()”. Finally, the eight calls to “tile_mask_grid()” with arguments “internal%[x]_indgs” may need change. But I’m not sure at all. My hesitation is that I don’t know on what grid the perturbations are computed. For EASE and LatLon, it should be the grid associated with the tile space, but it could also be a “coarsened” version of that grid. (See field %coarsen in “pert_param” variables.) src/Components/GEOSldas_GridComp/Shared/LDAS_TileCoordRoutines.F90 subroutine LDAS_create_grid_g -- not relevant subroutine LDAS_read_land_tile -- not relevant (preprocessing only) subroutine read_til_file -- not relevant (obsolete, remove?) subroutine get_tile_grid -- bypass for cs tiles in LdasGridComp init as suggested above I think the following subroutines would need to use “hash_[x]_indg” instead of “tile_coord%[x]_indg”: subroutine get_number_of_tiles_in_cell_ij
subroutine get_tile_num_in_ellipse
subroutine get_tile_num_from_latlon
The following helper subroutine already takes simple 1d arrays for [x]_indg: subroutine get_ij_ind_from_latlon
--> probably need to pass through “hash_[x]_indg” via the calling subroutines Note obsolete “use” statements for get_ij_ind_from_latlon in: The following subroutines are used only in GEOS_LandPertGridComp.F90 (see above): subroutine tile2grid_simple The following subroutines subroutine grid2tile_new called from write_smapL4SMaup() in clsm_ensupd_enkf_update.F90, see above for the calls from GEOS_LandPertGridComp.F90 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CMake changes ok.
closed and replaced by the PR #295 |
Address issue #111