subroutine writeaidlocal(luat,strmid,aymdh,aidlab, + ilat,ilon,ivmax,stype,isgnlon,mft) c c This routine writes a forecast aid in the ATCF format. c It is normally assumed that the lat,lon,vmax are in 6 hr intervals c and that all times should be written, but that can be changed through c the variables idelt and incp. c c Modified Jan 2023 (KM) for NCO specifications c c ++ Passed variables character *3 rdum character *4 aidlab character *4 stype(0:mft) character *8 strmid character *10 aymdh c dimension ilat(0:mft),ilon(0:mft),ivmax(0:mft) c c ++ Local variables parameter (mftt=100) character *1 lathem(0:mftt),lonhem(0:mftt) character *4 stypet(0:mftt) dimension ilatt(0:mftt),ilont(0:mftt) c c Specify the time interval of the model forecast to print (idelt) c and the interval for printing the output. For example, if the c model forecast is every 6 hr, but you only want to print forecast c at 12 h intervals, set idelt=6 and incp=2 c idelt = 12 incp = 1 c do i=0,mft if (ivmax(i) .le. 0 .or. ivmax(i) .gt. 200) exit c c Convert latitude ilatt(i) = iabs(ilat(i)) if (ilat(i) .lt. 0) then lathem(i) = 'S' else lathem(i) = 'N' endif c c Convert longitude if (ilon(i) .lt. 0) then ilont(i) = iabs(ilon(i)) lonhem(i) = 'W' elseif (ilon(i) .ge. 0 .and. ilon(i) .le. 1800) then ilont(i) = ilon(i) lonhem(i) = 'E' elseif (ilon(i) .gt. 1800 .and. ilon(i) .le. 3600) then ilont(i) = 3600 - ilon(i) lonhem(i) = 'W' else ilont(i) = ilon(i)-3600 lonhem(i) = 'E' endif c c Convert storm type if (stype(i) .eq. 'EXTP') then stypet(i) = 'EX' elseif (stype(i) .eq. 'TROP') then if (ivmax(i) .lt. 34) then stypet(i) = 'TD' elseif (ivmax(i) .ge. 34 .and. ivmax(i) .lt. 64) then stypet(i) = 'TS' else stypet(i) = 'HU' endif elseif (stype(i) .eq. 'SUBT') then if (ivmax(i) .lt. 34) then stypet(i) = 'SD' elseif (ivmax(i) .ge. 34 .and. ivmax(i) .lt. 64) then stypet(i) = 'SS' else stypet(i) = 'SH' endif else stypet(i) = ' ' endif enddo c iaid = 3 ipres = 0 idum = 0 rdum = ' ' c do i=0,mft,incp if (ivmax(i) .le. 0 .or. ivmax(i) .gt. 200) exit c write(luat,200) strmid(1:2),strmid(3:4),aymdh,iaid,aidlab, + i*idelt,ilatt(i),lathem(i),ilont(i),lonhem(i), + ivmax(i),ipres,stypet(i), + idum,rdum,idum,idum,idum,idum 200 format(a2,', ',a2,', ',a10,', ',i2.2,', ',a4,', ', + i3,', ',i3,a1,', ',i4,a1,', ', + i3,', ',i4,', ',a2,', ', + i3,', ',a3,', ',i4,', ',i4,', ',i4,', ',i4,', ') enddo c return end