Manage wrf output variables

Questions and other topics related to UEMS 15.
gtrem
Posts: 10
Joined: Mon Aug 18, 2014 3:03 pm

Manage wrf output variables

Post by gtrem » Wed Dec 09, 2015 11:10 am

Hi,

I am using UEMS version 15.47.3 and I would like to write to the wrf netcdf output files the following variables: swddir, swddni, swddif, etc ... (WRF-Solar).

I have edited the Registry file (/wrf/uems/util/UEMSbuild/src/models/wrf/WRFncar2uems/Registry/Registry.EM_COMMON) and search for the lines that start with "state real swddir", "state real swddni" and "state real swddif". I have changed the 8-th column of these lines from "rd" to "rhd" and saved the file.

But there is no change. Do I have to re-compile the code or is there another way to do it ?

Thanks!

meteoadriatic
Posts: 1531
Joined: Wed Aug 19, 2009 10:05 am

Re: Manage wrf output variables

Post by meteoadriatic » Wed Dec 09, 2015 1:08 pm

gtrem wrote:But there is no change. Do I have to re-compile the code or is there another way to do it ?
Yes, Registry settings are read at compile-time and built into exe binary.

gtrem
Posts: 10
Joined: Mon Aug 18, 2014 3:03 pm

Re: Manage wrf output variables

Post by gtrem » Wed Dec 09, 2015 1:21 pm

meteoadriatic wrote: Yes, Registry settings are read at compile-time and built into exe binary.
Thank you meteoadriatic. Can you tell me how to re-compile ?

meteoadriatic
Posts: 1531
Joined: Wed Aug 19, 2009 10:05 am

Re: Manage wrf output variables

Post by meteoadriatic » Wed Dec 09, 2015 1:50 pm

I believe I don't know the procedure to recompile EMS version. Probably you should ask Robert Rozumalski for instructions but I guess you will need to have PGI compiler...

smartie
Posts: 94
Joined: Sat May 21, 2011 7:34 am

Re: Manage wrf output variables

Post by smartie » Thu Dec 10, 2015 9:10 pm

You don't have to recompile to alter output streams. Instructions for WRF 3.4.1 are given here-
viewtopic.php?f=5&t=593

I haven't converted over to UEMS with 3.7.1 yet but it's likely something similar.
To recompile UEMS you'll have to copy over Bob's source code mods into 3.7.1 source code and use PGF. If you have a different compiler you may well have to make further mods.

gtrem
Posts: 10
Joined: Mon Aug 18, 2014 3:03 pm

Re: Manage wrf output variables

Post by gtrem » Fri Dec 11, 2015 8:20 am

Thanks Smartie.
After having talked to Robert, there are actually two ways to modify output streams:
1) following the instructions you gave
2) by modifying the Registry and then recompile. The directions are summarized in uems/util/UEMSbuild/SourceCode_WhatsInHere.txt but the basics steps are the same as the NCAR release, except the UEMS modified files must be included. Don't need a PGI compiler but Robert has never used the GNU compilers so will have to modify the configuration files.

About point 1):
I tried your instructions and it works well with WRF 3.4.1, but there is something I miss with UEMS because that doesn't work. I asked Robert and he told me that he has not implemented this functionality into the UEMS so I will have to do the work. But I don't know what is the work exactly.
What I have seen is that part of the code WRFrun.pm (step 2 of your instructions) has been changed in UEMS, and I don't know at this moment if this file has to be modified or not. The uems/data/tables/wrf/ structure has been modified too.

If you have any ideas !

smartie
Posts: 94
Joined: Sat May 21, 2011 7:34 am

Re: Manage wrf output variables

Post by smartie » Fri Dec 11, 2015 9:58 am

It looks like around 241

Code: Select all

    #  Finally create the links to the various lookup tables depending upon the
    #  core being used and we'll be off and running
    #
    my @tables = ($core =~ /nmm/i) ? qw(ETAMPNEW_DATA ETAMPNEW_DATA.expanded_rain RRTM_DATA GENPARM.TBL LANDUSE.TBL 
                                        SOILPARM.TBL VEGPARM.TBL MPTABLE.TBL tr49t67 tr49t85 tr67t85 gribmap.txt
                                        grib2map.tbl co2_trans my_iofields_list.txt) 

                                   : qw(ETAMPNEW_DATA ETAMPNEW_DATA.expanded_rain RRTM_DATA RRTMG_LW_DATA RRTMG_SW_DATA 
                                        CAM_ABS_DATA CAM_AEROPT_DATA ozone.formatted ozone_lat.formatted ozone_plev.formatted
                                        GENPARM.TBL LANDUSE.TBL SOILPARM.TBL URBPARM.TBL VEGPARM.TBL MPTABLE.TBL tr49t67
                                        tr49t85 tr67t85 gribmap.txt grib2map.tbl my_iofields_list.txt);
                                        
    foreach (@tables) {symlink "$ENV{DATA_TBLS}/wrf/$_" => "$ENV{EMS_RUN}/$_"; push @rfiles => "$ENV{EMS_RUN}/$_";}
    foreach (@{$WRFrun{GEONMM}}) {symlink "static/$_" => "$_"; push @rfiles => "$ENV{EMS_RUN}/$_";}
has been replaced by

Code: Select all

    foreach (@{$WRFrun{TABLES}{physics}}) {
        my $t = &Eutils::popit($_); 
        symlink "$ENV{DATA_TBLS}/wrf/physics/$_" => "$ENV{EMS_RUN}/$t"; 
        push @rfiles => "$ENV{EMS_RUN}/$t";
    }
I don't suppose putting my_iofields_list.txt with the other tables gets it copied over to the run dir??
I'll have to do a test install, figure how the new STRC works and get back to you.
I was holding off as my heavily modified 3.4 is already updated to WRF 3.7.1 and works (fine for the moment).

smartie
Posts: 94
Joined: Sat May 21, 2011 7:34 am

Re: Manage wrf output variables

Post by smartie » Mon Dec 21, 2015 7:12 pm

I haven't fully figured out what has changed yet but the following hack adds the required functionality calling the i/o text file at runtime.

After lines 243 and 519 in .../uems/strc/EMSrun/Models/WRF/WRFrun.pm add

Code: Select all

  
    #  Finally create the link to the text file to modify the output history streams. Added by  DJS 21/12/2015.
    #  Place this file in uems/data/tables/wrf and following entries 
    #   iofields_filename                   = "my_iofields_list.txt"
    #   ignore_iofields_warning             = T
    #   are in /uems/data/tables/wrf/namelist.arw
    
    my @tables = qw( my_iofields_list.txt );
                                        
    foreach (@tables) {symlink "$ENV{DATA_TBLS}/wrf/$_" => "$ENV{EMS_RUN}/$_"; push @rfiles => "$ENV{EMS_RUN}/$_";}
    
and make the mods in the comment. I retained the quote word function, qw, should you want to add a list of new tables/files

smartie
Posts: 94
Joined: Sat May 21, 2011 7:34 am

Re: Manage wrf output variables

Post by smartie » Mon Dec 21, 2015 9:03 pm

I have just noticed there is a block in the wrfout.conf file

Code: Select all

#   Option:  IOFIELDS_FILENAME - list of filesnames used to override registry IO
#
#   Values:  The IOFIELDS_FILENAME parameter is a list of filenames in quotes, separated
#            by a comma, that contain modifications to the registry data stream. Files
#            must be located in the <domain>/static directory.
#
#            This option will be turned OFF if IOFIELDS_FILENAME is blank.
#
#   Notes:   If you use this option then make sure you follow the guidelines provided
#            in the official WRF user's guide. The files must have a naming convention
#            of "iofields_d<domain>.txt", i.e.,
#
#            IOFIELDS_FILENAME = iofields_d01.txt,iofields_d02.txt,...,iofields_d0N.txt
#
#            otherwise the UEMS will "accidentally" delete the files from the directory
#            during one of it's many cleaning efforts.
#
#            Actually, any files with the name "iofields_*" will be preserved.
#
#   Default: IOFIELDS_FILENAME = (blank)
#
IOFIELDS_FILENAME = iofields_d01.txt
But this doesn't seem to work??

gtrem
Posts: 10
Joined: Mon Aug 18, 2014 3:03 pm

Re: Manage wrf output variables

Post by gtrem » Wed Dec 23, 2015 1:46 pm

smartie wrote:I haven't fully figured out what has changed yet but the following hack adds the required functionality calling the i/o text file at runtime.

After lines 243 and 519 in .../uems/strc/EMSrun/Models/WRF/WRFrun.pm add

Code: Select all

  
    #  Finally create the link to the text file to modify the output history streams. Added by  DJS 21/12/2015.
    #  Place this file in uems/data/tables/wrf and following entries 
    #   iofields_filename                   = "my_iofields_list.txt"
    #   ignore_iofields_warning             = T
    #   are in /uems/data/tables/wrf/namelist.arw
    
    my @tables = qw( my_iofields_list.txt );
                                        
    foreach (@tables) {symlink "$ENV{DATA_TBLS}/wrf/$_" => "$ENV{EMS_RUN}/$_"; push @rfiles => "$ENV{EMS_RUN}/$_";}
    
and make the mods in the comment. I retained the quote word function, qw, should you want to add a list of new tables/files

Thank you very much smartie, that works perfectly !

Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests