Ignore:
Timestamp:
Jul 8, 2008 8:29:06 AM (14 years ago)
Author:
steinfeld
Message:

NCL scripts for spectra added. Bug fix concerning spectra in netcdf.f90

File:
1 edited

Legend:

Unmodified
Added
Removed
  • palm/trunk/SCRIPTS/NCL/timeseries.ncl

    r174 r175  
    1010   ; ***************************************************
    1111   
    12    if (isfilepresent(".ncl_preferences")) then
    13       parameter = asciiread(".ncl_preferences",77,"string")
     12   if (isfilepresent("~/.ncl_preferences")) then
     13      parameter = asciiread("~/.ncl_preferences",129,"string")
    1414      delete(parameter@_FillValue)
    1515   else
    16       print(" ")
    17       print("'.ncl_preferences' is not existent")
    18       print(" ")
    19       exit
     16      if (isfilepresent("~/palm/current_version/trunk/SRIPTS/NCL/.ncl_preferences")) then
     17         parameter = asciiread("~/palm/current_version/trunk/SRIPTS/NCL/.ncl_preferences",129,"string")
     18         delete(parameter@_FillValue)
     19      else
     20         print(" ")
     21         print("'.ncl_preferences' is not present in '~/palm/current_version/trunk/SRIPTS/NCL/'")
     22         print(" ")
     23         exit
     24      end if
    2025   end if
    2126
     
    2429   ; ***************************************************
    2530 
    26    if ( .not. isvar("file_in") ) then                   ; path+name of input file     
    27       if (parameter(7) .EQ. "input file") then
    28          print(" ")
    29          print("Please provide input file 'file_in = ' either in prompt or parameter_list")
     31   if ( .not. isvar("file_1") ) then                     
     32      if (parameter(7) .EQ. "File in") then
     33         print(" ")
     34         print("Please provide 1st input file 'file_1=' either in prompt or parameter_list")
    3035         print(" ")
    3136         exit
    3237      else
    3338         file_in = parameter(7)
    34       end if     
    35    end if
    36    if ( .not. isvar("format_out") ) then                ; format of output file
     39      end if   
     40   else
     41      file_in = file_1   
     42   end if
     43   if (.not. isfilepresent(file_in)) then
     44      print(" ")
     45      print("Your 1st input file: '"+file_in+"' does not exist")
     46      print(" ")
     47      exit
     48   end if
     49
     50   if ( .not. isvar("format_out") ) then               
    3751      format_out = "x11"
    3852      if (parameter(9) .NE. "x11") then
    3953         format_out = parameter(9) 
     54         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
     55            print(" ")
     56            print("Your 'format_out = "+format_out+"' is invalid and set to'x11'")
     57            print(" ")
     58         end if 
    4059      end if
    41    end if
     60   else
     61      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
     62         print(" ")
     63         print("Your 'format_out = "+format_out+"' is invalid and set to'x11'")
     64         print(" ")
     65      end if   
     66   end if
     67
    4268   if ( .not. isvar("file_out") ) then                  ; path+name of output file
    4369      file_out = "test"
     
    4672      end if     
    4773   end if
     74
    4875   if ( .not. isvar("no_columns") ) then                ; number of plots in one row
    4976      no_columns = 1
     
    5279      end if
    5380   end if
     81
    5482   if ( .not. isvar("no_lines") ) then                  ; number of plot-lines on one sheet
    5583      no_lines = 2
     
    5886      end if
    5987   end if 
     88
    6089   if ( .not. isvar("var") ) then                       ; variable name
    6190      check = True
    6291   end if
     92
    6393   if ( .not. isvar("over") ) then                      ; switches overlaying plots on
    6494      over = 0
     
    6797         if (stringtointeger(parameter(37)) .NE. 1) then
    6898            print(" ")
    69             print("Please set 'over' to 0 or 1")
    70             print(" ")
    71             exit
     99            print("Your 'over'= "+over+" is invalid and set to 0")
     100            print(" ")
     101            over = 0
    72102         end if   
    73103      end if
    74    end if
    75  
     104   else
     105      if (over .NE. 0 .AND. over .NE. 1)then
     106         print(" ")
     107         print("Your 'over'= "+over+" is invalid and set to 0")
     108         print(" ")
     109         over = 0
     110      end if
     111   end if
     112
    76113   ; ***************************************************
    77114   ; open input file
     
    220257   delete(end_time_step)
    221258   end_time_step=round(et,3)
     259
     260   print(" ")
     261   print("Output of time steps from "+t_all(start_time_step)/3600+" h = "+t_all(start_time_step)+" s => index = "+start_time_step)
     262   print("                     till "+t_all(end_time_step)/3600+" h = "+t_all(end_time_step)+" s => index = "+end_time_step)
     263   print(" ")
    222264
    223265   t = f->time(start_time_step:end_time_step)
     
    477519   if (count_var .EQ. 0) then
    478520      print(" ")
    479       print("Please select a variable 'var=' or use the default value")
    480       print(" ")
    481       print("Your selection '"+var+"' does not exist on the input file")
     521      print("The variables 'var=°"+var+"°' do not exist on your input file")
    482522      print(" ")
    483523      exit
    484    end if 
     524   end if
    485525
    486526   do varn = dim-1,0,1
     
    500540 
    501541      if(check) then
     542
     543        if (isStrSubset(vNam(varn),"_0" ))then
     544            print(" ")
     545            print("If you have Outputs of statistic regions you cannot overlay variables; 'over' is set to 0")
     546            print(" ")
     547            over = 0
     548         end if
    502549
    503550        if (over .EQ. 1) then
Note: See TracChangeset for help on using the changeset viewer.