c subroutine mkvolinfo(ibeg_iyd,ibeg_day,ibeg_hr,ibeg_min, + iend_iyd,iend_day,iend_hr,iend_min, + idelmin,iendonly,tgcm_version,isech,volinfo) c c Build char*80 volinfo field for mss history files containing info c for the first and last histories on the file (year-day and model time) c and the delta minutes between each history. Also include tgcm version c name and secondary/primary history string. c This char*80 is returned in volinfo, and is written to the mss comment c field by putms when the volume is disposed to mss. The information c is then available via msls -x. c c On input: c ibeg_iyd,ibeg_day,ibeg_hr,ibeg_min = year-day (i5) and model time c of 1st history on the file. c iend_iyd,iend_day,iend_hr,iend_min = year-day (i5) and model time c of last history on the file. c idelmin = time in minutes between each history (e.g. if histories c are hourly, idelmin=60. c tgcm_version = character name of tgcm_version (e.g., "tgcm22") c isech = secondary history flag (if > 0, histories are secondary, c otherwise are primary) c c On output: c character*80 volinfo is defined. c c Example output volinfo: c 96080 80, 0, 0 to 96084 84, 0, 0 by 720 tgcm22 primary c character*80 volinfo ! output character*(*) tgcm_version ! input character*9 htype c if (iendonly.le.0) then ibegiyd = ibeg_iyd ibegday = ibeg_day ibeghr = ibeg_hr ibegmin = ibeg_min else read(volinfo,"(i5,1x,i3,1x,i2,1x,i2)",err=100) + ibegiyd,ibegday,ibeghr,ibegmin goto 101 100 write(6,"('>>> WARNING mkvolinfo: iendonly=',i2, + ' error reading beginning time: input volinfo=',/a)") + iendonly,volinfo ibegiyd = -1 ibegday = -1 ibeghr = -1 ibegmin = -1 stop 'mkvolinfo' 101 continue endif do i=1,80 volinfo(i:i) = ' ' enddo iendiyd = iend_iyd iendday = iend_day iendhr = iend_hr iendmin = iend_min htype = 'primary ' if (isech.gt.0) htype = 'secondary' lenversion = len_trim(tgcm_version) if (lenversion.gt.29) then write(6,"('>>> WARNING mkvolinfo: length of input string', + ' tgcm_version too long=',i3,' (will truncate to 29 chars)')") + lenversion lenversion = 27 endif c c Commas cannot be used in mss comment field because commas are the c mswrite option separator. c For now, colons are not used because they are the default separator c used by msrawinfo (which is called by msallinfo). c write(volinfo,"(i5,' ',i3,' ',i2,' ',i2,' to ', + i5,' ',i3,' ',i2,' ',i2,' by ',i4,' ',a,' ',a)") + ibegiyd, ibegday, ibeghr, ibegmin, + iendiyd, iendday, iendhr, iendmin, idelmin, + tgcm_version(1:lenversion), htype c return end