Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
130 commits
Select commit Hold shift + click to select a range
9fd6b6b
partially finished reader
Oct 26, 2026
fac8e93
Merge remote-tracking branch 'origin/develop' into feature/lcandre2/j…
amfox37 Nov 2, 2026
cee4997
HDF5 reader for VIIRS SCF obs (VNP10C1, VJ110C1, VJ210C1)
amfox37 Nov 2, 2026
ca6b377
Keep low-illumination VIIRS SCF obs; exclude Clear_Index flag values …
amfox37 Nov 2, 2026
5d4d636
Cap VIIRS SCF obs at 1 (read_JPSS_SCF_hdf)
amfox37 Nov 2, 2026
5862a45
Log original file name (LocalGranuleID) in VIIRS SCF reader (read_JPS…
amfox37 Nov 3, 2026
d1475c1
Return blank from readAttributeChar unless the attribute is a single …
amfox37 Nov 4, 2026
8c778e4
Assimilate VIIRS SCF obs of tiles on a window boundary only once (rea…
amfox37 Nov 4, 2026
0bb0c1b
Correct VIIRS Basic_QA labels in read_JPSS_SCF_hdf comments
amfox37 Nov 4, 2026
baca36e
Never stop in readAttributeChar; read UTF-8 string attributes
amfox37 Nov 4, 2026
a3dbc48
Remove resolved striping notes in read_obs_JPSS_SCF
amfox37 Nov 4, 2026
dd2b751
Merge remote-tracking branch 'origin/develop' into feature/amfox/jpss…
amfox37 Nov 4, 2026
072cbce
Add CHANGELOG entry for VIIRS SCF obs
amfox37 Nov 4, 2026
fc04238
Remove leftover WIP note; align VIIRS species comments in ensupd nml
amfox37 Nov 4, 2026
6d0ed32
Remove commented-out debug output in read_obs_JPSS_SCF
amfox37 Nov 4, 2026
b279b5f
Merge branch 'develop' into feature/amfox/jpss_hdf5_reader
amfox37 Nov 5, 2026
0f9409a
Write VIIRS SCF file names to obslog, as for MODIS (read_obs_JPSS_SCF)
amfox37 Nov 5, 2026
0aa34f4
Fix NAG build on macOS (GEOSlandassim)
weiyuan-jiang Nov 6, 2026
9c85495
add cube-sphere ("c3") grid to get_ij_ind_from_latlon() and get_tile_…
amfox37 Nov 6, 2026
b20fe14
map obs to tiles on cube-sphere tile grid for cube-sphere tile space …
amfox37 Nov 6, 2026
9e99e35
apply QC of Tb obs for non-land surfaces also in cube-sphere tile spa…
amfox37 Nov 6, 2026
d955909
Merge branch 'develop' into feature/wjiang/macos_nag
gmao-rreichle Nov 6, 2026
1f37587
tweaked init of obs2tile_grid_f; edited comments and error messages (…
gmao-rreichle Nov 7, 2026
6ae7602
Merge branch 'develop' into feature/amfox/c3-obs-tile-cube
gmao-rreichle Nov 8, 2026
ada3680
Merge branch 'develop' into feature/amfox/c3-tb-water-qc
gmao-rreichle Nov 8, 2026
3c6e092
Merge branch 'develop' into feature/wjiang/macos_nag
gmao-rreichle Nov 8, 2026
2123d79
map obs to cube-sphere grid cells with MAPL_GetGlobalHorzIJIndex() an…
amfox37 Nov 8, 2026
2c1caa2
c3 obs-to-tile fallback: choose closest tile only among tiles within …
amfox37 Nov 8, 2026
cfcc269
c3 obs-to-tile mapping: also search grid cells within max_dist of the…
amfox37 Nov 8, 2026
66a1ead
build obs-to-tile tables in get_enkf_increments() only on root_proc; …
amfox37 Nov 8, 2026
b4045d7
renamed a couple of variables and edited comments for clarity (clsm_e…
gmao-rreichle Nov 8, 2026
52d84d3
reject stretched cube-sphere grids in init_c3_grid(); corrected comme…
amfox37 Nov 8, 2026
5da1e90
skip QC of Tb for non-land surfaces after EnKF update instead of abor…
amfox37 Nov 9, 2026
e97bdae
Update CHANGELOG with recent fixes and updates
weiyuan-jiang Nov 9, 2026
13b2abe
c3 obs-to-tile mapping: larger chunks and batches (N_chunk=100000, N_…
amfox37 Nov 9, 2026
c801424
changed QC of Tb for nonland fraction on c3 tile space to use "tile a…
gmao-rreichle Nov 9, 2026
c9531a3
corrected weights used in QC of TB for non-land in c3 tile space; edi…
gmao-rreichle Nov 10, 2026
c03de7a
fix undeclared land_frac_cell in c3 Tb non-land QC weight (use tmp_da…
amfox37 Nov 10, 2026
22880d7
cleanup of model-based QC logic and comments
gmao-rreichle Nov 10, 2026
c0dfa46
fixed syntax error in previous commit (clsm_ensupd_upd_routines.F90)
gmao-rreichle Nov 10, 2026
843e156
run QC of Tb for non-land fraction only for 'Tb' obs species; renamed…
gmao-rreichle Nov 10, 2026
79eeaa0
Apply Tb QC for non-land surfaces in cube-sphere tile space (#249)
gmao-rreichle Nov 10, 2026
43d7a11
set FFT lengths (fft_lens) for nr_fft used when MKL is not available …
amfox37 Nov 11, 2026
9b5fc21
Merge branch 'develop' into feature/wjiang/refactor_ldas_setup
gmao-rreichle Nov 11, 2026
2430d36
Merge branch 'develop' into feature/amfox/c3-obs-tile-cube
gmao-rreichle Nov 11, 2026
5da78d1
Merge branch 'feature/amfox/c3-obs-tile-cube' into feature/amfox/c3-o…
gmao-rreichle Nov 11, 2026
d00475b
Merge branch 'develop' into feature/wjiang/macos_nag
gmao-rreichle Nov 11, 2026
2762342
renamed variables and subroutines for clarity:
gmao-rreichle Nov 11, 2026
5b3500d
cleaned up if blocks that calculate N_tile_in_cell_ij and tile_num_in…
gmao-rreichle Nov 11, 2026
a38d331
removed pass-thru of tile_grid_g_ESMF from output_smapL4SMaup(), whic…
gmao-rreichle Nov 11, 2026
0c6403e
make "tile_grid_g_ESMF" regular input arg (not optional) for get_enkf…
gmao-rreichle Nov 12, 2026
fe1b8e1
Use land tiles only when copying per-tile data from tile_coord
amfox37 Nov 12, 2026
dc140fb
changed tile_grid_g_ESMF from optional to regular argument for subrou…
gmao-rreichle Nov 12, 2026
93b0c7c
fix typo/syntax error in previous commit (clsm_ensupd_read_obs.F90)
gmao-rreichle Nov 12, 2026
2bfe972
changed order of inputs args of output_smapL4SMaup() (clsm_ensupd_enk…
gmao-rreichle Nov 12, 2026
949f5b0
small cleanup of if block, comment, declaration (clsm_ensupd_enkf_upd…
gmao-rreichle Nov 12, 2026
a35b693
renamed tile_grid to tiles2obsFOV_grid where applicable (clsm_ensupd_…
gmao-rreichle Nov 12, 2026
1b27363
for cross-file consistency and clarity, renamed tile_grid_d -> obs2ti…
gmao-rreichle Nov 12, 2026
bda33b0
fixed typo/syntax error in previous commit (clsm_ensupd_read_obs.F90)
gmao-rreichle Nov 13, 2026
7d34a53
replaced optional logical arg "c3_tile_grid" with new regular arg "ti…
gmao-rreichle Nov 13, 2026
f58ef7d
fix keyword arg syntax error in previous commit (GEOS_LandAssimGridCo…
gmao-rreichle Nov 13, 2026
6887e84
changed name of logical variable "c3_grid" to "c3_tile_space" for cla…
gmao-rreichle Nov 13, 2026
8fb0524
for clarification, edited comments and renamed variables:
gmao-rreichle Nov 13, 2026
a0da967
for clarification, edited comments and changed "tile_grid" to "my_gri…
gmao-rreichle Nov 13, 2026
b019d40
use "sed -i.tmp" so process_hist.csh works with BSD sed on macOS (pro…
amfox37 Nov 11, 2026
3ae03d2
for clarification, edited comments and changed variable names:
gmao-rreichle Nov 13, 2026
7d4bdcf
for clarification, changed var name "obs2tile_grid" to "obs2tile_grid…
gmao-rreichle Nov 13, 2026
0560f4d
for consistency, changed ">" to ">=" for FOV_threshold if condition (…
gmao-rreichle Nov 13, 2026
ef1852b
cleaned up nodata values (LDAS_TileCoordRoutines.F90)
gmao-rreichle Nov 13, 2026
c260aa5
white-space changes only
gmao-rreichle Nov 14, 2026
53fd4dd
Update CHANGELOG
gmao-rreichle Nov 14, 2026
f262ad4
Bug fix: Use land tiles only when copying per-tile data from tile_coo…
gmao-rreichle Nov 14, 2026
d9d2ad3
Merge branch 'develop' into feature/wjiang/refactor_ldas_setup
gmao-rreichle Nov 14, 2026
e915e21
Merge branch 'develop' into feature/amfox/c3-obs-tile-cube-esmf
gmao-rreichle Nov 14, 2026
6e1353d
Merge branch 'develop' into bugfix/amfox/non-mkl-and-bsd-sed
gmao-rreichle Nov 14, 2026
648e3d7
Merge branch 'develop' into feature/wjiang/macos_nag
gmao-rreichle Nov 14, 2026
466d92d
Merge remote-tracking branch 'refs/remotes/origin/feature/amfox/c3-ob…
gmao-rreichle Nov 14, 2026
5c3e03b
Update CHANGELOG
gmao-rreichle Nov 14, 2026
5d4d130
Fix NAG build on macOS (GEOSlandassim) (#244)
gmao-rreichle Nov 14, 2026
3e9e4ff
Merge branch 'develop' into feature/wjiang/refactor_ldas_setup
gmao-rreichle Nov 14, 2026
534561e
Merge branch 'develop' into feature/amfox/c3-obs-tile-cube-esmf
gmao-rreichle Nov 14, 2026
5f8a813
Merge branch 'develop' into bugfix/amfox/non-mkl-and-bsd-sed
gmao-rreichle Nov 14, 2026
51c9322
Updated CHANGELOG
gmao-rreichle Nov 14, 2026
9d7ced9
Fixes for non-MKL builds (fft_lens) and BSD sed (process_hist.csh) su…
gmao-rreichle Nov 14, 2026
b49acb0
Merge branch 'develop' into feature/wjiang/refactor_ldas_setup
gmao-rreichle Nov 14, 2026
e36655c
Merge branch 'develop' into feature/amfox/c3-obs-tile-cube-esmf
gmao-rreichle Nov 14, 2026
e7065d4
Merge branch 'develop' into feature/amfox/jpss_hdf5_reader
amfox37 Nov 17, 2026
f87aa3f
Keep only Basic_QA 0 and 3 in VIIRS SCF reader (read_JPSS_SCF_hdf)
amfox37 Nov 17, 2026
17203a2
Merge remote-tracking branch 'refs/remotes/origin/feature/amfox/c3-ob…
gmao-rreichle Nov 18, 2026
5b948ab
mininmal edits of comments; white-space changes (LDAS_TileCoordType.F…
gmao-rreichle Nov 18, 2026
ae68155
edited/added comments; white-space changes (GEOS_LdasGridComp.F90, cl…
gmao-rreichle Nov 18, 2026
35c78c1
shift CYGNSS L3 obs lat/lon for obs-to-tile mapping on EASEv2 M09 til…
amfox37 Nov 19, 2026
0b180e6
SMOS: shift obs lat/lon before tile search only for EASEv2 M09 tile s…
amfox37 Nov 19, 2026
158a1bd
CHANGELOG: reword CYGNSS L3 M09 shift entry and add PR number
amfox37 Nov 19, 2026
40c085e
Shift lat/lon of CYGNSS L3 soil moisture obs for obs-to-tile mapping …
gmao-rreichle Nov 19, 2026
82c9c5a
Merge branch 'develop' into feature/amfox/c3-obs-tile-cube-esmf
gmao-rreichle Nov 19, 2026
da16c21
corrected variable name change from previous commit
gmao-rreichle Nov 19, 2026
d16751f
Merge branch 'develop' into feature/wjiang/refactor_ldas_setup
gmao-rreichle Nov 19, 2026
6884a9e
CHANGELOG: add PR number to SMOS tile assignment entry
amfox37 Nov 19, 2026
9e0450d
CHANGELOG: add PR number to cube-sphere obs-to-tile mapping entry
amfox37 Nov 19, 2026
4037cd1
simplified recent CHANGELOG entries
gmao-rreichle Nov 19, 2026
8d318ef
Fix obs-to-tile mapping in cube-sphere tile space using ESMF grid obj…
gmao-rreichle Nov 19, 2026
c5fe424
Merge branch 'develop' into feature/wjiang/refactor_ldas_setup
gmao-rreichle Nov 19, 2026
9be8a89
Run land_frac calc for Tb QC only before EnKF update (clsm_ensupd_upd…
gmao-rreichle Nov 19, 2026
fc2ba04
add M01 and M03 tile spaces to M36 obs lat/lon shift for SMAP, SMOS, …
gmao-rreichle Nov 19, 2026
6c541a8
added shift of SMAP L1C_TB_E (M09) obs lat/lon when tile space is M03…
gmao-rreichle Nov 19, 2026
f478b41
updated CHANGELOG
gmao-rreichle Nov 19, 2026
79c9fc0
reverted "shift" of L1C Enhanced (M09) obs when used with M03/M01 til…
gmao-rreichle Nov 21, 2026
19c822e
Merge branch 'develop' into feature/amfox/jpss_hdf5_reader
amfox37 Nov 22, 2026
64b713d
CHANGELOG: add PR number to VIIRS SCF entry
amfox37 Nov 22, 2026
6af6e15
Tidy VIIRS SCF code: alignment, comments, duplicate nml separator (no…
amfox37 Nov 22, 2026
64d2c3d
Simplify readAttributeChar: read as fixed-length string, return blank…
amfox37 Nov 22, 2026
982e1c8
moved entire subroutine read_JPSS_SCF() within file to get cleaner di…
gmao-rreichle Nov 23, 2026
5ddd814
Revert "moved entire subroutine read_JPSS_SCF() within file to get cl…
gmao-rreichle Nov 23, 2026
472a9db
merged read_obs_MODIS_SCF() and read_obs_JPSS_SCF() into single subro…
gmao-rreichle Nov 23, 2026
5d7d34b
added end date for VIIRS/SNPP (clsm_ensupd_read_obs.F90)
gmao-rreichle Nov 23, 2026
4c7427f
fixed build error in previous commit (clsm_ensupd_read_obs.F90)
gmao-rreichle Nov 23, 2026
a8c9bdc
minimal cleanup of comments, vertical alignment in VIIRS SCF reader (…
gmao-rreichle Nov 23, 2026
5ec90a7
moved comments in MODIS/VIIRS SCF reader (clsm_ensupd_read_obs.F90)
gmao-rreichle Nov 23, 2026
566f3b4
Update comment: read_obs_JPSS_SCF -> read_obs_MODIS_VIIRS_SCF (read_V…
amfox37 Nov 23, 2026
5a24911
Additional fixes for Tb QC and obs-to-tile mapping (#259⁠)
gmao-rreichle Nov 24, 2026
4384022
Merge branch 'develop' into feature/wjiang/refactor_ldas_setup
gmao-rreichle Nov 24, 2026
dc8536e
Merge branch 'develop' into feature/amfox/jpss_hdf5_reader
gmao-rreichle Nov 24, 2026
6150ecf
Add VIIRS snow cover fraction obs (VNP10C1, VJ110C1, VJ210C1) (#260)
gmao-rreichle Nov 24, 2026
b78ace0
Merge branch 'develop' into feature/wjiang/refactor_ldas_setup
gmao-rreichle Nov 24, 2026
3fa0911
Weight tiles by area in Python ObsFcstAna stats maps
amfox37 Nov 27, 2026
3b14a9b
tile_to_latlongrid: skip zero-area tiles
amfox37 Nov 27, 2026
eb8f5f4
CHANGELOG: add PR number
amfox37 Nov 27, 2026
ba97c22
Weight tiles by area in Python plots of ObsFcstAna stats maps
gmao-rreichle Nov 28, 2026
c65a695
Merge branch 'develop' into feature/wjiang/refactor_ldas_setup
gmao-rreichle Nov 28, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added
- Added obslog output for H SAF ASCAT and CYGNSS L3 soil moisture, with quoted filenames where needed ([PR #242](https://github.com/GEOS-ESM/GEOSldas_GridComp/pull/242)).
- Added functionality to generate perturbations on sphere ([PR #187](https://github.com/GEOS-ESM/GEOSldas_GridComp/pull/187)).
- Added assimilation of VIIRS snow cover fraction obs (VJ110C1, VJ210C1, VNP10C1; hdf5 reader); original obs file names are written to the obslog ([PR #260](https://github.com/GEOS-ESM/GEOSldas_GridComp/pull/260)).
- Added Python version of obs scaling scripts ([PR #228](https://github.com/GEOS-ESM/GEOSldas_GridComp/pull/228)).
- Added support for M21C date/time formatting in post-processing of HISTORY output ([PR #229](https://github.com/GEOS-ESM/GEOSldas_GridComp/pull/229)).
- Improved error handling in preprocessor for SMOS obs ([PR #212](https://github.com/GEOS-ESM/GEOSldas_GridComp/pull/212)).
Expand All @@ -20,16 +21,24 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Changed
- Refactored ldas_setup
- Changed Python ObsFcstAna stats maps (`tile_to_latlongrid.py`, `Plot_stats_maps.py`) to weight tiles by area (changes plots and spatial averages only) ([PR #262](https://github.com/GEOS-ESM/GEOSldas_GridComp/pull/262)).
- Changed MATLAB obs scaling scripts to read nc4 ObsFcstAna files ([PR #227](https://github.com/GEOS-ESM/GEOSldas_GridComp/pull/227)).
- Updated [x,y]corr values for HSAF ASCAT soil moisture obs in LDASsa_DEFAULT_inputs_ensupd.nml ([PR #235](https://github.com/GEOS-ESM/GEOSldas_GridComp/pull/235)).

### Fixed
- Fixed `frac_cell` and units of `area` in tile_coord when reading nc4 tile file in preprocessing (not 0-diff for nc4 tile files; 0-diff for *.til ASCII tile files).
- Fixed double assimilation of MODIS SCF obs for tiles whose center longitude is exactly on the boundary between two assimilation windows (not 0-diff for EASEv2 M36 and CF0360) ([PR #240](https://github.com/GEOS-ESM/GEOSldas_GridComp/pull/240)).
- Fixed obs-to-tile mapping in cube-sphere tile space (not 0-diff for assimilation in cube-sphere tile space) ([PR #252](https://github.com/GEOS-ESM/GEOSldas_GridComp/pull/252)).
- Fixed obs-to-tile mapping of SMAP Tb, SMOS Tb, and CYGNSS soil moisture obs on EASEv2 M36 when used with EASEv2 M09/M03/M01 tile space (not 0-diff for M09 tile space with CYGNSS obs or M03/M01 tile space with SMAP/SMOS/CYGNSS obs) ([PR #257](https://github.com/GEOS-ESM/GEOSldas_GridComp/pull/257), [PR #259](https://github.com/GEOS-ESM/GEOSldas_GridComp/pull/259)).
- Fixed NAG build on macOS (GEOSlandassim) ([PR #244](https://github.com/GEOS-ESM/GEOSldas_GridComp/pull/244)).
- Fixed out-of-bounds copies of per-tile data in LandPert (`i_indgs`, `j_indgs`) and LandAssim (`f_num`) when `tile_coord` contains lake and land ice tiles in addition to land tiles ([PR #254](https://github.com/GEOS-ESM/GEOSldas_GridComp/pull/254)).
- Fixed QC of Tb obs for non-land surfaces (water, landice) in cube-sphere tile space (not 0-diff for cube-sphere tile space with Tb obs) ([PR #249](https://github.com/GEOS-ESM/GEOSldas_GridComp/pull/249), [PR #259](https://github.com/GEOS-ESM/GEOSldas_GridComp/pull/259)).
- Fixed `frac_cell` and units of `area` in tile_coord when reading nc4 tile file in preprocessing (not 0-diff when using nc4 tile file) ([PR #247](https://github.com/GEOS-ESM/GEOSldas_GridComp/pull/247)).
- Fixed double assimilation of MODIS SCF obs for tiles whose center longitude is exactly on the boundary between two assimilation windows (not 0-diff for MODIS SCF assimilation) ([PR #240](https://github.com/GEOS-ESM/GEOSldas_GridComp/pull/240)).
- Fixed bugs in MATLAB obs scaling parameter scripts (not 0-diff for lat/lon grid) ([PR #227](https://github.com/GEOS-ESM/GEOSldas_GridComp/pull/227)).
- Fixed string and no-data obs handling in read_GEOSldas.py ([PR #228](https://github.com/GEOS-ESM/GEOSldas_GridComp/pull/228)).
- Fixed assignment of angles in obs_param structure ([PR #233](https://github.com/GEOS-ESM/GEOSldas_GridComp/pull/233)).
- Standardized units strings in LDASsa_DEFAULT_inputs_ensupd.nml ([PR #233](https://github.com/GEOS-ESM/GEOSldas_GridComp/pull/233)).
- Fixed segmentation fault in the generation of perturbations when MKL is not available (e.g., macOS builds) ([PR #255](https://github.com/GEOS-ESM/GEOSldas_GridComp/pull/255)).
- Fixed `process_hist.csh` for BSD `sed` (macOS) ([PR #255](https://github.com/GEOS-ESM/GEOSldas_GridComp/pull/255)).

### Removed

Expand Down
147 changes: 75 additions & 72 deletions GEOS_LdasGridComp.F90
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ module GEOS_LdasGridCompMod

use ESMF
use MAPL

use GEOS_MetforceGridCompMod, only: MetforceSetServices => SetServices
use GEOS_LandGridCompMod, only: LandSetServices => SetServices
use GEOS_LandPertGridCompMod, only: LandPertSetServices => SetServices
Expand Down Expand Up @@ -39,13 +39,13 @@ module GEOS_LdasGridCompMod
use StieglitzSnow, only: StieglitzSnow_echo_constants
use SurfParams, only: SurfParams_init
use mapl_StateMerge_mod, only: StateMerge

implicit none

private

! !PUBLIC MEMBER FUNCTIONS:

public SetServices

! !DESCRIPTION: This gridded component (GC) combines the GridComps:
Expand Down Expand Up @@ -75,7 +75,7 @@ module GEOS_LdasGridCompMod
logical :: with_lake ! true if lake tiles requested by config
logical :: with_land ! true if land tiles requested by config
integer :: RUN_ROUTE ! 0:, no river routing, 1: routing w/o reservoirs, 2: routing w/ reservoirs

contains

!BOP
Expand Down Expand Up @@ -531,16 +531,16 @@ subroutine Initialize(gc, import, export, clock, rc)
call MAPL_GetResource(MAPL, grid_type,Label="GEOSldas.GRID_TYPE:",RC=STATUS)
VERIFY_(STATUS)

! if (trim(grid_type) == "Cubed-Sphere") then
! call grid_manager%add_prototype("Cubed-Sphere", cubed_sphere_factory)
! associate (method => REGRID_METHOD_BILINEAR, mgr => regridder_manager)
! call mgr%add_prototype('Cubed-Sphere', 'LatLon', method, cube_to_latlon_prototype)
! call mgr%add_prototype('LatLon', 'Cubed-Sphere', method, latlon_to_cube_prototype)
! call mgr%add_prototype('Cubed-Sphere', 'Cubed-Sphere', method, cube_to_cube_prototype)
! end associate
! endif

! Create atmospheric (single level atm grid covers all of surface) grid
! if (trim(grid_type) == "Cubed-Sphere") then
! call grid_manager%add_prototype("Cubed-Sphere", cubed_sphere_factory)
! associate (method => REGRID_METHOD_BILINEAR, mgr => regridder_manager)
! call mgr%add_prototype('Cubed-Sphere', 'LatLon', method, cube_to_latlon_prototype)
! call mgr%add_prototype('LatLon', 'Cubed-Sphere', method, latlon_to_cube_prototype)
! call mgr%add_prototype('Cubed-Sphere', 'Cubed-Sphere', method, cube_to_cube_prototype)
! end associate
! endif
! Create atmospheric (single level atm grid covers all of surface) grid
call MAPL_GridCreate(gc, rc=status)
VERIFY_(status)

Expand Down Expand Up @@ -568,10 +568,10 @@ subroutine Initialize(gc, import, export, clock, rc)
isEASEv1 = .true.
endif
if( isEASEv1) then
! To be implemented
! To be implemented
endif
if( isEASEv2) then
! Retrieve the coordinates so we can set them
! Retrieve the coordinates so we can set them
call ESMF_GridGetCoord(agrid, coordDim=1, localDE=0, &
staggerloc=ESMF_STAGGERLOC_CENTER, &
farrayPtr=centerX, rc=status)
Expand Down Expand Up @@ -698,7 +698,7 @@ subroutine Initialize(gc, import, export, clock, rc)
call MPI_AllReduce(local_nt,total_nt,1,MPI_INT,MPI_SUM,mpicomm,mpierr);

decomf = get_io_filename(trim(out_path), trim(exp_id), 'ldas_domdecomp', date_time=start_time, &
dir_name='rc_out', file_ext='.txt')
dir_name='rc_out', file_ext='.txt')


if (IamRoot) then
Expand All @@ -707,48 +707,51 @@ subroutine Initialize(gc, import, export, clock, rc)
deallocate(f2g)
print*, "Number of tiles: ", N_f
if(N_f /= total_nt) then
print*, "total_nt = ", total_nt
stop "tiles number not equal"
print*, "total_nt = ", total_nt
stop "tiles number not equal"
endif
open(10,file= trim(decomf), action='write')
write(10,*) N_f
close(10)
call io_grid_def_type('w', logunit, tile_grid_f, 'tile_grid_f')

! get a grid for perturbations and EnKF:
!
! tile grid ! pert grid
! (defines tile space) ! (used for perturbations and as "hash" grid in EnKF analysis)
! ===========================================================================================================
! lat/lon ! same as tile_grid (i.e., lat/lon)
! -----------------------------------------------------------------------------------------------------------
! EASEv[X] ! same as tile_grid (i.e., EASE)
! -----------------------------------------------------------------------------------------------------------
! cube-sphere ! lat/lon grid of resolution similar to that of (cube-sphere) tile_grid

! get a grid for perturbations, also used (w/ one exception, see Table) for obs2tile + tiles2obsFOV mapping in EnKF:

! ===============================================================================================================
! tile_grid | pert_grid | obs2tile_grid | tiles2obsFOV_grid
! (defines tile space) | (perturbations) | (obs reader) | (get_obs_pred)
! ===============================================================================================================
! lat/lon | =tile_grid (i.e., lat/lon) | =pert_grid | =pert_grid
! ---------------------------------------------------------------------------------------------------------------
! EASEv[X] | =tile_grid (i.e., EASE) | =pert_grid | =pert_grid
! ---------------------------------------------------------------------------------------------------------------
! cube-sphere (c3) | lat/lon grid of resolution | =tile_grid (c3!) | =pert_grid (i.e., lat/lon)
! | similar to that of (c3) tile_grid | |
! ===============================================================================================================

pert_grid_g = get_pert_grid(tile_grid_g)

if ( .not. (pert_grid_g==tile_grid_g) ) then

! arrive here when tile_grid_g is cube-sphere and pert_grid_g is lat/lon after call to get_pert_grid() above

!1) get pert_i_indg, pert_j_indg for tiles in (full) domain relative to pert_grid_g
do i = 1, N_f
call get_ij_ind_from_latlon(pert_grid_g,tile_coord_f(i)%com_lat,tile_coord_f(i)%com_lon, &
tile_coord_f(i)%pert_i_indg,tile_coord_f(i)%pert_j_indg)
call get_ij_ind_from_latlon( pert_grid_g, tile_coord_f(i)%com_lat, tile_coord_f(i)%com_lon, &
tile_coord_f(i)%pert_i_indg, tile_coord_f(i)%pert_j_indg)
enddo
!2) determine pert_grid_f
pert_grid_f = get_minExtent_grid(N_f, tile_coord_f%pert_i_indg, tile_coord_f%pert_j_indg, &
tile_coord_f%min_lon, tile_coord_f%min_lat, tile_coord_f%max_lon, tile_coord_f%max_lat, &
pert_grid_f = get_minExtent_grid( N_f, tile_coord_f%pert_i_indg, tile_coord_f%pert_j_indg, &
tile_coord_f%min_lon, tile_coord_f%min_lat, tile_coord_f%max_lon, tile_coord_f%max_lat, &
pert_grid_g)

else

pert_grid_f = tile_grid_f

! note that %pert_i_indg and %pert_j_indg were initialized to %i_indg and %j_indg
! in io_tile_coord_type() when tile_coord was read via io_domain_files()

endif
endif

Expand All @@ -774,24 +777,24 @@ subroutine Initialize(gc, import, export, clock, rc)
enddo
enddo
if (j /= local_nt) then
stop "tile distributtion is wrong. cannot find the right tile"
stop "tile distributtion is wrong. cannot find the right tile"
endif
tcinternal%tile_coord = tile_coord_f(tcinternal%l2f)
end block

do i = 0, numprocs-1
if( i == myid) then
open(10,file= trim(decomf), action='write',position='append')
do j = 1, local_nt
write(10,*) local_id(j), myid
enddo
close(10)
endif
call MPI_Barrier(mpicomm,mpierr)
enddo
if( i == myid) then
open(10,file= trim(decomf), action='write',position='append')
do j = 1, local_nt
write(10,*) local_id(j), myid
enddo
close(10)
endif
call MPI_Barrier(mpicomm,mpierr)
enddo

allocate(tcinternal%tile_coord_f,source = tile_coord_f)

pert_grid_l = get_minExtent_grid(local_nt, &
tcinternal%tile_coord%pert_i_indg, tcinternal%tile_coord%pert_j_indg, &
tcinternal%tile_coord%min_lon, tcinternal%tile_coord%min_lat, &
Expand All @@ -802,7 +805,7 @@ subroutine Initialize(gc, import, export, clock, rc)
tcinternal%pgrid_f = pert_grid_f
tcinternal%pgrid_l = pert_grid_l
tcinternal%tgrid_g = tile_grid_g

do i = 1, NUM_ENSEMBLE
call MAPL_GetObjectFromGC(gcs(METFORCE(i)), CHILD_MAPL, rc=status)
VERIFY_(status) ! CHILD = METFORCE
Expand All @@ -816,7 +819,7 @@ subroutine Initialize(gc, import, export, clock, rc)
enddo

do i = 1,NUM_ENSEMBLE

if (with_land) then
call MAPL_GetObjectFromGC(gcs(LAND(i)), CHILD_MAPL, rc=status)
VERIFY_(status)
Expand All @@ -827,7 +830,7 @@ subroutine Initialize(gc, import, export, clock, rc)
VERIFY_(status) ! CHILD = LANDPERT
call MAPL_Set(CHILD_MAPL, LocStream=land_locstream, rc=status)
VERIFY_(status)

! Add LAND's tile_coord to children's GridComps
call ESMF_UserCompSetInternalState(gcs(LAND(i)), 'TILE_COORD', tcwrap, status)
VERIFY_(status)
Expand All @@ -848,16 +851,16 @@ subroutine Initialize(gc, import, export, clock, rc)
call MAPL_Set(CHILD_MAPL, LocStream=landice_locstream, rc=status)
VERIFY_(status)
endif

if (RUN_ROUTE >= 1) then
call MAPL_GetObjectFromGC(gcs(ROUTE(i)), CHILD_MAPL, rc=status)
VERIFY_(status)
call MAPL_Set(CHILD_MAPL, LocStream=land_locstream, rc=status)
VERIFY_(status)
endif

enddo

enddo

if (land_assim .or. mwRTM ) then
call MAPL_GetObjectFromGC( gcs(LANDASSIM), CHILD_MAPL, rc=status)
VERIFY_(status)
Expand All @@ -867,13 +870,13 @@ subroutine Initialize(gc, import, export, clock, rc)
call ESMF_UserCompSetInternalState(gcs(LANDASSIM), 'TILE_COORD', tcwrap, status)
VERIFY_(status)
endif

call MAPL_GetObjectFromGC( gcs(METFORCEAVG), CHILD_MAPL, rc=status)
VERIFY_(status)
! only land_locstream is averaged.
call MAPL_Set( CHILD_MAPL, LocStream=land_locstream, rc=status)
VERIFY_(status)

if ( with_land) then
call MAPL_GetObjectFromGC( gcs(LANDAVG), CHILD_MAPL, rc=status)
VERIFY_(status) ! CHILD = ens_avg
Expand All @@ -892,7 +895,7 @@ subroutine Initialize(gc, import, export, clock, rc)
call MAPL_Set( CHILD_MAPL, LocStream=landice_locstream, rc=status)
VERIFY_(status)
endif

!if ( RUN_ROUTE >= 1) then
! ! not necessary. Route Avg has its own pfaf_locstream
! call MAPL_GetObjectFromGC(gcs(ROUTEAVG), CHILD_MAPL, rc=status)
Expand All @@ -901,15 +904,15 @@ subroutine Initialize(gc, import, export, clock, rc)
call MAPL_GenericInitialize(gc, import, export, clock, rc=status)
VERIFY_(status)

! solar alarm is created in solar gridcomp. Since GEOSldas doesnot have that gridcomp, it is created here
! -create-nonsticky-alarm-
! solar alarm is created in solar gridcomp. Since GEOSldas doesnot have that gridcomp, it is created here
! -create-nonsticky-alarm-
call MAPL_Get(MAPL, HEARTBEAT = DT, RC=STATUS)
VERIFY_(STATUS)
call MAPL_GetResource ( MAPL, DT_Solar, Label="SOLAR_DT:", DEFAULT=DT, RC=STATUS)
VERIFY_(STATUS)
call ESMF_TimeIntervalSet(SOLAR_DT, s=NINT(DT_Solar), rc=status)
VERIFY_(status)

SolarAlarm = ESMF_AlarmCreate( &
clock, &
name='SOLAR_Alarm', &
Expand All @@ -932,7 +935,7 @@ subroutine Initialize(gc, import, export, clock, rc)

end subroutine Initialize


subroutine Run(gc, import, export, clock, rc)

! !ARGUMENTS:
Expand Down Expand Up @@ -975,8 +978,8 @@ subroutine Run(gc, import, export, clock, rc)
type (ESMF_Field) :: field
type (ESMF_State) :: merged_import

! Begin...

! Begin...
! Get component's name and setup traceback handle
call ESMF_GridCompget(gc, name=comp_name, rc=status)
VERIFY_(status)
Expand Down Expand Up @@ -1026,7 +1029,7 @@ subroutine Run(gc, import, export, clock, rc)
VERIFY_(status)
call MAPL_TimerOff(MAPL, gcnames(igc))
enddo

! Run children GridComps (in order)
! Generate raw perturbed force and progn
do i = 1,NUM_ENSEMBLE
Expand All @@ -1037,7 +1040,7 @@ subroutine Run(gc, import, export, clock, rc)
call MAPL_TimerOff(MAPL, gcnames(igc))
enddo
endif ! with_land

do i = 1, NUM_ENSEMBLE
igc = METFORCE(i)
call MAPL_TimerOn( MAPL, gcnames(igc))
Expand Down Expand Up @@ -1072,7 +1075,7 @@ subroutine Run(gc, import, export, clock, rc)
endif
call MAPL_TimerOff(MAPL, gcnames(igc))
enddo

do i = 1,NUM_ENSEMBLE

if (with_land) then
Expand Down Expand Up @@ -1170,9 +1173,9 @@ subroutine Run(gc, import, export, clock, rc)
VERIFY_(status)
endif
endif
endif ! with_land
endif ! with_land
enddo

if ( mwRTM .and. LSM_CHOICE == 1 ) then
! output_smapl4smlmc
call ESMF_GridCompRun(gcs(LANDASSIM), importState=gim(LANDASSIM), exportState=gex(LANDASSIM), clock=clock,phase=4, userRC=status)
Expand All @@ -1194,7 +1197,7 @@ subroutine Run(gc, import, export, clock, rc)
! Extract updated exports from "cat_progn"
call ESMF_GridCompRun(gcs(igc), importState=gim(igc), exportState=gex(LAND(i)), clock=clock, phase=2, userRC=status)
VERIFY_(status)

enddo
call MAPL_TimerOff(MAPL, gcnames(igc))
endif
Expand All @@ -1214,7 +1217,7 @@ end subroutine Run
! !IROTUINE: Finalize -- finalize method for LDAS GC

! !INTERFACE:

subroutine Finalize(gc, import, export, clock, rc)

! !ARGUMENTS:
Expand Down
Loading
Loading