;************************************************* ; CSM Graphics: Norme MARS (R.P. :19052004) ;************************************************ load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl" load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl" load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl" load "$NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRF_contributed.ncl" ;*********************************************************** ;***Variables fichier Mars*************** ;(0) V ;(1) U ;(2) XE ;(3) HO ;(4) z ;(5) time ;(6) longitude ;(7) latitude ;********************************************* ;********************************************************** begin ;****************************************************************** ; Espace utilisateurs ;****************************************************************** reper_fichier = "./" nom_fichier = "bathy_sete_2010-04-13to15_+topo.txt" nom_fichier_out = "bathy_sete_2010-04-13to15+topo_wgs84.nc" ncol = 3 nrow = 109644 ntime = 1 temp=asciiread(reper_fichier+nom_fichier,(/nrow,ncol/),"float") profil_val=new((/nrow/),float) longitude=new((/nrow/),float) latitude=new((/nrow/),float) proof=new((/nrow/),float) time=new((/nrow/),integer) temp@units="m" temp@location="Lido of Sete in FRANCE" temp@activity="Bathymetric and topographic profiles" do n = 0,nrow-1 profil_val(n)=-sqrt(temp(n,0)*temp(n,0)+temp(n,1)*temp(n,1))+sqrt(temp(0,0)*temp(0,0)+temp(0,1)*temp(0,1)) longitude(n)=temp(n,0) latitude(n)=temp(n,1) proof(n)=temp(n,2) time(n)=20100414 end do longitude!0="lon" longitude@name="longitude" longitude@units="degrees_east" longitude@coordinates="WGS84" latitude!0="lat" latitude@name="latitude" latitude@units="degrees_north" latitude@coordinates="WGS84" proof!0="proof" proof@name="proof" proof@units="m" proof@coordinates="WGS84" time!0="time" time@name="time" time@units="date in YYYYMMDD" profil_val@units="m" profil_val@long_name="distance to coast" fich_out=reper_fichier+nom_fichier_out system("/bin/rm -f "+fich_out) ;**suppression s'il existe deja ncdf_out = addfile(fich_out, "c") dimNames = (/"profil_val"/) dimSizes = (/nrow/) dimUnlim = (/False/) filedimdef (ncdf_out, dimNames , dimSizes, dimUnlim) filevardef (ncdf_out, "latitude", typeof(latitude), "profil_val") filevarattdef(ncdf_out, "latitude", latitude) filevardef (ncdf_out, "longitude", typeof(longitude), "profil_val") filevarattdef(ncdf_out, "longitude", longitude) filevardef (ncdf_out, "proof" , typeof(proof), "profil_val") filevarattdef(ncdf_out, "proof", proof) filevardef (ncdf_out, "time" , typeof(time), "profil_val") filevarattdef(ncdf_out, "time", time) ;****** ncdf_out->latitude = (/latitude/) ncdf_out->longitude = (/longitude/) ncdf_out->proof = (/proof/) ncdf_out->time = (/time/) end