subroutine writeaidlocal2(luat,strmid,aymdh,aidlab, + ilat,ilon,ivmax,stype,itime,mft,minc) c c This routine writes a forecast aid in the ATCF format. c c This is a more general version of writeaidlocal, where the c data is not assumed to be at 6 hr intervales. Instead, the c forecast time array (itime) is provided as a calling argument. c c Modified Jan 2023 (KM) for NCO specifications c c Input c luat - unit number to write to (assumes file is already open) c strmid - ATCF Storm ID, such as AL072012 c aymdh - Date/Time group of t=0, such as 2011082706 c aidlab - Model label, such as AVNO c ilat - Latitude array, lat*10 with deg N pos, deg S neg c ilon - Longitude arrya, lon*10 with 0 to 360 convention c or 0 to 180 for eastern hemisphere, -180 to 0 for western hemisphere c ivmax - Max wind array (kt) c Storm type - TROP, EXTP or SUBT. Can also include blanks to leave this out c itime - Time values (hr) c mft - No of times to print c minc - Increment to print (minc=1 for all, minc=2 for every other time, etc) 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),itime(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 Check minc value if (minc .le. 0) minc = 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 Put deg W long west of dateline back in deg E if (lonhem(i) .eq. 'W' .and. ilont(i) .gt. 1800) then lonhem(i) = 'E' ilont(i) = 3600 - ilont(i) 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,minc if (ivmax(i) .le. 0 .or. ivmax(i) .gt. 200) exit c write(luat,200) strmid(1:2),strmid(3:4),aymdh,iaid,aidlab, + itime(i),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