;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; This script regrids FOAM R15 Data ; to the FOAM 128x128 Fixed Grid and outputs it to ; a netCDF file that can be read with GrADS ; ; May 14 2002 ; Author: Sara Rausher ; ; questions? Email Sara Rauscher at srausche@students.wisc.edu ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; begin ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; OPEN DATA FILES ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; open file to write interpolated variable(s) to out = addfile("regridded_ha.nc","c") ;data you want to regrid (here, an atm. data file at R15) data = addfile("ha.F1.2CO2T.temp.anni456525.nc", "r") ;file with correct dimensions (use to get right lat and lon - 128x128) foam = addfile("ho.F1.2CO2T.temp.anni456525.nc","r") ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; START the REGRIDDING PROCESS ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;new lat and lon dimensions jlat = 128 ilon = 128 ;we use the g2fsh function - info avail. online at ;http://ngwww.ucar.edu/ngdoc/ng/ref/ncl/functions/g2g.html Tlat = new((/70,18,128,128/),float) Tlat = g2fsh(data->T(:,:,:,:),(/jlat,ilon/)) print(dimsizes(Tlat)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;Write out data to file ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; we must assign the coordinate variables from our data file and copy them into our output file Tlat!0 = "time" Tlat&time = data->time Tlat!1 = "lev" Tlat&lev = data->lev ;notice we use the lat and lon from our file with 128x128 (correct) dimensions! Tlat!2 = "lat" Tlat&lat = foam->lat Tlat!3 = "lon" Tlat&lon = foam->lon ;write out data to file out->T = Tlat out->time = data->time out->lat = foam->lat out->lon = foam->lon out->lev = data->lev end