#!/bin/csh set IO = `basename $0` # #------------------------------------------------------- Fortran Code --------- cat >! ${IO}.f << FINEF90 parameter (nsec=72,ixm=100,jxm=100,nloc=4,maxdat=6000) real u(ixm,jxm,25),v(ixm,jxm,25),lat(ixm,jxm),lon(ixm,jxm) character file*80,title*80,mtitle*80,loc(nloc)*40 real rq(nsec),rf(nsec) real xlat(nloc),xlon(nloc),ux(maxdat,nloc),vx(maxdat,nloc) data loc /'Pescara','L''Aquila','Chieti','Teramo'/ data xlat /42.46361,42.35583,42.35111,42.65861/ data xlon /14.21389,13.39556,14.16833,13.70389/ do iloc=1,nloc ndat=0 do iy=2004,2008 call openmuseodb(91,'mm5ugr',iy*10+3) call openmuseodb(92,'mm5vgr',iy*10+3) do iday=1,31 ; read (91) ; read (92) ; enddo ! Skip January do iday=32,59 ! Read February read (91) lix1,ljx1,lkx1,nh, 2 ((lat(ii,jj),ii=1,lix1),jj=1,ljx1), 3 ((lon(ii,jj),ii=1,lix1),jj=1,ljx1), 4 (((u(ii,jj,n),ii=1,lix1),jj=1,ljx1),n=1,nh) read (92) lix2,ljx2,lkx2,nh, 2 ((lat(ii,jj),ii=1,lix2),jj=1,ljx2), 3 ((lon(ii,jj),ii=1,lix2),jj=1,ljx2), 4 (((v(ii,jj,n),ii=1,lix2),jj=1,ljx2),n=1,nh) if (lix1.eq.lix2.and.lix2.gt.0) then do ih=1,24 ndat=ndat+1 vx(ndat,iloc)=ginterp(v(1,1,ih),lat,lon,ixm,jxm,xlat(iloc),xlon(iloc)) ux(ndat,iloc)=ginterp(u(1,1,ih),lat,lon,ixm,jxm,xlat(iloc),xlon(iloc)) enddo endif enddo close(91) close(92) enddo ; enddo call mvsetflags('Ogni quanti colori',2.0) mtitle='MM5 simulation 2004-2008 Surface Wind (m/sec)' do iloc=1,nloc do i=1,nsec ; rf(i)=0.0 ; rq(i)=0.0 ; enddo do i=1,ndat call windrosebook(ux(i,iloc),vx(i,iloc),rf,rq,nsec) enddo call windroseplot(rq,rf,nsec) write(title,'(a)') loc(iloc)(1:lenstr(loc(iloc)))//' - February' call scrivisulplot(title,0.5,0.94) call displayexample('$IO',mtitle,' ') enddo end FINEF90 set LOGF = "true" set LOGF = "false" goto chkplatf retchkplatf: if ( -f $IO.exe ) /bin/rm $IO.exe f90 $OPTION -o $IO.exe $IO.f $JETNET $MVLIB $NCARLIB $X11LIB >&! fortran.log if ( ! -x $IO.exe ) then echo " ${IO}: cannot find $IO.exe " echo " This is the log for compilation:" echo "******************************************************************" cat fortran.log echo "******************************************************************" goto CANCELLA else if ( $LOGF == "true" ) then cat fortran.log echo " Running $IO.exe" endif ./$IO.exe CANCELLA: if ( $LOGF == "true" ) echo " Removing all tmp files." foreach FILE ( $IO.exe gmeta core $IO.log fortran.log \ gifmerge.log ${IO}common.f CONDRV.SCR tbl.tmp ) if ( -f $FILE) /bin/rm $FILE end if ( $LOGF == "true" ) echo " Done." exit chkplatf: set CHKSEL = "${?IO}" if ( $CHKSEL == 0 ) set IO = `basename $0` set CHKSEL = "${?SELCOMP}" if ( $CHKSEL == 0 ) set SELCOMP = "nocomp" set X11LIB = " -lX11 -lm " if ( $SELCOMP == "nocomp" ) then else if ( $SELCOMP == "pgf90" ) then if ( ! -X ${SELCOMP} ) then echo " ${IO}: ${SELCOMP} non available on this system. Exiting..." exit endif alias f90 pgf90 ; set COMP = "pgf90" set OPTION = '-silent -Mextend -byteswapio' set IPLATF = 5 goto retchkplatf else if ( $SELCOMP == "ifort" ) then if ( ! -X ${SELCOMP} ) then echo " ${IO}: ${SELCOMP} non available on this system. Exiting..." exit endif alias f90 ifort ; set COMP = "ifort" set OPTION = '-O2 -extend-source -convert big_endian' set IPLATF = 5 goto retchkplatf else if ( $SELCOMP == "gfortran" ) then if ( ! -X ${SELCOMP} ) then echo " ${IO}: ${SELCOMP} non available on this system. Exiting..." exit endif alias f90 gfortran ; set COMP = "gfortran" set OPTION = '-ffixed-line-length-132 -fconvert=big-endian -w -Wno-tabs -O2' set IPLATF = 5 goto retchkplatf else echo " ${IO}: compiler ${SELCOMP} not available on this machine, exiting..." exit endif set COMP = "f90" if ( `uname -a | grep alpha | wc -l` > 0 ) then set OPTION = ' -convert big_endian -extend_source' set IPLATF = 1 else if ( `uname -a | grep SunOS | wc -l` > 0 ) then set OPTION = ' -silent -e' # -silent is unknown for f90 set OPTION = ' -e' set IPLATF = 2 else if ( `uname -a | grep IRIX64 | wc -l` > 0 ) then # set OPTION = ' -n32 -pfa -mpio -mp -Ofast ' set OPTION = ' -n32 -Ofast -extend_source' set IPLATF = 3 else if ( `uname -a | grep AIX | wc -l` > 0 ) then set OPTION = ' -q64 ' set AROPT = ' -X 64 ' set IPLATF = 4 echo " Preprocessing source files for IBM AIX Platform." ./ibmsources set FILES = `ls *.f` foreach FILE ( $FILES ) ./ibmsources.exe $FILE end /bin/rm ./ibmsources.exe alias f90 xlf set COMP = "xlf" else if ( `uname -a | grep Linux | wc -l` > 0 ) then if ( -X gfortran ) then alias f90 gfortran ; set COMP = "gfortran" set OPTION = \ ' -ffixed-line-length-132 -fconvert=big-endian -w -Wno-tabs -O2' # set NOLTIME = 'true' else if ( -X ifort ) then alias f90 ifort ; set COMP = "ifort" set OPTION = ' -O2 -extend-source -convert big_endian' else if ( -X pgf90 ) then alias f90 pgf90 ; set COMP = "pgf90" set OPTION = ' -silent -Mextend -byteswapio ' endif set IPLATF = 5 else echo " Unknown HW/SW Platform. Exiting ..." exit endif # Alla ricerca delle ncarlib set NCARLIB = ' ' foreach JDIR ( /usr/lib /usr/local/lib /usr/local/ncarg /usr/local/ncarg/lib \ $HOME/../verdecch/ncarg/lib/ $HOME/ncarg $HOME/ncarg/lib \ ./ncarg ./ncarg/lib ) if ( -f $JDIR/libncarg.a ) then set NCARLIB = " -L$JDIR -lncarg -lncarg_gks -lncarg_c " setenv NCARG_ROOT $JDIR endif end # Alla ricerca delle mvlib set MVLIB = " " if ( -f /usr/local/lib/libmv.a ) set MVLIB = " -L/usr/local/lib -lmvgraf -lncaruti -lmv" if ( -f ./libmv.a ) set MVLIB = " -L. -lmvgraf -lncaruti -lmv" if ( -f /usr/local/ncarg/lib/libmv.a ) set MVLIB = " -L/usr/local/ncarg/lib -lmvgraf -lncaruti -lmv" if ( -f $HOME/../verdecch//mvlib/lib/$IPLATF/libmv.a ) set MVLIB = " -L$HOME/../verdecch//mvlib/lib/$IPLATF/ -lmvgraf -lncaruti -lmv" if ( -f $HOME/mvlib/lib/$IPLATF/libmv.a ) set MVLIB = " -L$HOME/mvlib/lib/$IPLATF/ -lmvgraf -lncaruti -lmv" if ( -f ./libchym.a ) set MVLIB = " -L. -lchym " set JETNET = ' ' foreach JDIR ( $HOME/../verdecch/mvlib/lib/$IPLATF /usr/local/lib \ /usr/lib $HOME/mvlib/lib/$IPLATF ) if ( -f $JDIR/libjetnet20.a ) set JETNET = " -L$JDIR -ljetnet20" if ( -f $JDIR/jetnet20.a ) set JETNET = " $JDIR/jetnet20.a" end goto retchkplatf