爱气象,爱气象家园! 

气象家园

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
楼主: renjia

有人知道adp_to_little-r.csh 怎么用吗?

[复制链接]
 楼主| 发表于 2014-8-29 11:22:41 | 显示全部楼层
longlivehj 发表于 2014-8-29 11:09
ifort -c -FR -convert big_endiangetsfcobs_hcl.f90
好像少了个空格似的。能把makefile文件发上来一下 ...

谢谢,好的,多谢帮忙
#        upa obs makefile

.IGNORE:

SHELL        =        /bin/sh
.SUFFIXES:        .F90 .f90 .c .i .o

.f90.o:
                $(FC) -c $(FCFLAGS)$*.f90   
.F90.o:
                $(FC) -c $(FCFLAGS) -D$(MACH)$*.F90
.c.o:
                $(CC) -c $(CFLAGS) -D$(MACH) -D$(WLENGTH) $<

MAKE        =        make
OBJS        =        adp_module.o cio.o conv_adp_r.o gbytesys.o manadp.o \
                proupr.o sigadp.o wppadp.o wzzadp.o adp_upa.o
RM        =        /bin/rm -f

default:
        uname -a > .tmpfile
        grep CRAY .tmpfile ; \
        if [ $$? = 0 ]; then echo "Compiling for CRAY" ;                \
                $(MAKE) target                                          \
                "MACH           =       CRAY"                           \
                "WLENGTH        =       BIT64"                          \
                "FC             =       f90"                            \
                "FCFLAGS        =       -f free"                        \
                "CC             =       cc"                             \
                "CFLAGS         =       "                               \
                "LDOPTIONS      =       -Wl'-i CRAY.LONG.LINES' "       \
                "LIBS           =       "                             ; \
        else \
        grep OSF .tmpfile ; \
        if [ $$? = 0 ]; then echo "Compiling for Compaq" ;              \
                $(MAKE) target                                          \
                "MACH           =       DEC"                            \
                "WLENGTH        =       BIT32"                          \
                "FC             =       f90"                            \
                "FCFLAGS        =       -free -convert big_endian -fpe" \
                "CC             =       cc"                             \
                "CFLAGS         =       "                               \
                "LDOPTIONS      =       "                               \
                "LIBS           =       "                             ; \
        else \
        grep AIX .tmpfile ; \
        if [ $$? = 0 ]; then echo "Compiling for IBM" ;              \
                $(MAKE) target                                          \
                "MACH           =       IBM"                            \
                "WLENGTH        =       BIT32"                          \
                "FC             =       xlf"                            \
                "FCFLAGS        =       -qfree=f90" \
                "CC             =       cc"                             \
                "CFLAGS         =       "                               \
                "LDOPTIONS      =       "                               \
                "LIBS           =       "                             ; \
        else \
        grep IRIX .tmpfile ; \
        if [ $$? = 0 ]; then echo "Compiling for SGI" ; \
                $(MAKE) target  \
                "MACH           =       SGI"  \
                "WLENGTH        =       BIT32"  \
                "FC             =       f90"  \
                "FCFLAGS        =       -freeform -n32" \
                "CC             =       cc"  \
                "CFLAGS         =       "  \
                "LDOPTIONS      =       -n32"  \
                "LIBS           =       " ; \
        else \
        grep SUN .tmpfile ; \
        if [ $$? = 0 ]; then echo "Compiling for SUN" ; \
                $(MAKE) target  \
                "MACH           =       SUN"  \
                "WLENGTH        =       BIT32"  \
                "FC             =       f90"  \
                "FCFLAGS        =       -ansi -free" \
                "CC             =       cc"  \
                "CFLAGS         =       "  \
                "LDOPTIONS      =       "  \
                "LIBS           =       " ; \
        else \
        grep Linux .tmpfile ; \
        if [ $$? = 0 ]; then echo "Compiling for Linux" ; \
                $(MAKE) target  \
                "MACH           =       DEC"  \
                "WLENGTH        =       BIT32"  \
                "FC             =       ifort"  \
                "FCFLAGS        =       -FR -pc 32  -convert big_endian"  \
                "CC             =       cc"  \
                "CFLAGS         =       "  \
                "LDOPTIONS      =       "  \
                "LIBS           =       " ; \
        fi ; \
        fi ; \
        fi ; \
        fi ; \
        fi ; \
        fi ;


target:                adp_upa.exe

adp_upa.exe:         $(OBJS)
                $(FC) -o $@ $(LDOPTIONS) $(OBJS) $(LIBS)

clean:
                $(RM) *.o *.exe fort.* core

adp_upa.o:        adp_module.o
proupr.o:        adp_module.o
manadp.o:        adp_module.o
sigadp.o:        adp_module.o
wppadp.o:        adp_module.o
wzzadp.o:        adp_module.o
密码修改失败请联系微信:mofangbao
 楼主| 发表于 2014-8-29 11:23:20 | 显示全部楼层
longlivehj 发表于 2014-8-29 11:09
ifort -c -FR -convert big_endiangetsfcobs_hcl.f90
好像少了个空格似的。能把makefile文件发上来一下 ...

这个是其中一个makefile
密码修改失败请联系微信:mofangbao
发表于 2014-8-29 14:10:03 | 显示全部楼层
renjia 发表于 2014-8-29 11:23
这个是其中一个makefile

.f90.o:
                $(FC) -c
$(FCFLAGS)$*.f90   
.F90.o:
                $(FC) -c $(FCFLAGS) -D$(MACH)$*.F90
.c.o:
                $(CC) -c $(CFLAGS) -D$(MACH) -D$(WLENGTH) $<
密码修改失败请联系微信:mofangbao
 楼主| 发表于 2014-8-29 14:30:56 | 显示全部楼层
longlivehj 发表于 2014-8-29 14:10
.f90.o:
                $(FC) -c $(FCFLAGS)$*.f90   
.F90.o:

谢谢,我马上试一下
密码修改失败请联系微信:mofangbao
 楼主| 发表于 2014-8-29 15:13:58 | 显示全部楼层
longlivehj 发表于 2014-8-29 14:10
.f90.o:
                $(FC) -c $(FCFLAGS)$*.f90   
.F90.o:

没看明白,这和上面Makefile是一致的啊?是把*放在上标位置上吗?
密码修改失败请联系微信:mofangbao
发表于 2014-8-29 15:34:36 | 显示全部楼层
renjia 发表于 2014-8-29 15:13
没看明白,这和上面Makefile是一致的啊?是把*放在上标位置上吗?

你看看最后一行,比较一下,红色标注出来的部分,括回后面不都少一个空格么?!
密码修改失败请联系微信:mofangbao
 楼主| 发表于 2014-8-29 16:04:36 | 显示全部楼层
longlivehj 发表于 2014-8-29 15:34
你看看最后一行,比较一下,红色标注出来的部分,括回后面不都少一个空格么?!

好的,谢谢
密码修改失败请联系微信:mofangbao
 楼主| 发表于 2014-8-29 16:20:13 | 显示全部楼层
longlivehj 发表于 2014-8-29 14:10
.f90.o:
                $(FC) -c $(FCFLAGS)$*.f90   
.F90.o:

编译的问题应该解决了,谢谢啊。不过在运行./adp_to_little-r.csh又出现了这个问题:
m4: Command not found.
Data.2
Converting Upper-Air Data
~/bin/mm5V3-7-0/LITTLE_R5/FETCH4
mv: No match.
mv: No match.
DONE with conversion

你看一下上面贴出的adp_to_little-r.csh,非常感谢。
密码修改失败请联系微信:mofangbao
发表于 2014-8-29 17:44:25 | 显示全部楼层
renjia 发表于 2014-8-29 16:20
编译的问题应该解决了,谢谢啊。不过在运行./adp_to_little-r.csh又出现了这个问题:
m4: Command not f ...

m4: Command not found.
缺啥装啥!
密码修改失败请联系微信:mofangbao
 楼主| 发表于 2014-8-29 19:29:57 | 显示全部楼层
longlivehj 发表于 2014-8-29 17:44
m4: Command not found.
缺啥装啥!

这个M4是adp_to_little-r.csh中的,已经存在的:
#!/bin/csh

#        This shell converts ADP data (surface/ship and upper air)
#        into a format suitable for the little_r program.
#       USE THIS ONLY IF YOU HAVE ADP DATA ON YOUR MACHINE
#       THIS SCRIPT WILL NOT DOWNLOAD ADP DATA FOR YOU
#
#       Three types of data files are created:
#             obs:DATE             : Upper-air and surface data used as
#                                    input to little_R
#             surface_obs_r:DATE   : Surface data needed for FDDA in lillte_r
#                                    (if no FDDA will be done, these are not
#                                    needed, since they are also contained
#                                    in obs:DATE)

### DataDir MUST be the ABSOLUTE path to your data directory
set DataDir       =  /home/renhehe/bin/mm5V3-7-0/LITTLE_R5/FETCH4                  

### INSFCData is both surface and ship data
set InUpperData   =  ( $DataDir/Y52853.bin )
#set InSFCData     =  ( $DataDir/Y920939.bin $DataDir/Y920939.bin )

set starting_date = 2004080100
set ending_date   = 2004083100

#        The amount of CPU time spent unpacking the entire
#        globe is embarrassing.  As much as possible, restrict the
#        bounds.

set lon_e         =  180
set lon_w         = -180
set lat_s         =  -90
set lat_n         =   90

set lon_e         =  140
set lon_w         =  110
set lat_s         =   10
set lat_n         =   35

##############################################
#        End of user modification
##############################################

set LETTERS = (A B C D E F G H I J K L M N O P Q R S T U V W X Y Z)

### Do surface data

pushd adp_sfc

#        Build the conversion routine, set the namelist up.

echo "Making code - Surface"

make -r
m4 -Dxstryy=`echo $starting_date | cut -c1-4`  \
   -Dxstrmm=`echo $starting_date | cut -c5-6`  \
   -Dxstrdd=`echo $starting_date | cut -c7-8`  \
   -Dxstrhh=`echo $starting_date | cut -c9-10` \
   -Dxendyy=`echo $ending_date | cut -c1-4`  \
   -Dxendmm=`echo $ending_date | cut -c5-6`  \
   -Dxenddd=`echo $ending_date | cut -c7-8`  \
   -Dxendhh=`echo $ending_date | cut -c9-10` \
   -Dxloe=$lon_e -Dxlow=$lon_w -Dxlas=$lat_s -Dxlan=$lat_n \
   namelist.template >! namelist.input


#        Run the program (convert data to little_r format).
#        At least a single file must exist for input.

set NUM = 1
foreach fil ( $InSFCData )
   ln -sf  $fil Data.$NUM
   @ NUM ++
   echo Data.$NUM
end

echo "Converting Surface Data"
        ( time ./adp_sfc.exe Data.* ) >&! adp_sfc_print

#       

set y = `echo $starting_date | cut -c1-4`
set m = `echo $starting_date | cut -c5-6`
set d = `echo $starting_date | cut -c7-8`
set h = `echo $starting_date | cut -c9-10`

popd


### Do upper_air data

pushd adp_upa

#        Build the conversion routine, set the namelist up.

echo "Making code - Upper-Air"

make -r
m4 -Dxstryy=`echo $starting_date | cut -c1-4`  \
   -Dxstrmm=`echo $starting_date | cut -c5-6`  \
   -Dxstrdd=`echo $starting_date | cut -c7-8`  \
   -Dxstrhh=`echo $starting_date | cut -c9-10` \
   -Dxendyy=`echo $ending_date | cut -c1-4`  \
   -Dxendmm=`echo $ending_date | cut -c5-6`  \
   -Dxenddd=`echo $ending_date | cut -c7-8`  \
   -Dxendhh=`echo $ending_date | cut -c9-10` \
   -Dxloe=$lon_e -Dxlow=$lon_w -Dxlas=$lat_s -Dxlan=$lat_n \
   namelist.template >! namelist.input

#        Run the program (convert data to little_r format).
#        At least a single file must exist for input.

set NUM = 1
foreach fil ( $InUpperData )
   ln -sf  $fil Data.$NUM
   @ NUM ++
   echo Data.$NUM
end

echo "Converting Upper-Air Data"
        ( time ./adp_upa.exe Data.* ) >&! adp_upa_print

#       

set y = `echo $starting_date | cut -c1-4`
set m = `echo $starting_date | cut -c5-6`
set d = `echo $starting_date | cut -c7-8`
set h = `echo $starting_date | cut -c9-10`

if ( -e upper-air_obs_r:${y}-${m}-${d}_${h} ) then

          foreach fil ( upper-air_obs_r:* )
            set dd = ` echo $fil | cut -c17-30 `
            set fil2 = ../adp_sfc/surface\*{$dd}
            cat $fil > obs:$dd
            cat $fil2 >> obs:$dd
          end
          rm -rf upper-air_obs_r:*
endif

popd

mv adp_sfc/surface* .
mv adp_upa/obs:* .

echo "DONE with conversion"
密码修改失败请联系微信:mofangbao
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Copyright ©2011-2014 bbs.06climate.com All Rights Reserved.  Powered by Discuz! (京ICP-10201084)

本站信息均由会员发表,不代表气象家园立场,禁止在本站发表与国家法律相抵触言论

快速回复 返回顶部 返回列表