Skip to content

Commit

Permalink
use partial tiel_coord in metforce
Browse files Browse the repository at this point in the history
  • Loading branch information
weiyuan-jiang committed Apr 25, 2024
1 parent 0c5bf7c commit 430a4d6
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 5 deletions.
3 changes: 3 additions & 0 deletions GEOS_LdasGridComp.F90
Original file line number Diff line number Diff line change
Expand Up @@ -724,6 +724,8 @@ subroutine Initialize(gc, import, export, clock, rc)
call MAPL_Set(CHILD_MAPL, LocStream=land_locstream, rc=status)
VERIFY_(status)
endif
call ESMF_UserCompSetInternalState(gcs(METFORCE(i)), 'TILE_COORD', tcwrap, status)
VERIFY_(status)

! exit after i=1 if using deterministic forcing
if (.not. ensemble_forcing) exit
Expand Down Expand Up @@ -757,6 +759,7 @@ subroutine Initialize(gc, import, export, clock, rc)
VERIFY_(status)
call ESMF_UserCompSetInternalState(gcs(LANDPERT(i)), 'TILE_COORD', tcwrap, status)
VERIFY_(status)

enddo

if (land_assim .or. mwRTM) then
Expand Down
22 changes: 17 additions & 5 deletions GEOSmetforce_GridComp/GEOS_MetforceGridComp.F90
Original file line number Diff line number Diff line change
Expand Up @@ -602,10 +602,12 @@ subroutine Initialize(gc, import, export, clock, rc)
! Internal private state variables
type(T_METFORCE_STATE), pointer :: internal=>null()
type(METFORCE_WRAP) :: wrap
type(TILECOORD_WRAP) :: tcwrap
type(tile_coord_type), pointer :: tile_coord(:)=>null()
type(tile_coord_type), pointer :: tile_coord_tmp(:)=>null()

! Misc variables
integer :: nt_local, k, NUM_ENSEMBLE
integer :: nt_local, k, NUM_ENSEMBLE, i1, i2
integer :: ForceDtStep
type(met_force_type) :: mf_nodata
logical :: MERRA_file_specs, ensemble_forcing
Expand Down Expand Up @@ -647,6 +649,11 @@ subroutine Initialize(gc, import, export, clock, rc)
VERIFY_(status)
internal => wrap%ptr

! Get component's internal tile_coord variable
call ESMF_UserCompGetInternalState(gc, 'TILE_COORD', tcwrap, status)
VERIFY_(status)
tile_coord_tmp => tcwrap%ptr%tile_coord

call MAPL_Get(MAPL, LocStream=locstream)
VERIFY_(status)
call MAPL_LocStreamGet( &
Expand All @@ -666,10 +673,15 @@ subroutine Initialize(gc, import, export, clock, rc)


allocate(mf%tile_coord(nt_local))
mf%tile_coord(:)%com_lon = TileLons
mf%tile_coord(:)%com_lat = TileLats
mf%tile_coord(:)%i_indg = i_indg
mf%tile_coord(:)%j_indg = j_indg
mf%tile_coord(1:NUM_LAND_TILE) = tile_coord_tmp
if (NUM_LANDICE_TILE > 0 ) then
i1 = NUM_LAND_TILE + 1
i2 = NUM_LAND_TILE + NUM_LANDICE_TILE
mf%tile_coord(i1:i2)%com_lon = TileLons(i1:i2)
mf%tile_coord(i1:i2)%com_lat = TileLats(i1:i2)
mf%tile_coord(i1:i2)%i_indg = i_indg(i1:i2)
mf%tile_coord(i1:i2)%j_indg = j_indg(i1:i2)

This comment has been minimized.

Copy link
@gmao-rreichle

gmao-rreichle Apr 25, 2024

Collaborator

@weiyuan-jiang : If I understand this correctly, only com_lon/lat and i/j_indg are correct in mf%tile_coord after this operation. Aren't the rest of the fields still as in tile_coord_tmp and therefore now inconsistent with com_lon/lat and i/j_indg? Or has tile_coord_tmp been initialized to no-data-values?

This comment has been minimized.

Copy link
@weiyuan-jiang

weiyuan-jiang Apr 25, 2024

Author Contributor

I actually not sure about this now. Supposedly, they should be the same. This step is not necessary. I will investigate what leads to non-zero diff

endif

call MAPL_GetResource ( MAPL, AEROSOL_DEPOSITION, Label="AEROSOL_DEPOSITION:", &
DEFAULT=0, RC=STATUS)
Expand Down

0 comments on commit 430a4d6

Please sign in to comment.