1 subroutine get_postfilename(fname)
9 use ctlblk_mod,
only : ifhr, me, modelname, ifmin
10 use rqstfld_mod,
only : ritehd, datset, iget
14 character(*),
intent(inout) :: fname
17 integer IHR,KDAT,KENV,KTHR,NDIG
18 CHARACTER*4 RESTHR,BLANK
19 CHARACTER*10 DESCR2,DESCR3
20 character CFHOUR*40,CFORM*40
22 CHARACTER*255 PGBOUT,IPVOUT,D3DOUT
40 CALL getenv(
'COMSP',envar)
41 CALL getenv(
'tmmark',resthr)
42 CALL getenv(
'PGBOUT',pgbout)
43 CALL getenv(
'IPVOUT',ipvout)
44 CALL getenv(
'D3DOUT',d3dout)
45 kdat = index(datset,
' ') -1
46 IF (kdat<=0) kdat = len(datset)
47 kenv = index(envar,
' ') -1
48 IF (kenv<=0) kenv = len(envar)
49 kthr = index(resthr,
' ') -1
50 IF (kthr<=0) kthr = len(resthr)
53 IF(modelname==
'GFS')
THEN
54 IF(d3dout(1:4)/=blank .AND. &
55 ((iget(354)>0).OR.(iget(355)>0).OR. &
56 (iget(356)>0).OR.(iget(357)>0).OR. &
57 (iget(358)>0).OR.(iget(359)>0).OR. &
58 (iget(360)>0).OR.(iget(361)>0).OR. &
59 (iget(362)>0).OR.(iget(363)>0).OR. &
60 (iget(364)>0).OR.(iget(365)>0).OR. &
61 (iget(366)>0).OR.(iget(367)>0).OR. &
62 (iget(368)>0).OR.(iget(369)>0).OR. &
63 (iget(370)>0).OR.(iget(371)>0).OR. &
64 (iget(372)>0).OR.(iget(373)>0).OR. &
65 (iget(374)>0).OR.(iget(375)>0)))
THEN
67 ELSE IF(ipvout(1:4)/=blank .AND. &
68 index(datset(1:kdat),
"IPV")>0 .AND. &
69 ((iget(332)>0).OR.(iget(333)>0).OR. &
70 (iget(334)>0).OR.(iget(335)>0).OR. &
71 (iget(351)>0).OR.(iget(352)>0).OR. &
72 (iget(353)>0).OR.(iget(378)>0)))
THEN
74 ELSE IF(pgbout(1:4)/=blank)
THEN
77 ndig=max(log10(ihr+0.5)+1.,2.)
79 WRITE(cform,
'("(I",I1,".",I1,")")') ndig,ndig
80 WRITE(cfhour,cform) ihr
81 fname = datset(1:kdat) //
'.GrbF'// cfhour
87 ELSEIF (envar(1:4)==blank.AND.resthr(1:4)==blank)
THEN
89 WRITE(descr2,1011) ihr
90 WRITE(descr3,1012) ifmin
91 fname = datset(1:kdat) // trim(descr2) //
'.'// descr3(1:2)
93 ndig=max(log10(ihr+0.5)+1.,2.)
95 WRITE(cform,
'("(I",I1,".",I1,")")') ndig,ndig
96 WRITE(cfhour,cform) ihr
97 fname = datset(1:kdat) //
'.GrbF'// cfhour
104 1011
FORMAT(
'.GrbF',i2.2)
109 ELSEIF(envar(1:4)==blank.AND.resthr(1:4)/=blank)
THEN
111 WRITE(descr3,1012) ifmin
113 WRITE(descr2,1012) ihr
114 fname = datset(1:kdat) // descr2(1:2) //
'.'// descr3(1:2) &
117 WRITE(descr2,1014) ihr
118 fname = datset(1:kdat) // descr2(1:3) //
'.'// descr3(1:2) &
123 WRITE(descr2,1012) ihr
124 fname = datset(1:kdat) // descr2(1:2) //
'.'// resthr
126 WRITE(descr2,1014) ihr
127 fname = datset(1:kdat) // descr2(1:3) //
'.'// resthr
132 WRITE(descr3,1012) ifmin
134 WRITE(descr2,1012) ihr
135 fname = envar(1:kenv) // datset(1:kdat) // descr2(1:2) &
136 //
'.'// descr3(1:2) //
'.'// resthr
138 WRITE(descr2,1014) ihr
139 fname = envar(1:kenv) // datset(1:kdat) // descr2(1:3) &
140 //
'.'// descr3(1:2) //
'.'// resthr
144 WRITE(descr2,1012) ihr
145 fname = envar(1:kenv) // datset(1:kdat) // descr2(1:2) &
150 WRITE(descr2,1014) ihr
151 fname = envar(1:kenv) // datset(1:kdat) // descr2(1:3) &
159 end subroutine get_postfilename