Layout of routine rd_clim
SUBROUTINE RD_CLIM(NCID)
#ifdef DOC
!**** *RDCLIM * - Reading netCDF file containing surface climate fields
! Purpose.
! --------
! initialization surface characteristics
!** Interface.
! ----------
! *CALL* *RDCLIM(NCID)
! Explicit arguments :
! --------------------
! NCID INT NetCDF file code
! Implicit arguments :
! --------------------
! Method.
! -------
! Opens a file called 'surfclim' to read relevant fields
! In the file, fields are assumed to be stored as
! FIELD(LAT,LON)
! or
! FIELD(MONTH,LAT,LON)
!
! Externals.
! ----------
! NETCDF-utilities
! screen output routine MINMAX
! Reference.
! ----------
! Author.
! -------
! Bart vd Hurk, KNMI
! Modifications.
! --------------
! Original : 2000-07-07
! ------------------------------------------------------------------
#endif
......
#include "netcdf.inc"
INTEGER ISTART2(2),ICOUNT2(2)
INTEGER ISTART3(3),ICOUNT3(3)
INTEGER NDIMS(100)
REAL*4,ALLOCATABLE :: ZREAL(:),ZREAL3(:,:)
REAL*8,ALLOCATABLE :: ZREALD(:),ZREAL3D(:,:)
CHARACTER*100 CNAME
CHARACTER*8 CDUM
DATA ISTART2/1,1/
DATA ISTART3/1,1,1/
!* check the dimensions
NIDLAT = NCDID(NCID, 'y', IERR)
NIDLON = NCDID(NCID, 'x', IERR)
NIDMON = NCDID(NCID, 'month', IERR)
CALL NCDINQ(NCID,NIDLAT,CNAME,NILAT,IERR)
CALL NCDINQ(NCID,NIDLON,CNAME,NILON,IERR)
CALL NCDINQ(NCID,NIDMON,CNAME,NIMON,IERR)
IF(NILON.NE.NLON .OR. NILAT.NE.NLAT) THEN
......
ENDIF
!
!* Note the reversal of the order of array storage
!
ICOUNT2(1)=NILON
ICOUNT2(2)=NILAT
ICOUNT3(1)=NILON
ICOUNT3(2)=NILAT
ICOUNT3(3)=12
ALLOCATE (ZREAL(NLALO))
ALLOCATE (ZREALD(NLALO))
!* Read surface climate values
!* -- momentum roughness
NVARID = NCVID(NCID, 'z0m', IERR)
CALL NCVINQ (NCID, NVARID, CNAME, NVARTYP,
+ NVDIMS, NDIMS,NVATTS, IERR)
IF(NVARTYP.EQ.NCFLOAT)THEN
CALL NCVGT(NCID, NVARID, ISTART2, ICOUNT2, ZREAL, IERR)
ZREALD(:)=ZREAL(:)
ELSE
CALL NCVGT(NCID, NVARID, ISTART2, ICOUNT2, ZREALD, IERR)
ENDIF
CALL MINMAX('Z0M',ZREALD,NLON,NLAT,LMASK,NULOUT)
VFZ0F=PACK(ZREALD,LMASK)
!* -- emissivity
.......
!* -- albedo
ALLOCATE (ZREAL3(NLALO,12))
ALLOCATE (ZREAL3D(NLALO,12))
NVARID = NCVID(NCID, 'Malbedo', IERR)
CALL NCVINQ (NCID, NVARID, CNAME, NVARTYP,
+ NVDIMS, NDIMS,NVATTS, IERR)
IF(NVARTYP.EQ.NCFLOAT)THEN
CALL NCVGT(NCID, NVARID, ISTART3, ICOUNT3, ZREAL3, IERR)
ZREAL3D(:,:)=ZREAL3(:,:)
ELSE
CALL NCVGT(NCID, NVARID, ISTART3, ICOUNT3, ZREAL3D, IERR)
ENDIF
DO JMON=1,12
WRITE(CDUM,'(A6,I2.2)')'ALBEDO',JMON
CALL MINMAX(CDUM,ZREAL3D(1,JMON),NLON,NLAT,LMASK,NULOUT)
VCALB(:,JMON)=PACK(ZREAL3D(:,JMON),LMASK)
ENDDO
VFALBF(:)=SUM(VCALB,DIM=2)/12.
CALL MINMAX('AVG ALB',VFALBF,NLON,NLAT,LMASK,NULOUT)
!* -- heat roughness
NVARID = NCVID(NCID, 'z0h', IERR)
...... (etc)
!* -- land sea mask
NVARID = NCVID(NCID, 'landsea', IERR)
...... (etc)
!* -- low vegetation coverage
NVARID = NCVID(NCID, 'cvl', IERR)
...... (etc)
!* -- high vegetation coverage
NVARID = NCVID(NCID, 'cvh', IERR)
...... (etc)
!* -- low vegetation type
NVARID = NCVID(NCID, 'tvl', IERR)
...... (etc)
!* -- high vegetation type
NVARID = NCVID(NCID, 'tvh', IERR)
...... (etc)
!* -- soil type
NVARID = NCVID(NCID, 'sotype', IERR)
...... (etc)
!* -- orographic variance
NVARID = NCVID(NCID, 'varoro', IERR)
...... (etc)
!* -- SST
NVARID = NCVID(NCID, 'sst', IERR)
...... (etc)
!* -- SEA ICE FRACTION
NVARID = NCVID(NCID, 'seaice', IERR)
...... (etc)
!* Check final values
.......
END SUBROUTINE RD_CLIM