1 subroutine assignnemsiovar(im,jsta,jend,jsta_2l,jend_2u,l,nrec, &
2 fldsize,spval,tmp,recname,reclevtyp, &
3 reclev,VarName,VcoordName,buf)
5 use ctlblk_mod,
only: me
9 integer,
intent(in) :: im,jsta,jend,jsta_2l,jend_2u,l,nrec,fldsize
10 integer,
intent(in) :: reclev(nrec)
11 real,
intent(in) :: spval,tmp(fldsize*nrec)
12 character(*),
intent(in) :: recname(nrec)
13 character(*),
intent(in) :: reclevtyp(nrec)
14 character(*),
intent(in) :: VarName,VcoordName
15 real,
intent(out) :: buf(im,jsta_2l:jend_2u)
16 integer :: fldst,recn,js,j,i
18 call getrecn(recname,reclevtyp,reclev,nrec,varname,vcoordname,l,recn)
20 fldst = (recn-1)*fldsize
24 buf(i,j) = tmp(i+js+fldst)
28 if(jsta == 1 .and. me == 0) print*,
'fail to read ', &
29 varname,vcoordname,l ,
' assign missing value'
41 SUBROUTINE getrecn(recname,reclevtyp,reclev,nrec,fldname, &
42 fldlevtyp,fldlev,recn)
48 use ctlblk_mod,
only: me
51 integer,
intent(in) :: nrec
52 character(*),
intent(in) :: recname(nrec)
53 character(*),
intent(in) :: reclevtyp(nrec)
54 integer,
intent(in) :: reclev(nrec)
55 character(*),
intent(in) :: fldname
56 character(*),
intent(in) :: fldlevtyp
57 integer,
intent(in) :: fldlev
58 integer,
intent(out) :: recn
64 if(trim(recname(i)) == trim(fldname) .and. &
65 trim(reclevtyp(i)) == trim(fldlevtyp) .and. &
66 reclev(i) == fldlev)
then
72 if(recn == 0 .and. me == 0) print *,
'WARNING: field ', &
73 trim(fldname),
' ', trim(fldlevtyp),
' ', &
74 fldlev,
' is not in the nemsio file!'
78 END SUBROUTINE getrecn