@@ -35,7 +35,7 @@ module GEOS_RouteGridCompMod
3535 integer , parameter :: upmax = 34
3636 character (len= 500 ) :: inputdir = " /discover/nobackup/yzeng3/data/river_input/"
3737 logical , parameter :: use_res = .True.
38- integer , save :: nmax
38+ integer , save :: nmax,nmaxt
3939
4040 private
4141
@@ -65,11 +65,17 @@ module GEOS_RouteGridCompMod
6565 integer :: myPe
6666 integer :: minCatch
6767 integer :: maxCatch
68+ integer :: minNT
69+ integer :: maxNT
6870 integer , pointer :: pfaf(:) = > NULL ()
6971 real , pointer :: tile_area(:) = > NULL () ! m2
72+
7073 integer , pointer :: nsub(:) = > NULL ()
7174 integer , pointer :: subi(:,:) = > NULL ()
7275 real , pointer :: subarea(:,:) = > NULL () ! m2
76+ integer , pointer :: nsubt(:) = > NULL ()
77+ integer , pointer :: subit(:,:) = > NULL ()
78+ real , pointer :: subareat(:,:) = > NULL () ! m2
7379
7480 integer , pointer :: scounts_global(:) = > NULL ()
7581 integer , pointer :: rdispls_global(:) = > NULL ()
@@ -343,6 +349,10 @@ subroutine INITIALIZE (GC,IMPORT, EXPORT, CLOCK, RC )
343349 real , pointer :: subarea_global(:,:)= > NULL (),subarea(:,:)= > NULL () ! Arrays for sub-area and fractions
344350 integer , pointer :: subi_global(:,:)= > NULL (),subi(:,:)= > NULL ()
345351 integer , pointer :: nsub_global(:)= > NULL (),nsub(:)= > NULL ()
352+ real , pointer :: subareat_global(:,:)= > NULL (),subareat(:,:)= > NULL () ! Arrays for sub-area and fractions
353+ integer , pointer :: subit_global(:,:)= > NULL (),subit(:,:)= > NULL ()
354+ integer , pointer :: nsubt_global(:)= > NULL (),nsubt(:)= > NULL ()
355+
346356 real , pointer :: area_cat_global(:)= > NULL (),area_cat(:)= > NULL ()
347357 integer , pointer :: scounts(:)= >NULL ()
348358 integer , pointer :: scounts_global(:)= >NULL (),rdispls_global(:)= >NULL ()
@@ -412,9 +422,11 @@ subroutine INITIALIZE (GC,IMPORT, EXPORT, CLOCK, RC )
412422 if (nt_global== 112573 )then
413423 resname= " M36"
414424 nmax= 150
425+ nmaxt= 34
415426 else if (nt_global== 1684725 )then
416427 resname= " M09"
417428 nmax= 458
429+ nmaxt= 12
418430 else
419431 if (mapl_am_I_root())then
420432 print * ," unknown grid for routing model"
@@ -465,6 +477,8 @@ subroutine INITIALIZE (GC,IMPORT, EXPORT, CLOCK, RC )
465477 deallocate (scounts)
466478 route% scounts_global= >scounts_global
467479 route% rdispls_global= >rdispls_global
480+ route% minNT= rdispls_global(mype+1 )+ 1
481+ route% maxNT= rdispls_global(mype+1 )+ nt_local
468482
469483 allocate (scounts(ndes),scounts_cat(ndes),rdispls_cat(ndes))
470484 scounts= 0
@@ -482,6 +496,27 @@ subroutine INITIALIZE (GC,IMPORT, EXPORT, CLOCK, RC )
482496 route% runoff_save = > runoff_save
483497 route% runoff_save= 0 .
484498
499+
500+ ! for output interpolated on model grid
501+ allocate (nsubt_global(nt_global),subareat_global(nmaxt,nt_global))
502+ open (77 ,file= trim (inputdir)// " /nsub_tile_" // trim (resname)// " .txt" ,status= " old" ,action= " read" ); read (77 ,* )nsubt_global; close (77 )
503+ open (77 ,file= trim (inputdir)// " /areasub_tile_" // trim (resname)// " .txt" ,status= " old" ,action= " read" ); read (77 ,* )subareat_global; close (77 )
504+ allocate (nsubt(nt_local),subareat(nmaxt,nt_local))
505+ nsubt= nsubt_global(route% minNT:route% maxNT)
506+ subareat= subareat_global(:,route% minNT:route% maxNT)
507+ subareat= subareat* 1.e6 ! km2->m2
508+ deallocate (nsubt_global,subareat_global)
509+ route% nsubt = > nsubt
510+ route% subareat = > subareat
511+
512+ allocate (subit_global(nmaxt,nt_global),subit(nmaxt,nt_local))
513+ open (77 ,file= trim (inputdir)// " /catisub_tile_" // trim (resname)// " .txt" ,status= " old" ,action= " read" );read (77 ,* )subit_global;close (77 )
514+ subit= subit_global(:,route% minNT:route% maxNT)
515+ route% subit = > subit
516+ deallocate (subit_global)
517+
518+
519+
485520 ! Read tile area data
486521 allocate (tile_area_local(nt_local),tile_area_global(nt_global))
487522 open (77 ,file= trim (inputdir)// " /area_" // trim (resname)// " _1d.txt" ,status= " old" ,action= " read" );read (77 ,* )tile_area_global;close (77 )
0 commit comments