260 likes | 1.2k Views
WRF to GrADS Converter. Cindy Bruy è re. GENERAL. This converter has been adapted from the one developed by Song-Yuo Hong from Dept. Atmospheric Sci., Yonsei University, Seoul, Korea. Talk will concentrate on WRF mass model, but work the same for the height coordinate model. PURPOSE.
E N D
WRF to GrADS Converter Cindy Bruyère
GENERAL • This converter has been adapted from the one developed by Song-Yuo Hong from Dept. Atmospheric Sci., Yonsei University, Seoul,Korea. • Talk will concentrate on WRF mass model, but work the same for the height coordinate model.
PURPOSE • Convert WRF output netCDF files to GrADS 'ieee' files format files(.dat files) • Create corresponding grads_control_files (.ctl files)
SOFTWARE • The wrf_grads.tar file • Available from WRF web site • This script makes use of the "ncl" libraries - setup ncl • Issue: this requirement will be removed in future releases • GrADS software • You can download and install GrADS from http::/grads/iges.org/grads
HARDWARE • The code has been ported to: • DEC Alpha • Linux • SGI • But, should run on any machine that can run the NCL software
Converter Files • README.wrf_grads • make_ncl_fortran • make_ncl_fortran.alpha • make_ncl_fortran.rhlinux • namelist.input • wrf_grads.sh • wrf_user.ncl • wrf_user_fortran_util_0.f
Make Link to NCL • README.wrf_grads • make_ncl_fortran • make_ncl_fortran.alpha • make_ncl_fortran.rhlinux • namelist.input • wrf_grads.sh • wrf_user.ncl • wrf_user_fortran_util_0.f
Make Link to NCL • make_ncl_fortran \ wrf_user_fortran_util_0 • If successful: • so_locations • wrf_user_fortran_util_0.o • wrf_user_fortran_util_0.so • wrf_user_fortran_util_0_W.c
ISSUES • Biggest problem in this step is the wrapit77 function • wrapit77 is part of NCAR Graphics, and the path to this function needs to be specified (.cshrc file) correctly
Edit NAMELIST • README.wrf_grads • make_ncl_fortran • make_ncl_fortran.alpha • make_ncl_fortran.rhlinux • namelist.input • wrf_grads.sh • wrf_user.ncl • wrf_user_fortran_util_0.f
Edit NAMELIST interp_pressure=0 plevels="1000., 925.,850.,700.,600.,500.,400.,300.,200.,150." Model 3D Fields if_plot_3dn=0 QCLOUD = "-" ; if_plot_3dn=0 QRAIN = "-" ; if_plot_3dn=0 TKE = "TURBULENCE KINETIC ENERGY" ; ………….. Post-Processed 3D fields if_plot_3dd=1 ua = "X WIND COMPONENT" ; if_plot_3dd=1 va = "Y WIND COMPONENT" ; if_plot_3dd=1 wa = "Z WIND COMPONENT" ; ………………
Edit NAMELIST Model Soil Fields if_plot_slf=0 SMOIS = "SOIL MOISTURE" ; if_plot_slf=0 TSLB = "SOIL TEMPERATURE" ; Model 2D Fields if_plot_2dn=0 HGT = "Terrain Height" ; if_plot_2dn=0 Q2 = "QV at 2 M" ; if_plot_2dn=1 RAINCV = "TIME-STEP CUMULUS PRECIPITATION" ; if_plot_2dn=0 TH2 = "TEMP at 2 M" ; ……………. Post-Processed 2D fields if_plot_2dd=1 slvl = "surface pressure" ;
Run Script • wrf_grads.sh wrfout_file >& log • This will create the following files: • log • netcdf_ieee.f • wrfout_map.nc.bin.ctl • wrfout_map.nc.bin.ieee • wrfout_map.nc.bin_map.ctl • wrfout_map.nc.head • wrfout_map.nc.ncl
Run ISSUES • The wrf_output_file_name gets renamed from: • wrf_output wrf_output.nc • This means that if you run the script a second time, it will not find the file.
.ctl file dset ^/WRF/data/wrfout_jan00_mass.nc.bin.ieee options sequential big_endian undef 1.e20 xdef 73 linear 0 0.0001 ydef 60 linear 0 0.0001 zdef 27 linear 1 1 tdef 9 linear 12z24jan2000 3hr vars 60 ACSNOM 0 0 ACCUMULATED MELTED SNOW "" ……….
map.ctl file dset ^/WRF/data/wrfout_jan00_mass.nc.bin.ieee options sequential big_endian undef 1.e20 pdef 73 60 lcc 34.12488 -98. -14.0 23.0 30. 60. -98. 30000. 30000. xdef 219 linear -94.5 0.13513513 ydef 161 linear 23.5 0.13513513 zdef 27 linear 1 1 tdef 9 linear 12z24jan2000 1hr vars 60 ACSNOM 0 0 ACCUMULATED MELTED SNOW "“ …………
ISSUES • NCL • Fortran 90 • Time interval not calculated – must be changed manually in the .ctl file