gwnu_numerical
gwnu_numerical

Reputation: 11

I use ncl, but gsn_panel takes too long only in certain files and never ends

I'm a user using ncl We're in the process of rotating the numerical model and visualizing the results For comparative analysis, I was drawing with gsn_panel and found that it no longer works and shuts down only in certain files

I thought it would take a long time, so I left it on all day, but it still didn't come out There was no error phrase, just gsn_panel working indefinitely

For other cases, we found it to be a work that doesn't take much time

I don't understand why it's like this

Below is my ncl code

begin
  files := systemfunc("ls /Volumes/hard/data/np3ne045/*.nc")
  files2 := systemfunc("ls /Volumes/hard/data/np4ne030/*.nc")

  print("Load File List...")

  nfile = dimsizes(files)
  dates = new(nfile, string)

  explist = new(nfile, "string")

  print("Set File variables...")

  do j = 3, 3
    dates(j) = str_get_field(files(j), 2, "-")
    dates(j) = str_get_field(dates(j), 1, ".")
    explist(j) = str_get_field(files(j), 3, "-")
    explist(j) = str_get_field(explist(j), 1, ".")
  end do
 
  print("Make Date and Exp_Num...")

  do i = 3, 3
    ncfile = addfile("/Volumes/hard/data/np3ne045/UP-" + dates(i) + "-" + explist(i) + ".nc" , "r")
    pres1 = ncfile->pds(0,:)

    print("Load Left Panel File...")

    ncfile2 = addfile("/Volumes/hard/data/np4ne030/UP-" + dates(i) + "-" + explist(i) + ".nc" , "r")
    pres2 = ncfile2->pds(0,:)
    
    print("Load Right Panel File...")

    wks = gsn_open_wks("png", "./figure/np3ne045_np4ne030_panel" + explist(i))
    
    setvalues NhlGetWorkspaceObjectId()
      "wsMaximumSize" : 500000000000
    end setvalues
    
    print("Set Workstation Option...")

    res = True
    
    res@gsnMaximize = True
    
    res@cnFillOn = True
    res@cnLinesOn = False
    res@cnLineLabelsOn = False
    res@cnConstFEnableFill = True
    res@cnLevelSelectionMode = "ExplicitLevels"
    res@cnLevels = ispan(99975, 100020, 1)
    
    res@cnFillPalette = "NCV_blue_red"
    res@lbLabelBarOn = False
    
    print("Set Contour1 Resource...")

    res@gsnLeftString = "np3ne045"
    res@gsnRightString = dates(i)
    
    res@gsnDraw = False
    res@gsnFrame = False
    
    res@sfXArray = ncfile->lons
    res@sfYArray = ncfile->lats

    print("Set Sub Option1...")
;-----------------------------------------------------------------------------
    res1 = True
    
    res1@gsnMaximize = True

    res1@cnFillOn = True
    res1@cnLinesOn = False
    res1@cnLineLabelsOn = False
    res1@cnConstFEnableFill = True
    res1@cnLevelSelectionMode = "ExplicitLevels"
    res1@cnLevels = ispan(99975, 100020, 1)
    res1@cnFillPalette = "NCV_blue_red"
    res1@lbLabelBarOn = False
    
    print("Set Contour2 Resource...")

    res1@gsnLeftString = "np4ne030"
    res1@gsnRightString = dates(i)
    
    res1@gsnDraw = False
    res1@gsnFrame = False
    
    res1@sfXArray = ncfile2->lons
    res1@sfYArray = ncfile2->lats
    
    print("Set Sub Option2...")

    map = gsn_csm_contour_map(wks, pres1, res)      
    map1 = gsn_csm_contour_map(wks, pres2, res1)

    print("Draw Map...")

    pnlres = True
    row = 2
    col = 1
    pnlres@gsnPanelLabelBar = True
    pnlres@gsnPanelMainString = "Jablonowski-Williamson Initial State"
    pnlres@gsnPanelYWhiteSpacePercent = 3

    print("Set Panel Option...")

    gsn_panel(wks, (/map, map1/), (/row, col/), pnlres)    

    print("Draw Panel...")    

    print("Finish Draw")
  end do
end

Upvotes: 0

Views: 10

Answers (0)

Related Questions