Changeset 218 for palm/trunk/SCRIPTS/NCL/cross_sections.ncl
- Timestamp:
- Dec 10, 2008 9:14:34 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
palm/trunk/SCRIPTS/NCL/cross_sections.ncl
r195 r218 37 37 if (file_1 .EQ. "File in") then 38 38 print(" ") 39 print(" Please provide 1st input file 'file_1=' in 'ncl_preferences.ncl'")39 print("Declare input file 'file_1=' in 'ncl_preferences.ncl' or prompt") 40 40 print(" ") 41 41 exit … … 43 43 file_in = file_1 44 44 end if 45 if (.not. isfilepresent(file_in)) then46 print(" ")47 print("1st input file: '"+file_in+"' does not exist")48 print(" ")49 exit50 end if51 45 52 46 if (format_out .NE. "x11" .AND. format_out .NE. "pdf" .AND. format_out .NE. "eps" .AND. format_out .NE. "ps" .AND. format_out .NE. "epsi" .AND. format_out .NE. "ncgm")then … … 73 67 if (fill_mode .NE. "AreaFill" .AND. fill_mode .NE. "RasterFill" .AND. fill_mode .NE. "CellFill") then 74 68 print(" ") 75 print(" Your'fill_mode'= "+fill_mode+" is invalid and set to 'AreaFill'")69 print("'fill_mode'= "+fill_mode+" is invalid and set to 'AreaFill'") 76 70 print(" ") 77 71 fill_mode = "AreaFill" … … 108 102 if (xyc .EQ. 0 .AND. xzc .EQ. 0 .AND. yzc .EQ. 0) then 109 103 print(" ") 110 print(" Please select one crossection (xyc=1 or xzc=1 or yzc=1)")104 print("Select one crossection (xyc=1 or xzc=1 or yzc=1)") 111 105 print(" ") 112 106 exit … … 115 109 if (xzc .EQ. 1 .OR. yzc .EQ. 1) then 116 110 print(" ") 117 print(" Please select just one crossection (xyc=1 or xzc=1 or yzc=1)")111 print("Select just one crossection (xyc=1 or xzc=1 or yzc=1)") 118 112 print(" ") 119 113 exit … … 123 117 if (xyc .EQ. 1 .OR. yzc .EQ. 1) then 124 118 print(" ") 125 print(" Please select just one crossection (xyc=1 or xzc=1 or yzc=1)")119 print("Select just one crossection (xyc=1 or xzc=1 or yzc=1)") 126 120 print(" ") 127 121 exit … … 131 125 if (xyc .EQ. 1 .OR. xzc .EQ. 1) then 132 126 print(" ") 133 print(" Please select just one crossection (xyc=1 or xzc=1 or yzc=1)")127 print("Select just one crossection (xyc=1 or xzc=1 or yzc=1)") 134 128 print(" ") 135 129 exit … … 139 133 if (vector .NE. 0 .AND. vector .NE. 1) then 140 134 print(" ") 141 print(" Please set 'vector' to 0 or 1")135 print("Set 'vector' to 0 or 1") 142 136 print(" ") 143 137 exit 144 end if 138 end if 139 140 if (norm_x .EQ. 0) then 141 print(" ") 142 print("Normalising with 0 is not allowed, 'norm_x' is set to 1.0") 143 print(" ") 144 norm_x = 1.0 145 end if 146 if (norm_y .EQ. 0) then 147 print(" ") 148 print("Normalising with 0 is not allowed, 'norm_y' is set to 1.0") 149 print(" ") 150 norm_y = 1.0 151 end if 152 if (norm_z .EQ. 0) then 153 print(" ") 154 print("Normalising with 0 is not allowed, 'norm_z' is set to 1.0") 155 print(" ") 156 norm_z = 1.0 157 end if 145 158 146 159 ; *************************************************** 147 160 ; open input file 148 161 ; *************************************************** 149 150 f = addfile( file_in, "r" ) 151 152 vNam = getfilevarnames(f) 162 163 file_in_1 = False 164 if (isStrSubset(file_in, ".nc"))then 165 start_f = -2 166 end_f = -2 167 file_in_1 = True 168 end if 169 170 if (start_f .EQ. -1)then 171 print(" ") 172 print("'start_f' must be one of the cyclic numbers (at least 0) of your input file(s)") 173 print(" ") 174 exit 175 end if 176 if (end_f .EQ. -1)then 177 print(" ") 178 print("'end_f' must be one of the cyclic numbers (at least 0) of your input file(s)") 179 print(" ") 180 exit 181 end if 182 183 files=new(end_f-start_f+1,string) 184 185 if (file_in_1)then 186 if (isfilepresent(file_in))then 187 files(0)=file_in 188 else 189 print(" ") 190 print("1st input file: '"+file_in+"' does not exist") 191 print(" ") 192 exit 193 end if 194 else 195 if (start_f .EQ. 0)then 196 if (isfilepresent(file_in+".nc"))then 197 files(0)=file_in+".nc" 198 do i=1,end_f 199 if (isfilepresent(file_in+"."+i+".nc"))then 200 files(i)=file_in+"."+i+".nc" 201 else 202 print(" ") 203 print("Input file: '"+file_in+"."+i+".nc' does not exist") 204 print(" ") 205 exit 206 end if 207 end do 208 else 209 print(" ") 210 print("Input file: '"+file_in+".nc' does not exist") 211 print(" ") 212 exit 213 end if 214 else 215 do i=start_f,end_f 216 if (isfilepresent(file_in+"."+i+".nc"))then 217 files(i-start_f)=file_in+"."+i+".nc" 218 else 219 print(" ") 220 print("Input file: '"+file_in+"."+i+".nc' does not exist") 221 print(" ") 222 exit 223 end if 224 end do 225 end if 226 end if 227 228 f=addfiles(files,"r") 229 f_att=addfile(files(0),"r") 230 ListSetType(f,"cat") 231 232 vNam = getfilevarnames(f_att) 153 233 print(" ") 154 234 print("Variables in input file:") … … 225 305 else 226 306 print(" ") 227 print("Your input file: '"+file_in+"'") 228 print("contains 3d or other data") 307 print("Your input file contains 3d or other data") 229 308 print(" ") 230 309 end if … … 242 321 243 322 cs_res = True 323 vecres = True 244 324 cs_res@gsnYAxisIrregular2Linear = True 245 325 … … 247 327 cs_res@gsnFrame = False 248 328 cs_res@gsnMaximize = True 249 cs_res@gsnPaperOrientation = "portrait" 250 cs_res@gsnPaperWidth = 8.27 251 cs_res@gsnPaperHeight = 11.69 252 cs_res@gsnPaperMargin = 0.79 253 cs_res@tmXBLabelFontHeightF = .03 254 cs_res@tmYLLabelFontHeightF = .03 255 cs_res@tiXAxisFontHeightF = .03 256 cs_res@tiYAxisFontHeightF = .03 329 330 cs_res@tmXBLabelFontHeightF = font_size 331 cs_res@tmYLLabelFontHeightF = font_size 332 cs_res@tiXAxisFontHeightF = font_size 333 cs_res@tiYAxisFontHeightF = font_size 257 334 cs_res@tmXBMode ="Automatic" 258 335 cs_res@tmYLMode ="Automatic" 259 cs_res@lgTitleFontHeightF = .03 260 cs_res@lgLabelFontHeightF = .03 261 cs_res@txFontHeightF = .03 336 262 337 cs_res@cnLevelSelectionMode = "ManualLevels" 338 cs_res@lbLabelFontHeightF = font_size_legend 339 cs_res@lbLabelStride = legend_label_stride 340 263 341 264 342 cs_resP = True 265 cs_resP@txString = f @title343 cs_resP@txString = f_att@title 266 344 cs_resP@txFuncCode = "~" 267 cs_resP@txFontHeightF = .02 268 345 cs_resP@txFontHeightF = 0.015 269 346 270 347 if ( mode .eq. "Fill" ) then 271 348 cs_res@cnFillOn = True 272 349 cs_res@gsnSpreadColors = True 273 cs_res@cnFillMode = fill_mode 274 cs_res@lbOrientation = "Vertical" 350 cs_res@cnFillMode = fill_mode 275 351 cs_res@cnLinesOn = False 276 352 cs_res@cnLineLabelsOn = False … … 280 356 cs_res@cnFillOn = True 281 357 cs_res@gsnSpreadColors = True 282 cs_res@cnFillMode = fill_mode 283 cs_res@lbOrientation = "Vertical" 358 cs_res@cnFillMode = fill_mode 284 359 cs_res@cnLinesOn = True 285 360 cs_res@cnLineLabelsOn = True … … 290 365 ; ********************************************* 291 366 292 t_all = f ->time367 t_all = f[:]->time 293 368 nt = dimsizes(t_all) 294 369 delta_t = t_all(nt-1)/nt … … 305 380 print("'start_time_step' = "+ start_time_step +"h is greater than last time step = " + t_all(nt-1)+"s = "+t_all(nt-1)/3600+"h") 306 381 print(" ") 307 print(" Please select another 'start_time_step'")382 print("Select another 'start_time_step'") 308 383 print(" ") 309 384 exit … … 313 388 print("'start_time_step' = "+ start_time_step +"h is lower than first time step = " + t_all(0)+"s = "+t_all(0)/3600+"h") 314 389 print(" ") 315 print(" Please select another 'start_time_step'")390 print("Select another 'start_time_step'") 316 391 print(" ") 317 392 exit 318 393 end if 319 394 end if 320 do i=0,nt-1 395 do i=0,nt-1 321 396 if (start_time_step .GE. (t_all(i)-delta_t/2)/3600 .AND. start_time_step .LT. (t_all(i)+delta_t/2)/3600)then 322 397 st=i … … 329 404 print("'start_time_step' = "+ start_time_step +"h is invalid") 330 405 print(" ") 331 print(" Please select another 'start_time_step'")406 print("Select another 'start_time_step'") 332 407 print(" ") 333 408 exit … … 345 420 print("'end_time_step' = "+end_time_step+ "h is lower than first time step = " + t_all(0)+"s = "+t_all(0)/3600+"h") 346 421 print(" ") 347 print(" Please select another 'end_time_step'")422 print("Select another 'end_time_step'") 348 423 print(" ") 349 424 exit … … 353 428 print("'end_time_step' = "+ end_time_step +"h is greater than last time step = " + t_all(nt-1)+"s = "+t_all(nt-1)/3600+"h") 354 429 print(" ") 355 print(" Please select another 'end_time_step'")430 print("Select another 'end_time_step'") 356 431 print(" ") 357 432 exit … … 361 436 print("'end_time_step' = "+ end_time_step +"h is lower than 'start_time_step' = "+start_time_step+"h") 362 437 print(" ") 363 print(" Please select another 'start_time_step' or 'end_time_step'")438 print("Select another 'start_time_step' or 'end_time_step'") 364 439 print(" ") 365 440 exit … … 377 452 print("'end_time_step' = "+ end_time_step +"h is invalid") 378 453 print(" ") 379 print(" Please select another 'end_time_step'")454 print("Select another 'end_time_step'") 380 455 print(" ") 381 456 exit … … 401 476 if (vec1 .EQ. "component1") then 402 477 print(" ") 403 print(" Please indicate Vector 1 ('vec1') for Vector-Plot or set 'vector' to 0")478 print("Indicate Vector 1 ('vec1') for Vector-Plot or set 'vector' to 0") 404 479 print(" ") 405 480 exit … … 407 482 if (vec2 .EQ. "component2") then 408 483 print(" ") 409 print(" Please indicate Vector 2 ('vec2') for Vector-Plot or set 'vector' to 0")484 print("Indicate Vector 2 ('vec2') for Vector-Plot or set 'vector' to 0") 410 485 print(" ") 411 486 exit … … 424 499 do varn=0,dim-1 425 500 if (vNam(varn) .eq. "xu" .OR. vNam(varn) .eq. "x")then 426 x_d = f ->$vNam(varn)$501 x_d = f_att->$vNam(varn)$ 427 502 xdim = dimsizes(x_d)-1 428 503 delta_x = x_d(1)-x_d(0) … … 432 507 do varn=0,dim-1 433 508 if (vNam(varn) .eq. "yv" .or. vNam(varn) .eq. "y")then 434 y_d = f ->$vNam(varn)$509 y_d = f_att->$vNam(varn)$ 435 510 ydim = dimsizes(y_d)-1 436 511 delta_y = y_d(1)-y_d(0) … … 440 515 do varn=0,dim-1 441 516 if (vNam(varn) .eq. "zu_3d" .OR. vNam(varn) .eq. "zw_3d")then 442 z_d = f ->$vNam(varn)$517 z_d = f_att->$vNam(varn)$ 443 518 zdim = dimsizes(z_d)-1 444 519 delta_z = 0 … … 446 521 else 447 522 if (vNam(varn) .eq. "zu_xy" .OR. vNam(varn) .eq. "zw_xy") then 448 z_d = f ->$vNam(varn)$523 z_d = f_att->$vNam(varn)$ 449 524 zdim = dimsizes(z_d)-1 450 525 delta_z = -1.d … … 460 535 do varn=0,dim-1 461 536 if (vNam(varn) .eq. "xu" .OR. vNam(varn) .eq. "x") then 462 x_d = f ->$vNam(varn)$537 x_d = f_att->$vNam(varn)$ 463 538 xdim = dimsizes(x_d)-1 464 539 delta_x = x_d(1)-x_d(0) … … 468 543 do varn=0,dim-1 469 544 if (vNam(varn) .eq. "zw" .or. vNam(varn) .eq. "zu" .OR. vNam(varn) .eq. "zu_3d" .or. vNam(varn) .eq. "zw_3d") then 470 z_d = f ->$vNam(varn)$545 z_d = f_att->$vNam(varn)$ 471 546 zdim = dimsizes(z_d)-1 472 547 delta_z = z_d(1)-z_d(0) … … 476 551 do varn=0,dim-1 477 552 if (vNam(varn) .eq. "yv" .or. vNam(varn) .eq. "y") then 478 y_d = f ->$vNam(varn)$553 y_d = f_att->$vNam(varn)$ 479 554 ydim = dimsizes(y_d)-1 480 555 delta_y = y_d(1)-y_d(0) … … 482 557 else 483 558 if (vNam(varn) .eq. "y_xz" .or. vNam(varn) .eq. "yv_xz") then 484 y_d = f ->$vNam(varn)$559 y_d = f_att->$vNam(varn)$ 485 560 ydim = dimsizes(y_d)-1 486 561 delta_y = -1.d … … 496 571 do varn=0,dim-1 497 572 if (vNam(varn) .eq. "yv" .or. vNam(varn) .eq. "y") then 498 y_d = f ->$vNam(varn)$573 y_d = f_att->$vNam(varn)$ 499 574 ydim = dimsizes(y_d)-1 500 575 delta_y = y_d(1)-y_d(0) … … 504 579 do varn=0,dim-1 505 580 if (vNam(varn) .eq. "zw" .or. vNam(varn) .eq. "zu" .OR. vNam(varn) .eq. "zu_3d" .or. vNam(varn) .eq. "zw_3d") then 506 z_d = f ->$vNam(varn)$581 z_d = f_att->$vNam(varn)$ 507 582 zdim = dimsizes(z_d)-1 508 583 delta_z = z_d(1)-z_d(0) … … 512 587 do varn=0,dim-1 513 588 if (vNam(varn) .eq. "xu" .or. vNam(varn) .eq. "x") 514 x_d = f ->$vNam(varn)$589 x_d = f_att->$vNam(varn)$ 515 590 xdim = dimsizes(x_d)-1 516 591 delta_x = x_d(1)-x_d(0) … … 518 593 else 519 594 if (vNam(varn) .eq. "xu_yz" .or. vNam(varn) .eq. "x_yz" ) then 520 x_d = f ->$vNam(varn)$595 x_d = f_att->$vNam(varn)$ 521 596 xdim = dimsizes(x_d)-1 522 597 delta_x = -1.d … … 848 923 end do 849 924 end if 850 925 851 926 if( shape .eq. 1 ) then 852 927 if (xyc .EQ. 1)then 853 928 cs_res@vpWidthF = (xe-xs)/(ye-ys) 854 929 cs_res@vpHeightF = 1 930 vecres@vpWidthF = (xe-xs)/(ye-ys) 931 vecres@vpHeightF = 1 932 if (xe-xs .GT. ye-ys)then 933 cs_res@gsnPaperOrientation = "landscape" 934 vecres@gsnPaperOrientation = "landscape" 935 cs_res@lbOrientation = "Horizontal" 936 else 937 cs_res@gsnPaperOrientation = "portrait" 938 vecres@gsnPaperOrientation = "portrait" 939 cs_res@lbOrientation = "Vertical" 940 end if 855 941 end if 856 942 if (xzc .EQ. 1)then 857 943 cs_res@vpWidthF = (xe-xs)/(delta_x*(ze-zs)) 858 944 cs_res@vpHeightF = 1 945 vecres@vpWidthF = (xe-xs)/(delta_x*(ze-zs)) 946 vecres@vpHeightF = 1 947 if (xe-xs .GT. (delta_x*(ze-zs)))then 948 cs_res@gsnPaperOrientation = "landscape" 949 vecres@gsnPaperOrientation = "landscape" 950 cs_res@lbOrientation = "Horizontal" 951 else 952 cs_res@gsnPaperOrientation = "portrait" 953 vecres@gsnPaperOrientation = "portrait" 954 cs_res@lbOrientation = "Vertical" 955 end if 859 956 end if 860 957 if (yzc .EQ. 1)then 861 958 cs_res@vpWidthF = (ye-ys)/(delta_y*(ze-zs)) 862 959 cs_res@vpHeightF = 1 863 end if 864 end if 865 960 vecres@vpWidthF = (ye-ys)/(delta_y*(ze-zs)) 961 vecres@vpHeightF = 1 962 if (ye-ys .GT. (delta_y*(ze-zs)))then 963 cs_res@gsnPaperOrientation = "landscape" 964 vecres@gsnPaperOrientation = "landscape" 965 cs_res@lbOrientation = "Horizontal" 966 else 967 cs_res@gsnPaperOrientation = "portrait" 968 vecres@gsnPaperOrientation = "portrait" 969 cs_res@lbOrientation = "Vertical" 970 end if 971 end if 972 end if 973 866 974 delete(xs) 867 975 delete(xe) … … 874 982 ye=yend 875 983 984 if (xyc .EQ. 1) then 985 d=(ye-ys+1)/(major_ticks_y-1) 986 e=(xe-xs+1)/(major_ticks_x-1) 987 array_yl =new(major_ticks_y,integer) 988 array_yl_labels=new(major_ticks_y,double) 989 array_minor_yl =new((major_ticks_y-1)*4,double) 990 array_xb =new(major_ticks_x,integer) 991 array_xb_labels=new(major_ticks_x,double) 992 array_minor_xb =new((major_ticks_x-1)*4,double) 993 array_yl(0)=ys 994 array_xb(0)=xs 995 array_yl_labels(0)=y_d(ys) 996 array_xb_labels(0)=x_d(xs) 997 do ar=1,major_ticks_y-1 998 array_yl(ar)=d*(ar-1)+d-1 999 array_yl_labels(ar) = y_d(array_yl(ar)) 1000 if (ar .GT. 0) 1001 do min_ar=0,3 1002 array_minor_yl(4*(ar-1)+min_ar)= int2dble(array_yl(ar-1))+int2dble(array_yl(ar)-array_yl(ar-1))/5*(min_ar+1) 1003 end do 1004 end if 1005 end do 1006 do br=1,major_ticks_x-1 1007 array_xb(br)=e*(br-1)+e-1 1008 array_xb_labels(br) = x_d(array_xb(br)) 1009 if (br .GT. 0) 1010 do min_br=0,3 1011 array_minor_xb(4*(br-1)+min_br)= int2dble(array_xb(br-1))+int2dble(array_xb(br)-array_xb(br-1))/5*(min_br+1) 1012 end do 1013 end if 1014 end do 1015 end if 1016 1017 if (xzc .EQ. 1) then 1018 d=(ze-zs+1)/(major_ticks_y-1) 1019 e=(xe-xs+1)/(major_ticks_x-1) 1020 array_yl =new(major_ticks_y,integer) 1021 array_yl_labels=new(major_ticks_y,double) 1022 array_minor_yl =new((major_ticks_y-1)*4,double) 1023 array_xb =new(major_ticks_x,integer) 1024 array_xb_labels=new(major_ticks_x,double) 1025 array_minor_xb =new((major_ticks_x-1)*4,double) 1026 array_yl(0)=zs 1027 array_xb(0)=xs 1028 array_yl_labels(0)=z_d(zs) 1029 array_xb_labels(0)=x_d(xs) 1030 do ar=1,major_ticks_y-1 1031 array_yl(ar)=d*(ar-1)+d-1 1032 array_yl_labels(ar) = z_d(array_yl(ar)) 1033 if (ar .GT. 0) 1034 do min_ar=0,3 1035 array_minor_yl(4*(ar-1)+min_ar)= int2dble(array_yl(ar-1))+int2dble(array_yl(ar)-array_yl(ar-1))/5*(min_ar+1) 1036 end do 1037 end if 1038 end do 1039 do br=1,major_ticks_x-1 1040 array_xb(br)=e*(br-1)+e-1 1041 array_xb_labels(br) = x_d(array_xb(br)) 1042 if (br .GT. 0) 1043 do min_br=0,3 1044 array_minor_xb(4*(br-1)+min_br)= int2dble(array_xb(br-1))+int2dble(array_xb(br)-array_xb(br-1))/5*(min_br+1) 1045 end do 1046 end if 1047 end do 1048 end if 1049 1050 if (yzc .EQ. 1) then 1051 d=(ze-zs+1)/(major_ticks_y-1) 1052 e=(ye-ys+1)/(major_ticks_x-1) 1053 array_yl =new(major_ticks_y,integer) 1054 array_yl_labels=new(major_ticks_y,double) 1055 array_minor_yl =new((major_ticks_y-1)*4,double) 1056 array_xb =new(major_ticks_x,integer) 1057 array_xb_labels=new(major_ticks_x,double) 1058 array_minor_xb =new((major_ticks_x-1)*4,double) 1059 array_yl(0)=zs 1060 array_xb(0)=ys 1061 array_yl_labels(0)=z_d(zs) 1062 array_xb_labels(0)=y_d(ys) 1063 do ar=1,major_ticks_y-1 1064 array_yl(ar)=d*(ar-1)+d-1 1065 array_yl_labels(ar) = y_d(array_yl(ar)) 1066 if (ar .GT. 0) 1067 do min_ar=0,3 1068 array_minor_yl(4*(ar-1)+min_ar)= int2dble(array_yl(ar-1))+int2dble(array_yl(ar)-array_yl(ar-1))/5*(min_ar+1) 1069 end do 1070 end if 1071 end do 1072 do br=1,major_ticks_x-1 1073 array_xb(br)=e*(br-1)+e-1 1074 array_xb_labels(br) = x_d(array_xb(br)) 1075 if (br .GT. 0) 1076 do min_br=0,3 1077 array_minor_xb(4*(br-1)+min_br)= int2dble(array_xb(br-1))+int2dble(array_xb(br)-array_xb(br-1))/5*(min_br+1) 1078 end do 1079 end if 1080 end do 1081 end if 1082 1083 if (axes_explicit .EQ. 1)then 1084 cs_res@tmYLMode = "Explicit" 1085 cs_res@tmXBMode = "Explicit" 1086 cs_res@tmYLValues = array_yl 1087 if (xyc .EQ. 1)then 1088 cs_res@tmYLLabels = array_yl_labels/norm_y 1089 cs_res@tmXBLabels = array_xb_labels/norm_x 1090 if (norm_x .NE. 1.)then 1091 cs_res@tiXAxisString = "x ["+unit_x+"]" 1092 else 1093 cs_res@tiXAxisString = "x [m]" 1094 end if 1095 if (norm_y .NE. 1.)then 1096 cs_res@tiYAxisString = "y ["+unit_y+"]" 1097 else 1098 cs_res@tiYAxisString = "y [m]" 1099 end if 1100 end if 1101 if (xzc .EQ. 1)then 1102 cs_res@tmYLLabels = array_yl_labels/norm_z 1103 cs_res@tmXBLabels = array_xb_labels/norm_x 1104 if (norm_x .NE. 1.)then 1105 cs_res@tiXAxisString = "x ["+unit_x+"]" 1106 else 1107 cs_res@tiXAxisString = "x [m]" 1108 end if 1109 if (norm_z .NE. 1.)then 1110 cs_res@tiYAxisString = "z ["+unit_z+"]" 1111 else 1112 cs_res@tiYAxisString = "z [m]" 1113 end if 1114 end if 1115 if (yzc .EQ. 1)then 1116 cs_res@tmYLLabels = array_yl_labels/norm_z 1117 cs_res@tmXBLabels = array_xb_labels/norm_y 1118 if (norm_y .NE. 1.)then 1119 cs_res@tiXAxisString = "y ["+unit_y+"]" 1120 else 1121 cs_res@tiXAxisString = "y [m]" 1122 end if 1123 if (norm_z .NE. 1.)then 1124 cs_res@tiYAxisString = "z ["+unit_z+"]" 1125 else 1126 cs_res@tiYAxisString = "z [m]" 1127 end if 1128 end if 1129 cs_res@tmXBValues = array_xb 1130 cs_res@tmYLMinorValues = array_minor_yl 1131 cs_res@tmXBMinorValues = array_minor_xb 1132 else 1133 if (axes_explicit .EQ. 0)then 1134 cs_res@tmYLMinorPerMajor = 4 1135 cs_res@tmXBMinorPerMajor = 4 1136 else 1137 print(" ") 1138 print("'axes_explicit' is invalid and set to 0") 1139 print(" ") 1140 axes_explicit = 0 1141 cs_res@tmYLMinorPerMajor = 4 1142 cs_res@tmXBMinorPerMajor = 4 1143 end if 1144 if (xyc .EQ. 1)then 1145 cs_res@tiXAxisString = "x [gridpoints]" 1146 cs_res@tiYAxisString = "y [gridpoints]" 1147 end if 1148 if (xzc .EQ. 1)then 1149 cs_res@tiXAxisString = "x [gridpoints]" 1150 cs_res@tiYAxisString = "z [gridpoints]" 1151 end if 1152 if (yzc .EQ. 1)then 1153 cs_res@tiXAxisString = "y [gridpoints]" 1154 cs_res@tiYAxisString = "z [gridpoints]" 1155 end if 1156 end if 1157 876 1158 if (xyc .EQ. 1 .OR. xzc .EQ.1)then 877 1159 if (xe .EQ. xs+1) then … … 916 1198 917 1199 MinVal = new(dim,float) 918 MaxVal = new(dim,float) 1200 MaxVal = new(dim,float) 1201 unit = new(dim,string) 919 1202 920 1203 ; **************************************************** … … 980 1263 981 1264 if (xyc .EQ. 1) then 982 data(varn,:,:,:,:)=f->$vNam(varn)$(:,zs:ze,ys:ye,xs:xe) 1265 temp = f[:]->$vNam(varn)$ 1266 data_att = f_att->$vNam(varn)$ 1267 data(varn,:,:,:,:)=temp(:,zs:ze,ys:ye,xs:xe) 983 1268 end if 984 1269 if ( xzc .eq. 1 ) then 985 data(varn,:,:,:,:)=f->$vNam(varn)$(:,zs:ze,ys:ye,xs:xe) 1270 temp = f[:]->$vNam(varn)$ 1271 data_att = f_att->$vNam(varn)$ 1272 data(varn,:,:,:,:)=temp(:,zs:ze,ys:ye,xs:xe) 986 1273 end if 987 1274 if ( yzc .eq. 1) then 988 data(varn,:,:,:,:)=f->$vNam(varn)$(:,zs:ze,ys:ye,xs:xe) 1275 temp = f[:]->$vNam(varn)$ 1276 data_att = f_att->$vNam(varn)$ 1277 data(varn,:,:,:,:)=temp(:,zs:ze,ys:ye,xs:xe) 989 1278 end if 990 1279 if (check_vec1) then … … 1003 1292 MinVal(varn) = min(data(varn,:,:,:,:)) 1004 1293 MaxVal(varn) = max(data(varn,:,:,:,:)) 1294 1295 unit(varn) = data_att@units 1005 1296 1006 1297 end if … … 1075 1366 gsn_define_colormap(wks_ps,"rainbow+white") 1076 1367 1077 plot=new((/no_time*no_layer*no_var/),graphic) 1078 1368 if (vector .EQ. 1 .AND. plotvec .EQ. "plotvec") then 1369 plot=new((/no_time*no_layer*no_var+no_time*no_layer/),graphic) 1370 else 1371 plot=new((/no_time*no_layer*no_var/),graphic) 1372 end if 1373 1079 1374 page = 0 1080 1375 n=0 … … 1090 1385 do lo = los, loe 1091 1386 do li = lis, lie 1092 level = "=" + data&z(lo) + "m" 1387 if (xyc .EQ. 1)then 1388 if (sort .EQ. "time")then 1389 level = "z=" + z_d(lo) + "m" 1390 else 1391 level = "z=" + z_d(li) + "m" 1392 end if 1393 end if 1394 if (xzc .EQ. 1)then 1395 if (sort .EQ. "time")then 1396 level = "y=" + y_d(lo) + "m" 1397 else 1398 level = "y=" + y_d(li) + "m" 1399 end if 1400 end if 1401 if (yzc .EQ. 1)then 1402 if (sort .EQ. "time")then 1403 level = "x=" + x_d(lo) + "m" 1404 else 1405 level = "x=" + x_d(li) + "m" 1406 end if 1407 end if 1093 1408 vecres = True ; vector only resources 1094 1409 vecres@gsnDraw = False ; don't draw … … 1098 1413 vecres@vcRefLengthF = 0.05 ; define length of vec ref 1099 1414 vecres@gsnRightString = "Vector plot of "+vec1+" and "+vec2 1100 vecres@gsnLeftString = "t=" + data&t(li) +"s z"+level 1101 vecres@tiXAxisString = " " 1102 plot(n) = gsn_csm_vector(wks_ps,vect1(li,lo,:,:),vect2(li,lo,:,:),vecres) 1415 vecres@tmXBLabelFontHeightF = font_size 1416 vecres@tmYLLabelFontHeightF = font_size 1417 vecres@tiXAxisFontHeightF = font_size 1418 vecres@tiYAxisFontHeightF = font_size 1419 if (sort .EQ. "time")then 1420 vecres@gsnLeftString = "t=" + decimalPlaces(t_all(li)/3600,2,True) +"h "+level 1421 else 1422 vecres@gsnLeftString = "t=" + decimalPlaces(t_all(lo)/3600,2,True) +"h "+level 1423 end if 1424 vecres@tiXAxisString = " " 1425 if (xyc .EQ. 1)then 1426 if (sort .EQ. "time")then 1427 plot(n) = gsn_csm_vector(wks_ps,vect1(li,lo,:,:),vect2(li,lo,:,:),vecres) 1428 else 1429 plot(n) = gsn_csm_vector(wks_ps,vect1(lo,li,:,:),vect2(lo,li,:,:),vecres) 1430 end if 1431 end if 1432 if (xzc .EQ. 1) then 1433 if (sort .EQ. "time")then 1434 plot(n) = gsn_csm_vector(wks_ps,vect1(li,:,lo,:),vect2(li,:,lo,:),vecres) 1435 else 1436 plot(n) = gsn_csm_vector(wks_ps,vect1(lo,:,li,:),vect2(lo,:,li,:),vecres) 1437 end if 1438 end if 1439 if (yzc .EQ. 1) then 1440 if (sort .EQ. "time")then 1441 plot(n) = gsn_csm_vector(wks_ps,vect1(li,:,:,lo),vect2(li,:,:,lo),vecres) 1442 else 1443 plot(n) = gsn_csm_vector(wks_ps,vect1(lo,:,:,li),vect2(lo,:,:,li),vecres) 1444 end if 1445 end if 1103 1446 n=n+1 1104 1447 end do … … 1123 1466 1124 1467 if(check) then 1125 1468 1126 1469 space=(MaxVal(varn)-MinVal(varn))/24 1127 1470 … … 1144 1487 1145 1488 if ( xyc .eq. 1 ) then 1146 1147 cs_res@tiXAxisString = "x [m]" 1148 cs_res@tiYAxisString = "y [m]" 1489 1149 1490 cs_res@gsnLeftString = "Plot of "+vNam(varn) 1491 cs_res@gsnRightString = unit(varn) 1150 1492 1151 1493 if ( sort .eq. "time" ) then 1152 if ( data&z(lo) .eq. -1)then1494 if ( z_d(lo) .eq. -1)then 1153 1495 if (delta_z .EQ. -1) then 1154 1496 level = "-average" 1155 1497 else 1156 level = "=" + data&z(lo) + "m"1498 level = "=" + z_d(lo) + "m" 1157 1499 end if 1158 1500 else 1159 level = "=" + data&z(lo) + "m"1501 level = "=" + z_d(lo) + "m" 1160 1502 end if 1161 1503 cs_res@gsnCenterString = "t=" + decimalPlaces(t_all(li)/3600,2,True) +"h z"+level … … 1177 1519 1178 1520 if ( sort .eq. "layer" ) then 1179 if ( data&z(li) .eq. -1) then1521 if (z_d(li) .eq. -1) then 1180 1522 if (delta_z .EQ. -1) then 1181 1523 level = "-average" 1182 1524 else 1183 level = "=" + data&z(li) + "m"1525 level = "=" + z_d(li) + "m" 1184 1526 end if 1185 1527 else 1186 level = "=" + data&z(li) + "m"1528 level = "=" + z_d(li) + "m" 1187 1529 end if 1188 1530 cs_res@gsnCenterString = "t=" + decimalPlaces(t_all(lo)/3600,2,True) + "h z"+ level … … 1209 1551 1210 1552 if ( xzc .eq. 1 ) then 1211 1212 cs_res@tiXAxisString = "x [m]" 1213 cs_res@tiYAxisString = "z [m]" 1553 1214 1554 cs_res@gsnLeftString = "Plot of "+vNam(varn) 1215 1555 1216 1556 if ( sort .eq. "time" ) then 1217 if ( data&y(lo) .eq. -1 ) then1557 if ( y_d(lo) .eq. -1 ) then 1218 1558 level = "-average" 1219 1559 else 1220 level = "=" + data&y(lo) + "m"1560 level = "=" + y_d(lo) + "m" 1221 1561 end if 1222 cs_res@gsnCenterString = "t=" + decimalPlaces(t_all(li)/3600,2,True) + " sy"+ level1562 cs_res@gsnCenterString = "t=" + decimalPlaces(t_all(li)/3600,2,True) + "h y"+ level 1223 1563 plot(n) = gsn_csm_contour(wks_ps,data(varn,li,:,lo,:),cs_res) 1224 1564 if (vector .EQ. 1 .AND. check_vecp) then … … 1232 1572 vecres@gsnLeftString = " " ; turn off left string 1233 1573 vecres@tiXAxisString = " " 1234 plot_vec=gsn_csm_vector(wks_ps,vect1(li, lo,:,:),vect2(li,lo,:,:),vecres)1574 plot_vec=gsn_csm_vector(wks_ps,vect1(li,:,lo,:),vect2(li,:,lo,:),vecres) 1235 1575 overlay(plot(n), plot_vec) 1236 1576 end if … … 1238 1578 1239 1579 if ( sort .eq. "layer" ) then 1240 if ( data&y(li) .eq. -1 ) then1580 if ( y_d(li) .eq. -1 ) then 1241 1581 level = "-average" 1242 1582 else 1243 level = "=" + data&y(li) + "m"1583 level = "=" + y_d(li) + "m" 1244 1584 end if 1245 cs_res@gsnCenterString = "t=" + decimalPlaces(t_all(lo)/3600,2,True) + " sy"+ level1585 cs_res@gsnCenterString = "t=" + decimalPlaces(t_all(lo)/3600,2,True) + "h y"+ level 1246 1586 plot(n) = gsn_csm_contour(wks_ps,data(varn,lo,:,li,:),cs_res) 1247 1587 if (vector .EQ. 1 .AND. check_vecp) then … … 1255 1595 vecres@gsnLeftString = " " ; turn off left string 1256 1596 vecres@tiXAxisString = " " 1257 plot_vec=gsn_csm_vector(wks_ps,vect1(lo, li,:,:),vect2(lo,li,:,:),vecres)1597 plot_vec=gsn_csm_vector(wks_ps,vect1(lo,:,li,:),vect2(lo,:,li,:),vecres) 1258 1598 overlay(plot(n), plot_vec) 1259 1599 end if … … 1266 1606 1267 1607 if ( yzc .eq. 1 ) then 1268 1269 cs_res@tiXAxisString = "y [m]" 1270 cs_res@tiYAxisString = "z [m]" 1608 1271 1609 cs_res@gsnLeftString = "Plot of "+vNam(varn) 1272 1610 1273 1611 if ( sort .eq. "time" ) then 1274 if ( data&x(lo) .eq. -1 ) then1612 if ( x_d(lo) .eq. -1 ) then 1275 1613 level = "-average" 1276 1614 else 1277 level = "=" + data&x(lo) + "m"1615 level = "=" + x_d(lo) + "m" 1278 1616 end if 1279 cs_res@gsnCenterString = "t=" + decimalPlaces(t_all(li)/3600,2,True) + " sx"+ level1617 cs_res@gsnCenterString = "t=" + decimalPlaces(t_all(li)/3600,2,True) + "h x"+ level 1280 1618 plot(n) = gsn_csm_contour(wks_ps,data(varn,li,:,:,lo),cs_res) 1281 1619 if (vector .EQ. 1 .AND. check_vecp) then … … 1289 1627 vecres@gsnLeftString = " " ; turn off left string 1290 1628 vecres@tiXAxisString = " " 1291 plot_vec=gsn_csm_vector(wks_ps,vect1(li, lo,:,:),vect2(li,lo,:,:),vecres)1629 plot_vec=gsn_csm_vector(wks_ps,vect1(li,:,:,lo),vect2(li,:,:,lo),vecres) 1292 1630 overlay(plot(n), plot_vec) 1293 1631 end if … … 1295 1633 1296 1634 if ( sort .eq. "layer" ) then 1297 if ( data&x(li) .eq. -1 ) then1635 if ( x_d(li) .eq. -1 ) then 1298 1636 level = "-average" 1299 1637 else 1300 level = "=" + data&x(li) + "m"1638 level = "=" + x_d(li) + "m" 1301 1639 end if 1302 cs_res@gsnCenterString = "t=" + decimalPlaces(t_all(lo)/3600,2,True) + " sx"+ level1640 cs_res@gsnCenterString = "t=" + decimalPlaces(t_all(lo)/3600,2,True) + "h x"+ level 1303 1641 plot(n) = gsn_csm_contour(wks_ps,data(varn,lo,:,:,li),cs_res) 1304 1642 if (vector .EQ. 1 .AND. check_vecp)then … … 1312 1650 vecres@gsnLeftString = " " ; turn off left string 1313 1651 vecres@tiXAxisString = " " 1314 plot_vec=gsn_csm_vector(wks_ps,vect1(lo, li,:,:),vect2(lo,li,:,:),vecres)1652 plot_vec=gsn_csm_vector(wks_ps,vect1(lo,:,:,li),vect2(lo,:,:,li),vecres) 1315 1653 overlay(plot(n), plot_vec) 1316 1654 end if 1317 1655 end if 1318 1656 end if 1319 n=n+1 1657 n=n+1 1320 1658 end do 1321 1659 end do … … 1334 1672 print(" ") 1335 1673 else 1336 do np = 0,no_layer*no_time*(no_var+1)-1,no_ lines*no_columns1337 if ( np + no_ lines*no_columns .gt. (no_layer*no_time*(no_var+1))-1) then1338 gsn_panel(wks_ps, plot(np:(no_layer*no_time*(no_var+1))-1),(/no_ lines,no_columns/),cs_resP)1674 do np = 0,no_layer*no_time*(no_var+1)-1,no_rows*no_columns 1675 if ( np + no_rows*no_columns .gt. (no_layer*no_time*(no_var+1))-1) then 1676 gsn_panel(wks_ps, plot(np:(no_layer*no_time*(no_var+1))-1),(/no_rows,no_columns/),cs_resP) 1339 1677 else 1340 gsn_panel(wks_ps, plot(np:np+no_ lines*no_columns-1),(/no_lines,no_columns/),cs_resP)1678 gsn_panel(wks_ps, plot(np:np+no_rows*no_columns-1),(/no_rows,no_columns/),cs_resP) 1341 1679 end if 1342 1680 end do 1343 1681 end if 1344 else 1682 else 1345 1683 if (format_out .EQ. "eps" .OR. format_out .EQ. "epsi") then 1346 1684 gsn_panel(wks_ps,plot(0:(no_time*no_layer*no_var)-1),(/no_var,no_layer*no_time/),cs_resP) … … 1349 1687 print(" ") 1350 1688 else 1351 do np = 0,no_layer*no_time*no_var-1,no_ lines*no_columns1352 if ( np + no_ lines*no_columns .gt. (no_layer*no_time*no_var)-1) then1353 gsn_panel(wks_ps, plot(np:(no_layer*no_time*no_var)-1),(/no_ lines,no_columns/),cs_resP)1689 do np = 0,no_layer*no_time*no_var-1,no_rows*no_columns 1690 if ( np + no_rows*no_columns .gt. (no_layer*no_time*no_var)-1) then 1691 gsn_panel(wks_ps, plot(np:(no_layer*no_time*no_var)-1),(/no_rows,no_columns/),cs_resP) 1354 1692 else 1355 gsn_panel(wks_ps, plot(np:np+no_ lines*no_columns-1),(/no_lines,no_columns/),cs_resP)1693 gsn_panel(wks_ps, plot(np:np+no_rows*no_columns-1),(/no_rows,no_columns/),cs_resP) 1356 1694 end if 1357 1695 end do
Note: See TracChangeset
for help on using the changeset viewer.