@@ -883,12 +883,18 @@ subroutine tracker (inp,maxstorm,numtcv,ifhmax,trkrinfo,ncfile
883883 v = -9999.0
884884 slp = -9999.0
885885 tmean = -9999.0
886- sst = -9999.0
887- q850 = -9999.0
888- rh = -9999.0
889- spfh = -9999.0
890- temperature = -9999.0
891- omega500 = -9999.0
886+
887+ if (sstflag == 'y' .or. sstflag == 'Y') then
888+ sst = -9999.0
889+ endif
890+
891+ if (genflag == 'y' .or. genflag == 'Y') then
892+ q850 = -9999.0
893+ rh = -9999.0
894+ spfh = -9999.0
895+ temperature = -9999.0
896+ omega500 = -9999.0
897+ endif
892898
893899 readflag = .FALSE.
894900 readgenflag = .FALSE.
@@ -4337,7 +4343,9 @@ subroutine open_grib_files (inp,lugb,lugi,gfilename,ifilename
43374343 logical(1) output_file_open
43384344 logical(1) file_open
43394345 logical(4) file_open4,file_open5
4340- character fnameg*7,fnamei*7,fnameo*7
4346+ character fnameg*255,fnamei*255,fnameo*255
4347+ character enameb*16,enamei*16,enameo*16
4348+ character lugb_c*16,lugi_c*16,lout_c*16
43414349 character fname_mask_g*7,fname_mask_i*7
43424350 character opening_mask*1
43434351 character(*) gfilename,ifilename
@@ -4351,20 +4359,41 @@ subroutine open_grib_files (inp,lugb,lugi,gfilename,ifilename
43514359 iooret = 0
43524360
43534361 if (inp%file_seq == 'onebig') then
4354- fnameg(1:5) = "fort."
4355- fnamei(1:5) = "fort."
4356- write(fnameg(6:7),'(I2)') lugb
4357- write(fnamei(6:7),'(I2)') lugi
4362+
4363+ write(lugb_c,'(I2.2)')lugb
4364+ write(lugi_c,'(I2.2)')lugi
4365+ enameb='FORT'//lugb_c
4366+ enamei='FORT'//lugi_c
4367+ call get_environment_variable(trim(enameb), fnameg
4368+ & , status=igoret)
4369+ call get_environment_variable(trim(enamei), fnamei
4370+ & , status=iioret)
4371+
4372+ if (igoret /= 0 .or. iioret /= 0) then
4373+ fnameg(1:5) = "fort."
4374+ fnamei(1:5) = "fort."
4375+ write(fnameg(6:7),'(I2)') lugb
4376+ write(fnamei(6:7),'(I2)') lugi
4377+ endif
4378+
43584379 call baopenr (lugb,fnameg,igoret)
43594380 call baopenr (lugi,fnamei,iioret)
4381+
43604382 if (opening_mask /= 'y') then
43614383 ! If this is a regular call to open_grib_files (i.e., not
43624384 ! for opening the land-sea mask file), then open the
43634385 ! output grib file unit.
4364- fnameo(1:5) = "fort."
4365- write(fnameo(6:7),'(I2)') lout
4366- call baopenw (lout,fnameo,iooret)
4386+ write(lout_c,'(I2.2)')lout
4387+ enameo='FORT'//lout_c
4388+ call get_environment_variable(trim(enameo), fnameo
4389+ & , status=iooret)
4390+ if (iooret /= 0) then
4391+ fnameo(1:5) = "fort."
4392+ write(fnameo(6:7),'(I2)') lout
4393+ call baopenw (lout,fnameo,iooret)
4394+ endif
43674395 endif
4396+
43684397 else
43694398
43704399 if (opening_mask == 'y') then
@@ -4375,7 +4404,9 @@ subroutine open_grib_files (inp,lugb,lugi,gfilename,ifilename
43754404 print *,'!!! inp%file_seq flag indicates that this is not'
43764405 print *,'!!! a onebig file, and as of yet, the functionality'
43774406 print *,'!!! for an additional land-sea mask file can only'
4378- print *,'!!! be used for onebig file applications.'
4407+ print *,'!!! be used for onebig file applications. As an'
4408+ print *,'!!! alternative, you can include a land-sea mask'
4409+ print *,'!!! record within each individual file.'
43794410 stop 95
43804411 endif
43814412
@@ -4413,7 +4444,7 @@ subroutine open_grib_files (inp,lugb,lugi,gfilename,ifilename
44134444 inquire (unit=lugb, opened=file_open)
44144445 if (file_open) then
44154446 print *,'TEST open_grib_files, unit lugb= ',lugb
4416- & ,' is OPEN'
4447+ & ,' is OPEN'
44174448 else
44184449 print *,'TEST open_grib_files, unit lugb= ',lugb
44194450 & ,' is CLOSED'
@@ -4476,6 +4507,7 @@ subroutine open_grib_files (inp,lugb,lugi,gfilename,ifilename
44764507
44774508 iret = 113
44784509 return
4510+
44794511 endif
44804512
44814513 return
@@ -12979,8 +13011,8 @@ subroutine output_atcf_gen (outlon,outlat,inp,ist
1297913011 & ,'_',a3,', ',i10.10,', 03, ',a4,', ',i3.3,', ',i3,a1
1298013012 & ,', ',i4,a1,', ',i3,', ',i4,', ',a12,4(', ',i4.4)
1298113013 & ,', ',3(i4,', '),3(i6,', '),a1,2(', ',i4),4(', ',i6)
12982- & ,', SHR82, ',i4,', ',i3,', ',i5,3(', ',i4),2( ', ',i9)
12983- & ,3(', ',i4))
13014+ & ,', SHR82, ',i4,', ',i3,', ',i5,3(', ',i4),', ',i9
13015+ & ,', ',i11, 3(', ',i4))
1298413016
1298513017c bug fix for IBM: flush the output stream so it actually writes
1298613018 flush(66)
@@ -20871,6 +20903,8 @@ subroutine find_maxmin (imax,jmax,dx,dy,cparm,fxy,maxmin,ist
2087120903 print *,' The immediately following lines for ilonfix, jlatfix,'
2087220904 print *,' ibeg, jbeg, iend and jend likely contain junk values'
2087320905 print *,' since we have not yet called get_ij_bounds....'
20906+ ilonfix = -9999
20907+ jlatfix = -9999
2087420908 print *,' ilonfix= ',ilonfix,' jlatfix= ',jlatfix
2087520909 print *,' ibeg= ',ibeg
2087620910 print *,' jbeg= ',jbeg
@@ -28977,7 +29011,7 @@ subroutine getgridinfo_grib (imax,jmax,ifh,dx,dy,lugb,lugi
2897729011 print *,' GRID MIN & MAX LON '
2897829012 print *,' (MODIFIED FOR GM WRAPPING):'
2897929013 print *,' glonmin (same as original)= ',glonmin
28980- print *,' glonmax (modified)= ',glonmax
29014+ print *,' glonmax (modified)= ',glonmax+360.
2898129015 print *,' '
2898229016 endif
2898329017 glonmax = glonmax + 360.
0 commit comments