Scheduled Downtime
On Friday 21 April 2023 @ 5pm MT, this website will be down for maintenance and expected to return online the morning of 24 April 2023 at the latest

Runtime I/O - removing unwanted variables

Abhi_nav

New member
Hi,

I am using WRFV4 with chemistry for more than 1 domain. The output size is huge therefore i'd like to remove unwanted variable from being written. I chose the runtime I/O method over editing the Registry.EM_COMMOM (which require reconfigure and recompile). I have added iofields_filename = "remove_vars_d01.txt","remove_vars_d02.txt" and ignore_iofields_warning = .true. to the namelist.input under &time_control. I have noticed that some of the variables are removed in wrfout files but not all of the variables mentioned in the text file. I have attached the text file in the post. Thanks.
 

Attachments

  • remove_vars.txt
    1.4 KB · Views: 56
Hi,
Can you let me know which variables (or a few) that are not removed with the Runtime I/O method? Thanks!
 
Hi,
Thanks for your reply. I have compared the two outputs and below is the list of removed variables:

CLDFRA2
RAINPROD
EVAPPROD
UST_T
ROUGH_COR
SMOIS_COR
MEAN_FCT_AGTF
MEAN_FCT_AGEF
MEAN_FCT_AGSV
MEAN_FCT_AGGR
FIRESIZE_AGTF
FIRESIZE_AGEF
FIRESIZE_AGSV
FIRESIZE_AGGR
EBIO_ISO
EBIO_API
LAI_VEGMASK
PHOTR204
PHOTR201
PHOTR202
PHOTR203
SNU
SAC
mgly
paa
gly

However, I have mentioned more variables in the text file to be removed in output. I have attached a text file mentioning all standard variables and variables in the removed file. Thanks.
 

Attachments

  • Removed_variables_list.txt
    6.2 KB · Views: 30
Okay, I think I know what the issue is. I noticed the 26 variables that were removed are the first 26 in your file, the last one being "gly." And then I noticed there is a space right after that variable, before the comma. I believe you just need to remove that space and run it again and it should continue through all the variables (as long as there are no other spaces).
 
Okay, I think I know what the issue is. I noticed the 26 variables that were removed are the first 26 in your file, the last one being "gly." And then I noticed there is a space right after that variable, before the comma. I believe you just need to remove that space and run it again and it should continue through all the variables (as long as there are no other spaces).
Hello,

Forgive me but I have tried to check for the space you've pointed out after variable "gly" (between gly and pan) in notepad as well as vim editor but I see there is no space just a comma separating the two. The content of the text file are:

-:h:0:CLDFRA2,RAINPROD,EVAPPROD,UST_T,ROUGH_COR,SMOIS_COR,MEAN_FCT_AGTF,MEAN_FCT_AGEF,MEAN_FCT_AGSV,MEAN_FCT_AGGR,FIRESIZE_AGTF,FIRESIZE_AGEF,FIRESIZE_AGSV,FIRESIZE_AGGR,EBIO_ISO,EBIO_API,LAI_VEGMASK,PHOTR204,PHOTR201,PHOTR202,PHOTR203,SNU,SAC,mgly,paa,gly,pan,mpan,macr,mvk,etooh,prooh,acetp,xooh,onitr,isooh,acetol,alkooh,mekooh,tolooh,terpooh,ald,mco3,c2h5oh,pro2,po2,aceto2,bigene,bigalk,eneo2,alko2,isopr,iso2,mvko2,mvkooh,hydrald,xo2,terpo2,tol,cres,to2,xoh,onit,isopn,meko2,SEAS_1,SEAS_2,SEAS_3,SEAS_4,GAMN205,CN205,KN205,YCLNO2,HFX_FORCE,LH_FORCE,TSK_FORCE,HFX_FORCE_TEND,LH_FORCE_TEND,TSK_FORCE_TEND,SHDMAX,SHDMIN,SNOALB,SMOIS,SH2O,SMCREL,SFROFF,UDROFF,ebu_oc,DRY_DEP_LEN,o1d_cb4,hno3,hno4,ho,ho2,h2o2,ch3ooh,h2,eo2,ch3cooh,aco3,acet,c3h6ooh,pan,mpan,macr,mvk,etooh,prooh,acetp,DUST_1,DUST_2,DUST_3,DUST_4,DUST_5,P10,FNM,FNP,RDNM,RDN,DNW,DN,CFN,CFN1,ZETATOP,CF1,CF2,CF3,QVAPOR,QCLOUD,QRAIN,QICE,QSNOW,QGRAUP,QNICE,QNRAIN,XICEM,MAPFAC_M,MAPFAC_U,MAPFAC_V,MAPFAC_MX,MAPFAC_MY,MAPFAC_UX,MAPFAC_UY,MAPFAC_VX,MAPFAC_VY,MF_VX_INV,F,E,SINALPHA,COSALPHA,TSK,TISO,TLP_STRAT,MAX_MSTFX,MAX_MSTFY,SNOWNC,GRAUPELNC,HAILNC,CLDFRA,ACSWUPT,ACSWUPTC,ACSWDNT,ACSWDNTC,ACSWUPB,ACSWUPBC,ACSWDNB,ACSWDNBC,ACLWUPT,ACLWUPTC,ACLWDNT,ACLWDNTC,ACLWUPB,ACLWUPBC,ACLWDNB,ACLWDNBC,SWUPT,SWUPTC,SWDNT,SWDNTC,SWUPB,SWUPBC,SWDNB,SWDNBC,LWUPT,LWUPTC,LWUPB,LWUPBC,LWDNT,LWDNTC,LWDNB,LWDNBC,CLAT,ALBBCK,TMN,UST,SR
 
Hi,
You're absolutely right and I am not sure what I was looking at that made me think there was a space. I apologize for the confusion. Can you package up your output files (e.g., rsl.*) into a single *.tar file so I can take a look? Thanks!
 
Hi,

Yes I have uploaded the tar file here. When I look at the rsl file during the run, it says:


WRF V4.0 MODEL
*************************************
Parent domain
ids,ide,jds,jde 1 130 1 130
ims,ime,jms,jme -4 40 -4 19
ips,ipe,jps,jpe 1 33 1 12
*************************************
DYNAMICS OPTION: Eulerian Mass Coordinate
alloc_space_field: domain 1 , 174225116 bytes allocated
med_initialdata_input: calling input_input
Domain 1 Resetting history stream 0 for cldfra2
Domain 1 Resetting history stream 0 for rainprod
Domain 1 Resetting history stream 0 for evapprod
Domain 1 Resetting history stream 0 for ust_t
Domain 1 Resetting history stream 0 for rough_cor
Domain 1 Resetting history stream 0 for smois_cor
Domain 1 Resetting history stream 0 for mean_fct_agtf
Domain 1 Resetting history stream 0 for mean_fct_agef
Domain 1 Resetting history stream 0 for mean_fct_agsv
Domain 1 Resetting history stream 0 for mean_fct_aggr
Domain 1 Resetting history stream 0 for firesize_agtf
Domain 1 Resetting history stream 0 for firesize_agef
Domain 1 Resetting history stream 0 for firesize_agsv
Domain 1 Resetting history stream 0 for firesize_aggr
Domain 1 Resetting history stream 0 for ebio_iso
Domain 1 Resetting history stream 0 for ebio_api
Domain 1 Resetting history stream 0 for lai_vegmask
Domain 1 Resetting history stream 0 for photr204
Domain 1 Resetting history stream 0 for photr201
Domain 1 Resetting history stream 0 for photr202
Domain 1 Resetting history stream 0 for photr203
Domain 1 Resetting history stream 0 for snu
Domain 1 Resetting history stream 0 for sac
Domain 1 Resetting history stream 0 for mgly
Domain 1 Resetting history stream 0 for paa
Domain 1 Resetting history stream 0 for gly
Ignoring problems reading new_remove_vars_d01.txt
Continuing. To make this a fatal error, set ignore_iofields_warn to false in namelist

Input data is acceptable to use: wrfinput_d01

As you've mentioned the last variable removed is gly. But it fails to read the list after that. Thanks for the help.
 

Attachments

  • remove_variables.tar
    1.5 MB · Views: 11
I have found the issue with what went wrong. The WRF was only reading the first 256 columns of the text file, so all the variables after gly (column 256) were not omitted. For any other user encountering the same problem, try to add variables in new line without any space and keep the column length below 256 for each line. For example:

-:h:0:CLDFRA2,RAINPROD,EVAPPROD,UST_T,ROUGH_COR,SMOIS_COR,MEAN_FCT_AGTF,MEAN_FCT_AGEF,MEAN_FCT_AGSV,MEAN_FCT_AGGR,FIRESIZE_AGTF,FIRESIZE_AGEF,FIRESIZE_AGSV,FIRESIZE_AGGR,EBIO_ISO,EBIO_API,LAI_VEGMASK,PHOTR204,PHOTR201,PHOTR202,PHOTR203,SNU,SAC,mgly,paa
-:h:0:gly,pan,mpan,macr,mvk,etooh,prooh,acetp,xooh,onitr,isooh,acetol,alkooh,mekooh,tolooh,terpooh,ald,mco3,c2h5oh,pro2,po2,aceto2,bigene,bigalk,eneo2,alko2,isopr,iso2,mvko2,mvkooh,hydrald,xo2,terpo2,tol,cres,to2,xoh,onit,isopn,meko2,SEAS_1,SEAS_2,SEAS_3

Instead of having all variables in a single line.
 
Hello,

I have a query regarding this approach for nested runs. I want to perform nested run with WRF-Chem (3 domains), the removal of unwanted variables reduced the size of WRF output files significantly, some variables maybe required to perform a nested run. When running a nested simulation without ndown (and removing unwanted variables), the simulation works well and information gets transferred between parent and child domain with only the required variables being saved, however this may not be the case with ndown approach of nested run. As answered by you on some other post, these are the mandatory variables to initialize a run, do they remain the same?
 
Take a look at this post that discusses the necessary variables for ndown.
Thanks for suggesting this post. As I can understand from it, all the variables with I/O as "i0" and "i2" are required fields, remaining "h" fields can be removed. In my case, wrfinput file has 373 while wrfout has 307 variables. There are 233 common variables in both the files. Thus this means all the variables not common in both can be removed safely?
 
Yes, I interpret that explanation the same as you are. Give that a try and hopefully it will work out for you!
 
hello, I want to know how to increase the number of variables we add in iofileds ? Currently it can only handle 200 variables.
Can I do a code change that will allow me to remove more than 200 variables?
 
@linlu9876
Yes, you are welcome to do a code change to modify this if you'd like. Just make sure to recompile the code after the change. Would it be easier to just output the variables you want to a new stream and then just turn the history stream off (history_interval = 0)?
 
Thank you for the reply.
Sorry I do not understand what do you mean by ''Would it be easier to just output the variables you want to a new stream and then just turn the history stream off (history_interval = 0)? ''
 
If you use the Runtime I/O option, you can output only the variables you are interested in to a different stream/output file (see the instructions for adding variables to a file - instead of removing variables). This means all other variables would remain in the wrfout* (history) files. However, if you set history_interval=0, then none of those remaining variables would be written out. In other words, there would be no wrfout* files written. If you have 200+ variables you don't want written out, it seems that this would be the easiest option, as opposed to having to modify the code to allow more than that, and then having to list every one of those variables in a text file.
 
Top