반응형

     정보

    • 업무명    : 그라즈 아스키 (ASCII) 형식인 복사전달모델 (RTM) 결과를 이용한 가시화

    • 작성자    : 이상호

    • 작성일    : 2019-09-03

    • 설   명     :

    • 수정이력 :

     

     내용

    [특징]

    • 복사전달모델 결과를 이해하기 위해 가시화 도구가 필요하며 이 프로그램은 이러한 목적을 달성하기 위해 고안된 소프트웨어

     

    [기능]

    • 아스키 형식인 입력 자료를 이용하여 매핑

    • 컬러바 생성

     

    [활용 자료]

    • 자료 : 복사전달모델 결과

    • 기간 : 2015년 04월 01일 - 2015년 04월 01일

    • 해상도 : 매 6시간

     

    [자료 처리 방안 및 활용 분석 기법]

    • 없음

     

    [사용법]

    • GrADS 가시화에 필요한 라이브러리를 동일 디렉터리 위치

    • 소스 코드를 실행 (csh Visualization_Using_ASCII_Format_of_Radiation_Transfer_Model_Result.csh)

    • 가시화 결과를 확인

     

    [사용 OS]

    • Linux

     

    [사용 언어]

    • GrADS

    • ShellScript (csh)

     

     소스 코드

    [명세]

    • 매핑을 위한 라이브러리

    function main(args)
    
    fname1=subwrd(args,1)
    latco=subwrd(args,2)
    lonco=subwrd(args,3)
    valco=subwrd(args,4)
    colco=subwrd(args,5)
    * xi=subwrd(args,5)
    * xd=subwrd(args,6)
    
    color='14 4 13 3 10 7 12 8 2 6'
    palgrey()
    
    'q dims'
    rec2=sublin(result,2)
    rec3 =sublin(result,3)
    xlon0=subwrd(rec2,6)
    xlon1=subwrd(rec2,8)
    ylat0=subwrd(rec3,6)
    ylat1=subwrd(rec3,8)
    
    ret=read(fname1)
    
    'q ll2xy 'xlon0' 'ylat0
    x0=subwrd(result,1)
    y0=subwrd(result,2)
    'q ll2xy  'xlon1' 'ylat1
    x1=subwrd(result,1)
    y1=subwrd(result,2)
    xs=x1-x0
    ys=y1-y0
    
    dx2=xs*0.05/(xlon1-xlon0) 
    dy2=ys*0.05/(ylat1-ylat0)
    
    while (1)
      ret = read(fname1)
      rc = sublin(ret,1)
      if (rc>0) 
        if (rc!=2) 
          say 'File I/O Error'
          return
        endif
        break
      endif
      rec = sublin(ret,2)
      time= subwrd(rec,valco)
      ylat= subwrd(rec,latco)
      xlon= subwrd(rec,lonco)
      xco=subwrd(rec,colco)
      if (xlon < 0);xlon=xlon+360;endif;
      
      if (xlon >= xlon0 & xlon <= xlon1 & ylat >= ylat0 & ylat <= ylat1)
         x=x0+xs*(xlon-xlon0)/(xlon1-xlon0)
         y=y0+ys*(ylat-ylat0)/(ylat1-ylat0)
    
    if (time < 0.000 ); xcol= 16 ;endif;
    
    if (time >=      0.000 & time <     10.000 ); xcol= 17 ;endif;
    if (time >=     10.000 & time <     20.000 ); xcol= 18 ;endif;
    if (time >=     20.000 & time <     30.000 ); xcol= 19 ;endif;
    if (time >=     30.000 & time <     40.000 ); xcol= 20 ;endif;
    if (time >=     40.000 & time <     50.000 ); xcol= 21 ;endif;
    if (time >=     50.000 & time <     60.000 ); xcol= 22 ;endif;
    if (time >=     60.000 & time <     70.000 ); xcol= 23 ;endif;
    if (time >=     70.000 & time <     80.000 ); xcol= 24 ;endif;
    if (time >=     80.000 & time <     90.000 ); xcol= 25 ;endif;
    if (time >=     90.000 & time <    100.000 ); xcol= 26 ;endif;
    if (time >=    100.000 & time <    110.000 ); xcol= 27 ;endif;
    if (time >=    110.000 & time <    120.000 ); xcol= 28 ;endif;
    if (time >=    120.000 & time <    130.000 ); xcol= 29 ;endif;
    if (time >=    130.000 & time <    140.000 ); xcol= 30 ;endif;
    if (time >=    140.000 & time <    150.000 ); xcol= 31 ;endif;
    if (time >=    150.000 & time <    160.000 ); xcol= 32 ;endif;
    if (time >=    160.000 & time <    170.000 ); xcol= 33 ;endif;
    if (time >=    170.000 & time <    180.000 ); xcol= 34 ;endif;
    if (time >=    180.000 & time <    190.000 ); xcol= 35 ;endif;
    if (time >=    190.000 & time <    200.000 ); xcol= 36 ;endif;
    if (time >=    200.000 & time <    210.000 ); xcol= 37 ;endif;
    if (time >=    210.000 & time <    220.000 ); xcol= 38 ;endif;
    if (time >=    220.000 & time <    230.000 ); xcol= 39 ;endif;
    if (time >=    230.000 & time <    240.000 ); xcol= 40 ;endif;
    if (time >=    240.000 & time <    250.000 ); xcol= 41 ;endif;
    if (time >=    250.000 & time <    260.000 ); xcol= 42 ;endif;
    if (time >=    260.000 & time <    270.000 ); xcol= 43 ;endif;
    if (time >=    270.000 & time <    280.000 ); xcol= 44 ;endif;
    if (time >=    280.000 & time <    290.000 ); xcol= 45 ;endif;
    if (time >=    290.000 & time <    300.000 ); xcol= 46 ;endif;
    if (time >=    300.000 & time <    310.000 ); xcol= 47 ;endif;
    if (time >=    310.000 & time <    320.000 ); xcol= 48 ;endif;
    if (time >=    320.000 & time <    330.000 ); xcol= 49 ;endif;
    if (time >=    330.000 & time <    340.000 ); xcol= 50 ;endif;
    if (time >=    340.000 & time <    350.000 ); xcol= 51 ;endif;
    if (time >=    350.000 & time <    360.000 ); xcol= 52 ;endif;
    if (time >=    360.000 & time <    370.000 ); xcol= 53 ;endif;
    if (time >=    370.000 & time <    380.000 ); xcol= 54 ;endif;
    if (time >=    380.000 & time <    390.000 ); xcol= 55 ;endif;
    if (time >=    390.000 & time <    400.000 ); xcol= 56 ;endif;
    if (time >=    400.000 & time <    410.000 ); xcol= 57 ;endif;
    if (time >=    410.000 & time <    420.000 ); xcol= 58 ;endif;
    if (time >=    420.000 & time <    430.000 ); xcol= 59 ;endif;
    if (time >=    430.000 & time <    440.000 ); xcol= 60 ;endif;
    if (time >=    440.000 & time <    450.000 ); xcol= 61 ;endif;
    if (time >=    450.000 & time <    460.000 ); xcol= 62 ;endif;
    if (time >=    460.000 & time <    470.000 ); xcol= 63 ;endif;
    if (time >=    470.000 & time <    480.000 ); xcol= 64 ;endif;
    if (time >=    480.000 & time <    490.000 ); xcol= 65 ;endif;
    if (time >=    490.000 & time <    500.000 ); xcol= 66 ;endif;
    if (time >=    500.000 & time <    510.000 ); xcol= 67 ;endif;
    if (time >=    510.000 & time <    520.000 ); xcol= 68 ;endif;
    if (time >=    520.000 & time <    530.000 ); xcol= 69 ;endif;
    if (time >=    530.000 & time <    540.000 ); xcol= 70 ;endif;
    if (time >=    540.000 & time <    550.000 ); xcol= 71 ;endif;
    if (time >=    550.000 & time <    560.000 ); xcol= 72 ;endif;
    if (time >=    560.000 & time <    570.000 ); xcol= 73 ;endif;
    if (time >=    570.000 & time <    580.000 ); xcol= 74 ;endif;
    if (time >=    580.000 & time <    590.000 ); xcol= 75 ;endif;
    if (time >=    590.000 & time <    600.000 ); xcol= 76 ;endif;
    if (time >=    600.000 & time <    610.000 ); xcol= 77 ;endif;
    if (time >=    610.000 & time <    620.000 ); xcol= 78 ;endif;
    if (time >=    620.000 & time <    630.000 ); xcol= 79 ;endif;
    if (time >=    630.000 & time <    640.000 ); xcol= 80 ;endif;
    if (time >=    640.000 & time <    650.000 ); xcol= 81 ;endif;
    if (time >=    650.000 & time <    660.000 ); xcol= 82 ;endif;
    if (time >=    660.000 & time <    670.000 ); xcol= 83 ;endif;
    if (time >=    670.000 & time <    680.000 ); xcol= 84 ;endif;
    if (time >=    680.000 & time <    690.000 ); xcol= 85 ;endif;
    if (time >=    690.000 & time <    700.000 ); xcol= 86 ;endif;
    if (time >=    700.000 & time <    710.000 ); xcol= 87 ;endif;
    if (time >=    710.000 & time <    720.000 ); xcol= 88 ;endif;
    if (time >=    720.000 & time <    730.000 ); xcol= 89 ;endif;
    if (time >=    730.000 & time <    740.000 ); xcol= 90 ;endif;
    if (time >=    740.000 & time <    750.000 ); xcol= 91 ;endif;
    if (time >=    750.000 & time <    760.000 ); xcol= 92 ;endif;
    if (time >=    760.000 & time <    770.000 ); xcol= 93 ;endif;
    if (time >=    770.000 & time <    780.000 ); xcol= 94 ;endif;
    if (time >=    780.000 & time <    790.000 ); xcol= 95 ;endif;
    if (time >=    790.000 & time <    800.000 ); xcol= 96 ;endif;
    if (time >=    800.000 & time <    810.000 ); xcol= 97 ;endif;
    if (time >=    810.000 & time <    820.000 ); xcol= 98 ;endif;
    if (time >=    820.000 & time <    830.000 ); xcol= 99 ;endif;
    if (time >=    830.000 & time <    840.000 ); xcol=100 ;endif;
    if (time >=    840.000 & time <    850.000 ); xcol=101 ;endif;
    if (time >=    850.000 & time <    860.000 ); xcol=102 ;endif;
    if (time >=    860.000 & time <    870.000 ); xcol=103 ;endif;
    if (time >=    870.000 & time <    880.000 ); xcol=104 ;endif;
    if (time >=    880.000 & time <    890.000 ); xcol=105 ;endif;
    if (time >=    890.000 & time <    900.000 ); xcol=106 ;endif;
    
    if (time >= 900.0 ); xcol= 199 ;endif;
    
    
    **    xcl=color2(time,xi,xd)
    **    say xcl
    **    xcl=subwrd(color,xcol)
    *
    *
         'set line 'xcol
    *    'set line 'xco
    
        'draw recf 'x-dx2' 'y-dy2' 'x+dx2' 'y+dy2
    *    'draw recf 'x'-'dx2' 'y'-'dy2' 'x'+'dx2' 'y'+'dy2
    *    'draw mark 3 'x' 'y' 0.1'
     endif
    endwhile
    
    return
    
    
    function palgrey()
    
    ***************** Rainbow ********************
    * 13 color
    *
    *'set rgb 16 64 64 64'
    *
    *'set rgb 17 240   0 130'
    *'set rgb 18 250  60  60'
    *'set rgb 19 240 130  40'
    *'set rgb 20 230 175  45'
    *'set rgb 21 230 220  50'
    *'set rgb 22 160 230  50'
    *'set rgb 23   0 220   0'
    *'set rgb 24   0 210 140'
    *'set rgb 25   0 200 200'
    *'set rgb 26   0 160 255'
    *'set rgb 27  30  60 255'
    *'set rgb 28 130   0 220'
    *'set rgb 29 160   0 200'
    *
    *'set rgb 99 255 255 255'
    
    ***************** KMA Radar ********************
    * color 30
    *
    *'set rgb  16  64  64  64'
    *
    *'set rgb  17 135 217 255'
    *'set rgb  18  62 193 255'
    *'set rgb  19   7 171 255'
    *'set rgb  20   0 141 255'
    *'set rgb  21   0 119 255'
    *'set rgb  22 105 252 105'
    *'set rgb  23  30 242 105'
    *'set rgb  24   0 213   0'
    *'set rgb  25   0 164   0'
    *'set rgb  26   0 128   0'
    *'set rgb  27 255 241 111'
    *'set rgb  28 255 226  86'
    *'set rgb  29 255 208  57'
    *'set rgb  30 255 188  30'
    *'set rgb  31 255 170   9'
    *'set rgb  32 255 156   0'
    *'set rgb  33 255 139  27'
    *'set rgb  34 255 128  81'
    *'set rgb  35 255 110 110'
    *'set rgb  36 246  94 103'
    *'set rgb  37 232  74  86'
    *'set rgb  38 217  52  62'
    *'set rgb  39 201  31  37'
    *'set rgb  40 188  13  15'
    *'set rgb  41 179   0   0'
    *'set rgb  42 197 125 255'
    *'set rgb  43 194  62 255'
    *'set rgb  44 173   7 255'
    *'set rgb  45 146   0 255'
    *'set rgb  46 127   0 191'
    *
    *'set rgb 99 255 255 255'
    
    
    ************* Rainbow *************************
    * 39 color
    
    *'set rgb 16  64  64  64'
    *
    *'set rgb 17 153 102 255'
    *'set rgb 18 131  87 255'
    *'set rgb 19 109  73 255'
    *'set rgb 20  87  58 255'
    *'set rgb 21  66  44 255'
    *'set rgb 22  44  29 255'
    *'set rgb 23   0   0 255'
    *'set rgb 24   0  72 255'
    *'set rgb 25   0 117 255'
    *'set rgb 26   0 156 255'
    *'set rgb 27   0 192 255'
    *'set rgb 28   0 213 255'
    *'set rgb 29   0 232 255'
    *'set rgb 30   0 246 255'
    *'set rgb 31   0 255 249'
    *'set rgb 32   0 255 213'
    *'set rgb 33   0 255 193'
    *'set rgb 34   0 255 159'
    *'set rgb 35   0 255 126'
    *'set rgb 36   0 255  77'
    *'set rgb 37   0 255  15'
    *'set rgb 38  50 255   0'
    *'set rgb 39 114 255   0'
    *'set rgb 40 152 255   0'
    *'set rgb 41 181 255   0'
    *'set rgb 42 227 255   0'
    *'set rgb 43 243 255   0'
    *'set rgb 44 255 253   0'
    *'set rgb 45 255 232   0'
    *'set rgb 46 255 211   0'
    *'set rgb 47 255 189   0'
    *'set rgb 48 255 168   0'
    *'set rgb 49 255 146   0'
    *'set rgb 50 255 124   0'
    *'set rgb 51 255 102   0'
    *'set rgb 52 255  87   0'
    *'set rgb 53 255  73   0'
    *'set rgb 54 255  58   0'
    *'set rgb 55 255  29   0'
    *'set rgb 56 255   0   0'
    *
    *'set rgb 99 255 255 255'
    *
    ************* Diff ****************************
    * 37 color
    *
    *'set rgb 16   0   0   0'
    *
    *'set rgb 17   0   0 255'
    *'set rgb 18  38  38 255'
    *'set rgb 19  51  51 255'
    *'set rgb 20  63  63 255'
    *'set rgb 21  76  76 255'
    *'set rgb 22  89  89 255'
    *'set rgb 23 102 102 255'
    *'set rgb 24 114 114 255'
    *'set rgb 25 127 127 255'
    *'set rgb 26 140 140 255'
    *'set rgb 27 153 153 255'
    *'set rgb 28 165 165 255'
    *'set rgb 29 178 178 255'
    *'set rgb 30 191 191 255'
    *'set rgb 31 204 204 255'
    *'set rgb 32 216 216 255'
    *'set rgb 33 229 229 255'
    *'set rgb 34 242 242 255'
    *'set rgb 35 255 255 255'
    *'set rgb 36 255 243 243'
    *'set rgb 37 255 230 230'
    *'set rgb 38 255 217 217'
    *'set rgb 39 255 205 205'
    *'set rgb 40 255 192 192'
    *'set rgb 41 255 179 179'
    *'set rgb 42 255 166 166'
    *'set rgb 43 255 154 154'
    *'set rgb 44 255 141 141'
    *'set rgb 45 255 128 128'
    *'set rgb 46 255 115 115'
    *'set rgb 47 255 102 102'
    *'set rgb 48 255  90  90'
    *'set rgb 49 255  77  77'
    *'set rgb 50 255  64  64'
    *'set rgb 51 255  51  51'
    *'set rgb 52 255  38  38'
    *'set rgb 53 255   0   0'
    *
    *'set rgb 99 255 255 255'
    
    **************  Forest  ****************
    * 65 color
    *
    *'set rgb 16  64  64  64'
    *
    *'set rgb 17   0   0  30'
    *'set rgb 18   5  26   2'
    *'set rgb 19  10  32   4'
    *'set rgb 20  15  38   6'
    *'set rgb 21  20  44   8'
    *'set rgb 22  25  50  10'
    *'set rgb 23  30  56  12'
    *'set rgb 24  35  62  14'
    *'set rgb 25  40  68  16'
    *'set rgb 26  45  74  18'
    *'set rgb 27  50  80  20'
    *'set rgb 28  55  86  22'
    *'set rgb 29  60  92  24'
    *'set rgb 30  65  98  26'
    *'set rgb 31  70 104  28'
    *'set rgb 32  75 110  30'
    *'set rgb 33  80 116  32'
    *'set rgb 34  85 122  34'
    *'set rgb 35  90 128  36'
    *'set rgb 36  95 134  38'
    *'set rgb 37 100 140  40'
    *'set rgb 38 105 146  42'
    *'set rgb 39 110 152  44'
    *'set rgb 40 115 158  46'
    *'set rgb 41 120 164  48'
    *'set rgb 42 125 170  50'
    *'set rgb 43 130 176  52'
    *'set rgb 44 135 182  54'
    *'set rgb 45 140 188  56'
    *'set rgb 46 145 194  58'
    *'set rgb 47 150 200  60'
    *'set rgb 48 155 206  62'
    *'set rgb 49 255 250 110'
    *'set rgb 50 249 238  98'
    *'set rgb 51 243 226  86'
    *'set rgb 52 237 214  74'
    *'set rgb 53 231 202  62'
    *'set rgb 54 225 190  50'
    *'set rgb 55 219 178  38'
    *'set rgb 56 213 166  26'
    *'set rgb 57 207 154  14'
    *'set rgb 58 201 142   2'
    *'set rgb 59 195 130   0'
    *'set rgb 60 189 118   0'
    *'set rgb 61 183 106   0'
    *'set rgb 62 177  94   0'
    *'set rgb 63 171  82   0'
    *'set rgb 64 165  70   0'
    *'set rgb 65 159  58   0'
    *'set rgb 66 153  46   0'
    *'set rgb 67 147  34   0'
    *'set rgb 68 141  22   0'
    *'set rgb 69 135  10   0'
    *'set rgb 70 129   0   0'
    *'set rgb 71 123   0   0'
    *'set rgb 72 117   0   0'
    *'set rgb 73 111   0   0'
    *'set rgb 74 105   0   0'
    *'set rgb 75  99   0   0'
    *'set rgb 76  93   0   0'
    *'set rgb 77  87   0   0'
    *'set rgb 78  81   0   0'
    *'set rgb 79  75   0   0'
    *'set rgb 80  69   0   0'
    *'set rgb 81  20   0   0'
    *
    *'set rgb 99 255 255 255'
    *
    **************  Rainbow [Red ~ Blue] ****************
    * color 100 
    
    'set rgb  16  64  64  64'
    
    'set rgb  17   0   0 130'
    'set rgb  18   0   0 134'
    'set rgb  19   0   0 146'
    'set rgb  20   0   0 154'
    'set rgb  21   0   0 166'
    'set rgb  22   0   0 174'
    'set rgb  23   0   0 186'
    'set rgb  24   0   0 198'
    'set rgb  25   0   0 206'
    'set rgb  26   0   0 218'
    'set rgb  27   0   0 226'
    'set rgb  28   0   0 238'
    'set rgb  29   0   0 250'
    'set rgb  30   0   0 254'
    'set rgb  31   0  11 254'
    'set rgb  32   0  19 254'
    'set rgb  33   0  31 254'
    'set rgb  34   0  39 254'
    'set rgb  35   0  51 254'
    'set rgb  36   0  63 254'
    'set rgb  37   0  71 254'
    'set rgb  38   0  83 254'
    'set rgb  39   0  91 254'
    'set rgb  40   0 103 254'
    'set rgb  41   0 115 254'
    'set rgb  42   0 123 254'
    'set rgb  43   0 134 254'
    'set rgb  44   0 142 254'
    'set rgb  45   0 154 254'
    'set rgb  46   0 162 254'
    'set rgb  47   0 174 254'
    'set rgb  48   0 186 254'
    'set rgb  49   0 194 254'
    'set rgb  50   0 206 254'
    'set rgb  51   0 214 254'
    'set rgb  52   0 226 254'
    'set rgb  53   0 238 254'
    'set rgb  54   0 246 254'
    'set rgb  55   0 254 254'
    'set rgb  56   7 254 246'
    'set rgb  57  19 254 234'
    'set rgb  58  31 254 222'
    'set rgb  59  39 254 214'
    'set rgb  60  51 254 202'
    'set rgb  61  59 254 194'
    'set rgb  62  71 254 181'
    'set rgb  63  79 254 174'
    'set rgb  64  91 254 162'
    'set rgb  65 103 254 150'
    'set rgb  66 111 254 142'
    'set rgb  67 123 254 130'
    'set rgb  68 130 254 123'
    'set rgb  69 142 254 111'
    'set rgb  70 154 254  99'
    'set rgb  71 162 254  91'
    'set rgb  72 174 254  79'
    'set rgb  73 182 254  71'
    'set rgb  74 194 254  59'
    'set rgb  75 202 254  51'
    'set rgb  76 214 254  39'
    'set rgb  77 226 254  27'
    'set rgb  78 234 254  19'
    'set rgb  79 246 254   7'
    'set rgb  80 254 254   0'
    'set rgb  81 254 242   0'
    'set rgb  82 254 230   0'
    'set rgb  83 254 222   0'
    'set rgb  84 254 210   0'
    'set rgb  85 254 202   0'
    'set rgb  86 254 190   0'
    'set rgb  87 254 178   0'
    'set rgb  88 254 170   0'
    'set rgb  89 254 158   0'
    'set rgb  90 254 150   0'
    'set rgb  91 254 138   0'
    'set rgb  92 254 130   0'
    'set rgb  93 254 119   0'
    'set rgb  94 254 107   0'
    'set rgb  95 254  99   0'
    'set rgb  96 254  87   0'
    'set rgb  97 254  79   0'
    'set rgb  98 254  67   0'
    'set rgb  99 254  55   0'
    'set rgb 100 254  47   0'
    'set rgb 101 254  35   0'
    'set rgb 102 254  27   0'
    'set rgb 103 254  15   0'
    'set rgb 104 254   7   0'
    'set rgb 105 249   0   0'
    'set rgb 106 236   0   0'
    'set rgb 107 227   0   0'
    'set rgb 108 214   0   0'
    'set rgb 109 205   0   0'
    'set rgb 110 192   0   0'
    'set rgb 111 179   0   0'
    'set rgb 112 170   0   0'
    'set rgb 113 157   0   0'
    'set rgb 114 148   0   0'
    'set rgb 115 135   0   0'
    'set rgb 116 130   0   0'
    
    'set rgb 199   0   0   0'
    
    return

     

    • 컬러바 생성을 위한 라이브러리

    function colorbar (args)
    
    vert=subwrd(args,1)
    xmid=subwrd(args,2)
    ymid=subwrd(args,3)
    barw=subwrd(args,4)
    sfc=subwrd(args,5)
    xsiz=subwrd(args,6)
    ysiz=subwrd(args,7)
    col1=subwrd(args,8)
    col2=subwrd(args,9)
    val1=subwrd(args,10)
    val2=subwrd(args,11)
    cl1=subwrd(args,12)
    cl2=subwrd(args,13)
    cli=subwrd(args,14)
    
    dum2=cli
    if (cli<0) ;dum2=cli*-1;endif
    dum1=cl2-cl1
    if (cl1>cl2);dum1=cl1-cl2;endif
    blnum=dum1/dum2+1
    
    * col1 & col2 : should be determined when dot-alb.f
    *               (min and max # of color scale) 
    * val1 & val2 : actual maginitude corresponding colors, col1 & col2
    *   if you set alb=0 to col#=40, and set alb=1.0 to col#=85, then
    *      val1=0, val2=1, col1=40, col2=85
    * cl1=val1, cl2=val2, I will change later, 
    * cli=interval of # under colorbar
    
    cnum=col2-col1+1
    
      stroff=0.05*sfc
      strxsiz=0.12*sfc
      strysiz=0.13*sfc
    
    *
    *	logic for setting the bar orientation with user overides
    *
        if(vert = 0) ; vchk = 0 ; endif
        if(vert = 1) ; vchk = 1 ; endif
    *
    *	vertical bar
    *
    
      if (vchk = 1 )
    
        ywid = ysiz / cnum
        xl = xmid - barw/2
        xr = xmid + barw/2
        yb = ymid-ysiz/2
        y1 = yb
        vert = 1
    
      else
    
    *
    *	horizontal bar
    *
    
        xwid = xsiz / cnum
        yt = ymid + barw/2
        yb = ymid - barw/2
        xl = xmid-xsiz/2
        x1 = xl
        'set string 1 tc 5'
        vert = 0
      endif
    
    *
    *  Plot colorbar
    *
      num = 1
      while (num<=cnum) 
        col = col1-1+num
        if (vert) 
          yt = yb + ywid
        else 
          xr = xl + xwid
        endif
    
        'set line 'col
        'draw recf 'xl' 'yb' 'xr' 'yt
    
        num = num + 1
        if (vert); yb = yt;
        else; xl = xr; endif;
      endwhile
    
     bli = 1
    
      'set strsiz 'strxsiz' 'strysiz
          if (vert)
            'set string 1 l 5'
             cl = cl1
             yp=y1 + ywid
             xp=xr+stroff
             yd = (ysiz - 2*ywid)/dum1*dum2
            while (bli <= blnum)
            'draw string 'xp' 'yp' 'cl
             cl = cl + cli
             yp = yp + yd
             bli=bli+1
            endwhile
          else
            'set string 1 tc 5'
             xp=x1 + xwid
             cl = cl1
             yp=yb-stroff
             xd = (xsiz - 2*xwid)/dum1*dum2
           while (bli <= blnum)
            'draw string 'xp' 'yp' 'cl
             cl = cl + cli
             xp = xp + xd
             bli=bli+1
            endwhile
          endif
    
    return

     

    • 가시화

    #!/bin/csh
    
    #rm -rf FIG/*
    
    set a = `ls DATA/2013??????`
    
    foreach fn ($a)
    set fn2 = `echo $fn | cut -c 6-15`
    
    set yy = `echo $fn | cut -c 6-9`
    set mm = `echo $fn | cut -c 10-11`
    set dd = `echo $fn | cut -c 12-13`
    set tt = `echo $fn | cut -c 14-15`
    set fn3 = `echo ${yy}.${mm}.${dd} ${tt}UTC`
    
    paste DATA/Geo.dat DATA/$fn2 > fort.1
    
    cat >! 2.exec << EOF
    reinit
    open GrADS/Map.ctl
    enable print 2.gx 
    set font 5
    set vpage 0  8.5 0 11
    set parea 0 8.5 2.0 10.0
    set mpdraw off
    set xlopts 1 5.5 0.15
    set ylopts 1 5.5 0.15
    set lat 31. 45.
    set lon 121. 135.5
    set cmin 9999
    set cint 2
    set xlint 2.0
    set ylint 2.0
    set grid on
    set grads off
    draw title  $fn3 [Clear]
    set strsiz 0.15 0.15
    draw string 3.5 1.4 Surface Solar Radiation [Wm\`a-2\`n]
    d t
    
    run GrADS/Library_For_Mapping_ASCII_Format_File.gs fort.1  1 2 3 3
    run GrADS/Library_For_Creating_Colorbar_From_ASCII_Format_File.gs   0   4.25 1.0   0.28 1.1   8.0 1.0  17 116   0 900 0 900 100
    *run GrADS/Library_For_Creating_Colorbar_From_ASCII_Format_File.gs   1   8.0 6.0    0.25 1.0   1.0 8.0  16 116   0 900 0 900 50
    
    set rgb 116 0 0 0
    draw shp GrADS/Map/GSHHG/GSHHS_shp/f/GSHHS_f_L1.shp
    *draw shp GrADS/Map/KOR_adm/KOR_adm0.shp
    *draw shp GrADS/Map/CHN_adm/CHN_adm0.shp
    *draw shp GrADS/Map/PRK_adm/PRK_adm0.shp
    *draw shp GrADS/Map/JPN_adm/JPN_adm0.shp
    
    print
    disable print
    !gxps -c -i 2.gx -o 2.ps
    quit
    EOF
    
    grads -bpc 'exec 2.exec'
    convert 2.ps 2.gif
    #display  2.gif 
    
    mv -f 2.gif FIG/${fn2}_SFC.gif
    end
    
    rm -f 2.ps  2.gx

     

    [GitHub Gist]

    • 매핑을 위한 라이브러리

     

     

     
    • 컬러바 생성을 위한 라이브러리

     

     

     
    • 가시화

     

     

     

     결과

    • 복사전달모델 결과를 이용한 가시화

    그림. 복사전달모델 결과를 이용한 가시화.

     

     참고 문헌

    [논문]

    • 없음

    [보고서]

    • 없음

    [URL]

    • 없음

     

     문의사항

    [기상학/프로그래밍 언어]

    • sangho.lee.1990@gmail.com

    [해양학/천문학/빅데이터]

    • saimang0804@gmail.com
     
    반응형
    • 네이버 블러그 공유하기
    • 네이버 밴드에 공유하기
    • 페이스북 공유하기
    • 카카오스토리 공유하기