From af6346497abe1d05d408c8c2b819427120a22961 Mon Sep 17 00:00:00 2001 From: "fanglin.yang" Date: Tue, 28 Apr 2020 18:18:44 +0000 Subject: [PATCH] modified: qctropcy.f by Qingfu Liu A bug was found that the history files (syndat_stmcat , syndat_stmcat.scr) save the first and last storm ID used. If the FORTRAN code finds that the storm ID has been used in the current hurricane season, the code will change the storm ID by adding 1 to the original storm ID. The fix is to skip the change of the storm ID. See also https://github.com/NOAA-EMC/global-workflow/issues/63 --- sorc/syndat_qctropcy.fd/qctropcy.f | 82 +++++------------------------- 1 file changed, 14 insertions(+), 68 deletions(-) diff --git a/sorc/syndat_qctropcy.fd/qctropcy.f b/sorc/syndat_qctropcy.fd/qctropcy.f index acb117d099..f0fae79aa0 100755 --- a/sorc/syndat_qctropcy.fd/qctropcy.f +++ b/sorc/syndat_qctropcy.fd/qctropcy.f @@ -4237,6 +4237,8 @@ SUBROUTINE RCNCIL(IUNTCA,IUNTCN,IUNTAL,NTEST,NOKAY,NBAD,MAXREC, c record with only one observing rsmc. It must also be entered int c the alias file. + istidn=0 ! Qingfu added to skip the changes of storm ID number + if(istidn .eq. 1) then if(rsmcz(1:1) .eq. '!') then @@ -11989,41 +11991,13 @@ SUBROUTINE OFILE0(IUNTOP,NFILMX,NFTOT,FILNAM) IF(CACCES(NF) .NE. 'DIRECT') THEN if(cpos(nf) .eq. ' ') then - if (cstat(nf).eq.'OLD') then - OPEN(UNIT=IUNIT(NF),FORM=cform(nf),STATUS='OLD', - 1 ACCESS=cacces(nf),FILE=FILNAM(NF)(1:LENGTH), - 2 ERR=95,IOSTAT=IOS) - elseif (cstat(nf).eq.'NEW') then - OPEN(UNIT=IUNIT(NF),FORM=cform(nf),STATUS='NEW', - 1 ACCESS=cacces(nf),FILE=FILNAM(NF)(1:LENGTH), - 2 ERR=95,IOSTAT=IOS) - elseif (cstat(nf).eq.'UNKNOWN') then - OPEN(UNIT=IUNIT(NF),FORM=cform(nf),STATUS='UNKNOWN', - 1 ACCESS=cacces(nf),FILE=FILNAM(NF)(1:LENGTH), - 2 ERR=95,IOSTAT=IOS) - else - OPEN(UNIT=IUNIT(NF),FORM=cform(nf),STATUS=cstat(nf), - 1 ACCESS=cacces(nf), - 2 ERR=95,IOSTAT=IOS) - endif + OPEN(UNIT=IUNIT(NF),FORM=cform(nf),STATUS=cstat(nf), + 1 ACCESS=cacces(nf),FILE=FILNAM(NF)(1:LENGTH), + 2 ERR=95,IOSTAT=IOS) else - if (cstat(nf).eq.'OLD') then - open(unit=iunit(nf),form=cform(nf),status='OLD', - 1 access=cacces(nf),position=cpos(nf), - 2 file=filnam(nf)(1:length),err=95,iostat=ios) - elseif (cstat(nf).eq.'NEW') then - open(unit=iunit(nf),form=cform(nf),status='NEW', - 1 access=cacces(nf),position=cpos(nf), - 2 file=filnam(nf)(1:length),err=95,iostat=ios) - elseif (cstat(nf).eq.'UNKNOWN') then - open(unit=iunit(nf),form=cform(nf),status='UNKNOWN', - 1 access=cacces(nf),position=cpos(nf), - 2 file=filnam(nf)(1:length),err=95,iostat=ios) - else - open(unit=iunit(nf),form=cform(nf),status=cstat(nf), - 1 access=cacces(nf),position=cpos(nf), - 2 err=95,iostat=ios) - endif + open(unit=iunit(nf),form=cform(nf),status=cstat(nf), + 1 access=cacces(nf),position=cpos(nf), + 2 file=filnam(nf)(1:length),err=95,iostat=ios) endif ELSE read(filnam(nf)(length+2:length+2+idgmax-1),37) lrec @@ -12031,41 +12005,13 @@ SUBROUTINE OFILE0(IUNTOP,NFILMX,NFTOT,FILNAM) write(6,39) lrec 39 format('...Direct access record length:',i7,'...') if(cpos(nf) .eq. ' ') then - if (cstat(nf).eq.'OLD') then - OPEN(UNIT=IUNIT(NF),FORM=CFORM(NF),STATUS='OLD', - 1 ACCESS=CACCES(NF),FILE=FILNAM(NF)(1:LENGTH), - 2 ERR=95,IOSTAT=IOS,RECL=lrec) - elseif (cstat(nf).eq.'NEW') then - OPEN(UNIT=IUNIT(NF),FORM=CFORM(NF),STATUS='NEW', - 1 ACCESS=CACCES(NF),FILE=FILNAM(NF)(1:LENGTH), - 2 ERR=95,IOSTAT=IOS,RECL=lrec) - elseif (cstat(nf).eq.'UNKNOWN') then - OPEN(UNIT=IUNIT(NF),FORM=CFORM(NF),STATUS='UNKNOWN', - 1 ACCESS=CACCES(NF),FILE=FILNAM(NF)(1:LENGTH), - 2 ERR=95,IOSTAT=IOS,RECL=lrec) - else - OPEN(UNIT=IUNIT(NF),FORM=CFORM(NF),STATUS=CSTAT(NF), - 1 ACCESS=CACCES(NF), - 2 ERR=95,IOSTAT=IOS,RECL=lrec) - endif + OPEN(UNIT=IUNIT(NF),FORM=CFORM(NF),STATUS=CSTAT(NF), + 1 ACCESS=CACCES(NF),FILE=FILNAM(NF)(1:LENGTH), + 2 ERR=95,IOSTAT=IOS,RECL=lrec) else - if (cstat(nf).eq.'OLD') then - open(unit=iunit(nf),form=cform(nf),status='OLD', - 1 access=cacces(nf),file=filnam(nf)(1:length), - 2 position=cpos(nf),err=95,iostat=ios,recl=lrec) - elseif (cstat(nf).eq.'NEW') then - open(unit=iunit(nf),form=cform(nf),status='NEW', - 1 access=cacces(nf),file=filnam(nf)(1:length), - 2 position=cpos(nf),err=95,iostat=ios,recl=lrec) - elseif (cstat(nf).eq.'UNKNOWN') then - open(unit=iunit(nf),form=cform(nf),status='UNKNOWN', - 1 access=cacces(nf),file=filnam(nf)(1:length), - 2 position=cpos(nf),err=95,iostat=ios,recl=lrec) - else - open(unit=iunit(nf),form=cform(nf),status=cstat(nf), - 1 access=cacces(nf), - 2 position=cpos(nf),err=95,iostat=ios,recl=lrec) - endif + open(unit=iunit(nf),form=cform(nf),status=cstat(nf), + 1 access=cacces(nf),file=filnam(nf)(1:length), + 2 position=cpos(nf),err=95,iostat=ios,recl=lrec) endif ENDIF ENDDO