'나의 연구'에 해당되는 글 14건

  1. 2017.06.01 난류지수: 산출구조
  2. 2010.02.12 if 문
  3. 2010.02.10 trend 분석
  4. 2010.01.06 RegCM3 output : 3hr -> daily
  5. 2009.12.30 draw string (math_mod)
  6. 2009.12.29 script_math_demo.gs [결과]
  7. 2009.12.29 script_math_demo.gs 5
  8. 2009.12.29 while
  9. 2009.12.29 size check
  10. 2009.12.29 tip on command

0. 차원설정 및 파라메터값 지정

변수별 차원 지정

코리올리

중력가속도

분해능

공기밀도


날짜시간

자료위치

input 파일명


1. 자료(t, u, v, w, gph)읽기,  온위/풍속계산, 평균구하기(u,v,w)

< loop 시간 >

      < loop  연직>

        자료읽기 (t, u, v, w, gph)

        온위 계산 

        풍속 계산

     < loop 연직 끝>


        시간합 (u, v, w)

< loop 시간 끝>

        시간평균 (u, v, w)



2. 난류계산을 위한 연직층높이, x/y/z방향의 차분값 산출

<loop 시간>

    < loop 연직>

         layer height

         theta_z, u_z, v_z 산출 

        < loop i, j> 

         u_y, v_x, u_x, v_y, SPD_x, S{PD_y, VWS (Vertical Wind Shear)

         <loop i,j 끝>

     <loop 연직>

<loop 시간>



3. 난류지수 계산 및 출력

<loop 시간>

  u', v', w' (시간 아노말리)

  Divergence, Shearing, Stretching, Vorticity, Deformation, Brunt Vaisala frequency, Brown1, Brown2, Ri, TI1, TI2, 

  출력: TI

<loop 시간 끝>


Posted by mclab
나의 연구/shell2010. 2. 12. 10:41
   if (${input} == P90 ) then
      set ax1=100
      set ax2=300
   else if (${input} == P95 ) then
      set ax1=200
      set ax2=400
   else if (${input} == P98 ) then
      set ax1=300
      set ax2=700
   else
      set ax1=500
      set ax2=1200
   endif

'나의 연구 > shell' 카테고리의 다른 글

while  (0) 2009.12.29
size check  (0) 2009.12.29
tip on command  (0) 2009.12.29
Posted by mclab
나의 연구/GraADS2010. 2. 10. 10:55
1. Grads 에서 trend는 ltrend 사용 
(예)
'open ${input}_165_ssn.ctl'
'set t 1 last'
'set grads off'
'define mann=(ann.1+ann.2+ann.3+ann.4+ann.5+ann.6)/6'
'd mann'
'ltrend mann trn slope rmse'
'd trn'
'drawstr -t 6-stations -p 1'
'd slope'
val=subwrd(result,4)
say ${input} ' slope = ' val
'drawstr -t slope='val' -p 5'
'draw title ANN:${input}'
*
'printim ${var}_${input}_avg.gif x1200 y800 white'

'나의 연구 > GraADS' 카테고리의 다른 글

draw string (math_mod)  (0) 2009.12.30
script_math_demo.gs [결과]  (0) 2009.12.29
script_math_demo.gs  (5) 2009.12.29
Standard Deviation  (1) 2009.12.29
draw string  (0) 2009.12.29
Posted by mclab

hr2dy.f90

integer, parameter :: nx=36, ny=60, nv=27, ndt=8  ! ndt=24hr/3hr=8
real:: data(nx,ny),dvar(nx,ny,nv)
integer:: iyr,iyrs,nmo(12),irec,orec
character*80 infil,oufil
character*8 var(27)
data nmo /31,28,31,30,31,30,31,31,30,31,30,31/
!data var /u10m,v10m,uvdrag,tg,tlef,t2m,q2m,ssw,rsw,tpr,evp,runoff,scv,sena,
!         + flw,fsw,flwd,sina,prcv,psb,zpbl,tgmax,tgmin,t2max,t2min,w10max,ps_min /


   DO iyr=1971,2000
   DO imo=1,12
      iyrs=int(iyr/10)*10
      write(*,*) 'Year = ',iyr, 'YearS = ',iyrs
      write(infil,'(a,i4.4,a,i4.4,i2.2,a)') '/nnas9/jshin/water21/dynds/obs',iyrs,'s_eman_kor/output/SRF.',iyr,imo,'0100'
      write(oufil,'(a,i4.4,i2.2,a)') 'dy_SRF.',iyr,imo,'0100'
      write(*,*) infil
      open(1,file=infil,form='unformatted',access='direct',recl=nx*ny,status='old')
      open(2,file=oufil,form='unformatted',access='direct',recl=nx*ny,status='unknown')

      irec=0
      orec=0
      nt=nmo(imo)
      if(mod(iyr,4).eq.0.and.imo.eq.2)  nt=29

   DO itm=1,nt
       dvar=0.
!       pause

     DO ihr=1,ndt
       DO ivr=1,27
          irec=irec+1
          read(1,rec=irec) data
          dvar(:,:,ivr)=dvar(:,:,ivr)+data(:,:)
!         if(ivr.eq.1) write(*,*) dvar(18,30,ivr),data(18,30)
       ENDDO ! ivr (Variable)
     ENDDO ! ihr

!      write(*,*) dvar(18,30,1),dvar(18,30,1)/ndt
!      write(*,*) dvar(18,30,1)

       DO ivr=1,27
         orec=orec+1
         write(*,*) iyr,imo,nt,irec,orec
         write(2,rec=orec) dvar(:,:,ivr)/ndt
       ENDDO ! ivr (Variable)
    ENDDO ! itm
   ENDDO  ! imo
         close(1)
         close(2)
   ENDDO  ! iyr

end

Posted by mclab
나의 연구/GraADS2009. 12. 30. 11:00

i=1
ii=1
jj=1
itot=23
*---------------------------
* ii = color
* jj = style
*---------------------------
iitot=7
jjtot=3
*
while (i<=itot)
ii=math_mod(i,iitot)
if(ii=0) ; ii=iitot ;endif
jj=math_nint(i/iitot)+1
say i' 'ii' 'jj
pull dummy
*
'q file 'i
line=sublin(result,2)
ctl=subwrd(line,2)
model=substr(ctl,11,10)
say model

is=(i-1)*12*5+1
ie=i*12*5

*
  x0=8.5
  y0=7.5
  x1 = x0
  x2 = x0+0.5
  x3 = x0+0.8
  y1=y0-i*0.2+0.05
  y2=y0-i*0.2
*
'set ccolor 'ii
'set cstyle 'jj
'set cmark 0'

'set line ' ii ' 'jj
'draw line 'x1' ' y1' ' x2' ' y1
'draw string 'x3 ' 'y2' 'model
*
'set grads off'


'나의 연구 > GraADS' 카테고리의 다른 글

trend 분석  (0) 2010.02.10
script_math_demo.gs [결과]  (0) 2009.12.29
script_math_demo.gs  (5) 2009.12.29
Standard Deviation  (1) 2009.12.29
draw string  (0) 2009.12.29
Posted by mclab
나의 연구/GraADS2009. 12. 29. 13:44
ga-> script_math_demo.gs
 
Formatting numbers:
%-6.1f of 3.1456 = 3.1  
%-6.2f of 3.1456 = 3.15 
%6.2f  of 3.1456 =   3.15
%06.3f of 3.1456 = 03.146
%6.0g  of 3.1456 =      3
%12.3e of 3.1456 =    3.146e+00
 
Trigonometric functions:
cos of 45 = 0.7071
sin of 45 = 0.7071
tan of 45 = 1.0000
acos of 0.7071 = 45.0000
asin of 0.7071 = 45.0000
atan of 1.0000 = 45.0000
atan2 of (1,-1) = 135.0000
cosh of 30 = 1.1402
sinh of 30 = 0.5479
tanh of 30 = 0.4805
acosh of 1.1402 = 65.3308 <-- math_acosh() may have a bug ... this value should be 30
asinh of 0.5479 = 30.0000
atanh of 0.4805 = 30.0000
 
Evaluating strings to see if they are numbers:
0 = not a number
1 = integer
2 = not an integer
valnum of 3.1455 = 2
valnum of 3 = 1
valnum of 3e10 = 2
valnum of 390210 = 1
valnum of a string = 0
 
Real-to-integer conversion:
nint of 3.0 = 3    int of 3.0 = 3
nint of 3.1 = 3    int of 3.1 = 3
nint of 3.2 = 3    int of 3.2 = 3
nint of 3.3 = 3    int of 3.3 = 3
nint of 3.4 = 3    int of 3.4 = 3
nint of 3.5 = 4    int of 3.5 = 3
nint of 3.6 = 4    int of 3.6 = 3
nint of 3.7 = 4    int of 3.7 = 3
nint of 3.8 = 4    int of 3.8 = 3
nint of 3.9 = 4    int of 3.9 = 3
 
Exponents:
2 raised to the power 0.5 = 1.4142135623731
 
Exponential function:
exp(1) = 2.71828182845905
 
Natural logarithm:
log(2.71828) = 0.999999327347282
 
Base 10 logarithm:
log10(2) = 0.301029995663981
10 raised to the power 0.3103 = 2.0000000199681
 
Modulo operator fmod:
6 fmod 2.25 (the remainder when 6 is divided by 2.25) = 1.5
 
Modulo operator mod:
6 mod 2.25 (the integer part of the remainder when 6 is divided by 2.25) = 1
 
String operations:
length of the string "this is a test" = 14
word 2 of the string "this is a test" starts at character 6

'나의 연구 > GraADS' 카테고리의 다른 글

trend 분석  (0) 2010.02.10
draw string (math_mod)  (0) 2009.12.30
script_math_demo.gs  (5) 2009.12.29
Standard Deviation  (1) 2009.12.29
draw string  (0) 2009.12.29
Posted by mclab
나의 연구/GraADS2009. 12. 29. 13:43
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* script_math_demo.gs
*
* Illustrates the use of the scripting language math funcitons
* Written by M. Fiorino
* Modified by J.M. Adams
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

doformat = 1
dotrig = 1
doint = 1
domisc = 1
dovalnum = 1

* FORMATTING NUMBERS
if (doformat)
  print ' '
  print 'Formatting numbers:'
  v = 3.1456
  fmt = '%-6.1f'
  rc = math_format(fmt,v)
  print fmt' of 'v' = 'rc

  fmt = '%-6.2f'
  rc = math_format(fmt,v)
  print fmt' of 'v' = 'rc

  fmt = '%6.2f'
  rc = math_format(fmt,v)
  print fmt'  of 'v' = 'rc

  fmt = '%06.3f'
  rc = math_format(fmt,v)
  print fmt' of 'v' = 'rc

  fmt = '%6.0g'
  rc = math_format(fmt,v)
  print fmt'  of 'v' = 'rc

  fmt = '%12.3e'
  rc = math_format(fmt,v)
  print fmt' of 'v' = 'rc
  print ' '
endif

* TRIG FUNCTIONS
if (dotrig)
  print 'Trigonometric functions:'
  pi  = 3.1415926
  d2r = pi/180
  r2d = 1/d2r
  dang = 45
  ang = dang*d2r
  fmt = '%-6.4f'

  cos  = math_cos(ang)
  cosf = math_format(fmt,cos)
  print 'cos of 'dang' = 'cosf

  sin  = math_sin(ang)
  sinf = math_format(fmt,sin)
  print 'sin of 'dang' = 'sinf

  tan  = math_tan(ang)
  tanf = math_format(fmt,tan)
  print 'tan of 'dang' = 'tanf

  ang = math_acos(cos)
  dang = ang * r2d
  dangf = math_format(fmt,dang)
  print 'acos of 'cosf' = 'dangf

  ang = math_asin(sin)
  dang = ang * r2d
  dangf = math_format(fmt,dang)
  print 'asin of 'sinf' = 'dangf

  ang = math_atan(tan)
  dang = ang * r2d
  dangf = math_format(fmt,dang)
  print 'atan of 'tanf' = 'dangf

  u =  1
  v = -1
  rc = math_atan2(u,v)
  rc2 = rc*r2d
  rc2f = math_format(fmt,rc2)
  print 'atan2 of ('u','v') = 'rc2f

  dang = 30
  ang = dang*d2r

  cosh = math_cosh(ang)
  coshf = math_format(fmt,cosh)
  print 'cosh of 'dang' = 'coshf

  sinh = math_sinh(ang)
  sinhf = math_format(fmt,sinh)
  print 'sinh of 'dang' = 'sinhf

  tanh = math_tanh(ang)
  tanhf = math_format(fmt,tanh)
  print 'tanh of 'dang' = 'tanhf

  demo = dang
  ang = math_acosh(cosh)
  dang = ang * r2d
  dangf = math_format(fmt,dang)
  print 'acosh of 'coshf' = 'dangf' <-- math_acosh() may have a bug ... this value should be 'demo

  ang = math_asinh(sinh)
  dang = ang * r2d
  dangf = math_format(fmt,dang)
  print 'asinh of 'sinhf' = 'dangf

  ang = math_atanh(tanh)
  dang = ang * r2d
  dangf = math_format(fmt,dang)
  print 'atanh of 'tanhf' = 'dangf
  print ' '
endif

* VALNUM
if (dovalnum)
  print 'Evaluating strings to see if they are numbers:'
  print '0 = not a number'
  print '1 = integer'
  print '2 = not an integer'
  num = '3.1455'
  rc = valnum(num)
  print 'valnum of 'num' = 'rc

  num = '3'
  rc = valnum(num)
  print 'valnum of 'num' = 'rc

  num = '3e10'
  rc = valnum(num)
  print 'valnum of 'num' = 'rc

  num = '390210'
  rc = valnum(num)
  print 'valnum of 'num' = 'rc

  num = 'a string'
  rc = valnum(num)
  print 'valnum of 'num' = 'rc
  print ' '
endif

* INTEGER CONVERSION
if (doint) 
  print 'Real-to-integer conversion:'
  v = 3.0
  while(v < 4.0) 
    rc1 = math_nint(v)
    rc2 = math_int(v)
    print 'nint of 'v' = 'rc1'    int of 'v' = 'rc2
    v = v + 0.1
  endwhile
  print ' '
endif

* MISCELLANEOUS FUNCTIONS
if (domisc)
  print 'Exponents:'
  pow = math_pow(2,0.5);
  print '2 raised to the power 0.5 = 'pow
  print ' '

  print 'Exponential function:'
  num = math_exp(1)
  print 'exp(1) = 'num
  print ' '

  print 'Natural logarithm:'
  num = math_log(2.71828)
  print 'log(2.71828) = 'num
  print ' '

  print 'Base 10 logarithm:'
  num = math_log10(2)
  print 'log10(2) = 'num
  pow = math_pow(10,0.30103);
  print '10 raised to the power 0.3103 = 'pow
  print ' '

  print 'Modulo operator fmod:'
  fmod = math_fmod(6,2.25);
  print '6 fmod 2.25 (the remainder when 6 is divided by 2.25) = 'fmod
  print ' '

  print 'Modulo operator mod:'
  fmod = math_mod(6,2.25);
  print '6 mod 2.25 (the integer part of the remainder when 6 is divided by 2.25) = 'fmod
  print ' '

  print 'String operations:'
  s = 'this is a test'
  rc = math_strlen(s)
  print 'length of the string "'s'" = 'rc

  p = 2
  rc = wrdpos(s,p)
  print 'word 'p' of the string "'s'" starts at character 'rc
  print ' '
endif


return

'나의 연구 > GraADS' 카테고리의 다른 글

draw string (math_mod)  (0) 2009.12.30
script_math_demo.gs [결과]  (0) 2009.12.29
Standard Deviation  (1) 2009.12.29
draw string  (0) 2009.12.29
my subplot  (0) 2009.12.29
Posted by mclab
나의 연구/shell2009. 12. 29. 11:18

#! /bin/csh

cd /nnas8/hyolee/uahnc/grib

set wgrib=/opt/grads-2.0.a3/grads-1.9b4/bin/wgrib

set year=1979
echo $year

while ($year <= 1979)
  set mon=1
  echo $mon
while ($mon <= 12)
  if ($mon <= 9) then
      set dum=0
  else
      set dum=''
  endif
  echo grib2ctl.pl  ./uahnca.pm${year}${dum}${mon}_pres.grb > ${year}${dum}${mon}.ctl
  grib2ctl.pl ./uahnca.pm${year}${dum}${mon}_pres.grb > ${year}${dum}${mon}.ctl
  gribmap -0 -i  ${year}${dum}${mon}.ctl
  echo gribmap -0 -i  ${year}${dum}${mon}.ctl
@ mon++
end
@ year++
end

'나의 연구 > shell' 카테고리의 다른 글

if 문  (0) 2010.02.12
size check  (0) 2009.12.29
tip on command  (0) 2009.12.29
Posted by mclab
나의 연구/shell2009. 12. 29. 11:17

#! /bin/csh

         set ifile=/nnas8/hyolee/uahnc/pm/uahnca.pmh9dec
         echo pmfile=`ls -ltr ${ifile}`
         set pmfile=`ls -ltr ${ifile}`
         set pmsize=$pmfile[5]
         echo ${pmsize}
         if ( $pmsize != 693518336 ) then
            echo "File size of ${ifile} is not equal 693518336 "
            stop
         endif

'나의 연구 > shell' 카테고리의 다른 글

if 문  (0) 2010.02.12
while  (0) 2009.12.29
tip on command  (0) 2009.12.29
Posted by mclab
나의 연구/shell2009. 12. 29. 11:16
 find . -size 0 -exec rm "{}" \;


'나의 연구 > shell' 카테고리의 다른 글

if 문  (0) 2010.02.12
while  (0) 2009.12.29
size check  (0) 2009.12.29
Posted by mclab