program readsst C$$$ MAIN PROGRAM DOCUMENTATION BLOCK C C MAIN PROGRAM: GFDC_GETSST C PRGMMR: MARCHOK ORG: NP22 DATE: 2001-03-30 C C ABSTRACT: This program extracts the sst and land-sea mask data from C the AVN sfcanl and siganl files, and then writes that data back out C into a regular flat file, to be used in a later executable. C C PROGRAM HISTORY LOG: C 01-03-20 Biju Thomas original writing C 12/09/2016: Bin Liu, NOAA/NCEP/EMC C Add the capability to read GFS nemsio format SST C C INPUT FILES: C UNIT 11 AVN sfcanl file C UNIT 12 AVN siganl file C C OUTPUT FILES: C UNIT 74 Output file containing AVN's sst data C UNIT 77 Output file containing AVN's land-sea mask data C UNIT 23 Output file containing lon lat dims and coordiantes C C ATTRIBUTES: C LANGUAGE: FORTRAN 77 C C$$$ c use sfcio_module use getsst_grib type(sfcio_head):: head type(sfcio_data):: data integer idate(4), ixdate(4) integer, parameter :: iosfc=11,iosig=12 real ext(245) real(4) fhour_4byte,ext_4byte(245) real xhour data idrt/4/ integer narg, iarg character(256) arg integer gfssst_type ! 1: grib2 format GFS SST ! 2: nemsio format GFS SST ! 3: sigio format GFS SST c Get commandline arguments if any narg=iargc() if (narg .eq. 0) then c No input argument, assumming gfssst_type=3, sigio format gfssst_type=3 else if (narg .ge. 1) then call getarg(1,arg) read(arg,'(I)') gfssst_type endif print*, 'gfssst_type=', gfssst_type c grib2 format GFS SST if (gfssst_type .eq. 1) then call getsst_grib2 endif c nemsio format GFS SST if (gfssst_type .eq. 2) then call getsst_nemsio('fort.11') endif c------------------------------------------------------------------------------ c sigio format GFS SST if (gfssst_type .eq. 3) then c call w3tagb('GFDC_GETSST',2001,0089,0074,'NP22') c read(11) c read(11) xhour, ixdate, im, jm, iver c print *,'From gfdlgg sfcanl read, xhour= ',xhour c print *,'From gfdlgg sfcanl read, ixdate= ',ixdate c print *,'From gfdlgg sfcanl read, im= ',im,' jm= ',jm c print *,'From gfdlgg sfcanl read, iver= ',iver c rewind(11) call sfcio_srohdc (iosfc,'fort.11',head,data,iret) if (iret /= 0) then print *,' ' print *,'ERROR in getsst reading sfcanl header, ' print *,' error code = ',iret print *,' ' stop endif print *,'From gfdlgg sfcanl read, xhour= ',head%fhour print *,'From gfdlgg sfcanl read, ixdate= ',head%idate print *,'From gfdlgg sfcanl read, im= ',head%lonb,' jm= ' & ,head%latb print *,'From gfdlgg sfcanl read, iver= ',head%ivs im = head%lonb jm = head%latb idate = head%idate read(iosig) read(iosig) fhour_4byte,idate,ext_4byte fhour = fhour_4byte ext = ext_4byte jcap=ext(202) nc=(jcap+1)*(jcap+2) print *, 'idate,idrt,im,jm', idate,idrt,im,jm print *, 'jcap,nc', jcap,nc print 10, fhour,idate,im,jm,ext 10 format(1x,'from spec file fhour,idate,si,sl ', a F10.3,6I10/(10X,10F11.7) ) call getsm(idrt,im,jm,jcap,nc) call w3tage('GFDC_GETSST') c jm1=jm/2 call avnglatlon(im,jm,jm1) endif c endif of sigio format GFS SST c------------------------------------------------------------------------------ stop end