program gminer30 implicit none !==================================================================== ! GMINER30 is a global database of mineral fractions (%) in ! potentially erodible soils. ! The database is available for download: wwww.seevccc.rs/GMINER30 ! Data are on 30-seconds gird (~ km) and are organized in 27 tiles ! with NXT x NYT points each. ! There is 9 minerals separated in clay and silt size populations. ! ! CLAY minerals: SILT minerals: ! ILLI illite FELD feldspars ! KAOL kaolinite GYPS gypsum ! SMEC smectite CAL2 calcite ! CAL1 calcite QUA2 quartz ! QUA1 quartz HEM2 hematite ! HEM1 hematite ! ! PHOS phosphorus at the moment is not classified in silt or clay ! ! This program is intended for reading mineral fractions (%) ! from the database and writing ASCII files (lon, lat, mineral frac). !==================================================================== integer :: i, j, it, k, jj real, parameter :: dlo=1./120.,dla=1./120. integer, parameter :: nxt=40./dlo+1, nyt=50./dla+1 integer, parameter :: nmin=12, ntile=27 real :: lat, lon real, dimension (nxt,nyt) :: minf real, dimension (ntile) :: tlon, tlat character*7, dimension (ntile) :: ctile character*4, dimension (nmin) :: cminer data cminer /'ILLI', 'KAOL', 'SMEC', 'CAL1', 'QUA1', 'PHOS', & 'HEM1', 'QUA2', 'FELD', 'CAL2', 'HEM2', 'GYPS'/ data ctile / & 'W180N90', 'W140N90', 'W100N90', 'W060N90', 'W020N90', & 'E020N90', 'E060N90', 'E100N90', 'E140N90', & 'W180N40', 'W140N40', 'W100N40', 'W060N40', 'W020N40', & 'E020N40', 'E060N40', 'E100N40', 'E140N40', & 'W180S10', 'W140S10', 'W100S10', 'W060S10', 'W020S10', & 'E020S10', 'E060S10', 'E100S10', 'E140S10'/ data tlon /-180.,-140.,-100.,-60.,-20., 20., 60., 100., 140., & -180.,-140.,-100.,-60.,-20., 20., 60., 100., 140., & -180.,-140.,-100.,-60.,-20., 20., 60., 100., 140./ data tlat /90., 90., 90., 90., 90., 90., 90., 90., 90., & 40., 40., 40., 40., 40., 40., 40., 40., 40., & -10.,-10.,-10.,-10.,-10.,-10.,-10.,-10.,-10./ print*, 'Dimensions of each tile:', nxt,'x', nyt print*, 'dlon:', dlo,' dlat:', dla do k=1,nmin print*, 'Processing mineral:',k, cminer(k) do it=1,ntile minf=0 open(31,file=ctile(it)//'.'//cminer(k), form='unformatted', & status='unknown', access='direct',recl=nxt*nyt*4) !! for pgf90 read(31,rec=1) ((minf(i,j),i=1,nxt),j=1,nyt) close(31) print*, 'Writing to ascii file: ', ctile(it),'_',cminer(k),'.txt' open(32,file=ctile(it)//'_'//cminer(k)//'.txt') do j=1,nyt lat=tlat(it)-dla*(j-1)-0.5*dla do i=1, nxt lon=tlon(it)+dlo*(i-1)+0.5*dlo write(32,'2f12.4,f12.2') lon, lat, minf(i,j) enddo enddo close(32) enddo enddo endprogram gminer30