subroutine writeedecklocal(lued,strmid,aymdh,aidlab, + itau,ilat,ilon,iprob,ithres, + ivmax,ibegtau,iendtau) c c This routine writes a forecast probability of RI in the ATCF format. c c This is based from writeaidlocal, but edeck format instead of adeck. It c only handles RI probabilities; other types have different formats. c c Input c lued - 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 itau - Forecast Tau at end of RI calculation (same as iendtau) c ilat - Latitude at ibegtau, lat*10 with deg N pos, deg S neg c ilon - Longitude at ibegtau, lon*10 with 0 to 360 convention c or 0 to 180 for eastern hemisphere, -180 to 0 for western hemisphere c iprob - Probabilty of RI c ithres - Threshold defined for RI c ivmax - Max wind at ibegtau (kt) c ibegtau - Forecast Tau for start of RI calculation c iendtau - Forecast Tau for end of RI calculation c c Modified Jan 2023 (KM) for NCO specifications c IMPLICIT NONE c c ++ Passed variables character(8), intent(in) :: strmid character(10), intent(in) :: aymdh character(4), intent(in) :: aidlab integer, intent(in) :: lued, ilat, ilon integer, intent(in) :: iprob, ithres, ivmax integer, intent(in) :: itau, ibegtau, iendtau c c ++ Local variables character(3) :: cdum character(2) :: caid character(1) :: lathem,lonhem integer :: ilatt,ilont,ivmaxf c if (iprob .eq. 999) return c if (ivmax .le. 0 .or. ivmax .gt. 200) return ivmaxf = ivmax + ithres c c Convert latitude ilatt = iabs(ilat) if (ilat .lt. 0) then lathem = 'S' else lathem = 'N' endif c c Convert longitude if (ilon .lt. 0 ) then ilont = iabs(ilon) lonhem = 'W' elseif (ilon .ge. 0 .and. ilon .le. 1800) then ilont = ilon lonhem = 'E' elseif (ilon .gt. 1800 .and. ilon .le. 3600) then ilont = 3600 - ilon lonhem = 'W' else ilont = ilon-3600 lonhem = 'E' endif c c Put deg W long west of dateline back in deg E if (lonhem .eq. 'W' .and. ilont .gt. 1800) then lonhem = 'E' ilont = 3600 - ilont endif c caid = 'RI' cdum = ' ' c c Write out edeck line write(lued,200) strmid(1:2),strmid(3:4),aymdh,caid,aidlab, + itau,ilatt,lathem,ilont,lonhem, + iprob,ithres,ivmaxf,cdum, + ibegtau,iendtau 200 format(a2,', ',a2,', ',a10,', ',a2,', ',a4,', ', + i3,', ',i3,a1,', ',i4,a1,', ', + i3,', ',i3,', ',i3,', ',a3,', ', + i3,', ',i3) c return end