Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
program TileFile_ASCII_to_nc4
use, intrinsic :: iso_fortran_env, only: REAL64
use MAPL
use LogRectRasterizeMod, only: WriteTilingNC4, MAPL_UNDEF_R8
use LogRectRasterizeMod, only: MAPL_UNDEF_R8
use EASE_conv, only: ease_extent

implicit none
Expand All @@ -29,7 +29,7 @@ program TileFile_ASCII_to_nc4
real :: cell_area

integer :: n_tile, n_grid, n_lon1, n_lat1, n_cat, tmp_in1, tmp_in2
integer :: n_lon2, n_lat2, nx, ny, num, ll, maxcat
integer :: n_lon2, n_lat2, nx, ny, num, ll, maxcat
logical :: file_exists

! ----------------------------------------------------------------------
Expand Down Expand Up @@ -181,9 +181,9 @@ program TileFile_ASCII_to_nc4
! write nc4 file

if (N_grid == 1) then
call WriteTilingNC4(filenameNc4, [gName1 ], [n_lon1 ], [n_lat1 ], nx, ny, iTable, rTable, N_PfafCat=maxcat)
call MAPL_WriteTilingNC4(filenameNc4, [gName1 ], [n_lon1 ], [n_lat1 ], nx, ny, iTable, rTable, N_PfafCat=maxcat)
else
call WriteTilingNC4(filenameNc4, [gName1, gName2], [n_lon1, n_lon2], [n_lat1, n_lat2], nx, ny, iTable, rTable, N_PfafCat=maxcat)
call MAPL_WriteTilingNC4(filenameNc4, [gName1, gName2], [n_lon1, n_lon2], [n_lat1, n_lat2], nx, ny, iTable, rTable, N_PfafCat=maxcat)
endif

contains
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ PROGRAM mkCatchParam
!
! Sarith Mahanama - March 23, 2012
! Email: [email protected]
use MAPL
use EASE_conv
use LogRectRasterizeMod, ONLY: ReadTilingNC4
use rmTinyCatchParaMod
use process_hres_data

Expand Down Expand Up @@ -274,7 +274,7 @@ PROGRAM mkCatchParam
endif
write (log_file,'(a)')' '

call ReadTilingNC4( trim(fnameTil)//".nc4", iTable = iTable)
call MAPL_ReadTilingNC4( trim(fnameTil)//".nc4", iTable = iTable)
N_land = count(iTable(:,0) == 100) ! n_land = number of land tiles
allocate(tile_j_dum, source = iTable(1:n_land,7)) ! possible used in cti_stats.dat
deallocate (iTable)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ PROGRAM mkEASETilesParam
use rmTinyCatchParaMod, only : RegridRasterReal
use rmTinyCatchParaMod, only : Target_mean_land_elev
use process_hres_data, only : histogram
use LogRectRasterizeMod, only : WriteTilingNC4, SRTM_maxcat, MAPL_UNDEF_R8 ! rasterize.F90
use LogRectRasterizeMod, only : SRTM_maxcat, MAPL_UNDEF_R8 ! rasterize.F90
use MAPL_SortMod
use MAPL_ConstantsMod
use MAPL_ExceptionHandling
Expand Down Expand Up @@ -975,7 +975,7 @@ PROGRAM mkEASETilesParam

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

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

deallocate( tileid_index, catid_index,veg )
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@ module rmTinyCatchParaMod
use LDAS_DateTimeMod
use MAPL_ConstantsMod
use MAPL_Base, ONLY: MAPL_UNDEF
use MAPL, only: MAPL_WriteTilingNC4
use lsm_routines, ONLY: sibalb
use LogRectRasterizeMod, ONLY: SRTM_maxcat, WritetilingNC4, MAPL_UNDEF_R8
use LogRectRasterizeMod, ONLY: SRTM_maxcat, MAPL_UNDEF_R8
use, intrinsic :: iso_fortran_env, only: REAL64
implicit none

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

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

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

! -----------------------------------------------------
Expand Down Expand Up @@ -998,11 +999,11 @@ SUBROUTINE supplemental_tile_attributes(nx,ny,regrid,dateline,fnameTil, Rst_id)
allocate(tile_area(ip))

id=0
read (10,*)j_dum
read (10,*) n_grid
IM = 0
JM = 0
gName = ['','']
do n = 1, j_dum
do n = 1, n_grid
read (10,'(a)')version
read (10,*)nc_gcm
read (10,*)nr_gcm
Expand Down Expand Up @@ -1208,11 +1209,7 @@ SUBROUTINE supplemental_tile_attributes(nx,ny,regrid,dateline,fnameTil, Rst_id)
endwhere

fname=trim(fnameTil)//'.nc4'
if (im(2) == 0) then ! one grid
call WriteTilingNC4(fname, [gName(1)], [im(1)], [jm(1)], nx, ny, iTable, rTable, N_PfafCat=SRTM_maxcat, rc=status)
else ! two grids
call WriteTilingNC4(fname, gName, im, jm, nx, ny, iTable, rTable, N_PfafCat=SRTM_maxcat, rc=status)
endif
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)

deallocate (rTable, iTable)
deallocate (limits)
Expand Down