[gradsusr] How to combine ctl files in grads?

giacomo tricarico mino-98 at hotmail.it
Wed Oct 21 16:12:32 EDT 2015


Hi James, I've used Jennifer's script. Her answer was:
"It sounds like what you want to do is change a 3-hourly time series to a 6-hourly time series. And that you have to do with brute-force coding by writing out a new file, one time step at a time, that adds two 3hr accumulations to get the 6hr accumulation. Something generally like this:"

This is my actual situation:WRF-NMM gives me 48 hours of forecast, with steps of 3 hours (so 17 files precisely). So I can only have rain accumulated for 3 hours: what I'm trying to do is having rain accumulated in 6 hours, or maybe also 12h and 24h.

WRF's files are processed by unipost and UPP, so that I have 17 files that can be used by grads. An example iswrfprs_d01_00.ctl, like wrfprs_d01_03.ctl and so on until wrfprs_d01_48.ctl.
This is for example wrfprs_d01_48.ctl (+48h):
dset ^wrfprs_d01.48index ^wrfprs_d01.48.idxundef 9.999E+20title wrfprs_d01.48*  produced by grib2ctl v0.9.13* command line options: -verf wrfprs_d01.48dtype grib 255pdef 93 87 lccr 40.251000 16.141000 1 1 40.805000 40.805000 16.914000 1391 1430xdef 93 linear 16.141000 0.0165685317281457ydef 87 linear 40.251000 0.013tdef 1 linear 12Z23oct2015 1mo*  z has 26 levels, for prszdef 26 levels1000 975 950 925 900 875 850 825 800 775 750 700 650 600 550 500 450 400 375 350 300 250 200 150 100 50vars 130......APCPsfc  0 61,1,0  ** surface Total precipitation [kg/m^2]......APCPsfc tough only gives me 3h accumulated precipitation, as I've said.

So I'm trying to find the best solution for this :)

Thanks AgainTo: gradsusr at gradsusr.org
From: jimp at hawaii.edu
Date: Wed, 21 Oct 2015 09:32:36 -1000
Subject: Re: [gradsusr] How to combine ctl files in grads?


  
    
  
  
    Giacomo,

    

    I'm now confused as to what you are trying to do.  You originally
    wanted to combine two GrADS data descriptor files, so I presumed you
    wanted to use the template option whereby you have one control file
    for many binary files.  It now appears that you want to do some sort
    of time integration (or summing?).  It might help if you give more
    information on your descriptor files (ctl files) and binary files,
    for example how is time defined in the ctl file and how do you
    define the data file (DSET)? The message below suggests you might be
    trying to access a time that is not defined.

    

    Jim

    

    On 10/21/15 9:10 AM, giacomo tricarico
      wrote:

    
    
      
      Thanks Jennifer :)

        

        I've put this:

        'clear'
        'set gxout fwrite'
        'set fwrite -ap 'provafile
        t=3
        while (t<=tlast)
        'set t 't
        'd APCPsfc+APCPsfc(t-1)'
        t=t+2
        endwhile
        'disable fwrite'
        

        
        but I get:

          Data Request Warning:  Request is completely outside file
            limits
          Data Request Warning:  Request is completely outside file
            limits
          Data Request Warning:  Request is completely outside file
            limits
          Data Request Warning:  Request is completely outside file
            limits
          Data Request Warning:  Request is completely outside file
            limits
          Data Request Warning:  Request is completely outside file
            limits
          Data Request Warning:  Request is completely outside file
            limits
          Data Request Warning:  Request is completely outside file
            limits
        
        ....
        

        
          From: jma at cola.iges.org

          Date: Wed, 21 Oct 2015 11:14:38 -0400

          To: gradsusr at gradsusr.org

          Subject: Re: [gradsusr] How to combine ctl files in grads?

          

          It sounds like what you want to do is change a 3-hourly time
          series to a 6-hourly time series. And that you have to do with
          brute-force coding by writing out a new file, one time step at
          a time, that adds two 3hr accumulations to get the 6hr
          accumulation. Something generally like this:
          

          
          ’set
                gxout fwrite’
          ‘set
                fwrite -ap 'outfilename
          *
                don’t forget to remove the outfile before you begin,
                otherwise you’ll append to an existing file
          t=3
          while
                (t<=tlast)
            ‘set
                t ‘t
            'd
                p+p(t-1)’
           
                t=t+2
          endwhile
          ‘disable
                fwrite’
          

              
          —Jennifer
          

            

            
            

              

                
                  On Oct 20, 2015, at 3:46 PM, giacomo tricarico
                    <mino-98 at hotmail.it>
                    wrote:
                  
                  
                    
                    
                      Hi, since in my GRADS's files
                        (produced by WRF-NMM Unipost) rain is in 3h
                        steps, I would like to combine for example 2 ctl
                        files, so that in one I have 6h rain:
                        how could I do this?

                          

                          Thanks,
                        Giacomo
                      
                    
                    _______________________________________________

                    gradsusr mailing list

                    gradsusr at gradsusr.org

                    http://gradsusr.org/mailman/listinfo/gradsusr

                  
                
                

                
                  
                      --
                      Jennifer M. Adams

                        Center for Ocean-Land-Atmosphere Studies (COLA)

                        111 Research Hall, Mail Stop 2B3

                        George Mason University

                        4400 University Drive

                        Fairfax, VA 22030 

                        

                      
                      
                      
                      
                    
                
                

              
            
          
          

          _______________________________________________
          gradsusr mailing list
          gradsusr at gradsusr.org
          http://gradsusr.org/mailman/listinfo/gradsusr
      
      

      
      

      _______________________________________________
gradsusr mailing list
gradsusr at gradsusr.org
http://gradsusr.org/mailman/listinfo/gradsusr

    
    

  


_______________________________________________
gradsusr mailing list
gradsusr at gradsusr.org
http://gradsusr.org/mailman/listinfo/gradsusr 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://gradsusr.org/pipermail/gradsusr/attachments/20151021/d987c3bf/attachment.html 


More information about the gradsusr mailing list