Skip to content

Commit 65db488

Browse files
authored
Merge branch 'develop' into feature/rtodling/these_read_cubed_output
2 parents 05dadc5 + 4533726 commit 65db488

File tree

4 files changed

+15
-18
lines changed

4 files changed

+15
-18
lines changed

GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/Utils/Raster/makebcs/TileFile_ASCII_to_nc4.F90

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
program TileFile_ASCII_to_nc4
99
use, intrinsic :: iso_fortran_env, only: REAL64
1010
use MAPL
11-
use LogRectRasterizeMod, only: WriteTilingNC4, MAPL_UNDEF_R8
11+
use LogRectRasterizeMod, only: MAPL_UNDEF_R8
1212
use EASE_conv, only: ease_extent
1313

1414
implicit none
@@ -29,7 +29,7 @@ program TileFile_ASCII_to_nc4
2929
real :: cell_area
3030

3131
integer :: n_tile, n_grid, n_lon1, n_lat1, n_cat, tmp_in1, tmp_in2
32-
integer :: n_lon2, n_lat2, nx, ny, num, ll, maxcat
32+
integer :: n_lon2, n_lat2, nx, ny, num, ll, maxcat
3333
logical :: file_exists
3434

3535
! ----------------------------------------------------------------------
@@ -181,9 +181,9 @@ program TileFile_ASCII_to_nc4
181181
! write nc4 file
182182

183183
if (N_grid == 1) then
184-
call WriteTilingNC4(filenameNc4, [gName1 ], [n_lon1 ], [n_lat1 ], nx, ny, iTable, rTable, N_PfafCat=maxcat)
184+
call MAPL_WriteTilingNC4(filenameNc4, [gName1 ], [n_lon1 ], [n_lat1 ], nx, ny, iTable, rTable, N_PfafCat=maxcat)
185185
else
186-
call WriteTilingNC4(filenameNc4, [gName1, gName2], [n_lon1, n_lon2], [n_lat1, n_lat2], nx, ny, iTable, rTable, N_PfafCat=maxcat)
186+
call MAPL_WriteTilingNC4(filenameNc4, [gName1, gName2], [n_lon1, n_lon2], [n_lat1, n_lat2], nx, ny, iTable, rTable, N_PfafCat=maxcat)
187187
endif
188188

189189
contains

GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/Utils/Raster/makebcs/mkCatchParam.F90

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ PROGRAM mkCatchParam
1818
!
1919
! Sarith Mahanama - March 23, 2012
2020
21+
use MAPL
2122
use EASE_conv
22-
use LogRectRasterizeMod, ONLY: ReadTilingNC4
2323
use rmTinyCatchParaMod
2424
use process_hres_data
2525

@@ -274,7 +274,7 @@ PROGRAM mkCatchParam
274274
endif
275275
write (log_file,'(a)')' '
276276

277-
call ReadTilingNC4( trim(fnameTil)//".nc4", iTable = iTable)
277+
call MAPL_ReadTilingNC4( trim(fnameTil)//".nc4", iTable = iTable)
278278
N_land = count(iTable(:,0) == 100) ! n_land = number of land tiles
279279
allocate(tile_j_dum, source = iTable(1:n_land,7)) ! possible used in cti_stats.dat
280280
deallocate (iTable)

GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/Utils/Raster/makebcs/mkEASETilesParam.F90

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ PROGRAM mkEASETilesParam
3535
use rmTinyCatchParaMod, only : RegridRasterReal
3636
use rmTinyCatchParaMod, only : Target_mean_land_elev
3737
use process_hres_data, only : histogram
38-
use LogRectRasterizeMod, only : WriteTilingNC4, SRTM_maxcat, MAPL_UNDEF_R8 ! rasterize.F90
38+
use LogRectRasterizeMod, only : SRTM_maxcat, MAPL_UNDEF_R8 ! rasterize.F90
3939
use MAPL_SortMod
4040
use MAPL_ConstantsMod
4141
use MAPL_ExceptionHandling
@@ -975,7 +975,7 @@ PROGRAM mkEASETilesParam
975975

976976
! write nc4-formatted tile file (including supplemental tile attributes ["catchment.def"])
977977

978-
call WriteTilingNC4('til/'//trim(gfile)//'.nc4', [EASELabel],[nc_ease],[nr_ease], &
978+
call MAPL_WriteTilingNC4('til/'//trim(gfile)//'.nc4', [EASELabel],[nc_ease],[nr_ease], &
979979
nc, nr, iTable, rTable)
980980

981981
deallocate( tileid_index, catid_index,veg )

GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/Utils/Raster/makebcs/rmTinyCatchParaMod.F90

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,9 @@ module rmTinyCatchParaMod
1010
use LDAS_DateTimeMod
1111
use MAPL_ConstantsMod
1212
use MAPL_Base, ONLY: MAPL_UNDEF
13+
use MAPL, only: MAPL_WriteTilingNC4
1314
use lsm_routines, ONLY: sibalb
14-
use LogRectRasterizeMod, ONLY: SRTM_maxcat, WritetilingNC4, MAPL_UNDEF_R8
15+
use LogRectRasterizeMod, ONLY: SRTM_maxcat, MAPL_UNDEF_R8
1516
use, intrinsic :: iso_fortran_env, only: REAL64
1617
implicit none
1718

@@ -924,7 +925,7 @@ SUBROUTINE supplemental_tile_attributes(nx,ny,regrid,dateline,fnameTil, Rst_id)
924925
INTEGER, allocatable, dimension(:) :: id, I_INDEX, J_INDEX
925926
integer :: nc_gcm, nr_gcm, nc_ocean, nr_ocean
926927
REAL :: lat, lon, fr_gcm, fr_cat, tarea
927-
INTEGER :: typ, pfs, ig, jg, j_dum, i_dum, ierr, indx_dum, ip2
928+
INTEGER :: typ, pfs, ig, jg, j_dum, i_dum, ierr, indx_dum, ip2, n_grid
928929

929930
REAL (REAL64), PARAMETER :: RADIUS=MAPL_RADIUS, pi= MAPL_PI
930931

@@ -945,7 +946,7 @@ SUBROUTINE supplemental_tile_attributes(nx,ny,regrid,dateline,fnameTil, Rst_id)
945946
real*4, allocatable, target :: q0 (:,:)
946947
real(REAL64), allocatable :: rTable(:,:)
947948
integer, allocatable :: iTable(:,:)
948-
character(len=512) :: gName(2)
949+
character(len=128) :: gName(2)
949950
logical, allocatable :: IsOcean(:)
950951

951952
! -----------------------------------------------------
@@ -998,11 +999,11 @@ SUBROUTINE supplemental_tile_attributes(nx,ny,regrid,dateline,fnameTil, Rst_id)
998999
allocate(tile_area(ip))
9991000

10001001
id=0
1001-
read (10,*)j_dum
1002+
read (10,*) n_grid
10021003
IM = 0
10031004
JM = 0
10041005
gName = ['','']
1005-
do n = 1, j_dum
1006+
do n = 1, n_grid
10061007
read (10,'(a)')version
10071008
read (10,*)nc_gcm
10081009
read (10,*)nr_gcm
@@ -1208,11 +1209,7 @@ SUBROUTINE supplemental_tile_attributes(nx,ny,regrid,dateline,fnameTil, Rst_id)
12081209
endwhere
12091210

12101211
fname=trim(fnameTil)//'.nc4'
1211-
if (im(2) == 0) then ! one grid
1212-
call WriteTilingNC4(fname, [gName(1)], [im(1)], [jm(1)], nx, ny, iTable, rTable, N_PfafCat=SRTM_maxcat, rc=status)
1213-
else ! two grids
1214-
call WriteTilingNC4(fname, gName, im, jm, nx, ny, iTable, rTable, N_PfafCat=SRTM_maxcat, rc=status)
1215-
endif
1212+
call MAPL_WriteTilingNC4(fname, gName(1:n_grid), im(1:n_grid), jm(1:n_grid), nx, ny, iTable, rTable, N_PfafCat=SRTM_maxcat, rc=status)
12161213

12171214
deallocate (rTable, iTable)
12181215
deallocate (limits)

0 commit comments

Comments
 (0)